diff --git a/app/build.gradle b/app/build.gradle index d07007229..4d7459c13 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,7 +43,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.2.19' + implementation 'com.simplemobiletools:commons:3.3.1' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0' implementation 'com.android.support:multidex:1.0.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index 278fc7701..ef52e77a2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -89,7 +89,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList supportFragmentManager.beginTransaction().replace(R.id.fragment_holder, mFragment).commit() } - if (config.darkBackground) { + if (config.blackBackground) { fragment_holder.background = ColorDrawable(Color.BLACK) } @@ -102,6 +102,9 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList override fun onResume() { super.onResume() supportActionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.actionbar_gradient_background)) + if (config.blackBackground) { + updateStatusbarColor(Color.BLACK) + } } private fun sendViewPagerIntent(path: String) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 6309dd18e..950f356cf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -148,10 +148,10 @@ class SettingsActivity : SimpleActivity() { } private fun setupDarkBackground() { - settings_dark_background.isChecked = config.darkBackground - settings_dark_background_holder.setOnClickListener { - settings_dark_background.toggle() - config.darkBackground = settings_dark_background.isChecked + settings_black_background.isChecked = config.blackBackground + settings_black_background_holder.setOnClickListener { + settings_black_background.toggle() + config.blackBackground = settings_black_background.isChecked } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 79de936e8..7db412eb6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -116,6 +116,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View setupRotation() invalidateOptionsMenu() + + if (config.blackBackground) { + updateStatusbarColor(Color.BLACK) + } } override fun onPause() { @@ -198,8 +202,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View reloadViewPager() scanPath(mPath) - if (config.darkBackground) + if (config.blackBackground) { view_pager.background = ColorDrawable(Color.BLACK) + } if (config.hideSystemUI) fragmentClicked() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 6c3093f46..747742a59 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -252,7 +252,7 @@ class PhotoFragment : ViewPagerFragment() { } override fun onReady() { - background = ColorDrawable(if (context.config.darkBackground) Color.BLACK else context.config.backgroundColor) + background = ColorDrawable(if (context.config.blackBackground) Color.BLACK else context.config.backgroundColor) setDoubleTapZoomScale(getDoubleTapZoomScale(sWidth, sHeight)) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index 5df4ae0b5..8c2f7cdb1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -156,7 +156,7 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getBoolean(DISPLAY_FILE_NAMES, false) set(display) = prefs.edit().putBoolean(DISPLAY_FILE_NAMES, display).apply() - var darkBackground: Boolean + var blackBackground: Boolean get() = prefs.getBoolean(DARK_BACKGROUND, false) set(darkBackground) = prefs.edit().putBoolean(DARK_BACKGROUND, darkBackground).apply() diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 788ab7f1c..9437d049a 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -209,7 +209,7 @@