mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Settings-Fix-UI: Improve ripple effect on pure-dark mode and process navigation bar insets on Settings screen
This commit is contained in:
@@ -26,7 +26,6 @@ import org.isoron.uhabits.R
|
|||||||
import org.isoron.uhabits.activities.AndroidThemeSwitcher
|
import org.isoron.uhabits.activities.AndroidThemeSwitcher
|
||||||
import org.isoron.uhabits.core.models.PaletteColor
|
import org.isoron.uhabits.core.models.PaletteColor
|
||||||
import org.isoron.uhabits.databinding.SettingsActivityBinding
|
import org.isoron.uhabits.databinding.SettingsActivityBinding
|
||||||
import org.isoron.uhabits.utils.applyBottomInset
|
|
||||||
import org.isoron.uhabits.utils.applyRootViewInsets
|
import org.isoron.uhabits.utils.applyRootViewInsets
|
||||||
import org.isoron.uhabits.utils.setupToolbar
|
import org.isoron.uhabits.utils.setupToolbar
|
||||||
|
|
||||||
@@ -45,7 +44,6 @@ class SettingsActivity : AppCompatActivity() {
|
|||||||
theme = themeSwitcher.currentTheme
|
theme = themeSwitcher.currentTheme
|
||||||
)
|
)
|
||||||
binding.root.applyRootViewInsets()
|
binding.root.applyRootViewInsets()
|
||||||
binding.root.applyBottomInset()
|
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,11 +26,14 @@ import android.net.Uri
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
import androidx.preference.ListPreference
|
import androidx.preference.ListPreference
|
||||||
import androidx.preference.Preference
|
import androidx.preference.Preference
|
||||||
import androidx.preference.PreferenceCategory
|
import androidx.preference.PreferenceCategory
|
||||||
import androidx.preference.PreferenceFragmentCompat
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import org.isoron.uhabits.HabitsApplication
|
import org.isoron.uhabits.HabitsApplication
|
||||||
import org.isoron.uhabits.R
|
import org.isoron.uhabits.R
|
||||||
import org.isoron.uhabits.activities.habits.list.RESULT_BUG_REPORT
|
import org.isoron.uhabits.activities.habits.list.RESULT_BUG_REPORT
|
||||||
@@ -44,6 +47,7 @@ import org.isoron.uhabits.core.utils.DateUtils.Companion.getLongWeekdayNames
|
|||||||
import org.isoron.uhabits.notifications.AndroidNotificationTray.Companion.createAndroidNotificationChannel
|
import org.isoron.uhabits.notifications.AndroidNotificationTray.Companion.createAndroidNotificationChannel
|
||||||
import org.isoron.uhabits.notifications.RingtoneManager
|
import org.isoron.uhabits.notifications.RingtoneManager
|
||||||
import org.isoron.uhabits.utils.StyledResources
|
import org.isoron.uhabits.utils.StyledResources
|
||||||
|
import org.isoron.uhabits.utils.applyBottomInset
|
||||||
import org.isoron.uhabits.utils.startActivitySafely
|
import org.isoron.uhabits.utils.startActivitySafely
|
||||||
import org.isoron.uhabits.widgets.WidgetUpdater
|
import org.isoron.uhabits.widgets.WidgetUpdater
|
||||||
import java.util.Calendar
|
import java.util.Calendar
|
||||||
@@ -94,6 +98,15 @@ class SettingsFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeLis
|
|||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onCreateRecyclerView(
|
||||||
|
inflater: LayoutInflater?,
|
||||||
|
parent: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?,
|
||||||
|
): RecyclerView? {
|
||||||
|
return super.onCreateRecyclerView(inflater, parent, savedInstanceState)
|
||||||
|
.also { it.applyBottomInset() }
|
||||||
|
}
|
||||||
|
|
||||||
override fun onPreferenceTreeClick(preference: Preference): Boolean {
|
override fun onPreferenceTreeClick(preference: Preference): Boolean {
|
||||||
val key = preference.key ?: return false
|
val key = preference.key ?: return false
|
||||||
when (key) {
|
when (key) {
|
||||||
|
|||||||
@@ -160,7 +160,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="PreferenceThemeOverlay.v14.Material.PureBlack">
|
<style name="PreferenceThemeOverlay.v14.Material.PureBlack">
|
||||||
<item name="android:background">@color/black</item>
|
<item name="colorControlHighlight">@color/white_a0</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user