Compare commits
8 Commits
develop
...
feature/ne
Author | SHA1 | Date |
---|---|---|
Benoit Marty | c3bdc6127c | |
Benoit Marty | 2d6ae3f494 | |
Benoit Marty | 920e36a554 | |
Benoit Marty | a13a39495f | |
Benoit Marty | a98bc23691 | |
Benoit Marty | 185c4eb764 | |
Benoit Marty | 625a1abe84 | |
Benoit Marty | 4e1a827405 |
|
@ -29,13 +29,25 @@ interface PushRuleService {
|
|||
|
||||
fun getPushRules(scope: String = RuleScope.GLOBAL): RuleSet
|
||||
|
||||
fun updatePushRuleEnableStatus(kind: RuleKind, pushRule: PushRule, enabled: Boolean, callback: MatrixCallback<Unit>): Cancelable
|
||||
fun updatePushRuleEnableStatus(kind: RuleKind,
|
||||
pushRule: PushRule,
|
||||
enabled: Boolean,
|
||||
callback: MatrixCallback<Unit>): Cancelable
|
||||
|
||||
fun addPushRule(kind: RuleKind, pushRule: PushRule, callback: MatrixCallback<Unit>): Cancelable
|
||||
fun addPushRule(kind: RuleKind,
|
||||
pushRule: PushRule,
|
||||
beforeRuleId: String?,
|
||||
afterRuleId: String?,
|
||||
callback: MatrixCallback<Unit>): Cancelable
|
||||
|
||||
fun updatePushRuleActions(kind: RuleKind, oldPushRule: PushRule, newPushRule: PushRule, callback: MatrixCallback<Unit>): Cancelable
|
||||
fun updatePushRuleActions(kind: RuleKind,
|
||||
oldPushRule: PushRule,
|
||||
newPushRule: PushRule,
|
||||
callback: MatrixCallback<Unit>): Cancelable
|
||||
|
||||
fun removePushRule(kind: RuleKind, pushRule: PushRule, callback: MatrixCallback<Unit>): Cancelable
|
||||
fun removePushRule(kind: RuleKind,
|
||||
pushRule: PushRule,
|
||||
callback: MatrixCallback<Unit>): Cancelable
|
||||
|
||||
fun addPushRuleListener(listener: PushRuleListener)
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ internal data class GetPushRulesResponse(
|
|||
val global: RuleSet,
|
||||
|
||||
/**
|
||||
* Device specific rules, apply only to current device
|
||||
* Device specific rules, apply only to current device. Not used anymore
|
||||
*/
|
||||
@Json(name = "device")
|
||||
val device: RuleSet? = null
|
||||
|
|
|
@ -20,23 +20,20 @@ package im.vector.matrix.android.api.session.room.notification
|
|||
* Defines the room notification state
|
||||
*/
|
||||
enum class RoomNotificationState {
|
||||
/**
|
||||
* All the messages will trigger a noisy notification
|
||||
*/
|
||||
ALL_MESSAGES_NOISY,
|
||||
|
||||
/**
|
||||
* All the messages will trigger a notification
|
||||
* This is the default for DMs
|
||||
*/
|
||||
ALL_MESSAGES,
|
||||
|
||||
/**
|
||||
* Only the messages with user display name / user name will trigger notifications
|
||||
* Only the messages with user display name / user name, or keywords will trigger notifications
|
||||
* This is the default for Rooms
|
||||
*/
|
||||
MENTIONS_ONLY,
|
||||
MENTIONS_AND_KEYWORDS,
|
||||
|
||||
/**
|
||||
* No notifications
|
||||
*/
|
||||
MUTE
|
||||
NONE
|
||||
}
|
||||
|
|
|
@ -111,9 +111,13 @@ internal class DefaultPushRuleService @Inject constructor(
|
|||
.executeBy(taskExecutor)
|
||||
}
|
||||
|
||||
override fun addPushRule(kind: RuleKind, pushRule: PushRule, callback: MatrixCallback<Unit>): Cancelable {
|
||||
override fun addPushRule(kind: RuleKind,
|
||||
pushRule: PushRule,
|
||||
beforeRuleId: String?,
|
||||
afterRuleId: String?,
|
||||
callback: MatrixCallback<Unit>): Cancelable {
|
||||
return addPushRuleTask
|
||||
.configureWith(AddPushRuleTask.Params(kind, pushRule)) {
|
||||
.configureWith(AddPushRuleTask.Params(kind, pushRule, beforeRuleId, afterRuleId)) {
|
||||
this.callback = callback
|
||||
}
|
||||
.executeBy(taskExecutor)
|
||||
|
|
|
@ -25,7 +25,9 @@ import javax.inject.Inject
|
|||
internal interface AddPushRuleTask : Task<AddPushRuleTask.Params, Unit> {
|
||||
data class Params(
|
||||
val kind: RuleKind,
|
||||
val pushRule: PushRule
|
||||
val pushRule: PushRule,
|
||||
val beforeRuleId: String?,
|
||||
val afterRuleId: String?
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -36,7 +38,13 @@ internal class DefaultAddPushRuleTask @Inject constructor(
|
|||
|
||||
override suspend fun execute(params: AddPushRuleTask.Params) {
|
||||
return executeRequest(eventBus) {
|
||||
apiCall = pushRulesApi.addRule(params.kind.value, params.pushRule.ruleId, params.pushRule)
|
||||
apiCall = pushRulesApi.addRule(
|
||||
kind = params.kind.value,
|
||||
ruleId = params.pushRule.ruleId,
|
||||
beforeRuleId = params.beforeRuleId,
|
||||
afterRuleId = params.afterRuleId,
|
||||
rule = params.pushRule
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2020 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.matrix.android.internal.session.pushers
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
internal class EnabledBody(
|
||||
@Json(name = "enabled")
|
||||
val enabled: Boolean
|
||||
)
|
|
@ -24,7 +24,11 @@ import retrofit2.http.DELETE
|
|||
import retrofit2.http.GET
|
||||
import retrofit2.http.PUT
|
||||
import retrofit2.http.Path
|
||||
import retrofit2.http.Query
|
||||
|
||||
/**
|
||||
* Ref: https://matrix.org/docs/spec/client_server/r0.6.1#push-rules-api
|
||||
*/
|
||||
internal interface PushRulesApi {
|
||||
/**
|
||||
* Get all push rules
|
||||
|
@ -37,12 +41,12 @@ internal interface PushRulesApi {
|
|||
*
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param ruleId the ruleId
|
||||
* @param enable the new enable status
|
||||
* @param body the new enable status
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "pushrules/global/{kind}/{ruleId}/enabled")
|
||||
fun updateEnableRuleStatus(@Path("kind") kind: String,
|
||||
@Path("ruleId") ruleId: String,
|
||||
@Body enable: Boolean?)
|
||||
@Body body: EnabledBody)
|
||||
: Call<Unit>
|
||||
|
||||
/**
|
||||
|
@ -71,15 +75,22 @@ internal interface PushRulesApi {
|
|||
: Call<Unit>
|
||||
|
||||
/**
|
||||
* Add the ruleID enable status
|
||||
* This endpoint allows the creation, modification and deletion of pushers for this user ID. The
|
||||
* behaviour of this endpoint varies depending on the values in the JSON body.
|
||||
*
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param ruleId the ruleId.
|
||||
* @param rule the rule to add.
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param ruleId the ruleId.
|
||||
* @param beforeRuleId Use 'before' with a rule_id as its value to make the new rule the next-most important rule with
|
||||
* respect to the given user defined rule. It is not possible to add a rule relative to a predefined server rule.
|
||||
* @param afterRuleId This makes the new rule the next-less important rule relative to the given user defined rule. It
|
||||
* is not possible to add a rule relative to a predefined server rule.
|
||||
* @param rule the rule to add. Note: only a subset of PushRule is documented: actions, condition, pattern. We should create a dedicated model
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "pushrules/global/{kind}/{ruleId}")
|
||||
fun addRule(@Path("kind") kind: String,
|
||||
@Path("ruleId") ruleId: String,
|
||||
@Query("before") beforeRuleId: String?,
|
||||
@Query("after") afterRuleId: String?,
|
||||
@Body rule: PushRule)
|
||||
: Call<Unit>
|
||||
}
|
||||
|
|
|
@ -39,7 +39,11 @@ internal class DefaultUpdatePushRuleActionsTask @Inject constructor(
|
|||
if (params.oldPushRule.enabled != params.newPushRule.enabled) {
|
||||
// First change enabled state
|
||||
executeRequest<Unit>(eventBus) {
|
||||
apiCall = pushRulesApi.updateEnableRuleStatus(params.kind.value, params.newPushRule.ruleId, params.newPushRule.enabled)
|
||||
apiCall = pushRulesApi.updateEnableRuleStatus(
|
||||
params.kind.value,
|
||||
params.newPushRule.ruleId,
|
||||
EnabledBody(enabled = params.newPushRule.enabled)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,11 @@ internal class DefaultUpdatePushRuleEnableStatusTask @Inject constructor(
|
|||
|
||||
override suspend fun execute(params: UpdatePushRuleEnableStatusTask.Params) {
|
||||
return executeRequest(eventBus) {
|
||||
apiCall = pushRulesApi.updateEnableRuleStatus(params.kind.value, params.pushRule.ruleId, params.enabled)
|
||||
apiCall = pushRulesApi.updateEnableRuleStatus(
|
||||
params.kind.value,
|
||||
params.pushRule.ruleId,
|
||||
EnabledBody(enabled = params.enabled)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,9 +45,13 @@ internal fun PushRuleEntity.toRoomPushRule(): RoomPushRule? {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* FIXME This is the trickiest part...
|
||||
*/
|
||||
internal fun RoomNotificationState.toRoomPushRule(roomId: String): RoomPushRule? {
|
||||
return when {
|
||||
this == RoomNotificationState.ALL_MESSAGES -> null
|
||||
this == RoomNotificationState.ALL_MESSAGES -> null
|
||||
/* TODO
|
||||
this == RoomNotificationState.ALL_MESSAGES_NOISY -> {
|
||||
val rule = PushRule(
|
||||
actions = listOf(Action.Notify, Action.Sound()).toJson(),
|
||||
|
@ -56,7 +60,8 @@ internal fun RoomNotificationState.toRoomPushRule(roomId: String): RoomPushRule?
|
|||
)
|
||||
return RoomPushRule(RuleSetKey.ROOM, rule)
|
||||
}
|
||||
else -> {
|
||||
*/
|
||||
else -> {
|
||||
val condition = PushCondition(
|
||||
kind = Condition.Kind.EventMatch.value,
|
||||
key = "room_id",
|
||||
|
@ -68,7 +73,7 @@ internal fun RoomNotificationState.toRoomPushRule(roomId: String): RoomPushRule?
|
|||
ruleId = roomId,
|
||||
conditions = listOf(condition)
|
||||
)
|
||||
val kind = if (this == RoomNotificationState.MUTE) {
|
||||
val kind = if (this == RoomNotificationState.NONE) {
|
||||
RuleSetKey.OVERRIDE
|
||||
} else {
|
||||
RuleSetKey.ROOM
|
||||
|
@ -83,16 +88,17 @@ internal fun RoomPushRule.toRoomNotificationState(): RoomNotificationState {
|
|||
val actions = rule.getActions()
|
||||
if (actions.contains(Action.DoNotNotify)) {
|
||||
if (kind == RuleSetKey.OVERRIDE) {
|
||||
RoomNotificationState.MUTE
|
||||
RoomNotificationState.NONE
|
||||
} else {
|
||||
RoomNotificationState.MENTIONS_ONLY
|
||||
RoomNotificationState.MENTIONS_AND_KEYWORDS
|
||||
}
|
||||
} else if (actions.contains(Action.Notify)) {
|
||||
val hasSoundAction = actions.find {
|
||||
it is Action.Sound
|
||||
} != null
|
||||
if (hasSoundAction) {
|
||||
RoomNotificationState.ALL_MESSAGES_NOISY
|
||||
RoomNotificationState.ALL_MESSAGES
|
||||
// TODO RoomNotificationState.ALL_MESSAGES_NOISY
|
||||
} else {
|
||||
RoomNotificationState.ALL_MESSAGES
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ internal class DefaultSetRoomNotificationStateTask @Inject constructor(private v
|
|||
}
|
||||
val newRoomPushRule = params.roomNotificationState.toRoomPushRule(params.roomId)
|
||||
if (newRoomPushRule != null) {
|
||||
addPushRuleTask.execute(AddPushRuleTask.Params(newRoomPushRule.kind, newRoomPushRule.rule))
|
||||
addPushRuleTask.execute(AddPushRuleTask.Params(newRoomPushRule.kind, newRoomPushRule.rule, null, null))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.airbnb.epoxy.EpoxyModelClass
|
|||
import im.vector.riotx.R
|
||||
|
||||
/**
|
||||
* Default background color is for the bottom sheets (R.attr.vctr_list_bottom_sheet_divider_color).
|
||||
* Default background color is for the bottom sheets (R.attr.riotx_list_bottom_sheet_divider_color).
|
||||
* To use in fragment, set color using R.attr.vctr_list_divider_color
|
||||
*/
|
||||
@EpoxyModelClass(layout = R.layout.item_divider)
|
||||
|
|
|
@ -31,6 +31,7 @@ import com.airbnb.epoxy.EpoxyModelClass
|
|||
import im.vector.riotx.R
|
||||
import im.vector.riotx.core.epoxy.VectorEpoxyHolder
|
||||
import im.vector.riotx.core.epoxy.VectorEpoxyModel
|
||||
import im.vector.riotx.core.platform.CheckableImageView
|
||||
import im.vector.riotx.features.themes.ThemeUtils
|
||||
|
||||
/**
|
||||
|
@ -42,18 +43,28 @@ abstract class BottomSheetActionItem : VectorEpoxyModel<BottomSheetActionItem.Ho
|
|||
@EpoxyAttribute
|
||||
@DrawableRes
|
||||
var iconRes: Int = 0
|
||||
|
||||
@EpoxyAttribute
|
||||
var textRes: Int = 0
|
||||
|
||||
@EpoxyAttribute
|
||||
var showExpand = false
|
||||
|
||||
@EpoxyAttribute
|
||||
var expanded = false
|
||||
|
||||
@EpoxyAttribute
|
||||
var showSelected = false
|
||||
|
||||
@EpoxyAttribute
|
||||
var selected = false
|
||||
|
||||
@EpoxyAttribute
|
||||
var subMenuItem = false
|
||||
|
||||
@EpoxyAttribute
|
||||
var destructive = false
|
||||
|
||||
@EpoxyAttribute
|
||||
lateinit var listener: View.OnClickListener
|
||||
|
||||
|
@ -62,16 +73,21 @@ abstract class BottomSheetActionItem : VectorEpoxyModel<BottomSheetActionItem.Ho
|
|||
listener.onClick(it)
|
||||
}
|
||||
holder.startSpace.isVisible = subMenuItem
|
||||
val tintColor = if (destructive) {
|
||||
ContextCompat.getColor(holder.view.context, R.color.riotx_notice)
|
||||
} else {
|
||||
ThemeUtils.getColor(holder.view.context, R.attr.riotx_text_secondary)
|
||||
val tintColor = when {
|
||||
destructive -> ContextCompat.getColor(holder.view.context, R.color.riotx_notice)
|
||||
selected -> ContextCompat.getColor(holder.view.context, R.color.riotx_accent)
|
||||
else -> ThemeUtils.getColor(holder.view.context, R.attr.riotx_text_primary)
|
||||
}
|
||||
val iconTintColor = when {
|
||||
destructive || selected -> tintColor
|
||||
else -> ThemeUtils.getColor(holder.view.context, R.attr.riotx_icon_color)
|
||||
}
|
||||
holder.icon.setImageResource(iconRes)
|
||||
ImageViewCompat.setImageTintList(holder.icon, ColorStateList.valueOf(tintColor))
|
||||
ImageViewCompat.setImageTintList(holder.icon, ColorStateList.valueOf(iconTintColor))
|
||||
holder.text.setText(textRes)
|
||||
holder.text.setTextColor(tintColor)
|
||||
holder.selected.isInvisible = !selected
|
||||
holder.selected.isInvisible = !showSelected
|
||||
holder.selected.isChecked = selected
|
||||
if (showExpand) {
|
||||
val expandDrawable = if (expanded) {
|
||||
ContextCompat.getDrawable(holder.view.context, R.drawable.ic_material_expand_less_black)
|
||||
|
@ -91,6 +107,6 @@ abstract class BottomSheetActionItem : VectorEpoxyModel<BottomSheetActionItem.Ho
|
|||
val startSpace by bind<View>(R.id.actionStartSpace)
|
||||
val icon by bind<ImageView>(R.id.actionIcon)
|
||||
val text by bind<TextView>(R.id.actionTitle)
|
||||
val selected by bind<ImageView>(R.id.actionSelected)
|
||||
val selected by bind<CheckableImageView>(R.id.actionSelected)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -217,25 +217,28 @@ class RoomListFragment @Inject constructor(
|
|||
|
||||
private fun handleQuickActions(quickAction: RoomListQuickActionsSharedAction) {
|
||||
when (quickAction) {
|
||||
is RoomListQuickActionsSharedAction.NotificationsAllNoisy -> {
|
||||
roomListViewModel.handle(RoomListAction.ChangeRoomNotificationState(quickAction.roomId, RoomNotificationState.ALL_MESSAGES_NOISY))
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.NotificationsAll -> {
|
||||
is RoomListQuickActionsSharedAction.NotificationsAll -> {
|
||||
roomListViewModel.handle(RoomListAction.ChangeRoomNotificationState(quickAction.roomId, RoomNotificationState.ALL_MESSAGES))
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.NotificationsMentionsOnly -> {
|
||||
roomListViewModel.handle(RoomListAction.ChangeRoomNotificationState(quickAction.roomId, RoomNotificationState.MENTIONS_ONLY))
|
||||
is RoomListQuickActionsSharedAction.NotificationsAllDefault -> {
|
||||
roomListViewModel.handle(RoomListAction.ChangeRoomNotificationState(quickAction.roomId, RoomNotificationState.ALL_MESSAGES))
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.NotificationsMute -> {
|
||||
roomListViewModel.handle(RoomListAction.ChangeRoomNotificationState(quickAction.roomId, RoomNotificationState.MUTE))
|
||||
is RoomListQuickActionsSharedAction.NotificationsMentionsKeywords -> {
|
||||
roomListViewModel.handle(RoomListAction.ChangeRoomNotificationState(quickAction.roomId, RoomNotificationState.MENTIONS_AND_KEYWORDS))
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.Settings -> {
|
||||
is RoomListQuickActionsSharedAction.NotificationsMentionsKeywordsDefault -> {
|
||||
roomListViewModel.handle(RoomListAction.ChangeRoomNotificationState(quickAction.roomId, RoomNotificationState.MENTIONS_AND_KEYWORDS))
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.NotificationsNone -> {
|
||||
roomListViewModel.handle(RoomListAction.ChangeRoomNotificationState(quickAction.roomId, RoomNotificationState.NONE))
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.Settings -> {
|
||||
navigator.openRoomProfile(requireActivity(), quickAction.roomId)
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.Favorite -> {
|
||||
is RoomListQuickActionsSharedAction.Favorite -> {
|
||||
roomListViewModel.handle(RoomListAction.ToggleFavorite(quickAction.roomId))
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.Leave -> {
|
||||
is RoomListQuickActionsSharedAction.Leave -> {
|
||||
AlertDialog.Builder(requireContext())
|
||||
.setTitle(R.string.room_participants_leave_prompt_title)
|
||||
.setMessage(R.string.room_participants_leave_prompt_msg)
|
||||
|
|
|
@ -59,30 +59,38 @@ class RoomListQuickActionsEpoxyController @Inject constructor(
|
|||
}
|
||||
|
||||
val selectedRoomState = state.roomNotificationState()
|
||||
RoomListQuickActionsSharedAction.NotificationsAllNoisy(roomSummary.roomId).toBottomSheetItem(0, selectedRoomState)
|
||||
RoomListQuickActionsSharedAction.NotificationsAll(roomSummary.roomId).toBottomSheetItem(1, selectedRoomState)
|
||||
RoomListQuickActionsSharedAction.NotificationsMentionsOnly(roomSummary.roomId).toBottomSheetItem(2, selectedRoomState)
|
||||
RoomListQuickActionsSharedAction.NotificationsMute(roomSummary.roomId).toBottomSheetItem(3, selectedRoomState)
|
||||
if (state.roomSummary()?.isDirect == true) {
|
||||
// In this case, default is All
|
||||
RoomListQuickActionsSharedAction.NotificationsAllDefault(roomSummary.roomId).toBottomSheetItem(0, selectedRoomState)
|
||||
RoomListQuickActionsSharedAction.NotificationsMentionsKeywords(roomSummary.roomId).toBottomSheetItem(1, selectedRoomState)
|
||||
} else {
|
||||
// In this case, default is MentionsKeywords
|
||||
RoomListQuickActionsSharedAction.NotificationsAll(roomSummary.roomId).toBottomSheetItem(0, selectedRoomState)
|
||||
RoomListQuickActionsSharedAction.NotificationsMentionsKeywordsDefault(roomSummary.roomId).toBottomSheetItem(1, selectedRoomState)
|
||||
}
|
||||
RoomListQuickActionsSharedAction.NotificationsNone(roomSummary.roomId).toBottomSheetItem(2, selectedRoomState)
|
||||
|
||||
if (showAll) {
|
||||
// Leave
|
||||
dividerItem {
|
||||
id("leave_separator")
|
||||
}
|
||||
RoomListQuickActionsSharedAction.Leave(roomSummary.roomId).toBottomSheetItem(5)
|
||||
}
|
||||
}
|
||||
|
||||
private fun RoomListQuickActionsSharedAction.toBottomSheetItem(index: Int, roomNotificationState: RoomNotificationState? = null) {
|
||||
val showSelected = roomNotificationState != null
|
||||
|
||||
val selected = when (this) {
|
||||
is RoomListQuickActionsSharedAction.NotificationsAllNoisy -> roomNotificationState == RoomNotificationState.ALL_MESSAGES_NOISY
|
||||
is RoomListQuickActionsSharedAction.NotificationsAll -> roomNotificationState == RoomNotificationState.ALL_MESSAGES
|
||||
is RoomListQuickActionsSharedAction.NotificationsMentionsOnly -> roomNotificationState == RoomNotificationState.MENTIONS_ONLY
|
||||
is RoomListQuickActionsSharedAction.NotificationsMute -> roomNotificationState == RoomNotificationState.MUTE
|
||||
else -> false
|
||||
is RoomListQuickActionsSharedAction.NotificationsAll,
|
||||
is RoomListQuickActionsSharedAction.NotificationsAllDefault -> roomNotificationState == RoomNotificationState.ALL_MESSAGES
|
||||
is RoomListQuickActionsSharedAction.NotificationsMentionsKeywords,
|
||||
is RoomListQuickActionsSharedAction.NotificationsMentionsKeywordsDefault -> roomNotificationState == RoomNotificationState.MENTIONS_AND_KEYWORDS
|
||||
is RoomListQuickActionsSharedAction.NotificationsNone -> roomNotificationState == RoomNotificationState.NONE
|
||||
is RoomListQuickActionsSharedAction.Settings,
|
||||
is RoomListQuickActionsSharedAction.Favorite,
|
||||
is RoomListQuickActionsSharedAction.Leave -> false
|
||||
}
|
||||
return bottomSheetActionItem {
|
||||
id("action_$index")
|
||||
showSelected(showSelected)
|
||||
selected(selected)
|
||||
iconRes(iconResId)
|
||||
textRes(titleRes)
|
||||
|
|
|
@ -27,24 +27,29 @@ sealed class RoomListQuickActionsSharedAction(
|
|||
val destructive: Boolean = false)
|
||||
: VectorSharedAction {
|
||||
|
||||
data class NotificationsAllNoisy(val roomId: String) : RoomListQuickActionsSharedAction(
|
||||
R.string.room_list_quick_actions_notifications_all_noisy,
|
||||
R.drawable.ic_room_actions_notifications_all_noisy
|
||||
)
|
||||
|
||||
data class NotificationsAll(val roomId: String) : RoomListQuickActionsSharedAction(
|
||||
R.string.room_list_quick_actions_notifications_all,
|
||||
R.drawable.ic_room_actions_notifications_all
|
||||
R.drawable.ic_room_actions_notifications_all_messages_24dp
|
||||
)
|
||||
|
||||
data class NotificationsMentionsOnly(val roomId: String) : RoomListQuickActionsSharedAction(
|
||||
R.string.room_list_quick_actions_notifications_mentions,
|
||||
R.drawable.ic_room_actions_notifications_mentions
|
||||
data class NotificationsAllDefault(val roomId: String) : RoomListQuickActionsSharedAction(
|
||||
R.string.room_list_quick_actions_notifications_all_default,
|
||||
R.drawable.ic_room_actions_notifications_all_messages_24dp
|
||||
)
|
||||
|
||||
data class NotificationsMute(val roomId: String) : RoomListQuickActionsSharedAction(
|
||||
R.string.room_list_quick_actions_notifications_mute,
|
||||
R.drawable.ic_room_actions_notifications_mutes
|
||||
data class NotificationsMentionsKeywords(val roomId: String) : RoomListQuickActionsSharedAction(
|
||||
R.string.room_list_quick_actions_notifications_mentions_and_keywords,
|
||||
R.drawable.ic_room_actions_notifications_mentions_keywords_24dp
|
||||
)
|
||||
|
||||
data class NotificationsMentionsKeywordsDefault(val roomId: String) : RoomListQuickActionsSharedAction(
|
||||
R.string.room_list_quick_actions_notifications_mentions_and_keywords_default,
|
||||
R.drawable.ic_room_actions_notifications_mentions_keywords_24dp
|
||||
)
|
||||
|
||||
data class NotificationsNone(val roomId: String) : RoomListQuickActionsSharedAction(
|
||||
R.string.room_list_quick_actions_notifications_none,
|
||||
R.drawable.ic_room_actions_notifications_none_24dp
|
||||
)
|
||||
|
||||
data class Settings(val roomId: String) : RoomListQuickActionsSharedAction(
|
||||
|
|
|
@ -115,19 +115,16 @@ class RoomProfileFragment @Inject constructor(
|
|||
}
|
||||
|
||||
private fun handleQuickActions(action: RoomListQuickActionsSharedAction) = when (action) {
|
||||
is RoomListQuickActionsSharedAction.NotificationsAllNoisy -> {
|
||||
roomProfileViewModel.handle(RoomProfileAction.ChangeRoomNotificationState(RoomNotificationState.ALL_MESSAGES_NOISY))
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.NotificationsAll -> {
|
||||
is RoomListQuickActionsSharedAction.NotificationsAll,
|
||||
is RoomListQuickActionsSharedAction.NotificationsAllDefault ->
|
||||
roomProfileViewModel.handle(RoomProfileAction.ChangeRoomNotificationState(RoomNotificationState.ALL_MESSAGES))
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.NotificationsMentionsOnly -> {
|
||||
roomProfileViewModel.handle(RoomProfileAction.ChangeRoomNotificationState(RoomNotificationState.MENTIONS_ONLY))
|
||||
}
|
||||
is RoomListQuickActionsSharedAction.NotificationsMute -> {
|
||||
roomProfileViewModel.handle(RoomProfileAction.ChangeRoomNotificationState(RoomNotificationState.MUTE))
|
||||
}
|
||||
else -> Timber.v("$action not handled")
|
||||
is RoomListQuickActionsSharedAction.NotificationsMentionsKeywords,
|
||||
is RoomListQuickActionsSharedAction.NotificationsMentionsKeywordsDefault ->
|
||||
roomProfileViewModel.handle(RoomProfileAction.ChangeRoomNotificationState(RoomNotificationState.MENTIONS_AND_KEYWORDS))
|
||||
is RoomListQuickActionsSharedAction.NotificationsNone ->
|
||||
roomProfileViewModel.handle(RoomProfileAction.ChangeRoomNotificationState(RoomNotificationState.NONE))
|
||||
else ->
|
||||
Timber.v("$action not handled")
|
||||
}
|
||||
|
||||
private fun onLeaveRoom() {
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="12dp"
|
||||
android:height="14dp"
|
||||
android:viewportWidth="12"
|
||||
android:viewportHeight="14">
|
||||
<path
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M12,10.002L0,10.002a1.8,1.8 0,0 0,1.8 -1.8L1.8,5.2a4.2,4.2 0,1 1,8.4 0v3a1.8,1.8 0,0 0,1.8 1.8zM7.038,12.402a1.2,1.2 0,0 1,-2.076 0h2.076z"
|
||||
android:strokeLineJoin="round"
|
||||
android:fillColor="#00000000"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#454545"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/ic_radio_button_on" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/ic_radio_button_off" />
|
||||
|
||||
</selector>
|
|
@ -0,0 +1,12 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
|
||||
<!-- Note: I adapted this vector manually since clip-path is API24+ -->
|
||||
<path
|
||||
android:fillColor="?riotx_disabled_view_color"
|
||||
android:pathData="M10,5M10,0C4.5,0 0,4.5 0,10C0,15.5 4.5,20 10,20C15.5,20 20,15.5 20,10C20,4.5 15.5,0 10,0ZM10,18C5.6,18 2,14.4 2,10C2,5.6 5.6,2 10,2C14.4,2 18,5.6 18,10C18,14.4 14.4,18 10,18Z" />
|
||||
|
||||
</vector>
|
|
@ -0,0 +1,12 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
|
||||
<!-- Note: I adapted this vector manually since clip-path is API24+ -->
|
||||
<path
|
||||
android:fillColor="#03B381"
|
||||
android:pathData="M10,5C7.2,5 5,7.2 5,10C5,12.8 7.2,15 10,15C12.8,15 15,12.8 15,10C15,7.2 12.8,5 10,5ZM10,0C4.5,0 0,4.5 0,10C0,15.5 4.5,20 10,20C15.5,20 20,15.5 20,10C20,4.5 15.5,0 10,0ZM10,18C5.6,18 2,14.4 2,10C2,5.6 5.6,2 10,2C14.4,2 18,5.6 18,10C18,14.4 14.4,18 10,18Z" />
|
||||
|
||||
</vector>
|
|
@ -1,39 +0,0 @@
|
|||
<!--
|
||||
~ 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.
|
||||
~
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="17dp"
|
||||
android:height="16dp"
|
||||
android:viewportWidth="17"
|
||||
android:viewportHeight="16">
|
||||
<path
|
||||
android:pathData="M10,1l-5,4l-4,0l0,6l4,0l5,4z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M14.54,4.46C16.4919,6.4125 16.4919,9.5775 14.54,11.53"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
|
@ -0,0 +1,13 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#2E2F32"
|
||||
android:pathData="M22,18C22.5523,18 23,17.5523 23,17C23,16.4477 22.5523,16 22,16V18ZM2,16C1.4477,16 1,16.4477 1,17C1,17.5523 1.4477,18 2,18V16ZM5,9H4H5ZM19,9H20H19ZM14.595,21.5018C14.8721,21.024 14.7095,20.4121 14.2318,20.135C13.754,19.8579 13.1421,20.0205 12.865,20.4982L14.595,21.5018ZM11.135,20.4982C10.8579,20.0205 10.246,19.8579 9.7682,20.135C9.2905,20.4121 9.1279,21.024 9.405,21.5018L11.135,20.4982ZM22,16H2V18H22V16ZM2,18C4.2091,18 6,16.2091 6,14H4C4,15.1046 3.1046,16 2,16V18ZM6,14V9H4V14H6ZM6,9C6,5.6863 8.6863,3 12,3V1C7.5817,1 4,4.5817 4,9H6ZM12,3C15.3137,3 18,5.6863 18,9H20C20,4.5817 16.4183,1 12,1V3ZM18,9V14H20V9H18ZM18,14C18,16.2091 19.7909,18 22,18V16C20.8954,16 20,15.1046 20,14H18ZM12.865,20.4982C12.6861,20.8066 12.3565,20.9965 12,20.9965V22.9965C13.0696,22.9965 14.0583,22.427 14.595,21.5018L12.865,20.4982ZM12,20.9965C11.6435,20.9965 11.3139,20.8066 11.135,20.4982L9.405,21.5018C9.9417,22.427 10.9304,22.9965 12,22.9965V20.9965Z"
|
||||
tools:fillColor="#FF0000" />
|
||||
|
||||
</vector>
|
|
@ -1,39 +0,0 @@
|
|||
<!--
|
||||
~ 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.
|
||||
~
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="18dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="18">
|
||||
<path
|
||||
android:pathData="M10,2l-5,4l-4,0l0,6l4,0l5,4z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M18.07,1.93C21.9738,5.835 21.9738,12.165 18.07,16.07M14.54,5.46C16.4919,7.4125 16.4919,10.5775 14.54,12.53"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
|
@ -1,47 +0,0 @@
|
|||
<!--
|
||||
~ 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.
|
||||
~
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="16dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="16">
|
||||
<path
|
||||
android:pathData="M10,1l-5,4l-4,0l0,6l4,0l5,4z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M18.8097,7.8097m-1.5238,0a1.5238,1.5238 0,1 1,3.0476 0a1.5238,1.5238 0,1 1,-3.0476 0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="1.3"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M20.3336,6.2858L20.3336,8.1906C20.3336,8.8218 20.8452,9.3335 21.4764,9.3335C22.1076,9.3335 22.6193,8.8218 22.6193,8.1906L22.6193,7.8097C22.6192,6.0393 21.3995,4.5024 19.6755,4.1001C17.9515,3.6977 16.1776,4.5361 15.3938,6.1235C14.6101,7.7109 15.0233,9.629 16.3909,10.753C17.7586,11.877 19.7204,11.9108 21.1259,10.8344"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="1.3"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
|
@ -0,0 +1,28 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M13.73,21C13.3722,21.6168 12.7131,21.9965 12,21.9965C11.287,21.9965 10.6278,21.6168 10.27,21"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#2E2F32"
|
||||
android:strokeLineCap="round"
|
||||
tools:strokeColor="#FF0000" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M11.9999,2.0002C8.1339,2.0002 4.9999,5.1343 4.9999,9.0002V14.0002C4.9999,15.6571 3.6567,17.0002 1.9999,17.0002H21.9999C20.343,17.0002 18.9999,15.6571 18.9999,14.0002V12.75"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#2E2F32"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"
|
||||
tools:strokeColor="#FF0000" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M18.75,5.25m-4.25,0a4.25,4.25 0,1 1,8.5 0a4.25,4.25 0,1 1,-8.5 0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#2E2F32"
|
||||
tools:strokeColor="#FF0000" />
|
||||
</vector>
|
|
@ -1,47 +0,0 @@
|
|||
<!--
|
||||
~ 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.
|
||||
~
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="23dp"
|
||||
android:height="16dp"
|
||||
android:viewportWidth="23"
|
||||
android:viewportHeight="16">
|
||||
<path
|
||||
android:pathData="M10,1l-5,4l-4,0l0,6l4,0l5,4z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M22,5L16,11"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M16,5L22,11"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#2E2F32"
|
||||
android:pathData="M8.0685,2.0292C7.5875,2.3006 7.4176,2.9106 7.689,3.3916C7.9604,3.8726 8.5703,4.0425 9.0513,3.7711L8.0685,2.0292ZM18.9999,9.0002L17.9999,8.9997V9.0002H18.9999ZM17.9999,13.0002C17.9999,13.5524 18.4476,14.0002 18.9999,14.0002C19.5522,14.0002 19.9999,13.5524 19.9999,13.0002H17.9999ZM17,18.0004C17.5523,18.0004 18,17.5526 18,17.0004C18,16.4481 17.5523,16.0004 17,16.0004V18.0004ZM2,16.0004C1.4477,16.0004 1,16.4481 1,17.0004C1,17.5526 1.4477,18.0004 2,18.0004V16.0004ZM5,9.0004H6L6,8.9991L5,9.0004ZM6.6685,6.2391C6.9219,5.7484 6.7295,5.1452 6.2387,4.8918C5.748,4.6384 5.1448,4.8309 4.8914,5.3216L6.6685,6.2391ZM14.5949,21.5018C14.872,21.024 14.7094,20.4121 14.2317,20.135C13.754,19.8579 13.142,20.0205 12.8649,20.4982L14.5949,21.5018ZM11.1349,20.4982C10.8578,20.0205 10.2459,19.8579 9.7682,20.135C9.2904,20.4121 9.1278,21.024 9.4049,21.5018L11.1349,20.4982ZM9.0513,3.7711C10.9095,2.7226 13.1847,2.7397 15.0268,3.8161L16.0358,2.0892C13.5796,0.6541 10.546,0.6312 8.0685,2.0292L9.0513,3.7711ZM15.0268,3.8161C16.869,4.8924 18.001,6.8661 17.9999,8.9997L19.9999,9.0007C20.0014,6.1559 18.492,3.5244 16.0358,2.0892L15.0268,3.8161ZM17.9999,9.0002V13.0002H19.9999V9.0002H17.9999ZM17,16.0004H2V18.0004H17V16.0004ZM2,18.0004C4.2091,18.0004 6,16.2095 6,14.0004H4C4,15.1049 3.1045,16.0004 2,16.0004V18.0004ZM6,14.0004V9.0004H4V14.0004H6ZM6,8.9991C5.9988,8.0389 6.228,7.0924 6.6685,6.2391L4.8914,5.3216C4.3041,6.4593 3.9984,7.7213 4,9.0016L6,8.9991ZM12.8649,20.4982C12.686,20.8066 12.3565,20.9965 11.9999,20.9965V22.9965C13.0695,22.9965 14.0582,22.427 14.5949,21.5018L12.8649,20.4982ZM11.9999,20.9965C11.6434,20.9965 11.3138,20.8066 11.1349,20.4982L9.4049,21.5018C9.9416,22.427 10.9303,22.9965 11.9999,22.9965V20.9965Z"
|
||||
tools:fillColor="#FF0000" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M1,1L23,23"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#2E2F32"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"
|
||||
tools:strokeColor="#FF0000" />
|
||||
</vector>
|
|
@ -6,6 +6,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:background="?riotx_bottom_sheet_background"
|
||||
android:fadeScrollbars="false"
|
||||
android:scrollbars="vertical">
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/callControlsWrapper"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?riotx_bottom_sheet_background"
|
||||
android:orientation="vertical">
|
||||
|
||||
<im.vector.riotx.core.ui.views.BottomSheetActionButton
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
android:id="@+id/bottomSheetRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?riotx_bottom_sheet_background"
|
||||
android:fadeScrollbars="false"
|
||||
android:scrollbars="vertical"
|
||||
tools:itemCount="5"
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:orientation="vertical">
|
||||
android:background="?riotx_bottom_sheet_background"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetTitle"
|
||||
|
@ -12,7 +13,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="8dp"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textColor="?riotx_text_primary"
|
||||
android:textSize="16sp"
|
||||
tools:text="@string/reactions" />
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/root_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?riotx_bottom_sheet_background"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
@ -131,8 +132,8 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="?riotx_text_secondary"
|
||||
android:text="@string/keys_backup_activate"
|
||||
android:textColor="?riotx_text_secondary"
|
||||
android:textSize="17sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
android:id="@+id/root_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?riotx_bottom_sheet_background"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
@ -16,8 +17,8 @@
|
|||
android:layout_marginEnd="@dimen/layout_horizontal_margin"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/room_widget_permission_title"
|
||||
android:textSize="20sp"
|
||||
android:textColor="?riotx_text_primary"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
|
@ -59,9 +60,9 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:textColor="?riotx_text_primary"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?riotx_text_primary"
|
||||
tools:text="User name" />
|
||||
|
||||
<TextView
|
||||
|
@ -69,8 +70,8 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?riotx_text_secondary"
|
||||
android:textSize="14sp"
|
||||
tools:text="\@foo:matrix.org" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
@ -100,7 +101,7 @@
|
|||
android:layout_marginEnd="@dimen/layout_vertical_margin"
|
||||
android:layout_marginRight="@dimen/layout_vertical_margin"
|
||||
android:text="@string/decline"
|
||||
android:textAllCaps="true"/>
|
||||
android:textAllCaps="true" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/widgetPermissionContinue"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorBackgroundFloating"
|
||||
android:background="?riotx_bottom_sheet_background"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
|
@ -7,6 +6,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:background="?riotx_bottom_sheet_background"
|
||||
android:fadeScrollbars="false"
|
||||
android:scrollbars="vertical">
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<androidx.fragment.app.FragmentContainerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/bottomSheetFragmentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?riotx_bottom_sheet_background" />
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
android:minHeight="50dp"
|
||||
android:minHeight="64dp"
|
||||
android:paddingLeft="@dimen/layout_horizontal_margin"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingRight="@dimen/layout_horizontal_margin"
|
||||
|
@ -30,43 +30,41 @@
|
|||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@id/actionStartSpace"
|
||||
android:scaleType="center"
|
||||
android:tint="?riotx_text_secondary"
|
||||
android:tint="?riotx_icon_color"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/actionStartSpace"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_room_actions_notifications_all" />
|
||||
tools:src="@drawable/ic_room_actions_notifications_all_messages_24dp" />
|
||||
|
||||
<im.vector.riotx.core.platform.EllipsizingTextView
|
||||
android:id="@+id/actionTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginStart="18dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:drawablePadding="16dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:textColor="?riotx_text_secondary"
|
||||
android:textColor="?riotx_text_primary"
|
||||
android:textSize="17sp"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/actionSelected"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toEndOf="@id/actionStartSpace"
|
||||
app:layout_constraintStart_toEndOf="@id/actionIcon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="zbla azjazjaz s sdkqdskdsqk kqsdkdqsk kdqsksqdk" />
|
||||
|
||||
|
||||
<ImageView
|
||||
<im.vector.riotx.core.platform.CheckableImageView
|
||||
android:id="@+id/actionSelected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_check_white_24dp"
|
||||
android:tint="@color/riotx_accent"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:checked="true"
|
||||
android:src="@drawable/ic_radio_button"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -4,16 +4,15 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/bottom_sheet_message_preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="72dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottomSheetRoomPreviewAvatar"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="@dimen/layout_horizontal_margin"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="@dimen/layout_horizontal_margin"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@drawable/circle"
|
||||
android:contentDescription="@string/avatar"
|
||||
|
@ -22,7 +21,6 @@
|
|||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<im.vector.riotx.core.platform.EllipsizingTextView
|
||||
|
@ -31,7 +29,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="sans-serif-bold"
|
||||
android:singleLine="true"
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/vctr_list_bottom_sheet_divider_color"
|
||||
android:background="?riotx_list_bottom_sheet_divider_color"
|
||||
tools:layout_height="100dp" />
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- FIXME This declare-styleable is not necessary, we should only use file color_riotx.xml, to declare attr and the related colors -->
|
||||
<declare-styleable name="VectorStyles">
|
||||
|
||||
<attr name="vctr_bottom_nav_background_color" format="color" />
|
||||
|
@ -46,7 +47,6 @@
|
|||
<attr name="vctr_list_header_primary_text_color" format="color" />
|
||||
<attr name="vctr_list_header_secondary_text_color" format="color" />
|
||||
|
||||
<attr name="vctr_list_bottom_sheet_divider_color" format="color" />
|
||||
<attr name="vctr_list_divider_color" format="color" />
|
||||
|
||||
<attr name="vctr_redacted_message_color" format="color" />
|
||||
|
|
|
@ -49,6 +49,12 @@
|
|||
<color name="riotx_background_dark">#FF181B21</color>
|
||||
<color name="riotx_background_black">#FF000000</color>
|
||||
|
||||
<!-- Background color of bottom sheets -->
|
||||
<attr name="riotx_bottom_sheet_background" format="color" />
|
||||
<color name="riotx_bottom_sheet_background_light">#FFFFFFFF</color>
|
||||
<color name="riotx_bottom_sheet_background_dark">#FF282C35</color>
|
||||
<color name="riotx_bottom_sheet_background_black">#FF000000</color>
|
||||
|
||||
<attr name="riotx_base" format="color" />
|
||||
<color name="riotx_base_light">#FF27303A</color>
|
||||
<color name="riotx_base_dark">#FF15171B</color>
|
||||
|
@ -185,6 +191,19 @@
|
|||
<color name="riotx_room_active_widgets_banner_text_dark">#E3E8F0</color>
|
||||
<color name="riotx_room_active_widgets_banner_text_black">#E3E8F0</color>
|
||||
|
||||
<attr name="riotx_icon_color" format="color" />
|
||||
<color name="riotx_icon_color_light">#61708B</color>
|
||||
<color name="riotx_icon_color_dark">#989DA5</color>
|
||||
|
||||
<attr name="riotx_disabled_view_color" format="color" />
|
||||
<color name="riotx_disabled_view_color_light">#EEEEEE</color>
|
||||
<color name="riotx_disabled_view_color_dark">#61708B</color>
|
||||
|
||||
<attr name="riotx_list_bottom_sheet_divider_color" format="color" />
|
||||
<color name="riotx_list_bottom_sheet_divider_color_light">#C0C0C2</color>
|
||||
<color name="riotx_list_bottom_sheet_divider_color_dark">#444E60</color>
|
||||
<color name="riotx_list_bottom_sheet_divider_color_black">#444E60</color>
|
||||
|
||||
<!-- (color from RiotWeb) -->
|
||||
<attr name="riotx_keys_backup_banner_accent_color" format="color" />
|
||||
<color name="riotx_keys_backup_banner_accent_color_light">#FFF8E3</color>
|
||||
|
|
|
@ -1853,9 +1853,15 @@ Not all features in Riot are implemented in RiotX yet. Main missing (and coming
|
|||
<string name="message_ignore_user">Block user</string>
|
||||
|
||||
<string name="room_list_quick_actions_notifications_all_noisy">"All messages (noisy)"</string>
|
||||
<string name="room_list_quick_actions_notifications_all">"All messages"</string>
|
||||
<string name="room_list_quick_actions_notifications_mentions">"Mentions only"</string>
|
||||
<string name="room_list_quick_actions_notifications_mute">"Mute"</string>
|
||||
|
||||
<string name="room_list_quick_actions_notifications_all">"All messages"</string>
|
||||
<string name="room_list_quick_actions_notifications_all_default">"All messages (default)"</string>
|
||||
<string name="room_list_quick_actions_notifications_mentions_and_keywords">"Mentions & keywords"</string>
|
||||
<string name="room_list_quick_actions_notifications_mentions_and_keywords_default">"Mentions & keywords (default)"</string>
|
||||
<string name="room_list_quick_actions_notifications_none">"None"</string>
|
||||
|
||||
<string name="room_list_quick_actions_settings">"Settings"</string>
|
||||
<string name="room_list_quick_actions_favorite_add">"Add to favorites"</string>
|
||||
<string name="room_list_quick_actions_favorite_remove">"Remove from favorites"</string>
|
||||
|
|
|
@ -54,6 +54,8 @@
|
|||
<item name="android:colorBackground">?riotx_background</item>
|
||||
<item name="colorOnBackground">?riotx_text_primary</item>
|
||||
|
||||
<item name="riotx_bottom_sheet_background">@color/riotx_bottom_sheet_background_black</item>
|
||||
|
||||
<!-- Keep color accent for legacy widget-->
|
||||
<item name="colorAccent">@color/riotx_accent</item>
|
||||
|
||||
|
@ -74,7 +76,7 @@
|
|||
<!--Header/Panel Text Secondary-->
|
||||
<item name="vctr_tab_home_secondary">@color/primary_color_dark_black</item>
|
||||
|
||||
<item name="vctr_list_bottom_sheet_divider_color">@color/list_divider_color_black</item>
|
||||
<item name="riotx_list_bottom_sheet_divider_color">@color/riotx_list_bottom_sheet_divider_color_black</item>
|
||||
<item name="vctr_list_divider_color">@color/riotx_header_panel_background_black</item>
|
||||
|
||||
<item name="vctr_redacted_message_color">@color/list_divider_color_black</item>
|
||||
|
|
|
@ -54,6 +54,10 @@
|
|||
<item name="android:colorBackground">?riotx_background</item>
|
||||
<item name="colorOnBackground">?riotx_text_primary</item>
|
||||
|
||||
<item name="riotx_bottom_sheet_background">@color/riotx_bottom_sheet_background_dark</item>
|
||||
<item name="riotx_icon_color">@color/riotx_icon_color_dark</item>
|
||||
<item name="riotx_disabled_view_color">@color/riotx_disabled_view_color_dark</item>
|
||||
|
||||
<!-- Keep color accent for legacy widget-->
|
||||
<item name="colorAccent">@color/riotx_accent</item>
|
||||
|
||||
|
@ -122,7 +126,7 @@
|
|||
<!--Header/Panel Text Secondary-->
|
||||
<item name="vctr_list_header_secondary_text_color">#FFC8C8CD</item>
|
||||
|
||||
<item name="vctr_list_bottom_sheet_divider_color">@color/list_divider_color_dark</item>
|
||||
<item name="riotx_list_bottom_sheet_divider_color">@color/riotx_list_bottom_sheet_divider_color_dark</item>
|
||||
<item name="vctr_list_divider_color">@color/riotx_header_panel_background_dark</item>
|
||||
|
||||
<item name="vctr_redacted_message_color">@color/list_divider_color_dark</item>
|
||||
|
|
|
@ -53,6 +53,10 @@
|
|||
<item name="android:colorBackground">?riotx_background</item>
|
||||
<item name="colorOnBackground">?riotx_text_primary</item>
|
||||
|
||||
<item name="riotx_bottom_sheet_background">@color/riotx_bottom_sheet_background_light</item>
|
||||
<item name="riotx_icon_color">@color/riotx_icon_color_light</item>
|
||||
<item name="riotx_disabled_view_color">@color/riotx_disabled_view_color_light</item>
|
||||
|
||||
<!-- Keep color accent for legacy widget-->
|
||||
<item name="colorAccent">@color/riotx_accent</item>
|
||||
|
||||
|
@ -122,7 +126,7 @@
|
|||
<!--Header/Panel Text Secondary-->
|
||||
<item name="vctr_list_header_secondary_text_color">#FFC8C8CD</item>
|
||||
|
||||
<item name="vctr_list_bottom_sheet_divider_color">@color/list_divider_color_light</item>
|
||||
<item name="riotx_list_bottom_sheet_divider_color">@color/riotx_list_bottom_sheet_divider_color_light</item>
|
||||
<item name="vctr_list_divider_color">@color/riotx_header_panel_background_light</item>
|
||||
|
||||
<item name="vctr_redacted_message_color">@color/list_divider_color_light</item>
|
||||
|
|
Loading…
Reference in New Issue