mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 06:17:59 +01:00
adding some widget config screen tweaks
This commit is contained in:
parent
6466245606
commit
a6fb0c18fa
3 changed files with 13 additions and 32 deletions
|
@ -70,11 +70,6 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
|
||||||
super.onResume()
|
|
||||||
setupToolbar(config_toolbar)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun initVariables() {
|
private fun initVariables() {
|
||||||
mBgColor = config.widgetBgColor
|
mBgColor = config.widgetBgColor
|
||||||
mBgAlpha = Color.alpha(mBgColor) / 255f
|
mBgAlpha = Color.alpha(mBgColor) / 255f
|
||||||
|
@ -83,14 +78,18 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||||
config_bg_seekbar.apply {
|
config_bg_seekbar.apply {
|
||||||
progress = (mBgAlpha * 100).toInt()
|
progress = (mBgAlpha * 100).toInt()
|
||||||
|
|
||||||
onSeekBarChangeListener {
|
onSeekBarChangeListener { progress ->
|
||||||
mBgAlpha = it / 100f
|
mBgAlpha = progress / 100f
|
||||||
updateBackgroundColor()
|
updateBackgroundColor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateBackgroundColor()
|
updateBackgroundColor()
|
||||||
|
|
||||||
mTextColor = config.widgetTextColor
|
mTextColor = config.widgetTextColor
|
||||||
|
if (mTextColor == resources.getColor(R.color.default_widget_text_color) && config.isUsingSystemTheme) {
|
||||||
|
mTextColor = resources.getColor(R.color.you_primary_color, theme)
|
||||||
|
}
|
||||||
|
|
||||||
updateTextColor()
|
updateTextColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +127,12 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun updateTextColor() {
|
||||||
|
config_folder_name.setTextColor(mTextColor)
|
||||||
|
config_text_color.setFillWithStroke(mTextColor, mTextColor)
|
||||||
|
config_save.setTextColor(getProperPrimaryColor().getContrastColor())
|
||||||
|
}
|
||||||
|
|
||||||
private fun updateBackgroundColor() {
|
private fun updateBackgroundColor() {
|
||||||
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
|
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
|
||||||
config_image_holder.background.applyColorFilter(mBgColor)
|
config_image_holder.background.applyColorFilter(mBgColor)
|
||||||
|
@ -135,12 +140,6 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||||
config_save.backgroundTintList = ColorStateList.valueOf(getProperPrimaryColor())
|
config_save.backgroundTintList = ColorStateList.valueOf(getProperPrimaryColor())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateTextColor() {
|
|
||||||
config_folder_name.setTextColor(mTextColor)
|
|
||||||
config_text_color.setFillWithStroke(mTextColor, mTextColor)
|
|
||||||
config_save.setTextColor(getProperPrimaryColor().getContrastColor())
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun pickBackgroundColor() {
|
private fun pickBackgroundColor() {
|
||||||
ColorPickerDialog(this, mBgColorWithoutTransparency) { wasPositivePressed, color ->
|
ColorPickerDialog(this, mBgColorWithoutTransparency) { wasPositivePressed, color ->
|
||||||
if (wasPositivePressed) {
|
if (wasPositivePressed) {
|
||||||
|
|
|
@ -1,33 +1,16 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/config_coordinator"
|
android:id="@+id/config_coordinator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
|
||||||
android:id="@+id/config_app_bar_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
|
||||||
android:id="@+id/config_toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:background="@color/color_primary"
|
|
||||||
app:title="@string/app_launcher_name"
|
|
||||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/config_holder"
|
android:id="@+id/config_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_margin="@dimen/activity_margin"
|
android:layout_margin="@dimen/activity_margin">
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/folder_picker_holder"
|
android:id="@+id/folder_picker_holder"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="actionbar_menu_icon">#454545</color>
|
|
||||||
<color name="crop_image_view_background">#BB000000</color>
|
<color name="crop_image_view_background">#BB000000</color>
|
||||||
<color name="circle_black_background">#66000000</color>
|
<color name="circle_black_background">#66000000</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue