improving the way default widget bg color is set
This commit is contained in:
parent
baa725a3a3
commit
d72d8fd052
|
@ -61,7 +61,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.7.7'
|
implementation 'com.simplemobiletools:commons:5.7.9'
|
||||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
||||||
|
|
|
@ -575,6 +575,8 @@ class SettingsActivity : SimpleActivity() {
|
||||||
put(APP_ICON_COLOR, config.appIconColor)
|
put(APP_ICON_COLOR, config.appIconColor)
|
||||||
put(USE_ENGLISH, config.useEnglish)
|
put(USE_ENGLISH, config.useEnglish)
|
||||||
put(WAS_USE_ENGLISH_TOGGLED, config.wasUseEnglishToggled)
|
put(WAS_USE_ENGLISH_TOGGLED, config.wasUseEnglishToggled)
|
||||||
|
put(WIDGET_BG_COLOR, config.widgetBgColor)
|
||||||
|
put(WIDGET_TEXT_COLOR, config.widgetTextColor)
|
||||||
put(INCLUDED_FOLDERS, TextUtils.join(",", config.includedFolders))
|
put(INCLUDED_FOLDERS, TextUtils.join(",", config.includedFolders))
|
||||||
put(EXCLUDED_FOLDERS, TextUtils.join(",", config.excludedFolders))
|
put(EXCLUDED_FOLDERS, TextUtils.join(",", config.excludedFolders))
|
||||||
put(SHOW_HIDDEN_MEDIA, config.showHiddenMedia)
|
put(SHOW_HIDDEN_MEDIA, config.showHiddenMedia)
|
||||||
|
@ -625,8 +627,6 @@ class SettingsActivity : SimpleActivity() {
|
||||||
put(MEDIA_COLUMN_CNT, config.mediaColumnCnt)
|
put(MEDIA_COLUMN_CNT, config.mediaColumnCnt)
|
||||||
put(SHOW_ALL, config.showAll)
|
put(SHOW_ALL, config.showAll)
|
||||||
put(SHOW_WIDGET_FOLDER_NAME, config.showWidgetFolderName)
|
put(SHOW_WIDGET_FOLDER_NAME, config.showWidgetFolderName)
|
||||||
put(WIDGET_BG_COLOR, config.widgetBgColor)
|
|
||||||
put(WIDGET_TEXT_COLOR, config.widgetTextColor)
|
|
||||||
put(VIEW_TYPE_FILES, config.viewTypeFiles)
|
put(VIEW_TYPE_FILES, config.viewTypeFiles)
|
||||||
put(VIEW_TYPE_FOLDERS, config.viewTypeFolders)
|
put(VIEW_TYPE_FOLDERS, config.viewTypeFolders)
|
||||||
put(SLIDESHOW_INTERVAL, config.slideshowInterval)
|
put(SLIDESHOW_INTERVAL, config.slideshowInterval)
|
||||||
|
@ -695,6 +695,8 @@ class SettingsActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
USE_ENGLISH -> config.useEnglish = value.toBoolean()
|
USE_ENGLISH -> config.useEnglish = value.toBoolean()
|
||||||
WAS_USE_ENGLISH_TOGGLED -> config.wasUseEnglishToggled = value.toBoolean()
|
WAS_USE_ENGLISH_TOGGLED -> config.wasUseEnglishToggled = value.toBoolean()
|
||||||
|
WIDGET_BG_COLOR -> config.widgetBgColor = value.toInt()
|
||||||
|
WIDGET_TEXT_COLOR -> config.widgetTextColor = value.toInt()
|
||||||
INCLUDED_FOLDERS -> config.addIncludedFolders(value.toStringSet())
|
INCLUDED_FOLDERS -> config.addIncludedFolders(value.toStringSet())
|
||||||
EXCLUDED_FOLDERS -> config.addExcludedFolders(value.toStringSet())
|
EXCLUDED_FOLDERS -> config.addExcludedFolders(value.toStringSet())
|
||||||
SHOW_HIDDEN_MEDIA -> config.showHiddenMedia = value.toBoolean()
|
SHOW_HIDDEN_MEDIA -> config.showHiddenMedia = value.toBoolean()
|
||||||
|
@ -745,8 +747,6 @@ class SettingsActivity : SimpleActivity() {
|
||||||
MEDIA_COLUMN_CNT -> config.mediaColumnCnt = value.toInt()
|
MEDIA_COLUMN_CNT -> config.mediaColumnCnt = value.toInt()
|
||||||
SHOW_ALL -> config.showAll = value.toBoolean()
|
SHOW_ALL -> config.showAll = value.toBoolean()
|
||||||
SHOW_WIDGET_FOLDER_NAME -> config.showWidgetFolderName = value.toBoolean()
|
SHOW_WIDGET_FOLDER_NAME -> config.showWidgetFolderName = value.toBoolean()
|
||||||
WIDGET_BG_COLOR -> config.widgetBgColor = value.toInt()
|
|
||||||
WIDGET_TEXT_COLOR -> config.widgetTextColor = value.toInt()
|
|
||||||
VIEW_TYPE_FILES -> config.viewTypeFiles = value.toInt()
|
VIEW_TYPE_FILES -> config.viewTypeFiles = value.toInt()
|
||||||
VIEW_TYPE_FOLDERS -> config.viewTypeFolders = value.toInt()
|
VIEW_TYPE_FOLDERS -> config.viewTypeFolders = value.toInt()
|
||||||
SLIDESHOW_INTERVAL -> config.slideshowInterval = value.toInt()
|
SLIDESHOW_INTERVAL -> config.slideshowInterval = value.toInt()
|
||||||
|
|
|
@ -66,12 +66,7 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||||
|
|
||||||
private fun initVariables() {
|
private fun initVariables() {
|
||||||
mBgColor = config.widgetBgColor
|
mBgColor = config.widgetBgColor
|
||||||
if (mBgColor == 1) {
|
|
||||||
mBgColor = Color.BLACK
|
|
||||||
mBgAlpha = .2f
|
|
||||||
} else {
|
|
||||||
mBgAlpha = Color.alpha(mBgColor) / 255f
|
mBgAlpha = Color.alpha(mBgColor) / 255f
|
||||||
}
|
|
||||||
|
|
||||||
mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor))
|
mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor))
|
||||||
config_bg_seekbar.apply {
|
config_bg_seekbar.apply {
|
||||||
|
|
Loading…
Reference in New Issue