diff --git a/app/build.gradle b/app/build.gradle index 8ed8763..a84a3f4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -55,7 +55,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:a74ec200da' + implementation 'com.github.SimpleMobileTools:Simple-Commons:c615eda325' implementation 'org.greenrobot:eventbus:3.2.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.1' } diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt index 01d735c..fe41bda 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt @@ -30,6 +30,14 @@ class SettingsActivity : SimpleActivity() { setupForcePortrait() updateTextColors(settings_holder) invalidateOptionsMenu() + + arrayOf(settings_color_customization_label, settings_general_settings_label).forEach { + it.setTextColor(getAdjustedPrimaryColor()) + } + + arrayOf(settings_color_customization_holder, settings_general_settings_holder).forEach { + it.background.applyColorFilter(baseConfig.backgroundColor.getContrastColor()) + } } override fun onCreateOptionsMenu(menu: Menu): Boolean { @@ -39,6 +47,12 @@ class SettingsActivity : SimpleActivity() { private fun setupPurchaseThankYou() { settings_purchase_thank_you_holder.beGoneIf(isOrWasThankYouInstalled()) + + // make sure the corners at ripple fit the stroke rounded corners + if (settings_purchase_thank_you_holder.isGone()) { + settings_use_english_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) + } + settings_purchase_thank_you_holder.setOnClickListener { launchPurchaseThankYouIntent() } @@ -63,6 +77,11 @@ class SettingsActivity : SimpleActivity() { private fun setupUseEnglish() { settings_use_english_holder.beVisibleIf(config.wasUseEnglishToggled || Locale.getDefault().language != "en") settings_use_english.isChecked = config.useEnglish + + if (settings_use_english_holder.isGone() && settings_purchase_thank_you_holder.isGone()) { + settings_turn_flashlight_on_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) + } + settings_use_english_holder.setOnClickListener { settings_use_english.toggle() config.useEnglish = settings_use_english.isChecked diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 8568ec8..0effd9c 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -1,6 +1,5 @@ @@ -11,205 +10,180 @@ android:layout_height="wrap_content" android:orientation="vertical"> - + android:text="@string/color_customization" /> - - - - - + android:layout_margin="@dimen/medium_margin" + android:background="@drawable/section_holder_stroke" + android:orientation="vertical"> - - - - - - - - - - - - - + android:background="@drawable/ripple_top_corners"> - + - + - + android:background="@drawable/ripple_bottom_corners"> - + - + + + + android:text="@string/general_settings" /> - - - - - + android:layout_margin="@dimen/medium_margin" + android:background="@drawable/section_holder_stroke" + android:orientation="vertical"> - + android:background="@drawable/ripple_top_corners"> - + - + - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_background"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml index 815619c..1b13619 100644 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu.xml @@ -1,12 +1,14 @@ + xmlns:app="http://schemas.android.com/apk/res-auto"> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> diff --git a/build.gradle b/build.gradle index 1d18681..9b82dbc 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath 'com.android.tools.build:gradle:7.0.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong