diff --git a/library/ui-styles/src/main/res/values/attrs_sc.xml b/library/ui-styles/src/main/res/values/attrs_sc.xml
index 7644c2d821..4a926de4c0 100644
--- a/library/ui-styles/src/main/res/values/attrs_sc.xml
+++ b/library/ui-styles/src/main/res/values/attrs_sc.xml
@@ -17,6 +17,10 @@
+
+
+
+
diff --git a/library/ui-styles/src/main/res/values/colors_sc.xml b/library/ui-styles/src/main/res/values/colors_sc.xml
index aafbe7f487..22e2e92ced 100644
--- a/library/ui-styles/src/main/res/values/colors_sc.xml
+++ b/library/ui-styles/src/main/res/values/colors_sc.xml
@@ -60,8 +60,16 @@
@color/accent_sc_50
@color/accent_sc_900
+
+ #F44336
+ #2196F3
+ @color/accent_sc
+
#76cfa6
+ @color/palette_polly
+ @color/palette_azure
+ @color/palette_element_green
diff --git a/library/ui-styles/src/main/res/values/theme_dark.xml b/library/ui-styles/src/main/res/values/theme_dark.xml
index e014c74f6d..6c0fdef569 100644
--- a/library/ui-styles/src/main/res/values/theme_dark.xml
+++ b/library/ui-styles/src/main/res/values/theme_dark.xml
@@ -125,6 +125,9 @@
- @color/element_accent_pale
- @style/Widget.Vector.TextInputLayout.Dense.ExposedDropdownMenu.Dark.SC
- ?vctr_header_background
+ - @color/user_color_element_pl_0
+ - @color/user_color_element_pl_50
+ - @color/user_color_element_pl_100
- @color/android_status_bar_background_dark
- @color/android_navigation_bar_background_dark
diff --git a/library/ui-styles/src/main/res/values/theme_light.xml b/library/ui-styles/src/main/res/values/theme_light.xml
index baa04c49d1..bacc833fc1 100644
--- a/library/ui-styles/src/main/res/values/theme_light.xml
+++ b/library/ui-styles/src/main/res/values/theme_light.xml
@@ -125,6 +125,9 @@
- @color/element_accent_pale
- @style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu
- ?vctr_header_background
+ - @color/user_color_element_pl_0
+ - @color/user_color_element_pl_50
+ - @color/user_color_element_pl_100
- @color/android_status_bar_background_dark
diff --git a/library/ui-styles/src/main/res/values/theme_sc.xml b/library/ui-styles/src/main/res/values/theme_sc.xml
index 60751a1806..ea3a9f2c57 100644
--- a/library/ui-styles/src/main/res/values/theme_sc.xml
+++ b/library/ui-styles/src/main/res/values/theme_sc.xml
@@ -87,6 +87,9 @@
- @color/background_floating_sc
- @color/accent_sc_pale
- @color/accent_sc_alpha25
+ - @color/user_color_sc_pl_0
+ - @color/user_color_sc_pl_50
+ - @color/user_color_sc_pl_100
- @color/background_black_sc
- @color/background_black_sc
diff --git a/library/ui-styles/src/main/res/values/theme_sc_light.xml b/library/ui-styles/src/main/res/values/theme_sc_light.xml
index 3b37f0f941..a4480ece98 100644
--- a/library/ui-styles/src/main/res/values/theme_sc_light.xml
+++ b/library/ui-styles/src/main/res/values/theme_sc_light.xml
@@ -87,6 +87,9 @@
- #737373
- @color/accent_sc_pale
- #ffe0e0e0
+ - @color/user_color_sc_pl_0
+ - @color/user_color_sc_pl_50
+ - @color/user_color_sc_pl_100
- @color/background_black_sc
- @color/background_black_sc
diff --git a/vector/src/main/java/im/vector/app/core/di/VectorComponent.kt b/vector/src/main/java/im/vector/app/core/di/VectorComponent.kt
index e5a47e872c..6d45cb4e96 100644
--- a/vector/src/main/java/im/vector/app/core/di/VectorComponent.kt
+++ b/vector/src/main/java/im/vector/app/core/di/VectorComponent.kt
@@ -39,6 +39,7 @@ import im.vector.app.features.home.AvatarRenderer
import im.vector.app.features.home.CurrentSpaceSuggestedRoomListDataSource
import im.vector.app.features.home.room.detail.RoomDetailPendingActionStore
import im.vector.app.features.home.room.detail.timeline.helper.MatrixItemColorProvider
+import im.vector.app.features.home.room.detail.timeline.helper.PowerLevelsHolder
import im.vector.app.features.home.room.detail.timeline.helper.RoomSummariesHolder
import im.vector.app.features.html.EventHtmlRenderer
import im.vector.app.features.html.VectorHtmlCompressor
@@ -164,6 +165,8 @@ interface VectorComponent {
fun roomSummaryHolder(): RoomSummariesHolder
+ fun powerLevelsHolder(): PowerLevelsHolder
+
@Component.Factory
interface Factory {
fun create(@BindsInstance context: Context): VectorComponent
diff --git a/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt b/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt
index 787027e0e2..968cf57d56 100644
--- a/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt
+++ b/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt
@@ -218,8 +218,8 @@ class AvatarRenderer @Inject constructor(private val activeSessionHolder: Active
}
@AnyThread
- fun getPlaceholderDrawable(matrixItem: MatrixItem): Drawable {
- val avatarColor = matrixItemColorProvider.getColor(matrixItem)
+ fun getPlaceholderDrawable(matrixItem: MatrixItem, userInRoomInformation: MatrixItemColorProvider.UserInRoomInformation? = null): Drawable {
+ val avatarColor = matrixItemColorProvider.getColor(matrixItem, userInRoomInformation)
return TextDrawable.builder()
.beginConfig()
.bold()
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt
index 2587a6582f..8d7c6970c7 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt
@@ -48,6 +48,7 @@ import im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrate
import im.vector.app.features.crypto.verification.SupportedVerificationMethodsProvider
import im.vector.app.features.home.room.detail.composer.rainbow.RainbowGenerator
import im.vector.app.features.home.room.detail.sticker.StickerPickerActionHandler
+import im.vector.app.features.home.room.detail.timeline.helper.PowerLevelsHolder
import im.vector.app.features.home.room.detail.timeline.helper.RoomSummariesHolder
import im.vector.app.features.home.room.detail.timeline.helper.TimelineSettingsFactory
import im.vector.app.features.home.room.detail.timeline.url.PreviewUrlRetriever
@@ -114,6 +115,7 @@ class RoomDetailViewModel @AssistedInject constructor(
private val supportedVerificationMethodsProvider: SupportedVerificationMethodsProvider,
private val stickerPickerActionHandler: StickerPickerActionHandler,
private val roomSummariesHolder: RoomSummariesHolder,
+ private val powerLevelsHolder: PowerLevelsHolder,
private val typingHelper: TypingHelper,
private val callManager: WebRtcCallManager,
private val chatEffectManager: ChatEffectManager,
@@ -163,6 +165,7 @@ class RoomDetailViewModel @AssistedInject constructor(
}
init {
+ powerLevelsHolder.clear(room.roomId)
timeline.start()
timeline.addListener(this)
observeRoomSummary()
@@ -213,10 +216,12 @@ class RoomDetailViewModel @AssistedInject constructor(
private fun observePowerLevel() {
PowerLevelsObservableFactory(room).createObservable()
.subscribe {
- val canSendMessage = PowerLevelsHelper(it).isUserAllowedToSend(session.myUserId, false, EventType.MESSAGE)
- val canInvite = PowerLevelsHelper(it).isUserAbleToInvite(session.myUserId)
+ val powerLevelsHelper = PowerLevelsHelper(it)
+ powerLevelsHolder.set(room.roomId, powerLevelsHelper)
+ val canSendMessage = powerLevelsHelper.isUserAllowedToSend(session.myUserId, false, EventType.MESSAGE)
+ val canInvite = powerLevelsHelper.isUserAbleToInvite(session.myUserId)
val isAllowedToManageWidgets = session.widgetService().hasPermissionsToHandleWidgets(room.roomId)
- val isAllowedToStartWebRTCCall = PowerLevelsHelper(it).isUserAllowedToSend(session.myUserId, false, EventType.CALL_INVITE)
+ val isAllowedToStartWebRTCCall = powerLevelsHelper.isUserAllowedToSend(session.myUserId, false, EventType.CALL_INVITE)
setState {
copy(
canSendMessage = canSendMessage,
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/MessageColorProvider.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/MessageColorProvider.kt
index 2b39eb1e26..40a42edef3 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/MessageColorProvider.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/MessageColorProvider.kt
@@ -31,8 +31,8 @@ class MessageColorProvider @Inject constructor(
private val vectorPreferences: VectorPreferences) {
@ColorInt
- fun getMemberNameTextColor(matrixItem: MatrixItem): Int {
- return matrixItemColorProvider.getColor(matrixItem)
+ fun getMemberNameTextColor(matrixItem: MatrixItem, userInRoomInformation: MatrixItemColorProvider.UserInRoomInformation? = null): Int {
+ return matrixItemColorProvider.getColor(matrixItem, userInRoomInformation)
}
@ColorInt
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MatrixItemColorProvider.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MatrixItemColorProvider.kt
index 58d8c96ce2..edfd4da56a 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MatrixItemColorProvider.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MatrixItemColorProvider.kt
@@ -21,6 +21,7 @@ import androidx.annotation.ColorRes
import androidx.annotation.VisibleForTesting
import im.vector.app.R
import im.vector.app.core.resources.ColorProvider
+import im.vector.app.features.settings.VectorPreferences
import im.vector.app.features.themes.ThemeUtils
import org.matrix.android.sdk.api.util.MatrixItem
import javax.inject.Inject
@@ -29,27 +30,38 @@ import kotlin.math.abs
@Singleton
class MatrixItemColorProvider @Inject constructor(
+ private val vectorPreferences: VectorPreferences,
private val colorProvider: ColorProvider
) {
private val cache = mutableMapOf()
@ColorInt
- fun getColor(matrixItem: MatrixItem): Int {
- if (ThemeUtils.isScTheme(colorProvider.context)) {
- return colorProvider.getColor(
- when (matrixItem) {
- is MatrixItem.UserItem -> R.color.username_sc_1
- else -> R.color.avatar_fill_sc_1
+ @Suppress("UNUSED_PARAMETER")
+ fun getColor(matrixItem: MatrixItem, userInRoomInformation: UserInRoomInformation? = null): Int {
+ val coloringMode = vectorPreferences.userColorMode(userInRoomInformation?.isDm ?: false, userInRoomInformation?.isPublicRoom ?: false)
+ return when (coloringMode) {
+ USER_COLORING_FROM_PL -> {
+ if (userInRoomInformation?.userPowerLevel == null || userInRoomInformation.userPowerLevel < 30) {
+ colorProvider.getColorFromAttribute(R.attr.user_color_pl_0)
+ } else if (userInRoomInformation.userPowerLevel < 80) {
+ colorProvider.getColorFromAttribute(R.attr.user_color_pl_50)
+ } else {
+ colorProvider.getColorFromAttribute(R.attr.user_color_pl_100)
}
- )
- }
- return cache.getOrPut(matrixItem.id) {
- colorProvider.getColor(
- when (matrixItem) {
- is MatrixItem.UserItem -> getColorFromUserId(matrixItem.id)
- else -> getColorFromRoomId(matrixItem.id)
- }
- )
+ }
+ USER_COLORING_FROM_ID -> {
+ return cache.getOrPut(matrixItem.id) {
+ colorProvider.getColor(
+ when (matrixItem) {
+ is MatrixItem.UserItem -> getColorFromUserId(matrixItem.id)
+ else -> getColorFromRoomId(matrixItem.id)
+ }
+ )
+ }
+ }
+ else -> {
+ colorProvider.getColorFromAttribute(android.R.attr.colorAccent)
+ }
}
}
@@ -81,5 +93,13 @@ class MatrixItemColorProvider @Inject constructor(
else -> R.color.element_room_01
}
}
+
+ // Same values as in R.array.user_color_mode_values
+ private const val USER_COLORING_UNIFORM = "uniform"
+ private const val USER_COLORING_FROM_ID = "from-id"
+ private const val USER_COLORING_FROM_PL = "from-pl"
+ const val USER_COLORING_DEFAULT = USER_COLORING_UNIFORM
}
+
+ data class UserInRoomInformation(val isDm: Boolean? = null, val isPublicRoom: Boolean? = null, val userPowerLevel: Int? = null)
}
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt
index 2dfcb8d7d8..bfc22ab1ad 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt
@@ -55,6 +55,7 @@ import javax.inject.Inject
*/
class MessageInformationDataFactory @Inject constructor(private val session: Session,
private val roomSummariesHolder: RoomSummariesHolder,
+ private val powerLevelsHolder: PowerLevelsHolder,
private val dateFormatter: VectorDateFormatter,
private val vectorPreferences: VectorPreferences,
private val context: Context) {
@@ -123,6 +124,13 @@ class MessageInformationDataFactory @Inject constructor(private val session: Ses
SendStateDecoration.NONE
}
+ // Sender power level
+ /*
+ val powerLevelsHelper = session.getRoom(event.roomId)?.getStateEvent(EventType.STATE_ROOM_POWER_LEVELS, QueryStringValue.NoCondition)?.content.toModel()?.let { PowerLevelsHelper(it) }
+ val senderPowerLevel = powerLevelsHelper?.getUserPowerLevelValue(event.senderInfo.userId)
+ */
+ val senderPowerLevel = powerLevelsHolder.get(event.roomId)?.getUserPowerLevelValue(event.senderInfo.userId)
+
return MessageInformationData(
eventId = eventId,
senderId = event.root.senderId ?: "",
@@ -165,7 +173,9 @@ class MessageInformationDataFactory @Inject constructor(private val session: Ses
} else {
AnonymousReadReceipt.PROCESSING
},
+ senderPowerLevel = senderPowerLevel,
isDirect = isEffectivelyDirect,
+ isPublic = roomSummary?.isPublic ?: false,
dmChatPartnerId = dmOtherMemberId,
e2eDecoration = e2eDecoration,
sendStateDecoration = sendStateDecoration
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/PowerLevelsHolder.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/PowerLevelsHolder.kt
new file mode 100644
index 0000000000..eb259a2538
--- /dev/null
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/PowerLevelsHolder.kt
@@ -0,0 +1,29 @@
+package im.vector.app.features.home.room.detail.timeline.helper
+
+import org.matrix.android.sdk.api.session.room.powerlevels.PowerLevelsHelper
+import javax.inject.Inject
+import javax.inject.Singleton
+
+/*
+ You can use this to share user power level helpers within the app.
+ You should probably use this only in the context of the timeline.
+ */
+@Singleton
+class PowerLevelsHolder @Inject constructor() {
+
+ private var roomHelpers = HashMap()
+
+ fun set(roomId: String, powerLevelsHelper: PowerLevelsHelper) {
+ roomHelpers[roomId] = powerLevelsHelper
+ }
+
+ fun get(roomId: String) = roomHelpers[roomId]
+
+ fun clear() {
+ roomHelpers.clear()
+ }
+
+ fun clear(roomId: String) {
+ roomHelpers.remove(roomId)
+ }
+}
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageItem.kt
index 1d6be83442..8c4e9632da 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageItem.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/AbsMessageItem.kt
@@ -42,6 +42,7 @@ import im.vector.app.core.ui.views.SendStateImageView
import im.vector.app.features.home.AvatarRenderer
import im.vector.app.features.home.room.detail.timeline.MessageColorProvider
import im.vector.app.features.home.room.detail.timeline.TimelineEventController
+import im.vector.app.features.home.room.detail.timeline.helper.MatrixItemColorProvider
import im.vector.app.features.themes.BubbleThemeUtils
import im.vector.app.features.themes.ThemeUtils
import kotlin.math.ceil
@@ -223,7 +224,14 @@ abstract class AbsMessageItem : AbsBaseMessageItem
super.unbind(holder)
}
- private fun Attributes.getMemberNameColor() = messageColorProvider.getMemberNameTextColor(informationData.matrixItem)
+ private fun Attributes.getMemberNameColor() = messageColorProvider.getMemberNameTextColor(
+ informationData.matrixItem,
+ MatrixItemColorProvider.UserInRoomInformation(
+ attributes.informationData.isDirect,
+ attributes.informationData.isPublic,
+ attributes.informationData.senderPowerLevel
+ )
+ )
abstract class Holder(@IdRes stubId: Int) : AbsBaseMessageItem.Holder(stubId) {
val avatarImageView by bind(R.id.messageAvatarImageView)
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageInformationData.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageInformationData.kt
index 525672fd34..a97cc01519 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageInformationData.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageInformationData.kt
@@ -42,6 +42,8 @@ data class MessageInformationData(
val sentByMe : Boolean,
val readReceiptAnonymous: AnonymousReadReceipt,
val isDirect: Boolean,
+ val isPublic: Boolean,
+ val senderPowerLevel: Int?,
val dmChatPartnerId: String?,
val e2eDecoration: E2EDecoration = E2EDecoration.NONE,
val sendStateDecoration: SendStateDecoration = SendStateDecoration.NONE
diff --git a/vector/src/main/java/im/vector/app/features/html/PillImageSpan.kt b/vector/src/main/java/im/vector/app/features/html/PillImageSpan.kt
index 76947e8d3d..07e8748ad0 100644
--- a/vector/src/main/java/im/vector/app/features/html/PillImageSpan.kt
+++ b/vector/src/main/java/im/vector/app/features/html/PillImageSpan.kt
@@ -31,6 +31,7 @@ import com.google.android.material.chip.ChipDrawable
import im.vector.app.R
import im.vector.app.core.glide.GlideRequests
import im.vector.app.features.home.AvatarRenderer
+import im.vector.app.features.home.room.detail.timeline.helper.MatrixItemColorProvider
import org.matrix.android.sdk.api.session.room.send.MatrixItemSpan
import org.matrix.android.sdk.api.util.MatrixItem
import java.lang.ref.WeakReference
@@ -43,7 +44,8 @@ import java.lang.ref.WeakReference
class PillImageSpan(private val glideRequests: GlideRequests,
private val avatarRenderer: AvatarRenderer,
private val context: Context,
- override val matrixItem: MatrixItem
+ override val matrixItem: MatrixItem,
+ val userInRoomInformation: MatrixItemColorProvider.UserInRoomInformation? = null
) : ReplacementSpan(), MatrixItemSpan {
private val pillDrawable = createChipDrawable()
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt
index 5d195db686..f6c9244a6e 100755
--- a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt
@@ -25,6 +25,7 @@ import im.vector.app.BuildConfig
import im.vector.app.R
import im.vector.app.core.di.DefaultSharedPreferences
import im.vector.app.features.disclaimer.SHARED_PREF_KEY
+import im.vector.app.features.home.room.detail.timeline.helper.MatrixItemColorProvider
import im.vector.app.features.homeserver.ServerUrlsRepository
import im.vector.app.features.themes.ThemeUtils
import org.matrix.android.sdk.api.extensions.tryOrNull
@@ -196,6 +197,9 @@ class VectorPreferences @Inject constructor(private val context: Context) {
private const val SETTINGS_SIMPLIFIED_MODE = "SETTINGS_SIMPLIFIED_MODE"
private const val SETTINGS_LABS_ALLOW_MARK_UNREAD = "SETTINGS_LABS_ALLOW_MARK_UNREAD"
const val SETTINGS_ALLOW_URL_PREVIEW_IN_ENCRYPTED_ROOM_KEY = "SETTINGS_ALLOW_URL_PREVIEW_IN_ENCRYPTED_ROOM_KEY"
+ private const val SETTINGS_USER_COLOR_MODE_DM = "SETTINGS_USER_COLOR_MODE_DM"
+ private const val SETTINGS_USER_COLOR_MODE_DEFAULT = "SETTINGS_USER_COLOR_MODE_DEFAULT"
+ private const val SETTINGS_USER_COLOR_MODE_PUBLIC_ROOM = "SETTINGS_USER_COLOR_MODE_PUBLIC_ROOM"
private const val DID_ASK_TO_ENABLE_SESSION_PUSH = "DID_ASK_TO_ENABLE_SESSION_PUSH"
@@ -968,6 +972,15 @@ class VectorPreferences @Inject constructor(private val context: Context) {
}
}
+ // SC addition
+ fun userColorMode(isDirect: Boolean, isPublic: Boolean): String {
+ return defaultPrefs.getString(when {
+ isPublic -> SETTINGS_USER_COLOR_MODE_PUBLIC_ROOM
+ isDirect -> SETTINGS_USER_COLOR_MODE_DM
+ else -> SETTINGS_USER_COLOR_MODE_DEFAULT
+ }, MatrixItemColorProvider.USER_COLORING_DEFAULT) ?: MatrixItemColorProvider.USER_COLORING_DEFAULT
+ }
+
/**
* The user enable protecting app access with pin code.
* Currently we use the pin code store to know if the pin is enabled, so this is not used
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedThemeFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedThemeFragment.kt
new file mode 100644
index 0000000000..2d15be4253
--- /dev/null
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedThemeFragment.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2019 New Vector Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package im.vector.app.features.settings
+
+import im.vector.app.R
+import javax.inject.Inject
+
+class VectorSettingsAdvancedThemeFragment @Inject constructor(
+ //private val vectorPreferences: VectorPreferences
+) : VectorSettingsBaseFragment() {
+
+ override var titleRes = R.string.settings_advanced_theme_settings
+ override val preferenceXmlRes = R.xml.vector_settings_advanced_theme_settings
+
+ override fun bindPref() {
+ }
+}
diff --git a/vector/src/main/java/im/vector/app/features/themes/ThemeUtils.kt b/vector/src/main/java/im/vector/app/features/themes/ThemeUtils.kt
index 7238efef8c..247a34bd76 100644
--- a/vector/src/main/java/im/vector/app/features/themes/ThemeUtils.kt
+++ b/vector/src/main/java/im/vector/app/features/themes/ThemeUtils.kt
@@ -206,26 +206,6 @@ object ThemeUtils {
}
}
- /**
- * Whether this is SC theme.
- *
- * @param context the context
- * @return true if SC theme is active, false otherwise
- */
- fun isScTheme(context: Context?): Boolean {
- if (context != null) {
- mIsScTheme = when (getApplicationTheme(context)) {
- THEME_SC_LIGHT_VALUE,
- THEME_SC_VALUE,
- THEME_SC_DARK_VALUE,
- THEME_SC_COLORED_VALUE,
- THEME_SC_DARK_COLORED_VALUE -> true
- else -> false
- }
- }
- return mIsScTheme;
- }
-
/**
* @return true if system theme is dark
*/
diff --git a/vector/src/main/res/values/arrays_sc.xml b/vector/src/main/res/values/arrays_sc.xml
index 2db442f582..2a42632b51 100644
--- a/vector/src/main/res/values/arrays_sc.xml
+++ b/vector/src/main/res/values/arrays_sc.xml
@@ -37,4 +37,16 @@
- @string/prompt_simplified_mode_off
+
+ - @string/user_colors_uniform
+ - @string/user_colors_from_pl
+ - @string/user_colors_from_id
+
+
+
+ - uniform
+ - from-pl
+ - from-id
+
+
diff --git a/vector/src/main/res/values/strings_sc.xml b/vector/src/main/res/values/strings_sc.xml
index 53e467168d..cbcc8bac86 100644
--- a/vector/src/main/res/values/strings_sc.xml
+++ b/vector/src/main/res/values/strings_sc.xml
@@ -69,4 +69,15 @@
Message status
+
+ User colors in direct chats
+ User colors in group chats
+ User colors in public rooms
+ Uniform
+ Based on power level
+ Based on Matrix ID
+
+ Advanced theme settings
+ User colors
+
diff --git a/vector/src/main/res/xml/vector_settings_advanced_theme_settings.xml b/vector/src/main/res/xml/vector_settings_advanced_theme_settings.xml
new file mode 100644
index 0000000000..3562a91a52
--- /dev/null
+++ b/vector/src/main/res/xml/vector_settings_advanced_theme_settings.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vector/src/main/res/xml/vector_settings_preferences.xml b/vector/src/main/res/xml/vector_settings_preferences.xml
index 904a66a167..59f5d6e7e2 100644
--- a/vector/src/main/res/xml/vector_settings_preferences.xml
+++ b/vector/src/main/res/xml/vector_settings_preferences.xml
@@ -64,6 +64,10 @@
android:persistent="false"
android:title="@string/font_size" />
+
+