mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-22 20:25:01 +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,8 +585,14 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun colorTabLayout(tabLayout: TabLayout) {
|
fun themeTabLayoutOnSurface(tabLayout: TabLayout) {
|
||||||
withScheme(tabLayout) { scheme ->
|
withScheme(tabLayout) { scheme ->
|
||||||
|
tabLayout.setBackgroundColor(scheme.surface)
|
||||||
|
colorTabLayout(tabLayout, scheme)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun colorTabLayout(tabLayout: TabLayout, scheme: Scheme) {
|
||||||
tabLayout.setSelectedTabIndicatorColor(scheme.primary)
|
tabLayout.setSelectedTabIndicatorColor(scheme.primary)
|
||||||
tabLayout.tabTextColors = ColorStateList(
|
tabLayout.tabTextColors = ColorStateList(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
@ -604,7 +610,6 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fun getPlaceholderImage(context: Context, mimetype: String?): Drawable? {
|
fun getPlaceholderImage(context: Context, mimetype: String?): Drawable? {
|
||||||
val drawableResourceId = DrawableUtils.getDrawableResourceIdForMimeType(mimetype)
|
val drawableResourceId = DrawableUtils.getDrawableResourceIdForMimeType(mimetype)
|
||||||
|
Loading…
Reference in New Issue
Block a user