|
@@ -585,27 +585,32 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- fun colorTabLayout(tabLayout: TabLayout) {
|
|
|
|
|
|
+ fun themeTabLayoutOnSurface(tabLayout: TabLayout) {
|
|
withScheme(tabLayout) { scheme ->
|
|
withScheme(tabLayout) { scheme ->
|
|
- tabLayout.setSelectedTabIndicatorColor(scheme.primary)
|
|
|
|
- tabLayout.tabTextColors = ColorStateList(
|
|
|
|
- arrayOf(
|
|
|
|
- intArrayOf(android.R.attr.state_selected),
|
|
|
|
- intArrayOf(-android.R.attr.state_selected)
|
|
|
|
- ),
|
|
|
|
- intArrayOf(scheme.primary, ContextCompat.getColor(tabLayout.context, R.color.high_emphasis_text))
|
|
|
|
- )
|
|
|
|
- tabLayout.tabRippleColor = ColorStateList(
|
|
|
|
- arrayOf(
|
|
|
|
- intArrayOf(android.R.attr.state_pressed)
|
|
|
|
- ),
|
|
|
|
- intArrayOf(
|
|
|
|
- calculateDisabledColor(scheme.primary, SURFACE_OPACITY_BUTTON_DISABLED)
|
|
|
|
- )
|
|
|
|
- )
|
|
|
|
|
|
+ tabLayout.setBackgroundColor(scheme.surface)
|
|
|
|
+ colorTabLayout(tabLayout, scheme)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ fun colorTabLayout(tabLayout: TabLayout, scheme: Scheme) {
|
|
|
|
+ tabLayout.setSelectedTabIndicatorColor(scheme.primary)
|
|
|
|
+ tabLayout.tabTextColors = ColorStateList(
|
|
|
|
+ arrayOf(
|
|
|
|
+ intArrayOf(android.R.attr.state_selected),
|
|
|
|
+ intArrayOf(-android.R.attr.state_selected)
|
|
|
|
+ ),
|
|
|
|
+ intArrayOf(scheme.primary, ContextCompat.getColor(tabLayout.context, R.color.high_emphasis_text))
|
|
|
|
+ )
|
|
|
|
+ tabLayout.tabRippleColor = ColorStateList(
|
|
|
|
+ arrayOf(
|
|
|
|
+ intArrayOf(android.R.attr.state_pressed)
|
|
|
|
+ ),
|
|
|
|
+ intArrayOf(
|
|
|
|
+ calculateDisabledColor(scheme.primary, SURFACE_OPACITY_BUTTON_DISABLED)
|
|
|
|
+ )
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+
|
|
fun getPlaceholderImage(context: Context, mimetype: String?): Drawable? {
|
|
fun getPlaceholderImage(context: Context, mimetype: String?): Drawable? {
|
|
val drawableResourceId = DrawableUtils.getDrawableResourceIdForMimeType(mimetype)
|
|
val drawableResourceId = DrawableUtils.getDrawableResourceIdForMimeType(mimetype)
|
|
val drawable = AppCompatResources.getDrawable(
|
|
val drawable = AppCompatResources.getDrawable(
|