mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-22 12:15:00 +01:00
unify tab layout theming on surface
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
1d776ed6bd
commit
365a7502b4
@ -24,6 +24,7 @@ package com.nextcloud.talk.remotefilebrowser.activities
|
|||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.content.res.ColorStateList
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
@ -74,14 +75,18 @@ class RemoteFileBrowserActivity : AppCompatActivity(), SelectionInterface, Swipe
|
|||||||
|
|
||||||
binding = ActivityRemoteFileBrowserBinding.inflate(layoutInflater)
|
binding = ActivityRemoteFileBrowserBinding.inflate(layoutInflater)
|
||||||
setSupportActionBar(binding.remoteFileBrowserItemsToolbar)
|
setSupportActionBar(binding.remoteFileBrowserItemsToolbar)
|
||||||
|
viewThemeUtils.themeToolbar(binding.remoteFileBrowserItemsToolbar)
|
||||||
|
val scheme = viewThemeUtils.getScheme(binding.sortListButtonGroup.context)
|
||||||
|
binding.sortListButtonGroup.setBackgroundColor(scheme.surface)
|
||||||
|
binding.sortButton.iconTint = ColorStateList.valueOf(scheme.onSurface)
|
||||||
|
binding.sortButton.setTextColor(scheme.onSurface)
|
||||||
|
viewThemeUtils.colorMaterialTextButton(binding.sortButton)
|
||||||
|
binding.pathNavigationBackButton.iconTint = ColorStateList.valueOf(scheme.onSurface)
|
||||||
|
binding.pathNavigationBackButton.setTextColor(scheme.onSurface)
|
||||||
|
viewThemeUtils.colorMaterialTextButton(binding.pathNavigationBackButton)
|
||||||
|
viewThemeUtils.themeStatusBar(this, binding.remoteFileBrowserItemsToolbar)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
|
||||||
DisplayUtils.applyColorToStatusBar(
|
|
||||||
this,
|
|
||||||
ResourcesCompat.getColor(
|
|
||||||
resources, R.color.appbar, null
|
|
||||||
)
|
|
||||||
)
|
|
||||||
DisplayUtils.applyColorToNavigationBar(
|
DisplayUtils.applyColorToNavigationBar(
|
||||||
this.window,
|
this.window,
|
||||||
ResourcesCompat.getColor(resources, R.color.bg_default, null)
|
ResourcesCompat.getColor(resources, R.color.bg_default, null)
|
||||||
|
@ -74,6 +74,8 @@ class SharedItemsActivity : AppCompatActivity() {
|
|||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
|
||||||
viewThemeUtils.themeStatusBar(this, binding.sharedItemsToolbar)
|
viewThemeUtils.themeStatusBar(this, binding.sharedItemsToolbar)
|
||||||
|
viewThemeUtils.themeToolbar(binding.sharedItemsToolbar)
|
||||||
|
viewThemeUtils.themeTabLayoutOnSurface(binding.sharedItemsTabs)
|
||||||
|
|
||||||
DisplayUtils.applyColorToNavigationBar(
|
DisplayUtils.applyColorToNavigationBar(
|
||||||
this.window,
|
this.window,
|
||||||
|
@ -148,9 +148,7 @@ class ShowReactionsDialog(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
viewThemeUtils.colorTabLayout(binding.emojiReactionsTabs)
|
viewThemeUtils.themeTabLayoutOnSurface(binding.emojiReactionsTabs)
|
||||||
binding.emojiReactionsTabs.setBackgroundColor(
|
|
||||||
viewThemeUtils.getScheme(binding.emojiReactionsTabs .context).surface)
|
|
||||||
|
|
||||||
updateParticipantsForEmoji(chatMessage, tagAll)
|
updateParticipantsForEmoji(chatMessage, tagAll)
|
||||||
}
|
}
|
||||||
|
@ -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.setBackgroundColor(scheme.surface)
|
||||||
tabLayout.tabTextColors = ColorStateList(
|
colorTabLayout(tabLayout, scheme)
|
||||||
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 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(
|
||||||
|
Loading…
Reference in New Issue
Block a user