mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 03:29:28 +01:00
Extract another theming method to common library
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
712e9b9eab
commit
7e3eb05b94
@ -333,7 +333,7 @@ dependencies {
|
|||||||
// implementation 'androidx.activity:activity-ktx:1.4.0'
|
// implementation 'androidx.activity:activity-ktx:1.4.0'
|
||||||
|
|
||||||
// TODO substitute for tag after first common release
|
// TODO substitute for tag after first common release
|
||||||
implementation 'com.github.nextcloud.android-common:ui:83c4a8aa885e8ef1bba2e44704be8625db396e1b'
|
implementation 'com.github.nextcloud.android-common:ui:82f6da3e9638e7578a8df8f6e52884e2923b2760'
|
||||||
}
|
}
|
||||||
|
|
||||||
task installGitHooks(type: Copy, group: "development") {
|
task installGitHooks(type: Copy, group: "development") {
|
||||||
|
@ -43,7 +43,6 @@ import androidx.core.graphics.drawable.DrawableCompat
|
|||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.core.view.children
|
import androidx.core.view.children
|
||||||
import com.google.android.material.card.MaterialCardView
|
import com.google.android.material.card.MaterialCardView
|
||||||
import com.google.android.material.chip.ChipDrawable
|
|
||||||
import com.nextcloud.android.common.ui.theme.MaterialSchemes
|
import com.nextcloud.android.common.ui.theme.MaterialSchemes
|
||||||
import com.nextcloud.android.common.ui.theme.ViewThemeUtilsBase
|
import com.nextcloud.android.common.ui.theme.ViewThemeUtilsBase
|
||||||
import com.nextcloud.android.common.ui.theme.utils.AndroidXViewThemeUtils
|
import com.nextcloud.android.common.ui.theme.utils.AndroidXViewThemeUtils
|
||||||
@ -59,7 +58,6 @@ import kotlin.math.roundToInt
|
|||||||
/**
|
/**
|
||||||
* View theme utils specific for the Talk app.
|
* View theme utils specific for the Talk app.
|
||||||
*
|
*
|
||||||
* TODO some of these can be renamed and made generic
|
|
||||||
*/
|
*/
|
||||||
@Suppress("TooManyFunctions")
|
@Suppress("TooManyFunctions")
|
||||||
class TalkSpecificViewThemeUtils @Inject constructor(
|
class TalkSpecificViewThemeUtils @Inject constructor(
|
||||||
@ -216,13 +214,6 @@ class TalkSpecificViewThemeUtils @Inject constructor(
|
|||||||
return drawable
|
return drawable
|
||||||
}
|
}
|
||||||
|
|
||||||
fun themePrimaryMentionChip(context: Context, chip: ChipDrawable) {
|
|
||||||
withScheme(context) { scheme ->
|
|
||||||
chip.chipBackgroundColor = ColorStateList.valueOf(scheme.primary)
|
|
||||||
chip.setTextColor(scheme.onPrimary)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun themeSearchView(searchView: SearchView) {
|
fun themeSearchView(searchView: SearchView) {
|
||||||
withScheme(searchView) { scheme ->
|
withScheme(searchView) { scheme ->
|
||||||
// hacky as no default way is provided
|
// hacky as no default way is provided
|
||||||
|
@ -304,7 +304,7 @@ public class DisplayUtils {
|
|||||||
chip.setEllipsize(TextUtils.TruncateAt.MIDDLE);
|
chip.setEllipsize(TextUtils.TruncateAt.MIDDLE);
|
||||||
|
|
||||||
if (chipResource == R.xml.chip_you) {
|
if (chipResource == R.xml.chip_you) {
|
||||||
viewThemeUtils.talk.themePrimaryMentionChip(context, chip);
|
viewThemeUtils.material.colorChipDrawable(context, chip);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
@ -20,3 +20,9 @@
|
|||||||
|
|
||||||
include ':app'
|
include ':app'
|
||||||
|
|
||||||
|
//// uncomment to use local build of common-ui
|
||||||
|
//includeBuild('../android-common') {
|
||||||
|
// dependencySubstitution {
|
||||||
|
// substitute module('com.github.nextcloud.android-common:ui') using project(':ui')
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
Loading…
Reference in New Issue
Block a user