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..0ea68be 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' } } @@ -48,8 +53,8 @@ dependencies { implementation 'com.google.android.material:material:1.7.0' // AndroidX - implementation 'androidx.appcompat:appcompat:1.5.1' - implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'androidx.core:core-ktx:1.13.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3' implementation 'androidx.navigation:navigation-ui-ktx:2.5.3' @@ -60,6 +65,7 @@ dependencies { implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.webkit:webkit:1.5.0' implementation 'androidx.browser:browser:1.4.0' + implementation 'androidx.activity:activity-ktx:1.9.0' // Room implementation("androidx.room:room-runtime:$room_version") diff --git a/app/src/main/java/nl/appt/dialog/BaseDialog.kt b/app/src/main/java/nl/appt/dialog/BaseDialog.kt index 84cefb8..378f78e 100644 --- a/app/src/main/java/nl/appt/dialog/BaseDialog.kt +++ b/app/src/main/java/nl/appt/dialog/BaseDialog.kt @@ -1,9 +1,24 @@ package nl.appt.dialog +import android.os.Bundle +import android.view.View +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat +import androidx.core.view.updatePadding import com.google.android.material.bottomsheet.BottomSheetDialogFragment open class BaseDialog: BottomSheetDialogFragment() { // TODO: Improve landscape height with peekHeight + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + // Apply bottom system bar insets to dialog + ViewCompat.setOnApplyWindowInsetsListener(view) { v, windowInsets -> + val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) + v.updatePadding(bottom = insets.bottom) + windowInsets + } + } } \ No newline at end of file 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