Merge pull request #854 from vector-im/feature/profiles_improvements

Feature/profiles improvements
This commit is contained in:
Benoit Marty 2020-01-17 12:22:16 +01:00 committed by GitHub
commit b375463aec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 228 additions and 148 deletions

View File

@ -6,7 +6,7 @@
"message": "William Shakespeare (bapt. 26 April 1564 23 April 1616) was an English poet, playwright and actor, widely regarded as the greatest writer in the English language and the world's greatest dramatist. He is often called England's national poet and the \"Bard of Avon\". His extant works, including collaborations, consist of approximately 39 plays, 154 sonnets, two long narrative poems, and a few other verses, some of uncertain authorship. His plays have been translated into every major living language and are performed more often than those of any other playwright.\n\nShakespeare was born and raised in Stratford-upon-Avon, Warwickshire. At the age of 18, he married Anne Hathaway, with whom he had three children: Susanna and twins Hamnet and Judith. Sometime between 1585 and 1592, he began a successful career in London as an actor, writer, and part-owner of a playing company called the Lord Chamberlain's Men, later known as the King's Men. At age 49 (around 1613), he appears to have retired to Stratford, where he died three years later. Few records of Shakespeare's private life survive; this has stimulated considerable speculation about such matters as his physical appearance, his sexuality, his religious beliefs, and whether the works attributed to him were written by others. Such theories are often criticised for failing to adequately note that few records survive of most commoners of the period.\n\nShakespeare produced most of his known works between 1589 and 1613. His early plays were primarily comedies and histories and are regarded as some of the best work produced in these genres. Until about 1608, he wrote mainly tragedies, among them Hamlet, Othello, King Lear, and Macbeth, all considered to be among the finest works in the English language. In the last phase of his life, he wrote tragicomedies (also known as romances) and collaborated with other playwrights.\n\nMany of Shakespeare's plays were published in editions of varying quality and accuracy in his lifetime. However, in 1623, two fellow actors and friends of Shakespeare's, John Heminges and Henry Condell, published a more definitive text known as the First Folio, a posthumous collected edition of Shakespeare's dramatic works that included all but two of his plays. The volume was prefaced with a poem by Ben Jonson, in which Jonson presciently hails Shakespeare in a now-famous quote as \"not of an age, but for all time\".\n\nThroughout the 20th and 21st centuries, Shakespeare's works have been continually adapted and rediscovered by new movements in scholarship and performance. His plays remain popular and are studied, performed, and reinterpreted through various cultural and political contexts around the world.",
"roomName": "Matrix HQ",
"roomAlias": "#matrix:matrix.org",
"roomTopic": "Welcome to Matrix HQ! Here is the rest of the room topic"
"roomTopic": "Welcome to Matrix HQ! Here is the rest of the room topic, with a https://www.example.org url and a phone number: 0102030405 which should not be clickable."
},
{
"displayName": "benoit",

View File

@ -15,11 +15,24 @@
*/
package im.vector.riotx.core.epoxy
import com.airbnb.epoxy.EpoxyAttribute
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).
* To use in fragment, set color using R.attr.vctr_list_divider_color
*/
@EpoxyModelClass(layout = R.layout.item_divider)
abstract class DividerItem : VectorEpoxyModel<DividerItem.Holder>() {
@EpoxyAttribute var color: Int = -1
override fun bind(holder: Holder) {
if (color != -1) {
holder.view.setBackgroundColor(color)
}
}
class Holder : VectorEpoxyHolder()
}

View File

@ -0,0 +1,28 @@
/*
* Copyright 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.riotx.core.epoxy
import android.view.View
/**
* Generally we do not care about the View parameter in [View.OnClickListener.onClick()], so create facility to remove it.
*/
typealias ClickListener = () -> Unit
fun View.onClick(listener: ClickListener?) {
setOnClickListener { listener?.invoke() }
}

View File

@ -45,9 +45,12 @@ abstract class BottomSheetMessagePreviewItem : VectorEpoxyModel<BottomSheetMessa
var time: CharSequence? = null
@EpoxyAttribute
var movementMethod: MovementMethod? = null
@EpoxyAttribute
var userClicked: (() -> Unit)? = null
override fun bind(holder: Holder) {
avatarRenderer.render(matrixItem, holder.avatar)
holder.avatar.setOnClickListener { userClicked?.invoke() }
holder.sender.setTextOrHide(matrixItem.displayName)
holder.body.movementMethod = movementMethod
holder.body.text = body

View File

@ -23,8 +23,10 @@ import com.airbnb.epoxy.EpoxyAttribute
import com.airbnb.epoxy.EpoxyModelClass
import im.vector.matrix.android.api.util.MatrixItem
import im.vector.riotx.R
import im.vector.riotx.core.epoxy.ClickListener
import im.vector.riotx.core.epoxy.VectorEpoxyHolder
import im.vector.riotx.core.epoxy.VectorEpoxyModel
import im.vector.riotx.core.epoxy.onClick
import im.vector.riotx.core.extensions.setTextOrHide
import im.vector.riotx.features.home.AvatarRenderer
@ -38,12 +40,13 @@ abstract class BottomSheetRoomPreviewItem : VectorEpoxyModel<BottomSheetRoomPrev
lateinit var avatarRenderer: AvatarRenderer
@EpoxyAttribute
lateinit var matrixItem: MatrixItem
@EpoxyAttribute var settingsClickListener: View.OnClickListener? = null
@EpoxyAttribute var settingsClickListener: ClickListener? = null
override fun bind(holder: Holder) {
avatarRenderer.render(matrixItem, holder.avatar)
holder.avatar.onClick(settingsClickListener)
holder.roomName.setTextOrHide(matrixItem.displayName)
holder.roomSettings.setOnClickListener(settingsClickListener)
holder.roomSettings.onClick(settingsClickListener)
}
class Holder : VectorEpoxyHolder() {

View File

@ -19,7 +19,7 @@ package im.vector.riotx.core.epoxy.profiles
import androidx.annotation.DrawableRes
import com.airbnb.epoxy.EpoxyController
import im.vector.riotx.core.epoxy.DividerItem_
import im.vector.riotx.core.epoxy.dividerItem
fun EpoxyController.buildProfileSection(title: String) {
profileSectionItem {
@ -31,6 +31,7 @@ fun EpoxyController.buildProfileSection(title: String) {
fun EpoxyController.buildProfileAction(
id: String,
title: String,
dividerColor: Int,
subtitle: String? = null,
editable: Boolean = true,
@DrawableRes icon: Int = 0,
@ -50,7 +51,10 @@ fun EpoxyController.buildProfileAction(
}
}
DividerItem_()
.id("divider_$title")
.addIf(divider, this)
if (divider) {
dividerItem {
id("divider_$title")
color(dividerColor)
}
}
}

View File

@ -19,7 +19,7 @@ package im.vector.riotx.core.extensions
/**
* Returns the last element yielding the smallest value of the given function or `null` if there are no elements.
*/
public inline fun <T, R : Comparable<R>> Iterable<T>.lastMinBy(selector: (T) -> R): T? {
inline fun <T, R : Comparable<R>> Iterable<T>.lastMinBy(selector: (T) -> R): T? {
val iterator = iterator()
if (!iterator.hasNext()) return null
var minElem = iterator.next()
@ -34,3 +34,17 @@ public inline fun <T, R : Comparable<R>> Iterable<T>.lastMinBy(selector: (T) ->
}
return minElem
}
/**
* Call each for each item, and between between each items
*/
inline fun <T> Collection<T>.join(each: (T) -> Unit, between: (T) -> Unit) {
val lastIndex = size - 1
forEachIndexed { idx, t ->
each(t)
if (idx != lastIndex) {
between(t)
}
}
}

View File

@ -860,7 +860,7 @@ class RoomDetailFragment @Inject constructor(
}
override fun navToMemberProfile(userId: String): Boolean {
navigator.openRoomMemberProfile(userId, roomDetailArgs.roomId, vectorBaseActivity)
openRoomMemberProfile(userId)
return true
}
})
@ -997,7 +997,11 @@ class RoomDetailFragment @Inject constructor(
}
override fun onAvatarClicked(informationData: MessageInformationData) {
navigator.openRoomMemberProfile(userId = informationData.senderId, roomId = roomDetailArgs.roomId, context = requireActivity())
openRoomMemberProfile(informationData.senderId)
}
private fun openRoomMemberProfile(userId: String) {
navigator.openRoomMemberProfile(userId = userId, roomId = roomDetailArgs.roomId, context = requireActivity())
}
override fun onMemberNameClicked(informationData: MessageInformationData) {
@ -1048,6 +1052,9 @@ class RoomDetailFragment @Inject constructor(
private fun handleActions(action: EventSharedAction) {
when (action) {
is EventSharedAction.OpenUserProfile -> {
openRoomMemberProfile(action.senderId)
}
is EventSharedAction.AddReaction -> {
startActivityForResult(EmojiReactionPickerActivity.intent(requireContext(), action.eventId), REACTION_SELECT_REQUEST_CODE)
}

View File

@ -26,6 +26,9 @@ sealed class EventSharedAction(@StringRes val titleRes: Int, @DrawableRes val ic
object Separator :
EventSharedAction(0, 0)
data class OpenUserProfile(val senderId: String) :
EventSharedAction(0, 0)
data class AddReaction(val eventId: String) :
EventSharedAction(R.string.message_add_reaction, R.drawable.ic_add_reaction)

View File

@ -20,7 +20,11 @@ import com.airbnb.epoxy.TypedEpoxyController
import com.airbnb.mvrx.Success
import im.vector.riotx.EmojiCompatFontProvider
import im.vector.riotx.R
import im.vector.riotx.core.epoxy.bottomsheet.*
import im.vector.riotx.core.epoxy.bottomsheet.BottomSheetQuickReactionsItem
import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetActionItem
import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetMessagePreviewItem
import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetQuickReactionsItem
import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetSendStateItem
import im.vector.riotx.core.epoxy.dividerItem
import im.vector.riotx.core.resources.StringProvider
import im.vector.riotx.features.home.AvatarRenderer
@ -32,9 +36,11 @@ import javax.inject.Inject
/**
* Epoxy controller for message action list
*/
class MessageActionsEpoxyController @Inject constructor(private val stringProvider: StringProvider,
private val avatarRenderer: AvatarRenderer,
private val fontProvider: EmojiCompatFontProvider) : TypedEpoxyController<MessageActionState>() {
class MessageActionsEpoxyController @Inject constructor(
private val stringProvider: StringProvider,
private val avatarRenderer: AvatarRenderer,
private val fontProvider: EmojiCompatFontProvider
) : TypedEpoxyController<MessageActionState>() {
var listener: MessageActionsEpoxyControllerListener? = null
@ -47,6 +53,7 @@ class MessageActionsEpoxyController @Inject constructor(private val stringProvid
avatarRenderer(avatarRenderer)
matrixItem(state.informationData.matrixItem)
movementMethod(createLinkMovementMethod(listener))
userClicked { listener?.didSelectMenuAction(EventSharedAction.OpenUserProfile(state.informationData.senderId)) }
body(body.linkify(listener))
time(state.time())
}

View File

@ -43,7 +43,7 @@ class RoomListQuickActionsEpoxyController @Inject constructor(private val avatar
id("room_preview")
avatarRenderer(avatarRenderer)
matrixItem(roomSummary.toMatrixItem())
settingsClickListener(View.OnClickListener { listener?.didSelectMenuAction(RoomListQuickActionsSharedAction.Settings(roomSummary.roomId)) })
settingsClickListener { listener?.didSelectMenuAction(RoomListQuickActionsSharedAction.Settings(roomSummary.roomId)) }
}
// Notifications

View File

@ -21,11 +21,16 @@ import com.airbnb.epoxy.TypedEpoxyController
import im.vector.riotx.R
import im.vector.riotx.core.epoxy.profiles.buildProfileAction
import im.vector.riotx.core.epoxy.profiles.buildProfileSection
import im.vector.riotx.core.resources.ColorProvider
import im.vector.riotx.core.resources.StringProvider
import javax.inject.Inject
class RoomMemberProfileController @Inject constructor(private val stringProvider: StringProvider)
: TypedEpoxyController<RoomMemberProfileViewState>() {
class RoomMemberProfileController @Inject constructor(
private val stringProvider: StringProvider,
colorProvider: ColorProvider
) : TypedEpoxyController<RoomMemberProfileViewState>() {
private val dividerColor = colorProvider.getColorFromAttribute(R.attr.vctr_list_divider_color)
var callback: Callback? = null
@ -54,6 +59,7 @@ class RoomMemberProfileController @Inject constructor(private val stringProvider
buildProfileAction(
id = "ignore",
title = ignoreActionTitle,
dividerColor = dividerColor,
destructive = true,
editable = false,
divider = false,
@ -72,7 +78,9 @@ class RoomMemberProfileController @Inject constructor(private val stringProvider
buildProfileAction(
id = "learn_more",
title = stringProvider.getString(R.string.room_profile_section_security_learn_more),
dividerColor = dividerColor,
editable = false,
divider = false,
subtitle = stringProvider.getString(learnMoreSubtitle),
action = { callback?.onLearnMoreClicked() }
)
@ -84,6 +92,7 @@ class RoomMemberProfileController @Inject constructor(private val stringProvider
id = "read_receipt",
editable = false,
title = stringProvider.getString(R.string.room_member_jump_to_read_receipt),
dividerColor = dividerColor,
action = { callback?.onJumpToReadReceiptClicked() }
)
@ -92,6 +101,7 @@ class RoomMemberProfileController @Inject constructor(private val stringProvider
buildProfileAction(
id = "mention",
title = stringProvider.getString(R.string.room_participants_action_mention),
dividerColor = dividerColor,
editable = false,
divider = ignoreActionTitle != null,
action = { callback?.onMentionClicked() }
@ -100,6 +110,7 @@ class RoomMemberProfileController @Inject constructor(private val stringProvider
buildProfileAction(
id = "ignore",
title = ignoreActionTitle,
dividerColor = dividerColor,
destructive = true,
editable = false,
divider = false,

View File

@ -21,11 +21,16 @@ import com.airbnb.epoxy.TypedEpoxyController
import im.vector.riotx.R
import im.vector.riotx.core.epoxy.profiles.buildProfileAction
import im.vector.riotx.core.epoxy.profiles.buildProfileSection
import im.vector.riotx.core.resources.ColorProvider
import im.vector.riotx.core.resources.StringProvider
import javax.inject.Inject
class RoomProfileController @Inject constructor(private val stringProvider: StringProvider)
: TypedEpoxyController<RoomProfileViewState>() {
class RoomProfileController @Inject constructor(
private val stringProvider: StringProvider,
colorProvider: ColorProvider
) : TypedEpoxyController<RoomProfileViewState>() {
private val dividerColor = colorProvider.getColorFromAttribute(R.attr.vctr_list_divider_color)
var callback: Callback? = null
@ -53,6 +58,7 @@ class RoomProfileController @Inject constructor(private val stringProvider: Stri
buildProfileAction(
id = "learn_more",
title = stringProvider.getString(R.string.room_profile_section_security_learn_more),
dividerColor = dividerColor,
subtitle = stringProvider.getString(learnMoreSubtitle),
action = { callback?.onLearnMoreClicked() }
)
@ -62,12 +68,14 @@ class RoomProfileController @Inject constructor(private val stringProvider: Stri
buildProfileAction(
id = "settings",
title = stringProvider.getString(R.string.room_profile_section_more_settings),
dividerColor = dividerColor,
icon = R.drawable.ic_room_profile_settings,
action = { callback?.onSettingsClicked() }
)
buildProfileAction(
id = "notifications",
title = stringProvider.getString(R.string.room_profile_section_more_notifications),
dividerColor = dividerColor,
icon = R.drawable.ic_room_profile_notification,
action = { callback?.onNotificationsClicked() }
)
@ -75,18 +83,21 @@ class RoomProfileController @Inject constructor(private val stringProvider: Stri
buildProfileAction(
id = "member_list",
title = stringProvider.getQuantityString(R.plurals.room_profile_section_more_member_list, numberOfMembers, numberOfMembers),
dividerColor = dividerColor,
icon = R.drawable.ic_room_profile_member_list,
action = { callback?.onMemberListClicked() }
)
buildProfileAction(
id = "uploads",
title = stringProvider.getString(R.string.room_profile_section_more_uploads),
dividerColor = dividerColor,
icon = R.drawable.ic_room_profile_uploads,
action = { callback?.onUploadsClicked() }
)
buildProfileAction(
id = "leave",
title = stringProvider.getString(R.string.room_profile_section_more_leave),
dividerColor = dividerColor,
divider = false,
destructive = true,
editable = false,

View File

@ -19,20 +19,28 @@ package im.vector.riotx.features.roomprofile.members
import com.airbnb.epoxy.TypedEpoxyController
import im.vector.matrix.android.api.session.room.model.RoomMemberSummary
import im.vector.matrix.android.api.util.toMatrixItem
import im.vector.riotx.R
import im.vector.riotx.core.epoxy.dividerItem
import im.vector.riotx.core.epoxy.profiles.buildProfileSection
import im.vector.riotx.core.epoxy.profiles.profileMatrixItem
import im.vector.riotx.core.extensions.join
import im.vector.riotx.core.resources.ColorProvider
import im.vector.riotx.core.resources.StringProvider
import im.vector.riotx.features.home.AvatarRenderer
import javax.inject.Inject
class RoomMemberListController @Inject constructor(private val avatarRenderer: AvatarRenderer,
private val stringProvider: StringProvider) : TypedEpoxyController<RoomMemberListViewState>() {
class RoomMemberListController @Inject constructor(
private val avatarRenderer: AvatarRenderer,
private val stringProvider: StringProvider,
colorProvider: ColorProvider
) : TypedEpoxyController<RoomMemberListViewState>() {
interface Callback {
fun onRoomMemberClicked(roomMember: RoomMemberSummary)
}
private val dividerColor = colorProvider.getColorFromAttribute(R.attr.vctr_list_divider_color)
var callback: Callback? = null
init {
@ -48,20 +56,24 @@ class RoomMemberListController @Inject constructor(private val avatarRenderer: A
buildProfileSection(
stringProvider.getString(powerLevelCategory.titleRes)
)
roomMemberList.forEach { roomMember ->
profileMatrixItem {
id(roomMember.userId)
matrixItem(roomMember.toMatrixItem())
avatarRenderer(avatarRenderer)
clickListener { _ ->
callback?.onRoomMemberClicked(roomMember)
roomMemberList.join(
each = { roomMember ->
profileMatrixItem {
id(roomMember.userId)
matrixItem(roomMember.toMatrixItem())
avatarRenderer(avatarRenderer)
clickListener { _ ->
callback?.onRoomMemberClicked(roomMember)
}
}
},
between = { roomMemberBefore ->
dividerItem {
id("divider_${roomMemberBefore.userId}")
color(dividerColor)
}
}
}
dividerItem {
id("divider_${roomMember.userId}")
}
}
)
}
}
}

View File

@ -111,7 +111,7 @@ class RoomMemberListViewModel @AssistedInject constructor(@Assisted initialState
}
}
return mapOf(
return listOf(
PowerLevelCategory.ADMIN to admins,
PowerLevelCategory.MODERATOR to moderators,
PowerLevelCategory.CUSTOM to customs,

View File

@ -34,7 +34,7 @@ data class RoomMemberListViewState(
constructor(args: RoomProfileArgs) : this(roomId = args.roomId)
}
typealias RoomMemberSummaries = Map<PowerLevelCategory, List<RoomMemberSummary>>
typealias RoomMemberSummaries = List<Pair<PowerLevelCategory, List<RoomMemberSummary>>>
enum class PowerLevelCategory(@StringRes val titleRes: Int) {
ADMIN(R.string.room_member_power_level_admins),

View File

@ -1,19 +1,3 @@
<!--
~ 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="24dp"
@ -24,7 +8,7 @@
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#61708B"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
<path
android:pathData="M9,11C11.2091,11 13,9.2091 13,7C13,4.7909 11.2091,3 9,3C6.7909,3 5,4.7909 5,7C5,9.2091 6.7909,11 9,11Z"
@ -32,20 +16,20 @@
android:strokeWidth="2"
android:fillColor="#00000000"
android:fillType="evenOdd"
android:strokeColor="#61708B"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
<path
android:pathData="M23,21V19C22.9986,17.1771 21.765,15.5857 20,15.13"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#61708B"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
<path
android:pathData="M16,3.13C17.7699,3.5832 19.0078,5.178 19.0078,7.005C19.0078,8.832 17.7699,10.4268 16,10.88"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#61708B"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
</vector>

View File

@ -1,19 +1,3 @@
<!--
~ 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="24dp"
@ -21,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M2,16C1.4477,16 1,16.4477 1,17C1,17.5523 1.4477,18 2,18V16ZM5,9H4H5ZM19,9H20H19ZM13.73,21L14.595,21.5018C14.7744,21.1924 14.775,20.8108 14.5965,20.5009C14.418,20.191 14.0876,20 13.73,20V21ZM10.27,21V20C9.9124,20 9.582,20.191 9.4035,20.5009C9.225,20.8108 9.2255,21.1924 9.405,21.5018L10.27,21ZM22,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.9965ZM10.27,22H13.73V20H10.27V22Z"
android:fillColor="#61708B"/>
android:fillColor="#000000"/>
</vector>

View File

@ -1,30 +1,22 @@
<!--
~ 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="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,15C13.6569,15 15,13.6569 15,12C15,10.3431 13.6569,9 12,9C10.3431,9 9,10.3431 9,12C9,13.6569 10.3431,15 12,15Z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:fillType="evenOdd"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
<path
android:pathData="M19.4,15C19.1277,15.6171 19.2583,16.3378 19.73,16.82L19.79,16.88C20.1656,17.2551 20.3766,17.7642 20.3766,18.295C20.3766,18.8258 20.1656,19.3349 19.79,19.71C19.4149,20.0856 18.9058,20.2966 18.375,20.2966C17.8442,20.2966 17.3351,20.0856 16.96,19.71L16.9,19.65C16.4178,19.1783 15.6971,19.0477 15.08,19.32C14.4755,19.5791 14.0826,20.1724 14.08,20.83V21C14.08,22.1046 13.1846,23 12.08,23C10.9754,23 10.08,22.1046 10.08,21V20.91C10.0642,20.2327 9.6359,19.6339 9,19.4C8.3829,19.1277 7.6622,19.2583 7.18,19.73L7.12,19.79C6.7449,20.1656 6.2358,20.3766 5.705,20.3766C5.1742,20.3766 4.6651,20.1656 4.29,19.79C3.9144,19.4149 3.7034,18.9058 3.7034,18.375C3.7034,17.8442 3.9144,17.3351 4.29,16.96L4.35,16.9C4.8217,16.4178 4.9524,15.6971 4.68,15.08C4.4209,14.4755 3.8276,14.0826 3.17,14.08H3C1.8954,14.08 1,13.1846 1,12.08C1,10.9754 1.8954,10.08 3,10.08H3.09C3.7673,10.0642 4.3661,9.6359 4.6,9C4.8724,8.3829 4.7417,7.6622 4.27,7.18L4.21,7.12C3.8345,6.7449 3.6234,6.2358 3.6234,5.705C3.6234,5.1742 3.8345,4.6651 4.21,4.29C4.5851,3.9144 5.0942,3.7034 5.625,3.7034C6.1558,3.7034 6.6649,3.9144 7.04,4.29L7.1,4.35C7.5822,4.8217 8.3029,4.9524 8.92,4.68H9C9.6045,4.4209 9.9974,3.8276 10,3.17V3C10,1.8954 10.8954,1 12,1C13.1046,1 14,1.8954 14,3V3.09C14.0026,3.7476 14.3955,4.3409 15,4.6C15.6171,4.8724 16.3378,4.7417 16.82,4.27L16.88,4.21C17.2551,3.8345 17.7642,3.6234 18.295,3.6234C18.8258,3.6234 19.3349,3.8345 19.71,4.21C20.0856,4.5851 20.2966,5.0942 20.2966,5.625C20.2966,6.1558 20.0856,6.6649 19.71,7.04L19.65,7.1C19.1783,7.5822 19.0477,8.3029 19.32,8.92V9C19.5791,9.6045 20.1724,9.9974 20.83,10H21C22.1046,10 23,10.8954 23,12C23,13.1046 22.1046,14 21,14H20.91C20.2524,14.0026 19.6591,14.3955 19.4,15Z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:fillType="evenOdd"
android:strokeColor="#61708B"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
</vector>

View File

@ -1,19 +1,3 @@
<!--
~ 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="24dp"
@ -25,13 +9,13 @@
android:strokeWidth="2"
android:fillColor="#00000000"
android:fillType="evenOdd"
android:strokeColor="#61708B"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
<path
android:pathData="M13,2V9H20"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#61708B"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
</vector>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10dp" />
<solid android:color="?vctr_list_divider_color" />
<solid android:color="?vctr_redacted_message_color" />
</shape>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/quickReactTopDivider"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/vctr_list_divider_color" />
android:background="?attr/vctr_list_bottom_sheet_divider_color"
tools:layout_height="100dp" />

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
@ -26,7 +25,8 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_room_profile_notification" />
tools:src="@drawable/ic_room_profile_notification"
tools:visibility="visible" />
<TextView
android:id="@+id/actionTitle"
@ -39,14 +39,14 @@
android:maxLines="2"
android:textColor="?riotx_text_primary"
android:textSize="16sp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toTopOf="@+id/actionSubtitle"
app:layout_constraintEnd_toStartOf="@+id/actionEditable"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@id/actionIcon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constrainedWidth="true"
app:layout_goneMarginStart="0dp"
tools:text="Learn more" />
tools:text="@string/room_profile_section_security_learn_more" />
<TextView
android:id="@+id/actionSubtitle"
@ -59,15 +59,14 @@
android:maxLines="2"
android:textColor="?riotx_text_secondary"
android:textSize="12sp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/actionEditable"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@id/actionIcon"
app:layout_constraintTop_toBottomOf="@id/actionTitle"
app:layout_constrainedWidth="true"
app:layout_goneMarginStart="0dp"
tools:text="Messages in this room are not end-to-end encrypted" />
tools:text="@string/room_profile_encrypted_subtitle" />
<ImageView
android:id="@+id/actionEditable"
@ -81,5 +80,4 @@
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<im.vector.riotx.core.platform.StateView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/memberProfileStateView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/memberProfileStateView"
android:background="?riotx_background"
android:padding="16dp">
@ -28,7 +27,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/Vector.Toolbar.Title"
android:textSize="20sp"
android:textStyle="bold"
@ -41,7 +39,6 @@
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:singleLine="true"
android:textAppearance="@style/Vector.Toolbar.Title"
android:textSize="14sp"
android:textStyle="bold"
@ -69,7 +66,9 @@
android:gravity="center"
android:textSize="14sp"
android:visibility="gone"
tools:text="Here is a room topic, it can be multi-line but should always be displayed in full 🍱" />
tools:text="Here is a profile status"
tools:visibility="visible" />
</LinearLayout>
</im.vector.riotx.core.platform.StateView>

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?riotx_background"
android:padding="16dp"
android:orientation="vertical">
android:orientation="vertical"
android:padding="16dp">
<ImageView
android:id="@+id/roomProfileAvatarView"
@ -22,11 +21,10 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/Vector.Toolbar.Title"
android:textSize="20sp"
android:textStyle="bold"
tools:text="Random" />
tools:text="@sample/matrix.json/data/roomName" />
<TextView
android:id="@+id/roomProfileAliasView"
@ -39,7 +37,7 @@
android:textAppearance="@style/Vector.Toolbar.Title"
android:textSize="14sp"
android:textStyle="bold"
tools:text="#random:matrix.org" />
tools:text="@sample/matrix.json/data/roomAlias" />
<TextView
android:id="@+id/roomProfileTopicView"
@ -48,10 +46,11 @@
android:layout_gravity="center_horizontal"
android:layout_marginStart="40dp"
android:layout_marginEnd="40dp"
android:autoLink="web"
android:fontFamily="sans-serif"
android:gravity="center"
android:textSize="14sp"
android:textStyle="normal"
tools:text="Here is a room topic, it can be multi-line but should always be displayed in full 🍱" />
tools:text="@sample/matrix.json/data/roomTopic" />
</LinearLayout>

View File

@ -46,8 +46,11 @@
<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" />
<!-- gradient on the bottom of some activities -->
<attr name="vctr_activity_bottom_gradient_color" format="color" />

View File

@ -34,5 +34,11 @@
<string name="unignore">Unignore</string>
<!-- Title for category in the settings which affect what is displayed in the timeline (ex: show read receipts, etc.) -->
<string name="settings_category_timeline">Timeline</string>
<!-- Title for category in the settings which affect the behavior of the message editor (ex: enable Markdown, send typing notification, etc.) -->
<string name="settings_category_composer">Message editor</string>
</resources>

View File

@ -70,7 +70,11 @@
<item name="vctr_tab_home">@color/primary_color_black</item>
<!--Header/Panel Text Secondary-->
<item name="vctr_tab_home_secondary">@color/primary_color_dark_black</item>
<item name="vctr_list_divider_color">@color/list_divider_color_black</item>
<item name="vctr_list_bottom_sheet_divider_color">@color/list_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>
<item name="vctr_markdown_block_background_color">#FF4D4D4D</item>

View File

@ -121,7 +121,10 @@
<!--Header/Panel Text Secondary-->
<item name="vctr_list_header_secondary_text_color">#FFC8C8CD</item>
<item name="vctr_list_divider_color">@color/list_divider_color_dark</item>
<item name="vctr_list_bottom_sheet_divider_color">@color/list_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>
<!-- gradient on the home bottom -->
<item name="vctr_activity_bottom_gradient_color">#80000000</item>

View File

@ -121,7 +121,10 @@
<!--Header/Panel Text Secondary-->
<item name="vctr_list_header_secondary_text_color">#FFC8C8CD</item>
<item name="vctr_list_divider_color">@color/list_divider_color_light</item>
<item name="vctr_list_bottom_sheet_divider_color">@color/list_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>
<!-- gradient on the home bottom -->
<item name="vctr_activity_bottom_gradient_color">#80ffffff</item>

View File

@ -71,8 +71,6 @@
<item name="vctr_list_header_primary_text_color">#7F3C3C3C</item>
<item name="vctr_list_header_secondary_text_color">#4D3C3C3C</item>
<item name="vctr_list_divider_color">@color/list_divider_color_light</item>
<!-- gradient on the home bottom -->
<item name="vctr_activity_bottom_gradient_color">#80ffffff</item>

View File

@ -2,7 +2,6 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<im.vector.riotx.core.preference.VectorPreferenceCategory
android:key="SETTINGS_USER_INTERFACE_KEY"
android:title="@string/settings_user_interface">
@ -26,12 +25,15 @@
android:key="SETTINGS_INTERFACE_TEXT_SIZE_KEY"
android:title="@string/font_size" />
</im.vector.riotx.core.preference.VectorPreferenceCategory>
<im.vector.riotx.core.preference.VectorPreferenceCategory android:title="@string/settings_category_composer">
<im.vector.riotx.core.preference.VectorSwitchPreference
android:defaultValue="true"
android:key="SETTINGS_SHOW_URL_PREVIEW_KEY"
android:summary="@string/settings_inline_url_preview_summary"
android:title="@string/settings_inline_url_preview"
app:isPreferenceVisible="@bool/false_not_implemented" />
android:defaultValue="false"
android:key="SETTINGS_ENABLE_MARKDOWN_KEY"
android:summary="@string/settings_send_markdown_summary"
android:title="@string/settings_send_markdown" />
<im.vector.riotx.core.preference.VectorSwitchPreference
android:defaultValue="true"
@ -39,11 +41,16 @@
android:summary="@string/settings_send_typing_notifs_summary"
android:title="@string/settings_send_typing_notifs" />
</im.vector.riotx.core.preference.VectorPreferenceCategory>
<im.vector.riotx.core.preference.VectorPreferenceCategory android:title="@string/settings_category_timeline">
<im.vector.riotx.core.preference.VectorSwitchPreference
android:defaultValue="false"
android:key="SETTINGS_ENABLE_MARKDOWN_KEY"
android:summary="@string/settings_send_markdown_summary"
android:title="@string/settings_send_markdown" />
android:defaultValue="true"
android:key="SETTINGS_SHOW_URL_PREVIEW_KEY"
android:summary="@string/settings_inline_url_preview_summary"
android:title="@string/settings_inline_url_preview"
app:isPreferenceVisible="@bool/false_not_implemented" />
<im.vector.riotx.core.preference.VectorSwitchPreference
android:key="SETTINGS_ALWAYS_SHOW_TIMESTAMPS_KEY"
@ -59,8 +66,7 @@
android:defaultValue="true"
android:key="SETTINGS_SHOW_READ_RECEIPTS_KEY"
android:summary="@string/settings_show_read_receipts_summary"
android:title="@string/settings_show_read_receipts"
app:isPreferenceVisible="@bool/false_not_implemented" />
android:title="@string/settings_show_read_receipts" />
<im.vector.riotx.core.preference.VectorSwitchPreference
android:defaultValue="true"