From 22e5ed3ed236dba7f7baaf358e3ed0aa838de9c0 Mon Sep 17 00:00:00 2001 From: Thanos Tsakiridis Date: Wed, 29 Oct 2025 01:02:39 +0100 Subject: [PATCH 1/2] Update AGP, Kotlin version, compile and target SDK version Kotlin synthetics were also replaced with findViewById, since they are not available anymore. Avoided to migrate to view binding since a migration to Jetpack Compose would make more sense in the future. --- .gitignore | 2 + .idea/.name | 1 - .idea/codeStyles/Project.xml | 122 ------------------ .idea/codeStyles/codeStyleConfig.xml | 5 - .idea/compiler.xml | 6 - .idea/jarRepositories.xml | 30 ----- app/build.gradle | 17 ++- .../main/java/nl/appt/dialog/ItemsDialog.kt | 4 +- .../main/java/nl/appt/dialog/ListDialog.kt | 7 +- .../main/java/nl/appt/dialog/PageDialog.kt | 5 +- .../java/nl/appt/dialog/SettingsDialog.kt | 5 +- .../java/nl/appt/widgets/ToolbarActivity.kt | 6 +- .../java/nl/appt/widgets/ToolbarFragment.kt | 8 +- .../main/java/nl/appt/widgets/WebActivity.kt | 32 ++++- app/src/main/res/values/attrs.xml | 5 + build.gradle | 10 +- gradle/wrapper/gradle-wrapper.properties | 4 +- 17 files changed, 67 insertions(+), 202 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/jarRepositories.xml create mode 100644 app/src/main/res/values/attrs.xml diff --git a/.gitignore b/.gitignore index 7a144bb..4cc333b 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,5 @@ lint/tmp/ # App app/google-services.json app/release/* + +.idea/ diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 3bf5846..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -Appt \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 88ea3aa..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - -
- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
-
-
-
- - -
-
\ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index fb7f4a8..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index 2370474..0000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 9b13f55..9fe1f4d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,23 +1,28 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' + apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'com.google.gms.google-services' apply plugin: 'kotlin-kapt' android { - compileSdkVersion 33 + namespace 'nl.appt' + compileSdkVersion 36 defaultConfig { applicationId 'nl.appt' minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 36 versionCode 200 versionName '2.0.0' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + buildFeatures { + buildConfig = true + } + buildTypes { debug { buildConfigField "String", "BASE_URL", '"https://appt.org/"' @@ -33,11 +38,11 @@ android { viewBinding true } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '17' } } diff --git a/app/src/main/java/nl/appt/dialog/ItemsDialog.kt b/app/src/main/java/nl/appt/dialog/ItemsDialog.kt index d293235..eb4d5a5 100644 --- a/app/src/main/java/nl/appt/dialog/ItemsDialog.kt +++ b/app/src/main/java/nl/appt/dialog/ItemsDialog.kt @@ -5,8 +5,8 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import com.hannesdorfmann.adapterdelegates4.ListDelegationAdapter -import kotlinx.android.synthetic.main.layout_list.view.* import nl.appt.R import nl.appt.extensions.addItemDecoration import nl.appt.helpers.itemAdapterDelegate @@ -39,7 +39,7 @@ open class ItemsDialog(private val items: List) : BaseDialog() { ): View? { val view = inflater.inflate(R.layout.layout_list, container, false) - view.recyclerView.run { + view.findViewById(R.id.recyclerView).run { layoutManager = LinearLayoutManager(context) adapter = adapterDelegate addItemDecoration() diff --git a/app/src/main/java/nl/appt/dialog/ListDialog.kt b/app/src/main/java/nl/appt/dialog/ListDialog.kt index 44b7e21..66b8954 100644 --- a/app/src/main/java/nl/appt/dialog/ListDialog.kt +++ b/app/src/main/java/nl/appt/dialog/ListDialog.kt @@ -4,7 +4,8 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import kotlinx.android.synthetic.main.layout_list_dialog.view.* +import android.widget.Button +import android.widget.TextView import nl.appt.R abstract class ListDialog(val title: Int) : BaseDialog() { @@ -16,9 +17,9 @@ abstract class ListDialog(val title: Int) : BaseDialog() { ): View? { val view = inflater.inflate(R.layout.layout_list_dialog, container, false) - view.titleView.setText(title) + view.findViewById(R.id.titleView).setText(title) - view.closeButton.setOnClickListener { + view.findViewById