From 512a41e14651c3c989b43faa18d66c7e9286a6f9 Mon Sep 17 00:00:00 2001 From: Abrynos <6608231+Abrynos@users.noreply.github.com> Date: Tue, 31 Aug 2021 00:21:20 +0200 Subject: [PATCH 01/10] Migrate kotlin synthetics to Android view binding --- app/build.gradle | 3 +- .../s999844/shoppinglist/AddItemActivity.kt | 24 +++++++------ .../pjwstk/s999844/shoppinglist/Extensions.kt | 35 +++++++++++++++++++ .../s999844/shoppinglist/MainActivity.kt | 21 ++++++----- .../s999844/shoppinglist/OptionsActivity.kt | 12 ++++--- .../ShoppingListAdapter.kt | 13 ++++--- 6 files changed, 75 insertions(+), 33 deletions(-) create mode 100644 app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/Extensions.kt diff --git a/app/build.gradle b/app/build.gradle index 45bf441..e2234d6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,7 +27,6 @@ plugins { id "com.android.application" id "kotlin-android" - id "kotlin-android-extensions" id "kotlin-kapt" } @@ -96,6 +95,8 @@ android { disable "ConvertToWebp" // easier to read if in xml and not in a bunch of lambdas within the setup method for the activity disable "UsingOnClickInXml" + // TODO - remove when android linting is smart enough to detect the usage of these IDs in our view bindings + disable "UnusedIds" } } diff --git a/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/AddItemActivity.kt b/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/AddItemActivity.kt index 38d3017..519a940 100644 --- a/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/AddItemActivity.kt +++ b/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/AddItemActivity.kt @@ -8,7 +8,7 @@ * | | | | __/ | * |_| |_| |___/ * - * Copyright (C) 2021-2021 Sebastian Göls + * Copyright (C) 2021-2021 Sebastian Göls * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,9 +35,9 @@ import android.view.View import android.view.inputmethod.InputMethodManager import android.widget.TextView import com.google.android.material.snackbar.Snackbar -import kotlinx.android.synthetic.main.activity_add_item.* import pl.edu.pjwstk.s999844.shoppinglist.dal.ShoppingListDao import pl.edu.pjwstk.s999844.shoppinglist.dal.ShoppingListDatabase +import pl.edu.pjwstk.s999844.shoppinglist.databinding.ActivityAddItemBinding import pl.edu.pjwstk.s999844.shoppinglist.models.RequiredItem import java.util.* @@ -47,6 +47,8 @@ class AddItemActivity : AbstractShoppingActivity() { const val AmountParameterName = "amount" } + private val binding by viewBinding(ActivityAddItemBinding::inflate) + private val inputMethodManager: InputMethodManager by lazy { getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager } private val currentLocale: Locale @@ -54,7 +56,7 @@ class AddItemActivity : AbstractShoppingActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_add_item) + setContentView(binding.root) } @@ -63,9 +65,9 @@ class AddItemActivity : AbstractShoppingActivity() { // german-speaking people capitalize nouns - as a shopping list usually contains nouns we capitalize the first letter automatically. They can still use lowercase manually if they need a pronoun when (currentLocale.language) { - Locale.GERMAN.language -> addItemNameInput.inputType = InputType.TYPE_TEXT_FLAG_CAP_SENTENCES or addItemNameInput.inputType + Locale.GERMAN.language -> binding.addItemNameInput.inputType = InputType.TYPE_TEXT_FLAG_CAP_SENTENCES or binding.addItemNameInput.inputType } - addItemNameInput.requestFocus() + binding.addItemNameInput.requestFocus() title = getString(R.string.addTitleBarText) @@ -78,7 +80,7 @@ class AddItemActivity : AbstractShoppingActivity() { return } - addItemNameInput.setText(nameParameter, TextView.BufferType.EDITABLE) + binding.addItemNameInput.setText(nameParameter, TextView.BufferType.EDITABLE) val amountParameter = data.getQueryParameter(AmountParameterName) ?: return if (amountParameter.isEmpty() || amountParameter.isBlank()) { @@ -92,7 +94,7 @@ class AddItemActivity : AbstractShoppingActivity() { } if (amount > 1) { - addItemAmountInput.setText(amount.toString(), TextView.BufferType.EDITABLE) + binding.addItemAmountInput.setText(amount.toString(), TextView.BufferType.EDITABLE) } } @@ -105,13 +107,13 @@ class AddItemActivity : AbstractShoppingActivity() { } private fun createAndValidateItem(): RequiredItem? { - val name: String = addItemNameInput.text.toString().trim() + val name: String = binding.addItemNameInput.text.toString().trim() if (name.isEmpty()) { warnError(getString(R.string.addNameIsEmptyMessage)) return null } - val amountString = addItemAmountInput.text.toString().trim() + val amountString = binding.addItemAmountInput.text.toString().trim() val amount: Int = if (amountString.isEmpty() || amountString.isBlank()) { 1 } else { @@ -147,7 +149,7 @@ class AddItemActivity : AbstractShoppingActivity() { @Suppress("UNUSED_PARAMETER") fun addItem(view: View) { - inputMethodManager.hideSoftInputFromWindow(addItemNameInput.windowToken, 0) + inputMethodManager.hideSoftInputFromWindow(binding.addItemNameInput.windowToken, 0) val item = createAndValidateItem() ?: return @@ -163,5 +165,5 @@ class AddItemActivity : AbstractShoppingActivity() { finish() } - private fun warnError(message: String) = Snackbar.make(saveButton, message, Snackbar.LENGTH_SHORT).show() + private fun warnError(message: String) = Snackbar.make(binding.saveButton, message, Snackbar.LENGTH_SHORT).show() } diff --git a/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/Extensions.kt b/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/Extensions.kt new file mode 100644 index 0000000..fb72eaa --- /dev/null +++ b/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/Extensions.kt @@ -0,0 +1,35 @@ +/* + * _____ _ _ _ _ _ + * / ___| | (_) | | (_) | | + * \ `--.| |__ ___ _ __ _ __ _ _ __ __ _| | _ ___| |_ + * `--. \ '_ \ / _ \| '_ \| '_ \| | '_ \ / _` | | | / __| __| + * /\__/ / | | | (_) | |_) | |_) | | | | | (_| | |___| \__ \ |_ + * \____/|_| |_|\___/| .__/| .__/|_|_| |_|\__, \_____/_|___/\__| + * | | | | __/ | + * |_| |_| |___/ + * + * Copyright (C) 2021-2021 Sebastian Göls + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License only + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package pl.edu.pjwstk.s999844.shoppinglist + +import android.view.LayoutInflater +import androidx.viewbinding.ViewBinding + + +inline fun AbstractShoppingActivity.viewBinding(crossinline bindingInflater: (LayoutInflater) -> T) = lazy(LazyThreadSafetyMode.NONE) { + bindingInflater.invoke(layoutInflater) +} diff --git a/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/MainActivity.kt b/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/MainActivity.kt index ff42e43..d836535 100644 --- a/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/MainActivity.kt +++ b/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/MainActivity.kt @@ -8,7 +8,7 @@ * | | | | __/ | * |_| |_| |___/ * - * Copyright (C) 2021-2021 Sebastian Göls + * Copyright (C) 2021-2021 Sebastian Göls * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,24 +35,26 @@ import android.view.View import androidx.core.view.isVisible import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager -import kotlinx.android.synthetic.main.activity_main.* import pl.edu.pjwstk.s999844.shoppinglist.dal.ShoppingListDao import pl.edu.pjwstk.s999844.shoppinglist.dal.ShoppingListDatabase +import pl.edu.pjwstk.s999844.shoppinglist.databinding.ActivityMainBinding import pl.edu.pjwstk.s999844.shoppinglist.models.RequiredItem import pl.edu.pjwstk.s999844.shoppinglist.recyclerviewadapters.ShoppingListAdapter class MainActivity : AbstractShoppingActivity() { + private val binding by viewBinding(ActivityMainBinding::inflate) + private val shoppingListDao: ShoppingListDao by lazy { ShoppingListDatabase.getInstance(applicationContext).getShoppingListDao() } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) + setContentView(binding.root) - mainListRecyclerView.layoutManager = LinearLayoutManager(this) - mainListRecyclerView.addItemDecoration(DividerItemDecoration(this, DividerItemDecoration.VERTICAL)) + binding.mainListRecyclerView.layoutManager = LinearLayoutManager(this) + binding.mainListRecyclerView.addItemDecoration(DividerItemDecoration(this, DividerItemDecoration.VERTICAL)) shoppingListDao.findAllItems().observe(this, this::observeDatabaseChange) - mainListRecyclerView.adapter = ShoppingListAdapter(this::changeItemCallback) + binding.mainListRecyclerView.adapter = ShoppingListAdapter(this::changeItemCallback) } override fun onCreateOptionsMenu(menu: Menu?): Boolean { @@ -89,8 +91,9 @@ class MainActivity : AbstractShoppingActivity() { } private fun observeDatabaseChange(items: List) { - (mainListRecyclerView.adapter as ShoppingListAdapter).setItems(items) - mainEmptyTextView.isVisible = items.isEmpty() - mainListRecyclerView.isVisible = items.isNotEmpty() + (binding.mainListRecyclerView.adapter as ShoppingListAdapter).setItems(items) + + binding.mainEmptyTextView.isVisible = items.isEmpty() + binding.mainListRecyclerView.isVisible = items.isNotEmpty() } } diff --git a/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/OptionsActivity.kt b/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/OptionsActivity.kt index e291fcc..6d5e2b6 100644 --- a/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/OptionsActivity.kt +++ b/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/OptionsActivity.kt @@ -8,7 +8,7 @@ * | | | | __/ | * |_| |_| |___/ * - * Copyright (C) 2021-2021 Sebastian Göls + * Copyright (C) 2021-2021 Sebastian Göls * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ import android.content.Intent import android.net.Uri import android.os.Bundle import android.view.View -import kotlinx.android.synthetic.main.activity_options.* +import pl.edu.pjwstk.s999844.shoppinglist.databinding.ActivityOptionsBinding import pl.edu.pjwstk.s999844.shoppinglist.settings.Settings class OptionsActivity : AbstractShoppingActivity() { @@ -44,24 +44,26 @@ class OptionsActivity : AbstractShoppingActivity() { private val LATEST_RELEASE_URI: Uri = Uri.parse(LATEST_RELEASE_LINK) } + private val binding by viewBinding(ActivityOptionsBinding::inflate) + private val settings: Settings by lazy { Settings(this) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_options) + setContentView(binding.root) } override fun onStart() { super.onStart() - optionsThemeSwitch.isChecked = settings.darkThemeActive + binding.optionsThemeSwitch.isChecked = settings.darkThemeActive title = getString(R.string.optionsTitleBarText) } @Suppress("UNUSED_PARAMETER") fun onClickThemeSwitch(view: View) { - val isDark = optionsThemeSwitch.isChecked + val isDark = binding.optionsThemeSwitch.isChecked settings.darkThemeActive = isDark ThemeManager.setDark(isDark) } diff --git a/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/recyclerviewadapters/ShoppingListAdapter.kt b/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/recyclerviewadapters/ShoppingListAdapter.kt index eaacdb9..8202e24 100644 --- a/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/recyclerviewadapters/ShoppingListAdapter.kt +++ b/app/src/main/java/pl/edu/pjwstk/s999844/shoppinglist/recyclerviewadapters/ShoppingListAdapter.kt @@ -8,7 +8,7 @@ * | | | | __/ | * |_| |_| |___/ * - * Copyright (C) 2021-2021 Sebastian Göls + * Copyright (C) 2021-2021 Sebastian Göls * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,7 +31,6 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView -import kotlinx.android.synthetic.main.shopping_list_item.view.* import pl.edu.pjwstk.s999844.shoppinglist.databinding.ShoppingListItemBinding import pl.edu.pjwstk.s999844.shoppinglist.models.RequiredItem import java.util.function.BiConsumer @@ -49,19 +48,19 @@ class ShoppingListAdapter(private val changeAmountCallback: BiConsumer 1 binding.nameTextView.text = item.name - binding.buttonLayout.addButton.setOnClickListener { + binding.addButton.setOnClickListener { changeAmountCallback.accept(item, 1) } - binding.buttonLayout.subtractButton.setOnClickListener { + binding.subtractButton.setOnClickListener { changeAmountCallback.accept(item, -1) } - binding.buttonLayout.deleteButton.setOnClickListener { + binding.deleteButton.setOnClickListener { changeAmountCallback.accept(item, -item.amount) } } @@ -74,5 +73,5 @@ class ShoppingListAdapter(private val changeAmountCallback: BiConsumer Date: Wed, 1 Sep 2021 22:06:09 +0200 Subject: [PATCH 02/10] Update build.gradle --- app/build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e2234d6..ac920f5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -95,8 +95,6 @@ android { disable "ConvertToWebp" // easier to read if in xml and not in a bunch of lambdas within the setup method for the activity disable "UsingOnClickInXml" - // TODO - remove when android linting is smart enough to detect the usage of these IDs in our view bindings - disable "UnusedIds" } } From ab8138e24c2ed201259530edd6ad3460d5cc3fee Mon Sep 17 00:00:00 2001 From: Abrynos <6608231+Abrynos@users.noreply.github.com> Date: Sat, 11 Sep 2021 16:18:06 +0200 Subject: [PATCH 03/10] Re-enable UnusedIds warnings where the were already placed previously --- app/src/main/res/layout/shopping_list_item.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/shopping_list_item.xml b/app/src/main/res/layout/shopping_list_item.xml index f424550..07f7aa1 100644 --- a/app/src/main/res/layout/shopping_list_item.xml +++ b/app/src/main/res/layout/shopping_list_item.xml @@ -28,15 +28,14 @@ android:layout_centerVertical="true" android:layout_marginStart="10dp" android:textIsSelectable="false" - android:textSize="@dimen/listItemTextSize" - tools:ignore="UnusedIds" /> + android:textSize="@dimen/listItemTextSize" /> + tools:ignore="RelativeOverlap"> Date: Thu, 9 Sep 2021 01:06:53 +0200 Subject: [PATCH 04/10] Bump --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 71c18d7..15c0aeb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,8 +42,8 @@ android { applicationId "pl.edu.pjwstk.s999844.shoppinglist" minSdkVersion 24 targetSdkVersion 31 - versionCode 8 - versionName "v1.7.0" + versionCode 9 + versionName "v1.8.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" From 5e6d87a4b71d5f4df336b6db8d317ce1edade393 Mon Sep 17 00:00:00 2001 From: Abrynos <6608231+Abrynos@users.noreply.github.com> Date: Fri, 10 Sep 2021 21:28:11 +0200 Subject: [PATCH 05/10] Streamline signing in build.gradle --- app/build.gradle | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 15c0aeb..ff05a68 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,6 @@ plugins { } def keystorePropertiesFile = rootProject.file("keystore.properties") -def keystoreProperties = new Properties() -keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) android { compileSdkVersion 31 @@ -55,11 +53,17 @@ android { } signingConfigs { release { - storeFile file(keystoreProperties["storeFile"]) - storePassword keystoreProperties["storePassword"] - keyAlias keystoreProperties["keyAlias"] - keyPassword keystoreProperties["keyPassword"] - v2SigningEnabled true + if(keystorePropertiesFile.exists()) { + def keystoreProperties = new Properties() + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + + storeFile file(keystoreProperties.getProperty("storeFile")) + storePassword keystoreProperties.getProperty("storePassword") + keyAlias keystoreProperties.getProperty("keyAlias") + keyPassword keystoreProperties.getProperty("keyPassword") + v2SigningEnabled true + } + } } applicationVariants.all { @@ -68,7 +72,7 @@ android { buildTypes { release { minifyEnabled true - signingConfig signingConfigs.release + signingConfig keystorePropertiesFile.exists() ? signingConfigs.release : null proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" } } From 9febec120827a5af08cb2c9144491612c25c6690 Mon Sep 17 00:00:00 2001 From: Abrynos <6608231+Abrynos@users.noreply.github.com> Date: Fri, 10 Sep 2021 21:28:25 +0200 Subject: [PATCH 06/10] Changelog updates --- fastlane/metadata/android/en-US/changelogs/8.txt | 1 - fastlane/metadata/android/en-US/changelogs/9.txt | 1 + fastlane/metadata/android/en-US/changelogs/default.txt | 3 +-- 3 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/9.txt diff --git a/fastlane/metadata/android/en-US/changelogs/8.txt b/fastlane/metadata/android/en-US/changelogs/8.txt index 6331f2c..404c214 100644 --- a/fastlane/metadata/android/en-US/changelogs/8.txt +++ b/fastlane/metadata/android/en-US/changelogs/8.txt @@ -1,2 +1 @@ -* * The usual amount of miscellaneous code improvements and optimizations. diff --git a/fastlane/metadata/android/en-US/changelogs/9.txt b/fastlane/metadata/android/en-US/changelogs/9.txt new file mode 100644 index 0000000..404c214 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/9.txt @@ -0,0 +1 @@ +* The usual amount of miscellaneous code improvements and optimizations. diff --git a/fastlane/metadata/android/en-US/changelogs/default.txt b/fastlane/metadata/android/en-US/changelogs/default.txt index 6331f2c..6494b76 100644 --- a/fastlane/metadata/android/en-US/changelogs/default.txt +++ b/fastlane/metadata/android/en-US/changelogs/default.txt @@ -1,2 +1 @@ -* -* The usual amount of miscellaneous code improvements and optimizations. +* A huge amount of miscellaneous code improvements and optimizations. From 59a5c7bd1e70a3962c7fccf45e70726b2362e5e7 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 18 Sep 2021 18:47:19 +0000 Subject: [PATCH 07/10] Update kotlin_version to v1.5.31 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 102bc70..c991db2 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ // Top-level build file where you can add configuration oit's PLN and not zlptions common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.5.30' + ext.kotlin_version = '1.5.31' repositories { google() mavenCentral() From 9e05eac2c1dd4e98ea735779b4ec144eb27ba6f2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 25 Sep 2021 02:36:20 +0000 Subject: [PATCH 08/10] Update dependency androidx.constraintlayout:constraintlayout to v2.1.1 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index ff05a68..05d9df7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -118,7 +118,7 @@ dependencies { implementation "androidx.core:core-ktx:1.6.0" implementation "androidx.appcompat:appcompat:1.3.1" implementation "com.google.android.material:material:1.4.0" - implementation "androidx.constraintlayout:constraintlayout:2.1.0" + implementation "androidx.constraintlayout:constraintlayout:2.1.1" testImplementation "junit:junit:4.13.2" androidTestImplementation "androidx.test.ext:junit:1.1.3" From 56718ece102ddc1d92c9f59aa91cd96065aca531 Mon Sep 17 00:00:00 2001 From: Abrynos <6608231+Abrynos@users.noreply.github.com> Date: Sat, 18 Feb 2023 10:59:47 +0100 Subject: [PATCH 09/10] Update libraries and fix build --- app/build.gradle | 10 ++++- .../ic_launcher_foreground_monochrome.xml | 37 +++++++++++++++++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 1 + build.gradle | 4 +- 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/ic_launcher_foreground_monochrome.xml diff --git a/app/build.gradle b/app/build.gradle index 24b6861..9dc1646 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -63,8 +63,14 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - kotlinOptions { - jvmTarget = "1.8" + kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(18)) + } + // Or shorter: + jvmToolchain(18) + // For example: + jvmToolchain(8) } buildFeatures { viewBinding true diff --git a/app/src/main/res/drawable/ic_launcher_foreground_monochrome.xml b/app/src/main/res/drawable/ic_launcher_foreground_monochrome.xml new file mode 100644 index 0000000..d124f22 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground_monochrome.xml @@ -0,0 +1,37 @@ + + + + + + + diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 5476e22..17ec6a7 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -18,4 +18,5 @@ + diff --git a/build.gradle b/build.gradle index ac1cd6b..35448a3 100644 --- a/build.gradle +++ b/build.gradle @@ -26,13 +26,13 @@ // Top-level build file where you can add configuration oit's PLN and not zlptions common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.7.20' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:7.4.1' //noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" From a53177675349cc5d51f97da93948ffca32b39049 Mon Sep 17 00:00:00 2001 From: Abrynos <6608231+Abrynos@users.noreply.github.com> Date: Sat, 18 Feb 2023 12:09:49 +0100 Subject: [PATCH 10/10] Upgrade Java to 11 --- app/build.gradle | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f6a9545..edd7dff 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,10 @@ android { javaCompileOptions { annotationProcessorOptions { - arguments["room.incremental"] = "true" + arguments += [ + "room.schemaLocation": "$projectDir/schemas", + "room.incremental" : "true" + ] } } signingConfig signingConfigs.debug @@ -61,17 +64,14 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlin { jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(18)) + languageVersion.set(JavaLanguageVersion.of(11)) } - // Or shorter: - jvmToolchain(18) - // For example: - jvmToolchain(8) + jvmToolchain(11) } buildFeatures { viewBinding true @@ -103,6 +103,7 @@ dependencies { def room_version = "2.5.0" implementation "androidx.room:room-runtime:$room_version" + annotationProcessor "androidx.room:room-compiler:$room_version" kapt "androidx.room:room-compiler:$room_version" implementation fileTree(include: ["*.jar"], dir: "libs")