├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── menu
│ │ │ │ └── popup_menu.xml
│ │ │ ├── drawable
│ │ │ │ ├── ic_add.xml
│ │ │ │ ├── ic_navigate.xml
│ │ │ │ ├── ic_calendar.xml
│ │ │ │ ├── ic_more.xml
│ │ │ │ ├── ic_timer.xml
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ └── ic_empty_state.xml
│ │ │ ├── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── themes.xml
│ │ │ │ └── strings.xml
│ │ │ ├── layout
│ │ │ │ ├── empty_state.xml
│ │ │ │ ├── item_task.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ └── activity_add_task.xml
│ │ │ └── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ ├── java
│ │ │ └── br
│ │ │ │ └── com
│ │ │ │ └── dio
│ │ │ │ └── todolist
│ │ │ │ ├── model
│ │ │ │ └── Task.kt
│ │ │ │ ├── extensions
│ │ │ │ └── AppExtensions.kt
│ │ │ │ ├── datasource
│ │ │ │ └── TaskDataSource.kt
│ │ │ │ └── ui
│ │ │ │ ├── MainActivity.kt
│ │ │ │ ├── TaskListAdapter.kt
│ │ │ │ └── AddTaskActivity.kt
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── br
│ │ │ └── com
│ │ │ └── dio
│ │ │ └── todolist
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── br
│ │ └── com
│ │ └── dio
│ │ └── todolist
│ │ └── ExampleInstrumentedTest.kt
├── proguard-rules.pro
└── build.gradle.kts
├── apresentacao
└── Apresentação.pptx
├── gradle
├── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
└── libs.versions.toml
├── settings.gradle.kts
├── gradle.properties
├── gradlew.bat
├── README.md
├── .gitignore
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/apresentacao/Apresentação.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/apresentacao/Apresentação.pptx
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EzequielMessore/To-Do-List/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/java/br/com/dio/todolist/model/Task.kt:
--------------------------------------------------------------------------------
1 | package br.com.dio.todolist.model
2 |
3 | data class Task(
4 | val title: String,
5 | val hour: String,
6 | val date: String,
7 | val id: Int = 0
8 | )
9 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Nov 24 18:50:23 BRT 2025
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.0-milestone-1-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/popup_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_navigate.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/app/src/test/java/br/com/dio/todolist/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package br.com.dio.todolist
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_calendar.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/br/com/dio/todolist/extensions/AppExtensions.kt:
--------------------------------------------------------------------------------
1 | package br.com.dio.todolist.extensions
2 |
3 | import com.google.android.material.textfield.TextInputLayout
4 | import java.text.SimpleDateFormat
5 | import java.util.*
6 |
7 | private val locale = Locale("pt", "BR")
8 |
9 | fun Date.format() : String {
10 | return SimpleDateFormat("dd/MM/yyyy", locale).format(this)
11 | }
12 |
13 | var TextInputLayout.text : String
14 | get() = editText?.text?.toString() ?: ""
15 | set(value) {
16 | editText?.setText(value)
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_more.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google {
4 | content {
5 | includeGroupByRegex("com\\.android.*")
6 | includeGroupByRegex("com\\.google.*")
7 | includeGroupByRegex("androidx.*")
8 | }
9 | }
10 | mavenCentral()
11 | gradlePluginPortal()
12 | }
13 | }
14 | dependencyResolutionManagement {
15 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
16 | repositories {
17 | google()
18 | mavenCentral()
19 | }
20 | }
21 |
22 | rootProject.name = "To do list"
23 | include(":app")
24 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_timer.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | TO DO
3 | Criar Tarefa
4 | Título
5 | Data
6 | Hora
7 | Cancelar
8 | Tarefas
9 | Nova tarefa
10 | Editar
11 | Deletar
12 | Ops! Você não possui\nnenhum tarefa
13 |
--------------------------------------------------------------------------------
/app/src/main/java/br/com/dio/todolist/datasource/TaskDataSource.kt:
--------------------------------------------------------------------------------
1 | package br.com.dio.todolist.datasource
2 |
3 | import br.com.dio.todolist.model.Task
4 |
5 | object TaskDataSource {
6 | private val list = arrayListOf()
7 |
8 | fun getList() = list.toList()
9 |
10 | fun insertTask(task: Task) {
11 | if (task.id == 0) {
12 | list.add(task.copy(id = list.size + 1))
13 | } else {
14 | val taskToRemove = list.find { task.id == it.id }
15 | list.remove(taskToRemove)
16 | list.add(task)
17 | }
18 | }
19 |
20 | fun findById(taskId: Int) = list.find { it.id == taskId }
21 |
22 | fun deleteTask(task: Task) {
23 | list.remove(task)
24 | }
25 | }
--------------------------------------------------------------------------------
/app/src/androidTest/java/br/com/dio/todolist/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package br.com.dio.todolist
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("br.com.dio.todolist", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/gradle/libs.versions.toml:
--------------------------------------------------------------------------------
1 | [versions]
2 | agp = "8.13.1"
3 | kotlin = "2.2.21"
4 |
5 | constraintlayout = "2.2.1"
6 | coreKtxVersion = "1.17.0"
7 | espressoCore = "3.7.0"
8 | junit = "4.13.2"
9 | junitVersion = "1.3.0"
10 | material = "1.13.0"
11 |
12 | [libraries]
13 | constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
14 | core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtxVersion" }
15 | espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
16 | ext-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" }
17 | junit = { module = "junit:junit", version.ref = "junit" }
18 | material = { module = "com.google.android.material:material", version.ref = "material" }
19 |
20 | [plugins]
21 | android-application = { id = "com.android.application", version.ref = "agp" }
22 | kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
23 |
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
--------------------------------------------------------------------------------
/app/src/main/res/layout/empty_state.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
21 |
22 |
31 |
32 |
--------------------------------------------------------------------------------
/app/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2 |
3 | plugins {
4 | alias(libs.plugins.android.application)
5 | alias(libs.plugins.kotlin.android)
6 | }
7 |
8 | android {
9 | namespace = "br.com.dio.todolist"
10 | compileSdk {
11 | version = release(36)
12 | }
13 |
14 | defaultConfig {
15 | applicationId = "br.com.dio.todolist"
16 | minSdk = 21
17 | targetSdk = 36
18 | versionCode = 1
19 | versionName = "1.0.0"
20 |
21 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
22 | }
23 |
24 | buildTypes {
25 | release {
26 | isMinifyEnabled = false
27 | proguardFiles(
28 | getDefaultProguardFile("proguard-android-optimize.txt"),
29 | "proguard-rules.pro"
30 | )
31 | }
32 | }
33 | compileOptions {
34 | sourceCompatibility = JavaVersion.VERSION_11
35 | targetCompatibility = JavaVersion.VERSION_11
36 | }
37 |
38 | buildFeatures {
39 | viewBinding = true
40 | }
41 | }
42 |
43 | kotlin {
44 | compilerOptions {
45 | jvmTarget.set(JvmTarget.JVM_11)
46 | }
47 | }
48 |
49 | dependencies {
50 | // implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
51 | implementation(libs.core.ktx)
52 | // implementation 'androidx.appcompat:appcompat:1.7.1'
53 | implementation(libs.material)
54 | implementation(libs.constraintlayout)
55 |
56 | testImplementation(libs.junit)
57 | androidTestImplementation(libs.ext.junit)
58 | androidTestImplementation(libs.espresso.core)
59 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_task.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
29 |
30 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
23 |
24 |
35 |
36 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/java/br/com/dio/todolist/ui/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package br.com.dio.todolist.ui
2 |
3 | import android.app.Activity
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import android.view.View
7 | import androidx.activity.result.contract.ActivityResultContracts
8 | import androidx.appcompat.app.AppCompatActivity
9 | import br.com.dio.todolist.databinding.ActivityMainBinding
10 | import br.com.dio.todolist.datasource.TaskDataSource
11 |
12 | class MainActivity : AppCompatActivity() {
13 |
14 | private lateinit var binding: ActivityMainBinding
15 | private val adapter by lazy { TaskListAdapter() }
16 |
17 | /**
18 | * Nova maneira de iniciar uma activity.
19 | * Já que `startActivityForResult` foi depreciado.
20 | */
21 | private val register =
22 | registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
23 | if (it.resultCode == Activity.RESULT_OK) updateList()
24 | }
25 |
26 | override fun onCreate(savedInstanceState: Bundle?) {
27 | super.onCreate(savedInstanceState)
28 | binding = ActivityMainBinding.inflate(layoutInflater)
29 | setContentView(binding.root)
30 |
31 | binding.rvTasks.adapter = adapter
32 | updateList()
33 |
34 | insertListeners()
35 | }
36 |
37 | private fun insertListeners() {
38 | binding.fab.setOnClickListener {
39 | register.launch(Intent(this, AddTaskActivity::class.java))
40 | }
41 |
42 | adapter.listenerEdit = {
43 | val intent = Intent(this, AddTaskActivity::class.java)
44 | intent.putExtra(AddTaskActivity.TASK_ID, it.id)
45 | register.launch(intent)
46 | }
47 |
48 | adapter.listenerDelete = {
49 | TaskDataSource.deleteTask(it)
50 | updateList()
51 | }
52 | }
53 |
54 | private fun updateList() {
55 | val list = TaskDataSource.getList()
56 | binding.includeEmpty.emptyState.visibility = if (list.isEmpty()) View.VISIBLE
57 | else View.GONE
58 |
59 | adapter.submitList(list)
60 | }
61 | }
--------------------------------------------------------------------------------
/app/src/main/java/br/com/dio/todolist/ui/TaskListAdapter.kt:
--------------------------------------------------------------------------------
1 | package br.com.dio.todolist.ui
2 |
3 | import android.view.LayoutInflater
4 | import android.view.ViewGroup
5 | import android.widget.PopupMenu
6 | import androidx.recyclerview.widget.DiffUtil
7 | import androidx.recyclerview.widget.ListAdapter
8 | import androidx.recyclerview.widget.RecyclerView
9 | import br.com.dio.todolist.R
10 | import br.com.dio.todolist.databinding.ItemTaskBinding
11 | import br.com.dio.todolist.model.Task
12 |
13 | class TaskListAdapter : ListAdapter(DiffCallback()) {
14 |
15 | var listenerEdit : (Task) -> Unit = {}
16 | var listenerDelete : (Task) -> Unit = {}
17 |
18 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TaskViewHolder {
19 | val inflater = LayoutInflater.from(parent.context)
20 | val binding = ItemTaskBinding.inflate(inflater, parent, false)
21 | return TaskViewHolder(binding)
22 | }
23 |
24 | override fun onBindViewHolder(holder: TaskViewHolder, position: Int) {
25 | holder.bind(getItem(position))
26 | }
27 |
28 | inner class TaskViewHolder(
29 | private val binding: ItemTaskBinding
30 | ) : RecyclerView.ViewHolder(binding.root) {
31 |
32 | fun bind(item: Task) {
33 | binding.tvTitle.text = item.title
34 | binding.tvDate.text = "${item.date} ${item.hour}"
35 | binding.ivMore.setOnClickListener {
36 | showPopup(item)
37 | }
38 | }
39 |
40 | private fun showPopup(item: Task) {
41 | val ivMore = binding.ivMore
42 | val popupMenu = PopupMenu(ivMore.context, ivMore)
43 | popupMenu.menuInflater.inflate(R.menu.popup_menu, popupMenu.menu)
44 | popupMenu.setOnMenuItemClickListener {
45 | when (it.itemId) {
46 | R.id.action_edit -> listenerEdit(item)
47 | R.id.action_delete -> listenerDelete(item)
48 | }
49 | return@setOnMenuItemClickListener true
50 | }
51 | popupMenu.show()
52 | }
53 | }
54 | }
55 |
56 | class DiffCallback : DiffUtil.ItemCallback() {
57 | override fun areItemsTheSame(oldItem: Task, newItem: Task) = oldItem == newItem
58 | override fun areContentsTheSame(oldItem: Task, newItem: Task) = oldItem.id == newItem.id
59 | }
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/java/br/com/dio/todolist/ui/AddTaskActivity.kt:
--------------------------------------------------------------------------------
1 | package br.com.dio.todolist.ui
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import androidx.appcompat.app.AppCompatActivity
6 | import br.com.dio.todolist.databinding.ActivityAddTaskBinding
7 | import br.com.dio.todolist.datasource.TaskDataSource
8 | import br.com.dio.todolist.extensions.format
9 | import br.com.dio.todolist.extensions.text
10 | import br.com.dio.todolist.model.Task
11 | import com.google.android.material.datepicker.MaterialDatePicker
12 | import com.google.android.material.timepicker.MaterialTimePicker
13 | import com.google.android.material.timepicker.TimeFormat
14 | import java.util.*
15 |
16 | class AddTaskActivity : AppCompatActivity() {
17 |
18 | private lateinit var binding: ActivityAddTaskBinding
19 |
20 | override fun onCreate(savedInstanceState: Bundle?) {
21 | super.onCreate(savedInstanceState)
22 |
23 | binding = ActivityAddTaskBinding.inflate(layoutInflater)
24 | setContentView(binding.root)
25 |
26 | if (intent.hasExtra(TASK_ID)) {
27 | val taskId = intent.getIntExtra(TASK_ID, 0)
28 | TaskDataSource.findById(taskId)?.let {
29 | binding.tilTitle.text = it.title
30 | binding.tilDate.text = it.date
31 | binding.tilHour.text = it.hour
32 | }
33 | }
34 |
35 | insertListeners()
36 | }
37 |
38 | private fun insertListeners() {
39 | binding.tilDate.editText?.setOnClickListener {
40 | val datePicker = MaterialDatePicker.Builder.datePicker().build()
41 |
42 | datePicker.addOnPositiveButtonClickListener {
43 | val timeZone = TimeZone.getDefault()
44 | val offset = timeZone.getOffset(Date().time) * -1
45 | binding.tilDate.text = Date(it + offset).format()
46 | }
47 | datePicker.show(supportFragmentManager, "DATE_PICKER_TAG")
48 | }
49 |
50 | binding.tilHour.editText?.setOnClickListener {
51 | val timePicker = MaterialTimePicker.Builder()
52 | .setTimeFormat(TimeFormat.CLOCK_24H)
53 | .build()
54 |
55 | timePicker.addOnPositiveButtonClickListener {
56 | val minute = if (timePicker.minute in 0..9) "0${timePicker.minute}" else timePicker.minute
57 | val hour = if (timePicker.hour in 0..9) "0${timePicker.hour}" else timePicker.hour
58 |
59 | binding.tilHour.text = "$hour:$minute"
60 | }
61 |
62 | timePicker.show(supportFragmentManager, null)
63 | }
64 |
65 | binding.btnCancel.setOnClickListener {
66 | finish()
67 | }
68 |
69 | binding.btnNewTask.setOnClickListener {
70 | val task = Task(
71 | title = binding.tilTitle.text,
72 | date = binding.tilDate.text,
73 | hour = binding.tilHour.text,
74 | id = intent.getIntExtra(TASK_ID, 0)
75 | )
76 | TaskDataSource.insertTask(task)
77 | setResult(Activity.RESULT_OK)
78 | finish()
79 | }
80 | }
81 |
82 |
83 | companion object {
84 | const val TASK_ID = "task_id"
85 | }
86 |
87 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # LAB - Criando um app de lembretes e tarefas com Kotlin.
2 | O curso pode ser acessado na plataforma da [Digital Innovation One](https://digitalinnovation.one/).
3 |
4 | ## Sobre o Autor
5 |
Sou um desenvolvedor Android que ama novos desafios e não perde a oportunidade de aprender coisas novas, sou organizado, pontual e estou sempre disponível para o ajudar, procuro estar cercado de pessoas que extraem o melhor de mim, me ajudando a sempre desempenhar o meu máximo. Por isso, quero compartilhar com vocês um pouco do que sinto quando programo e retribuir com tudo o que sei.
6 |
7 | [](https://www.linkedin.com/in/ezequielmessore/) [](mailto:ezequielmessore@gmail.com)
8 |
9 | ##
Descrição do Lab.
10 | O objetivo do projeto é criar um App de `To do list` do zero mostrando o processo de desenvolvimento usando Kotlin, uma das linguagens de programação de maior ascensão dos últimos anos. Além disto, desafiar a evolução do App e entregar uma solução mais robusta pensando sempre na melhor experiência do usuário.
11 |
12 | ## PRs importantes.
13 | Ao longo do tempo foram detectados alguns detalhes importantes no projeto, em atuação a esses detalhes forem criados os seguintes Pull Request e mergeados a branch master:
14 | - [APIs Activity Result](https://github.com/EzequielMessore/To-Do-List/pull/1)
15 | - [Duplicando item ao fazer a edição.](https://github.com/EzequielMessore/To-Do-List/pull/2)
16 |
17 | ## Aulas e materiais de estudo.
18 | - Aula - 01: Apresentação pessoal e apresentação do curso.
19 | - [Apresentação](https://drive.google.com/file/d/1KhneglCpya7VgAsczDsa7zXmpWkyo0XZ/view?usp=sharing)
20 | - Aula - 02: Configurando nosso primeiro projeto.
21 | - Aula - 03: Um pouco do Android Studio.
22 | - [Conheça o Android Studio](https://developer.android.com/studio/intro)
23 | - Aula - 04: Temas
24 | - [Documentação dos temas](https://developer.android.com/guide/topics/ui/look-and-feel/themes?hl=pt-br)
25 | - Link de referência do [stackoverflow](https://stackoverflow.com/questions/22192291/how-to-change-the-status-bar-color-in-android/24997241#24997241)
26 | - Customização do Floating Action Button [stackoverflow](https://stackoverflow.com/questions/30969455/android-changing-floating-action-button-color/56158913#56158913)
27 | - Aula - 05: Começando por a mão na massa.
28 | - [Protótipo](https://xd.adobe.com/view/77c56d1f-232d-41e9-a220-371d51991646-2296/)
29 | - [Material Design](https://material.io/design)
30 | - Aula - 06: Criando a tela criar tarefas.
31 | - Aula - 07: ViewBinding e DatePicker.
32 | - [Documentação do View Binding](https://developer.android.com/topic/libraries/view-binding)
33 | - [Artigo sobre View Binding](https://medium.com/androiddevelopers/use-view-binding-to-replace-findviewbyid-c83942471fc)
34 | - Aula - 08: Time Picker.
35 | - Problema com o TimeZone [stackoverflow](https://stackoverflow.com/a/60979837)
36 | - Aula - 09: RecyclerView.
37 | - Documentação do [RecyclerView](https://developer.android.com/guide/topics/ui/layout/recyclerview?hl=pt-br).
38 | - Aula - 10: Mostrando lista de tarefas.
39 | - [Popup menu](https://material.io/components/menus#usage)
40 | - Aula - 11: Editando tarefas.
41 | - Aula - 12: Finalizando o app.
42 | - [Empty States](https://material.io/design/communication/empty-states.html#content)
43 |
44 |
45 | ## Desafios
46 | Tornar nosso aplicativo um aplicativo resiliente que não perca nossas tarefas salvas quando é encerrado, para isto podemos usar a estratégia de salvar nossos dados localmente.
47 | Podemos fazer isto de duas maneiras usar nossas [Shared Preferences](https://developer.android.com/training/data-storage/shared-preferences?hl=pt-br) ou nosso [SQLite](https://developer.android.com/training/data-storage/sqlite) para utilizar os esses conceitos de uma maneira facilitada devemos usar as seguintes bibliotecas:
48 |
49 | - [Room](https://developer.android.com/training/data-storage/room): é um banco de dados que oferece uma camada de abstração sobre o SQLite, e nos ajuda a lidar melhor com a complexidade do mesmo.
50 |
51 | - [DataStore](https://developer.android.com/topic/libraries/architecture/datastore?hl=pt-br): é uma solução de armazenamento de dados que permite armazenar pares de chave-valor ou objetos tipados.
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Created by https://www.toptal.com/developers/gitignore/api/android,kotlin,androidstudio
3 | # Edit at https://www.toptal.com/developers/gitignore?templates=android,kotlin,androidstudio
4 |
5 | ### Android ###
6 | # Built application files
7 | *.apk
8 | *.aar
9 | *.ap_
10 | *.aab
11 |
12 | # Files for the ART/Dalvik VM
13 | *.dex
14 |
15 | # Java class files
16 | *.class
17 |
18 | # Generated files
19 | bin/
20 | gen/
21 | out/
22 | # Uncomment the following line in case you need and you don't have the release build type files in your app
23 | # release/
24 |
25 | # Gradle files
26 | .gradle/
27 | build/
28 |
29 | # Local configuration file (sdk path, etc)
30 | local.properties
31 |
32 | # Proguard folder generated by Eclipse
33 | proguard/
34 |
35 | # Log Files
36 | *.log
37 |
38 | # Android Studio Navigation editor temp files
39 | .navigation/
40 |
41 | # Android Studio captures folder
42 | captures/
43 |
44 | # IntelliJ
45 | *.iml
46 | .idea
47 |
48 | # Keystore files
49 | # Uncomment the following lines if you do not want to check your keystore files in.
50 | #*.jks
51 | #*.keystore
52 |
53 | # External native build folder generated in Android Studio 2.2 and later
54 | .externalNativeBuild
55 | .cxx/
56 |
57 | # Google Services (e.g. APIs or Firebase)
58 | # google-services.json
59 |
60 | # Freeline
61 | freeline.py
62 | freeline/
63 | freeline_project_description.json
64 |
65 | # fastlane
66 | fastlane/report.xml
67 | fastlane/Preview.html
68 | fastlane/screenshots
69 | fastlane/test_output
70 | fastlane/readme.md
71 |
72 | # Version control
73 | vcs.xml
74 |
75 | # lint
76 | lint/intermediates/
77 | lint/generated/
78 | lint/outputs/
79 | lint/tmp/
80 | # lint/reports/
81 |
82 | ### Android Patch ###
83 | gen-external-apklibs
84 | output.json
85 |
86 | # Replacement of .externalNativeBuild directories introduced
87 | # with Android Studio 3.5.
88 |
89 | ### Kotlin ###
90 | # Compiled class file
91 |
92 | # Log file
93 |
94 | # BlueJ files
95 | *.ctxt
96 |
97 | # Mobile Tools for Java (J2ME)
98 | .mtj.tmp/
99 |
100 | # Package Files #
101 | *.jar
102 | *.war
103 | *.nar
104 | *.ear
105 | *.zip
106 | *.tar.gz
107 | *.rar
108 |
109 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
110 | hs_err_pid*
111 |
112 | ### AndroidStudio ###
113 | # Covers files to be ignored for android development using Android Studio.
114 |
115 | # Built application files
116 |
117 | # Files for the ART/Dalvik VM
118 |
119 | # Java class files
120 |
121 | # Generated files
122 |
123 | # Gradle files
124 | .gradle
125 |
126 | # Signing files
127 | .signing/
128 |
129 | # Local configuration file (sdk path, etc)
130 |
131 | # Proguard folder generated by Eclipse
132 |
133 | # Log Files
134 |
135 | # Android Studio
136 | /*/build/
137 | /*/local.properties
138 | /*/out
139 | /*/*/build
140 | /*/*/production
141 | *.ipr
142 | *~
143 | *.swp
144 |
145 | # Keystore files
146 | *.jks
147 | *.keystore
148 |
149 | # Google Services (e.g. APIs or Firebase)
150 | # google-services.json
151 |
152 | # Android Patch
153 |
154 | # External native build folder generated in Android Studio 2.2 and later
155 |
156 | # NDK
157 | obj/
158 |
159 | # IntelliJ IDEA
160 | *.iws
161 | /out/
162 |
163 | # User-specific configurations
164 | .idea/caches/
165 | .idea/libraries/
166 | .idea/shelf/
167 | .idea/.name
168 | .idea/compiler.xml
169 | .idea/copyright/profiles_settings.xml
170 | .idea/encodings.xml
171 | .idea/misc.xml
172 | .idea/scopes/scope_settings.xml
173 | .idea/vcs.xml
174 | .idea/jsLibraryMappings.xml
175 | .idea/datasources.xml
176 | .idea/dataSources.ids
177 | .idea/sqlDataSources.xml
178 | .idea/dynamic.xml
179 | .idea/uiDesigner.xml
180 | .idea/jarRepositories.xml
181 |
182 | # OS-specific files
183 | .DS_Store
184 | .DS_Store?
185 | ._*
186 | .Spotlight-V100
187 | .Trashes
188 | ehthumbs.db
189 | Thumbs.db
190 |
191 | # Legacy Eclipse project files
192 | .classpath
193 | .project
194 | .cproject
195 | .settings/
196 |
197 | # Mobile Tools for Java (J2ME)
198 |
199 | # Package Files #
200 |
201 | # virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
202 |
203 | ## Plugin-specific files:
204 |
205 | # mpeltonen/sbt-idea plugin
206 | .idea_modules/
207 |
208 | # JIRA plugin
209 | atlassian-ide-plugin.xml
210 |
211 | # Mongo Explorer plugin
212 | .idea/mongoSettings.xml
213 |
214 | # Crashlytics plugin (for Android Studio and IntelliJ)
215 | com_crashlytics_export_strings.xml
216 | crashlytics.properties
217 | crashlytics-build.properties
218 | fabric.properties
219 |
220 | ### AndroidStudio Patch ###
221 |
222 | !/gradle/wrapper/gradle-wrapper.jar
223 |
224 | # End of https://www.toptal.com/developers/gitignore/api/android,kotlin,androidstudio
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_add_task.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
21 |
22 |
28 |
29 |
39 |
40 |
44 |
45 |
46 |
47 |
59 |
60 |
65 |
66 |
67 |
68 |
78 |
79 |
84 |
85 |
86 |
87 |
97 |
98 |
109 |
110 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_empty_state.xml:
--------------------------------------------------------------------------------
1 |
6 |
11 |
18 |
23 |
26 |
29 |
34 |
37 |
42 |
45 |
50 |
53 |
58 |
61 |
66 |
71 |
76 |
81 |
86 |
91 |
96 |
101 |
104 |
107 |
114 |
121 |
124 |
127 |
130 |
133 |
136 |
139 |
142 |
145 |
148 |
151 |
154 |
157 |
162 |
165 |
168 |
171 |
174 |
177 |
180 |
183 |
186 |
189 |
192 |
195 |
198 |
201 |
204 |
207 |
210 |
217 |
220 |
223 |
226 |
229 |
232 |
235 |
238 |
241 |
244 |
247 |
250 |
253 |
256 |
259 |
262 |
265 |
272 |
273 |
--------------------------------------------------------------------------------