diff --git a/WaterMeProject/app/.gitignore b/WaterMeProject/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/WaterMeProject/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/WaterMeProject/app/build.gradle b/WaterMeProject/app/build.gradle new file mode 100644 index 0000000..cf229f0 --- /dev/null +++ b/WaterMeProject/app/build.gradle @@ -0,0 +1,52 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' +} + +android { + compileSdk 32 + + defaultConfig { + applicationId "com.example.watermeproject" + minSdk 21 + targetSdk 32 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } + buildFeatures{ + dataBinding true + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + implementation('androidx.fragment:fragment-ktx:1.4.1') + implementation "androidx.activity:activity-ktx:1.4.0" + implementation('androidx.work:work-runtime-ktx:2.7.1') + + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + implementation 'androidx.test.uiautomator:uiautomator:2.2.0' +} \ No newline at end of file diff --git a/WaterMeProject/app/proguard-rules.pro b/WaterMeProject/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/WaterMeProject/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/WaterMeProject/app/src/androidTest/java/com/example/watermeproject/NotificationTest.kt b/WaterMeProject/app/src/androidTest/java/com/example/watermeproject/NotificationTest.kt new file mode 100644 index 0000000..8473cfd --- /dev/null +++ b/WaterMeProject/app/src/androidTest/java/com/example/watermeproject/NotificationTest.kt @@ -0,0 +1,68 @@ +package com.example.watermeproject + +import androidx.test.espresso.Espresso +import androidx.test.espresso.action.ViewActions +import androidx.test.espresso.matcher.ViewMatchers +import androidx.test.ext.junit.rules.ActivityScenarioRule +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.uiautomator.By +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiSelector +import androidx.test.uiautomator.Until +import org.junit.Assert +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith + +@RunWith(AndroidJUnit4::class) +class NotificationTest { + + /** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ + @RunWith(AndroidJUnit4::class) + class NotificationTest { + + private val timeout: Long = 6000 + + private val plantName = "Carrot" + + @get:Rule + var activityRule: ActivityScenarioRule + = ActivityScenarioRule(MainActivity::class.java) + + private lateinit var uiDevice: UiDevice + + @Before + fun setup() { + uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) + Espresso.onView(ViewMatchers.withText("Carrot")).perform(ViewActions.longClick()) + Espresso.onView(ViewMatchers.withText("5 seconds")).perform(ViewActions.click()) + uiDevice.pressHome() + uiDevice.openNotification() + uiDevice.wait(Until.hasObject(By.textContains(plantName)), timeout) + } + + @Test + fun notification_scheduled() { + val notification = uiDevice.findObject(UiSelector().textContains(plantName)).exists() + Assert.assertTrue("Could not find text 'Carrot'", notification) + uiDevice.pressHome() + } + + @Test + fun notification_click() { + val notification = uiDevice.findObject(UiSelector().textContains("Carrot")) + notification.click() + uiDevice.wait(Until.hasObject(By.pkg("com.example.waterme") + .depth(0)), 1000) + val pkg = uiDevice.findObject(UiSelector().packageName("com.example.waterme")) + .exists() + Assert.assertTrue("Could not find package", pkg) + } +} +} \ No newline at end of file diff --git a/WaterMeProject/app/src/main/AndroidManifest.xml b/WaterMeProject/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..68041b1 --- /dev/null +++ b/WaterMeProject/app/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WaterMeProject/app/src/main/java/com/example/watermeproject/BaseApplication.kt b/WaterMeProject/app/src/main/java/com/example/watermeproject/BaseApplication.kt new file mode 100644 index 0000000..f31633d --- /dev/null +++ b/WaterMeProject/app/src/main/java/com/example/watermeproject/BaseApplication.kt @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2021 The Android Open Source Project. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.watermeproject + +import android.app.Application +import android.app.NotificationChannel +import android.app.NotificationManager +import android.content.Context +import android.os.Build + +class BaseApplication : Application() { + + override fun onCreate() { + super.onCreate() + + //https://developer.android.com/training/notify-user/build-notification + // Create the NotificationChannel, but only on API 26+ because + // the NotificationChannel class is new and not in the support library + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + val name = getString(R.string.channel_name) + val descriptionText = getString(R.string.channel_description) + val importance = NotificationManager.IMPORTANCE_DEFAULT + val channel = NotificationChannel(CHANNEL_ID, name, importance).apply { + description = descriptionText + } + // Register the channel with the system + val notificationManager: NotificationManager = + getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager + notificationManager.createNotificationChannel(channel) + } + } + + companion object { + const val CHANNEL_ID = "water_reminder_id" + } +} diff --git a/WaterMeProject/app/src/main/java/com/example/watermeproject/MainActivity.kt b/WaterMeProject/app/src/main/java/com/example/watermeproject/MainActivity.kt new file mode 100644 index 0000000..aad7d47 --- /dev/null +++ b/WaterMeProject/app/src/main/java/com/example/watermeproject/MainActivity.kt @@ -0,0 +1,33 @@ +package com.example.watermeproject + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import androidx.activity.viewModels +import androidx.recyclerview.widget.RecyclerView +import com.example.watermeproject.adapter.PlantAdapter +import com.example.watermeproject.adapter.PlantListener +import com.example.watermeproject.ui.ReminderDialogFragment +import com.example.watermeproject.viewmodel.PlantViewModel +import com.example.watermeproject.viewmodel.PlantViewModelFactory + +class MainActivity : AppCompatActivity() { + + private val viewModel: PlantViewModel by viewModels { + PlantViewModelFactory(application) + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + val adapter = PlantAdapter(PlantListener { plant -> + val dialog = ReminderDialogFragment(plant.name) + dialog.show(supportFragmentManager,"WaterReminderDialogFragment") + true + }) + val recyclerView: RecyclerView = findViewById(R.id.recycler_view) + recyclerView.adapter = adapter + val data = viewModel.plants + adapter.submitList(data) + } +} \ No newline at end of file diff --git a/WaterMeProject/app/src/main/java/com/example/watermeproject/adapter/PlantAdapter.kt b/WaterMeProject/app/src/main/java/com/example/watermeproject/adapter/PlantAdapter.kt new file mode 100644 index 0000000..3a0b0ab --- /dev/null +++ b/WaterMeProject/app/src/main/java/com/example/watermeproject/adapter/PlantAdapter.kt @@ -0,0 +1,55 @@ +package com.example.watermeproject.adapter + + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.DiffUtil +import androidx.recyclerview.widget.ListAdapter +import androidx.recyclerview.widget.RecyclerView +import com.example.watermeproject.databinding.ListItemBinding +import com.example.watermeproject.model.Plant + +class PlantAdapter(private val longClickListener: PlantListener) : + ListAdapter(DiffCallback) { + + class PlantViewHolder( + private val binding: ListItemBinding + ) : RecyclerView.ViewHolder(binding.root) { + + fun bind( + longClickListener: PlantListener, + plant: Plant + ) { + binding.plant = plant + binding.longClickListner = longClickListener + binding.executePendingBindings() + } + } + + companion object DiffCallback: DiffUtil.ItemCallback() { + override fun areItemsTheSame(oldItem: Plant, newItem: Plant): Boolean { + return oldItem == newItem + } + + override fun areContentsTheSame(oldItem: Plant, newItem: Plant): Boolean { + return oldItem.name == newItem.name + } + + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PlantViewHolder { + val layoutInflater = LayoutInflater.from(parent.context) + return PlantViewHolder( + ListItemBinding.inflate(layoutInflater, parent, false) + ) + } + + override fun onBindViewHolder(holder: PlantViewHolder, position: Int) { + val plant = getItem(position) + holder.bind(longClickListener, plant) + } +} + +class PlantListener(val longClickListener: (plant: Plant) -> Boolean) { + fun onLongClick(plant: Plant) = longClickListener(plant) +} diff --git a/WaterMeProject/app/src/main/java/com/example/watermeproject/data/DataSource.kt b/WaterMeProject/app/src/main/java/com/example/watermeproject/data/DataSource.kt new file mode 100644 index 0000000..cac80b7 --- /dev/null +++ b/WaterMeProject/app/src/main/java/com/example/watermeproject/data/DataSource.kt @@ -0,0 +1,44 @@ +package com.example.watermeproject.data + +import com.example.watermeproject.model.Plant + +object DataSource { + val plants = listOf( + Plant( + name = "Lithop", + schedule = "monthly", + type = "Succulent", + description = "Stone mimicking succulent" + ), + Plant( + name = "Carrot", + schedule = "daily", + type = "Root", + description = "Hardy root vegetable" + ), + Plant( + name = "Peony", + schedule = "weekly", + type = "Flower", + description = "Spring blooming flower" + ), + Plant( + name = "Pothos", + schedule = "weekly", + type = "Houseplant", + description = "Indoor vine" + ), + Plant( + name = "Fiddle Leaf Fig", + schedule = "weekly", + type = "Broadleaf evergreen", + description = "Ornamental fig" + ), + Plant( + name = "Strawberry", + schedule = "daily", + type = "Fruit", + description = "Delicious 'multiple fruit'" + ) + ) +} \ No newline at end of file diff --git a/WaterMeProject/app/src/main/java/com/example/watermeproject/model/Plant.kt b/WaterMeProject/app/src/main/java/com/example/watermeproject/model/Plant.kt new file mode 100644 index 0000000..90ffbc3 --- /dev/null +++ b/WaterMeProject/app/src/main/java/com/example/watermeproject/model/Plant.kt @@ -0,0 +1,6 @@ +package com.example.watermeproject.model + +data class Plant(val name : String, +val schedule : String, +val type:String, +val description:String) diff --git a/WaterMeProject/app/src/main/java/com/example/watermeproject/ui/ReminderDialogFragment.kt b/WaterMeProject/app/src/main/java/com/example/watermeproject/ui/ReminderDialogFragment.kt new file mode 100644 index 0000000..a03e682 --- /dev/null +++ b/WaterMeProject/app/src/main/java/com/example/watermeproject/ui/ReminderDialogFragment.kt @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2021 The Android Open Source Project. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.watermeproject.ui + +import android.app.AlertDialog +import android.app.Dialog +import android.os.Bundle +import androidx.fragment.app.DialogFragment +import androidx.fragment.app.viewModels +import com.example.watermeproject.R +import com.example.watermeproject.viewmodel.PlantViewModel +import com.example.watermeproject.viewmodel.PlantViewModelFactory +import java.util.concurrent.TimeUnit + +class ReminderDialogFragment(private val plantName: String) : DialogFragment() { + + private val viewModel: PlantViewModel by viewModels { + PlantViewModelFactory(requireActivity().application) + } + + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { + return activity?.let { + val builder = AlertDialog.Builder(it) + .setTitle(R.string.water_reminder) + .setItems(R.array.water_schedule_array) { _, position -> + when (position) { + 0 -> + viewModel + .scheduleReminder(5, TimeUnit.SECONDS, plantName) + 1 -> + viewModel + .scheduleReminder(1, TimeUnit.DAYS, plantName) + 2 -> + viewModel + .scheduleReminder(7, TimeUnit.DAYS, plantName) + 3 -> + viewModel + .scheduleReminder(30, TimeUnit.DAYS, plantName) + } + } + builder.create() + } ?: throw IllegalStateException("Activity cannot be null") + } +} diff --git a/WaterMeProject/app/src/main/java/com/example/watermeproject/viewmodel/PlantViewModel.kt b/WaterMeProject/app/src/main/java/com/example/watermeproject/viewmodel/PlantViewModel.kt new file mode 100644 index 0000000..4ad3c04 --- /dev/null +++ b/WaterMeProject/app/src/main/java/com/example/watermeproject/viewmodel/PlantViewModel.kt @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 The Android Open Source Project. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.watermeproject.viewmodel + +import android.app.Application +import androidx.lifecycle.ViewModel +import androidx.lifecycle.ViewModelProvider +import androidx.work.Data +import androidx.work.ExistingWorkPolicy +import androidx.work.OneTimeWorkRequestBuilder +import androidx.work.WorkManager +import com.example.watermeproject.data.DataSource +import com.example.watermeproject.worker.WaterReminderWorker +import com.example.watermeproject.worker.WaterReminderWorker.Companion.nameKey +import java.util.concurrent.TimeUnit + +class PlantViewModel(application: Application): ViewModel() { + + val plants = DataSource.plants + private val workManager = WorkManager.getInstance(application) + + internal fun scheduleReminder( + duration: Long, + unit: TimeUnit, + plantName: String + ) { + // create a Data instance with the plantName passed to it + val data = Data.Builder().putString(nameKey,plantName).build() + + // Generate a OneTimeWorkRequest with the passed in duration, time unit, and data + // instance + val request = OneTimeWorkRequestBuilder() + .setInputData(data) + .setInitialDelay(duration,unit) + .build() + // Enqueue the request as a unique work request + workManager.enqueueUniqueWork(plantName,ExistingWorkPolicy.REPLACE,request) + } +} + +class PlantViewModelFactory(private val application: Application) : ViewModelProvider.Factory { + override fun create(modelClass: Class): T { + return if (modelClass.isAssignableFrom(PlantViewModel::class.java)) { + PlantViewModel(application) as T + } else { + throw IllegalArgumentException("Unknown ViewModel class") + } + } +} diff --git a/WaterMeProject/app/src/main/java/com/example/watermeproject/worker/WaterReminderWorker.kt b/WaterMeProject/app/src/main/java/com/example/watermeproject/worker/WaterReminderWorker.kt new file mode 100644 index 0000000..9845b70 --- /dev/null +++ b/WaterMeProject/app/src/main/java/com/example/watermeproject/worker/WaterReminderWorker.kt @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2021 The Android Open Source Project. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.watermeproject.worker + +import android.app.PendingIntent +import android.content.Context +import android.content.Intent +import androidx.core.app.NotificationCompat +import androidx.core.app.NotificationManagerCompat +import androidx.work.Worker +import androidx.work.WorkerParameters +import com.example.watermeproject.BaseApplication +import com.example.watermeproject.MainActivity +import com.example.watermeproject.R + +class WaterReminderWorker( + context: Context, + workerParams: WorkerParameters +) : Worker(context, workerParams) { + + // Arbitrary id number + private val notificationId = 17 + + override fun doWork(): Result { + + //setting notification tap action + // Create an explicit intent for an Activity in your app + val intent = Intent(applicationContext, MainActivity::class.java).apply { + flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK + } + + val pendingIntent: PendingIntent = PendingIntent + .getActivity(applicationContext, 0, intent, 0) + + val plantName = inputData.getString(nameKey) + + //CHANEL ID: This is required for compatibility with Android 8.0 (API level 26) and higher, but is ignored by older versions. + val builder = NotificationCompat.Builder(applicationContext, BaseApplication.CHANNEL_ID) + .setSmallIcon(R.drawable.ic_android_black_24dp) + .setContentTitle("Water me!") + .setContentText("It's time to water your $plantName") + .setPriority(NotificationCompat.PRIORITY_HIGH) + .setContentIntent(pendingIntent) + .setAutoCancel(true) //removes the notification after tap + + //show the notification + with(NotificationManagerCompat.from(applicationContext)) { + notify(notificationId, builder.build()) + } + + return Result.success() + } + + companion object { + const val nameKey = "NAME" + } +} diff --git a/WaterMeProject/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/WaterMeProject/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/WaterMeProject/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/WaterMeProject/app/src/main/res/drawable/ic_android_black_24dp.xml b/WaterMeProject/app/src/main/res/drawable/ic_android_black_24dp.xml new file mode 100644 index 0000000..41f6410 --- /dev/null +++ b/WaterMeProject/app/src/main/res/drawable/ic_android_black_24dp.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/WaterMeProject/app/src/main/res/drawable/ic_launcher_background.xml b/WaterMeProject/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/WaterMeProject/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WaterMeProject/app/src/main/res/layout/activity_main.xml b/WaterMeProject/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..9b64403 --- /dev/null +++ b/WaterMeProject/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/WaterMeProject/app/src/main/res/layout/list_item.xml b/WaterMeProject/app/src/main/res/layout/list_item.xml new file mode 100644 index 0000000..53cb324 --- /dev/null +++ b/WaterMeProject/app/src/main/res/layout/list_item.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WaterMeProject/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/WaterMeProject/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/WaterMeProject/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/WaterMeProject/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/WaterMeProject/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/WaterMeProject/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/WaterMeProject/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/WaterMeProject/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/WaterMeProject/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/WaterMeProject/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/WaterMeProject/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/WaterMeProject/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/WaterMeProject/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/WaterMeProject/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/WaterMeProject/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/WaterMeProject/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/WaterMeProject/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/WaterMeProject/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/WaterMeProject/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/WaterMeProject/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/WaterMeProject/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/WaterMeProject/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/WaterMeProject/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/WaterMeProject/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/WaterMeProject/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/WaterMeProject/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/WaterMeProject/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/WaterMeProject/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/WaterMeProject/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/WaterMeProject/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/WaterMeProject/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/WaterMeProject/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/WaterMeProject/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/WaterMeProject/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/WaterMeProject/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/WaterMeProject/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/WaterMeProject/app/src/main/res/values-night/themes.xml b/WaterMeProject/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..6cbb803 --- /dev/null +++ b/WaterMeProject/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/WaterMeProject/app/src/main/res/values/arrays.xml b/WaterMeProject/app/src/main/res/values/arrays.xml new file mode 100644 index 0000000..2746d75 --- /dev/null +++ b/WaterMeProject/app/src/main/res/values/arrays.xml @@ -0,0 +1,25 @@ + + + + + 5 seconds + 1 day + 1 week + 1 month + + diff --git a/WaterMeProject/app/src/main/res/values/colors.xml b/WaterMeProject/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/WaterMeProject/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/WaterMeProject/app/src/main/res/values/strings.xml b/WaterMeProject/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..6d28938 --- /dev/null +++ b/WaterMeProject/app/src/main/res/values/strings.xml @@ -0,0 +1,7 @@ + + WaterMeProject + Water %s + water_channel + water_reminder + Remind me to water in… + \ No newline at end of file diff --git a/WaterMeProject/app/src/main/res/values/themes.xml b/WaterMeProject/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..b0d2810 --- /dev/null +++ b/WaterMeProject/app/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/WaterMeProject/app/src/test/java/com/example/watermeproject/ExampleUnitTest.kt b/WaterMeProject/app/src/test/java/com/example/watermeproject/ExampleUnitTest.kt new file mode 100644 index 0000000..5e7fe8d --- /dev/null +++ b/WaterMeProject/app/src/test/java/com/example/watermeproject/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.example.watermeproject + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file