Skip to content

Commit

Permalink
Upgrade Kotlin to 1.9.10
Browse files Browse the repository at this point in the history
Also fixes code problem at BaseBottomSheetFragment causing project compile fails - where a when branch for SYSTEM theme is missing.

There is no handling for SYSTEM theme at ThemedActivity, hence the do-nothing branch as BaseBottomSheetFragment too.
  • Loading branch information
TranceLove committed Oct 15, 2023
1 parent 6783e4d commit 8988db1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 25 deletions.
3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'com.hiya.jacoco-android'
apply plugin: "com.starter.easylauncher"

android {
compileSdkVersion 31
compileSdk 31
packagingOptions {
resources {
excludes += ['proguard-project.txt', 'project.properties', 'META-INF/LICENSE.txt', 'META-INF/LICENSE', 'META-INF/NOTICE.txt', 'META-INF/NOTICE', 'META-INF/DEPENDENCIES.txt', 'META-INF/DEPENDENCIES']
Expand Down Expand Up @@ -91,7 +91,6 @@ android {

kotlinOptions {
jvmTarget = '1.8'
useIR = true
}

testOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package com.amaze.filemanager.ui.base
import android.app.Dialog
import android.os.Bundle
import android.view.View
import androidx.core.content.res.ResourcesCompat
import com.amaze.filemanager.R
import com.amaze.filemanager.ui.activities.superclasses.ThemedActivity
import com.amaze.filemanager.ui.theme.AppTheme
Expand All @@ -39,28 +40,33 @@ open class BaseBottomSheetFragment : BottomSheetDialogFragment() {
* Initializes bottom sheet ui resources based on current theme
*/
fun initDialogResources(rootView: View) {
when ((activity as ThemedActivity?)!!.appTheme!!) {
AppTheme.DARK -> {
rootView.setBackgroundDrawable(
context?.resources?.getDrawable(
R.drawable.shape_dialog_bottomsheet_dark
(requireActivity() as ThemedActivity).appTheme?.let { appTheme ->
when (appTheme) {
AppTheme.DARK -> {
rootView.background = ResourcesCompat.getDrawable(
requireContext().resources,
R.drawable.shape_dialog_bottomsheet_dark,
requireActivity().theme
)
)
}
AppTheme.BLACK -> {
rootView.setBackgroundDrawable(
context?.resources?.getDrawable(
R.drawable.shape_dialog_bottomsheet_black
}
AppTheme.BLACK -> {
rootView.background = ResourcesCompat.getDrawable(
requireContext().resources,
R.drawable.shape_dialog_bottomsheet_black,
requireActivity().theme
)
)
}
AppTheme.LIGHT, AppTheme.TIMED -> {
rootView
.setBackgroundDrawable(
context?.resources?.getDrawable(
R.drawable.shape_dialog_bottomsheet_white
)
}
AppTheme.LIGHT, AppTheme.TIMED -> {
rootView.background = ResourcesCompat.getDrawable(
requireContext().resources,
R.drawable.shape_dialog_bottomsheet_white,
requireActivity().theme
)
}
AppTheme.SYSTEM -> {
// do nothing
// FIXME: or need to derive the necessary background based on app's accent?
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

buildscript {
ext {
kotlin_version = "1.6.10"
kotlin_version = "1.9.10"
robolectricVersion = '4.9'
glideVersion = '4.11.0'
sshjVersion = '0.35.0'
Expand Down
2 changes: 1 addition & 1 deletion commons_compress_7z/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
compileSdk 31

defaultConfig {
minSdkVersion 19
Expand Down
4 changes: 2 additions & 2 deletions file_operations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 30
compileSdk 31

defaultConfig {
minSdkVersion 19
Expand Down Expand Up @@ -51,7 +51,7 @@ android {
}

kotlinOptions {
useIR = true
jvmTarget = '1.8'
}
}

Expand Down

0 comments on commit 8988db1

Please sign in to comment.