Coder Social home page Coder Social logo

dutragames / my-task-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 20.73 MB

App in react Native, My task, list

Home Page: https://play.google.com/store/apps/details?id=com.lutrizstudios.mylist

License: MIT License

JavaScript 100.00%
react react-native javascript expo checklist-application task-app

my-task-app's Introduction

My task app React Native

GitHub GitHub top language

Description 📰

App in react Native, My task, to-do list

👨‍💻Technology:

📖Libs:

📚Dependencies version:

GitHub package.json dependency version (prod) GitHub package.json dependency version (prod) GitHub package.json dependency version (prod)

🎥GIFs:

slider-gif app-gif

Some gifs to demonstrate the application

📷Images:

intro1 intro2 intro3

Application intro screens. They're even on the app's Slider.

splash

The expo app requires a pre-configured splash screen, in the app I use this one, referring to my youtube channel

💻Code:

As I used some libraries, not necessarily native for expo or React Native, I will leave here part of the code in which I use them.

picker

import React, {useState} from 'react';
import {Picker} from '@react-native-picker/picker';

 const [pickerSelect, setPickerSelect] = useState('Simples')
 
  <Picker style={{width:300}}
  selectedValue={pickerSelect}
  onValueChange={(itemValue, itemIndex) => setPickerSelect(itemValue)}>
    <Picker.Item label="Simples" value="Simples" />
     <Picker.Item label="Importante" value="Importante" />
     <Picker.Item label="Muito Importante" value="Muito Importante" />
  </Picker>

AsyncStorage

import React, {useEffect} from 'react';
import AsyncStorage  from  '@react-native-async-storage/async-storage';

  useEffect(() => { 
    async function LoadStorage(){
       const StorageTarefa = await AsyncStorage.getItem('@tarefas')
  
       if(StorageTarefa){
         setTarefa(JSON.parse(StorageTarefa))
       }
    }
  
    LoadStorage()
  }, [])
  
  useEffect(() => {
  async function SaveStorage(){
    await AsyncStorage.setItem('@tarefas', JSON.stringify(tarefa))
  }

  SaveStorage()

  }, [tarefa])


  useEffect(() => { 
    async function LoadApp(){
       const StorageIntro = await AsyncStorage.getItem('@intro')
  
       if(StorageIntro){
         setApp(JSON.parse(StorageIntro))
       }
    }
  
    LoadApp()
  }, [])

  useEffect(() => {
    async function SaveIntro(){
      await AsyncStorage.setItem('@intro', JSON.stringify(app))
    }
  
    SaveIntro()
  
    }, [app])

NOTE

tarefa is a state in the code, I recommend that you see the complete code by clicking here


AppIntroSlider

import AppIntroSlider from 'react-native-app-intro-slider'
import AsyncStorage  from  '@react-native-async-storage/async-storage'

const [app, setApp] = useState(false)

  useEffect(() => { 
    async function LoadApp(){
       const StorageIntro = await AsyncStorage.getItem('@intro')
  
       if(StorageIntro){
         setApp(JSON.parse(StorageIntro))
       }
    }
  
    LoadApp()
  }, [])

  useEffect(() => {
    async function SaveIntro(){
      await AsyncStorage.setItem('@intro', JSON.stringify(app))
    }
  
    SaveIntro()
  
    }, [app])
    
    const slider = [
      {
          key: '1',
          title: 'Introdução',
          desc: 'Aplicativo simples para por as suas tarefas que, você precisa realizar no dia a dia!',
          image: require('./assets/intro1.png')
      },
      {
          key: '2',
          title: 'Como usar?',
          desc: 'Aperte o botão azul com o + para adicionar uma nova tarefa.',
          image: require('./assets/intro2.png')
      },
      {
          key: '3',
          title: 'Bom Uso',
          desc: 'Espero que goste de usar o aplicativo e não deixe de avaliar na play Store.',
          image: require('./assets/intro3.png')
      }
    ]
    
      const AppIntro = ({item})=>{
    return(
      <SafeAreaView style={{flex:1, alignItems:'center', backgroundColor:'#222'}}>
        <View style={{flex:1, alignItems:'center', backgroundColor:'#222'}}>
          <Image  source={item.image} style={{resizeMode: 'cover', marginTop:50}}/>
          <Text style={{fontSize: 30, fontWeight: 'bold', color:'#09acff',padding: 20}}>{item.title}</Text>
          <Text style={{color:'#aaa', fontSize:15, padding:10, textAlign:'center'}}>{item.desc}</Text>
        </View>
      </SafeAreaView>
    )
  }
  
    if(app){
     return(
      <SafeAreaView style={{flex:1, alignItems:'center', backgroundColor:'#222'}}>
        <View style={{flex:1, alignItems:'center', backgroundColor:'#222'}}>
          <Image  source={item.image} style={{resizeMode: 'cover', marginTop:50}}/>
          <Text style={{fontSize: 30, fontWeight: 'bold', color:'#09acff',padding: 20}}>{item.title}</Text>
          <Text style={{color:'#aaa', fontSize:15, padding:10, textAlign:'center'}}>{item.desc}</Text>
        </View>
      </SafeAreaView>
    )
    }
    else{
    ...
    }

NOTE

The code above is just the introduction of the app. .I recommend that you see the complete code by clicking here


animatable


NOTE

The animatable is pretty much in all the code I've developed, so I'm just going to put the to-do list code so you can see the example of it in the app.

you can see this full code by clicking here

import React, {useState} from 'react'
import {View, Text, StyleSheet, TouchableOpacity} from 'react-native'
import {Ionicons} from '@expo/vector-icons'
import * as Animatatable from 'react-native-animatable'



export default function Tarefalist({data, deletTarefa}){
    return(
        <Animatatable.View style={styles.container}
        animation="bounceIn"
        useNativeDriver
        >
            <TouchableOpacity onPress={() => deletTarefa(data)}>
                <Ionicons name="md-checkmark-circle" size={30} color="#212121"/>
            </TouchableOpacity>
            <View>
                <Text style={styles.tarefa}>{data.tarefa}</Text>
            </View>

            <View>
                <Text style={styles.important}>{data.important}</Text>
            </View>
        </Animatatable.View>
    )
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.