Split sample step 3: rooms and spaces

This commit is contained in:
Benoit Marty 2021-05-10 23:07:08 +02:00
parent 2b632a2d52
commit 3a746cf23a
24 changed files with 74 additions and 91 deletions

View file

@ -1,40 +0,0 @@
{
"data": [
{
"roomName": "Matrix HQ",
"roomAlias": "#matrix:matrix.org",
"spaceName": "Runner's world",
"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."
},
{
"roomName": "Room name very loooooooong with some details",
"roomAlias": "#matrix:matrix.org",
"spaceName": "Matrix Org",
"roomTopic": "Room topic very loooooooong with some details"
},
{
"roomName": "Room name very loooooooong with some details",
"roomAlias": "#matrix:matrix.org",
"spaceName": "Rennes",
"roomTopic": "Room topic very loooooooong with some details"
},
{
"roomName": "Room name very loooooooong with some details",
"roomAlias": "#matrix:matrix.org",
"spaceName": "Est London",
"roomTopic": "Room topic very loooooooong with some details"
},
{
"roomName": "Room name very loooooooong with some details",
"roomAlias": "#matrix:matrix.org",
"spaceName": "Element HQ",
"roomTopic": "Room topic very loooooooong with some details"
},
{
"roomName": "Room name very loooooooong with some details",
"roomAlias": "#matrix:matrix.org",
"spaceName": "My Company",
"roomTopic": "Room topic very loooooooong with some details"
}
]
}

View file

@ -0,0 +1,14 @@
{
"data": [
{
"name": "Matrix HQ",
"alias": "#matrix:matrix.org",
"topic": "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."
},
{
"name": "Room name very loooooooong with some details",
"alias": "#matrix:matrix.org",
"topic": "Room topic very loooooooong with some details"
}
]
}

View file

@ -0,0 +1,28 @@
{
"data": [
{
"name": "Runner's world",
"topic": "Space about running around the world!"
},
{
"name": "Matrix Org",
"topic": "Space about matrix.org!"
},
{
"name": "Rennes",
"topic": "Venez visiter Rennes!"
},
{
"name": "Est London",
"topic": "All about Est London!"
},
{
"name": "Element HQ",
"topic": "All about Element!"
},
{
"name": "My Company",
"topic": "All about My company!"
}
]
}

View file

@ -43,7 +43,7 @@
app:layout_constraintStart_toEndOf="@id/spaceAvatarImageView"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@sample/users.json/data/displayName" />
tools:text="@sample/spaces.json/data/name" />
<TextView
android:id="@+id/spaceDescription"
@ -61,7 +61,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/spaceAvatarImageView"
app:layout_constraintTop_toBottomOf="@+id/spaceNameView"
tools:text="@sample/messages.json/data/message"
tools:text="@sample/spaces.json/data/topic"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -87,7 +87,7 @@
app:layout_constraintStart_toEndOf="@+id/matrixProfileToolbarAvatarImageView"
app:layout_constraintTop_toTopOf="parent"
tools:alpha="1"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -52,7 +52,7 @@
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@+id/matrixToCardAvatar"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
<TextView
android:id="@+id/matrixToCardAliasText"
@ -67,7 +67,8 @@
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/matrixToCardNameText"
app:layout_goneMarginTop="0dp"
tools:text="@sample/matrix.json/data/roomAlias" />
tools:text="@sample/rooms.json/data/alias"
tools:visibility="visible" />
<LinearLayout
android:id="@+id/matrixToMemberPills"
@ -117,7 +118,7 @@
android:textColor="?riotx_text_secondary"
android:textSize="15sp"
app:layout_constraintTop_toBottomOf="@id/matrixToMemberPills"
tools:text="@sample/matrix.json/data/roomTopic" />
tools:text="@sample/rooms.json/data/topic" />
<ImageView
android:id="@+id/knownMember5"

View file

@ -58,7 +58,7 @@
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/roomToolbarAvatarImageView"
app:layout_constraintTop_toTopOf="parent"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
<TextView
android:id="@+id/roomToolbarSubtitleView"
@ -75,7 +75,7 @@
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/roomToolbarAvatarImageView"
app:layout_constraintTop_toBottomOf="@+id/roomToolbarTitleView"
tools:text="@sample/matrix.json/data/roomTopic" />
tools:text="@sample/rooms.json/data/topic" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -93,7 +93,7 @@
android:textAppearance="@style/TextAppearance.Vector.Title"
android:textSize="15sp"
android:textStyle="bold"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
<TextView
android:id="@+id/roomPreviewNoPreviewTopic"
@ -104,7 +104,7 @@
android:gravity="center"
android:textAppearance="@style/TextAppearance.Vector.Subtitle"
android:textSize="15sp"
tools:text="@sample/matrix.json/data/roomTopic" />
tools:text="@sample/rooms.json/data/topic" />
<TextView
android:id="@+id/roomPreviewNoPreviewLabel"

View file

@ -57,7 +57,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/roomSettingsToolbarAvatarImageView"
app:layout_constraintTop_toTopOf="parent"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -62,7 +62,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/roomUploadsToolbarAvatarImageView"
app:layout_constraintTop_toTopOf="parent"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -63,7 +63,7 @@
android:maxLines="1"
android:textColor="?riotx_text_secondary"
android:textSize="16sp"
tools:text="@sample/matrix.json/data/spaceName" />
tools:text="@sample/spaces.json/data/name" />
</LinearLayout>

View file

@ -42,7 +42,7 @@
app:layout_constraintStart_toEndOf="@id/bottomSheetRoomPreviewAvatar"
app:layout_constraintTop_toTopOf="@id/bottomSheetRoomPreviewAvatar"
tools:fontFamily="sans-serif"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
<ImageView
android:id="@+id/bottomSheetRoomPreviewLowPriority"

View file

@ -20,7 +20,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:maxLines="2"
tools:text="@sample/matrix.json/data/roomTopic" />
tools:text="@sample/rooms.json/data/topic" />
<ImageView
android:id="@+id/expandableArrow"

View file

@ -39,7 +39,7 @@
app:layout_constraintStart_toEndOf="@id/itemPublicRoomAvatar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
<TextView
android:id="@+id/itemPublicRoomTopic"
@ -57,7 +57,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/itemPublicRoomName"
app:layout_constraintTop_toBottomOf="@+id/itemPublicRoomName"
tools:text="@sample/matrix.json/data/roomTopic"
tools:text="@sample/rooms.json/data/topic"
tools:visibility="visible" />
<TextView
@ -93,7 +93,7 @@
app:layout_constraintBaseline_toBaselineOf="@+id/itemPublicRoomMembersCount"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/itemPublicRoomMembersCount"
tools:text="@sample/matrix.json/data/roomAlias" />
tools:text="@sample/rooms.json/data/alias" />
<im.vector.app.core.platform.ButtonStateView
android:id="@+id/itemPublicRoomButtonState"

View file

@ -50,7 +50,7 @@
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/roomInvitationAvatarImageView"
app:layout_constraintTop_toTopOf="parent"
tools:text="@sample/users.json/data/displayName" />
tools:text="@sample/rooms.json/data/name" />
<TextView
android:id="@+id/roomInvitationSubTitle"
@ -64,7 +64,7 @@
app:layout_constraintEnd_toEndOf="@+id/roomInvitationNameView"
app:layout_constraintStart_toStartOf="@+id/roomInvitationNameView"
app:layout_constraintTop_toBottomOf="@+id/roomInvitationNameView"
tools:text="@sample/messages.json/data/message" />
tools:text="@sample/rooms.json/data/topic" />
<!-- Margin bottom does not work, so I use space -->
<Space

View file

@ -38,7 +38,7 @@
app:layout_constraintStart_toEndOf="@id/itemAddRoomRoomAvatar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
<ImageView
android:id="@+id/itemAddRoomRoomCheckBox"

View file

@ -1,7 +1,6 @@
<?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"
android:id="@+id/itemPublicRoomLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -28,29 +27,10 @@
android:layout_marginStart="17dp"
android:layout_marginEnd="40dp"
android:background="@drawable/rounded_rect_shape_8"
android:ellipsize="end"
android:maxLines="2"
android:textColor="?riotx_text_primary"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/itemAddRoomRoomAvatar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@sample/matrix.json/data/roomName" />
<!-- <ImageView-->
<!-- android:id="@+id/itemAddRoomRoomCheckBox"-->
<!-- android:layout_width="20dp"-->
<!-- android:layout_height="20dp"-->
<!-- android:layout_marginEnd="16dp"-->
<!-- android:importantForAccessibility="no"-->
<!-- android:src="@drawable/ic_checkbox_off"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toEndOf="@id/itemAddRoomRoomNameText"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
app:layout_constraintVertical_chainStyle="packed" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -57,7 +57,7 @@
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/childRoomAvatar"
app:layout_constraintTop_toTopOf="parent"
tools:text="@sample/matrix.json/data/spaceName" />
tools:text="@sample/rooms.json/data/name" />
<TextView
android:id="@+id/childRoomTopic"
@ -71,7 +71,7 @@
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="@+id/childRoomName"
app:layout_constraintTop_toBottomOf="@+id/childRoomName"
tools:text="@sample/matrix.json/data/roomTopic" />
tools:text="@sample/rooms.json/data/topic" />
<ImageView
android:id="@+id/spaceChildMemberCountIcon"

View file

@ -62,6 +62,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/childSpaceAvatar"
app:layout_constraintTop_toTopOf="parent"
tools:text="@sample/matrix.json/data/spaceName" />
tools:text="@sample/spaces.json/data/name" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -44,6 +44,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spaceSummaryMemberCountIcon"
tools:text="@sample/matrix.json/data/roomTopic" />
tools:text="@sample/spaces.json/data/topic" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -70,7 +70,7 @@
app:layout_constraintEnd_toStartOf="@id/joinSuggestedRoomButton"
app:layout_constraintStart_toStartOf="@+id/roomNameView"
app:layout_constraintTop_toBottomOf="@+id/roomNameView"
tools:text="@sample/messages.json/data/message" />
tools:text="@sample/rooms.json/data/topic" />
<com.google.android.material.button.MaterialButton
android:id="@+id/joinSuggestedRoomButton"

View file

@ -73,7 +73,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/creationTileRoomAvatarImageView"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
<TextView
android:id="@+id/roomNameDescriptionText"

View file

@ -39,7 +39,7 @@
app:layout_constraintStart_toEndOf="@id/itemUnknownRoomAvatar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
<View
android:id="@+id/itemPublicRoomBottomSeparator"

View file

@ -41,7 +41,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/roomProfileAvatarView"
tools:text="@sample/matrix.json/data/roomName" />
tools:text="@sample/rooms.json/data/name" />
<TextView
android:id="@+id/roomProfileAliasView"
@ -57,6 +57,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/roomProfileNameView"
tools:text="@sample/matrix.json/data/roomAlias" />
tools:text="@sample/rooms.json/data/alias" />
</androidx.constraintlayout.widget.ConstraintLayout>