diff --git a/app/build.gradle b/app/build.gradle index a1984d0db8..1bb57b9d53 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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'] @@ -91,7 +91,6 @@ android { kotlinOptions { jvmTarget = '1.8' - useIR = true } testOptions { diff --git a/app/src/main/java/com/amaze/filemanager/ui/base/BaseBottomSheetFragment.kt b/app/src/main/java/com/amaze/filemanager/ui/base/BaseBottomSheetFragment.kt index 78c3b6449f..17b39a9697 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/base/BaseBottomSheetFragment.kt +++ b/app/src/main/java/com/amaze/filemanager/ui/base/BaseBottomSheetFragment.kt @@ -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 @@ -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? + } } } } diff --git a/build.gradle b/build.gradle index be887ac69a..e19f9c79e8 100644 --- a/build.gradle +++ b/build.gradle @@ -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' diff --git a/commons_compress_7z/build.gradle b/commons_compress_7z/build.gradle index 0b7e3a9e9a..d69c482ff6 100644 --- a/commons_compress_7z/build.gradle +++ b/commons_compress_7z/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 28 + compileSdk 31 defaultConfig { minSdkVersion 19 diff --git a/file_operations/build.gradle b/file_operations/build.gradle index eadddd661e..10fcc01a7e 100644 --- a/file_operations/build.gradle +++ b/file_operations/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 30 + compileSdk 31 defaultConfig { minSdkVersion 19 @@ -51,7 +51,7 @@ android { } kotlinOptions { - useIR = true + jvmTarget = '1.8' } }