From 1d25512053a5bf0905dacc542456dc5d339af9ff Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 25 Apr 2022 22:44:58 +0200 Subject: [PATCH] adding some widget config related improvements --- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 3 ++- .../pro/activities/WidgetConfigureActivity.kt | 16 +++++++++------- .../main/res/layout/activity_widget_config.xml | 16 +++++++++++----- app/src/main/res/xml/widget_info.xml | 7 +++---- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index acc5d9f61..835787fcd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,7 +77,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:63a9866b86' + implementation 'com.github.SimpleMobileTools:Simple-Commons:c8c3073668' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e0a1e545d..41cd0fbae 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -301,7 +301,8 @@ + android:icon="@drawable/img_widget_preview" + android:label="@string/folder"> diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt index 70350e275..8512bc52a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt @@ -48,6 +48,13 @@ class WidgetConfigureActivity : SimpleActivity() { config_text_color.setOnClickListener { pickTextColor() } folder_picker_value.setOnClickListener { changeSelectedFolder() } config_image_holder.setOnClickListener { changeSelectedFolder() } + + updateTextColors(folder_picker_holder) + val primaryColor = getProperPrimaryColor() + config_bg_seekbar.setColors(mTextColor, primaryColor, primaryColor) + config_save.setTextColor(mTextColor) + folder_picker_holder.background = ColorDrawable(getProperBackgroundColor()) + folder_picker_show_folder_name.isChecked = config.showWidgetFolderName handleFolderNameDisplay() folder_picker_show_folder_name_holder.setOnClickListener { @@ -55,9 +62,6 @@ class WidgetConfigureActivity : SimpleActivity() { handleFolderNameDisplay() } - updateTextColors(folder_picker_holder) - folder_picker_holder.background = ColorDrawable(getProperBackgroundColor()) - getCachedDirectories(false, false) { mDirectories = it val path = it.firstOrNull()?.path @@ -122,15 +126,13 @@ class WidgetConfigureActivity : SimpleActivity() { private fun updateBackgroundColor() { mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha) - config_save.setBackgroundColor(mBgColor) config_image_holder.setBackgroundColor(mBgColor) - config_bg_color.setFillWithStroke(mBgColor, Color.BLACK) + config_bg_color.setFillWithStroke(mBgColor, mBgColor) } private fun updateTextColor() { - config_save.setTextColor(mTextColor) config_folder_name.setTextColor(mTextColor) - config_text_color.setFillWithStroke(mTextColor, Color.BLACK) + config_text_color.setFillWithStroke(mTextColor, mTextColor) } private fun pickBackgroundColor() { diff --git a/app/src/main/res/layout/activity_widget_config.xml b/app/src/main/res/layout/activity_widget_config.xml index 559bd14ff..d945f585e 100644 --- a/app/src/main/res/layout/activity_widget_config.xml +++ b/app/src/main/res/layout/activity_widget_config.xml @@ -84,7 +84,8 @@ android:id="@+id/config_bg_color" android:layout_width="@dimen/widget_colorpicker_size" android:layout_height="@dimen/widget_colorpicker_size" - android:layout_above="@+id/config_save" /> + android:layout_above="@+id/config_text_color" + android:layout_margin="@dimen/tiny_margin" /> + android:background="@drawable/widget_config_seekbar_background"> - + + android:layout_alignParentBottom="true" + android:layout_margin="@dimen/tiny_margin" />