Fixed odd accent color for profile image
This commit is contained in:
parent
1d7203cbec
commit
9d6d7de1c7
5 changed files with 10 additions and 11 deletions
|
@ -187,7 +187,7 @@ class HomeFragment :
|
|||
}
|
||||
GlideApp.with(requireActivity())
|
||||
.load(RetroGlideExtension.getUserModel())
|
||||
.userProfileOptions(RetroGlideExtension.getUserModel())
|
||||
.userProfileOptions(RetroGlideExtension.getUserModel(), requireContext())
|
||||
.into(binding.userImage)
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ class UserInfoFragment : Fragment() {
|
|||
}
|
||||
GlideApp.with(this)
|
||||
.load(RetroGlideExtension.getUserModel())
|
||||
.userProfileOptions(RetroGlideExtension.getUserModel())
|
||||
.userProfileOptions(RetroGlideExtension.getUserModel(), requireContext())
|
||||
.into(binding.userImage)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package code.name.monkey.retromusic.glide
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import code.name.monkey.appthemehelper.ThemeStore.Companion.accentColor
|
||||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
|
@ -150,10 +151,11 @@ object RetroGlideExtension {
|
|||
@GlideOption
|
||||
fun userProfileOptions(
|
||||
baseRequestOptions: BaseRequestOptions<*>,
|
||||
file: File
|
||||
file: File,
|
||||
context: Context
|
||||
): BaseRequestOptions<*> {
|
||||
return baseRequestOptions.diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY)
|
||||
.error(getErrorUserProfile())
|
||||
.error(getErrorUserProfile(context))
|
||||
.signature(createSignature(file))
|
||||
}
|
||||
|
||||
|
@ -201,11 +203,11 @@ object RetroGlideExtension {
|
|||
return File(dir, USER_BANNER)
|
||||
}
|
||||
|
||||
private fun getErrorUserProfile(): Drawable {
|
||||
private fun getErrorUserProfile(context: Context): Drawable {
|
||||
return TintHelper.createTintedDrawable(
|
||||
getContext(),
|
||||
R.drawable.ic_account,
|
||||
accentColor(getContext())
|
||||
accentColor(context)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -43,9 +43,7 @@ class WallpaperAccentManager(val context: Context) {
|
|||
.getWallpaperColors(WallpaperManager.FLAG_SYSTEM)
|
||||
if (colors != null) {
|
||||
val primaryColor = colors.primaryColor.toArgb()
|
||||
if (primaryColor != ThemeStore.wallpaperColor(context)) {
|
||||
ThemeStore.editTheme(context).wallpaperColor(primaryColor).commit()
|
||||
}
|
||||
ThemeStore.editTheme(context).wallpaperColor(context, primaryColor).commit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,8 +48,7 @@
|
|||
android:key="wallpaper_accent"
|
||||
android:layout="@layout/list_item_view_switch"
|
||||
android:summary="@string/pref_summary_wallpaper_accent"
|
||||
android:title="@string/pref_title_wallpaper_accent"
|
||||
app:isPreferenceVisible="@bool/wallpaper_accent_visible" />
|
||||
android:title="@string/pref_title_wallpaper_accent" />
|
||||
|
||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEColorPreference
|
||||
android:dependency="material_you"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue