forked from GitHub-Mirror/riotX-android
Get Public rooms and join public room
This commit is contained in:
13
vector/src/main/res/drawable/ic_plus_circle.xml
Normal file
13
vector/src/main/res/drawable/ic_plus_circle.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector android:height="24dp" android:viewportHeight="22"
|
||||
android:viewportWidth="22" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#00000000" android:fillType="evenOdd"
|
||||
android:pathData="M11,11m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"
|
||||
android:strokeColor="#03B381" android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" android:strokeWidth="1.4"/>
|
||||
<path android:fillColor="#00000000" android:fillType="evenOdd"
|
||||
android:pathData="M11,7L11,15" android:strokeColor="#03B381"
|
||||
android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="1.4"/>
|
||||
<path android:fillColor="#00000000" android:fillType="evenOdd"
|
||||
android:pathData="M7,11L15,11" android:strokeColor="#03B381"
|
||||
android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="1.4"/>
|
||||
</vector>
|
9
vector/src/main/res/drawable/ic_tick.xml
Normal file
9
vector/src/main/res/drawable/ic_tick.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector android:height="24dp" android:viewportHeight="11"
|
||||
android:viewportWidth="15" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#00000000" android:fillType="evenOdd"
|
||||
android:pathData="M5.3033,10.0815L13.7886,1.5962"
|
||||
android:strokeColor="#7E899C" android:strokeLineCap="round" android:strokeWidth="1.3"/>
|
||||
<path android:fillColor="#00000000" android:fillType="evenOdd"
|
||||
android:pathData="M5.3033,10.0815L1.0607,5.8388"
|
||||
android:strokeColor="#7E899C" android:strokeLineCap="round" android:strokeWidth="1.3"/>
|
||||
</vector>
|
11
vector/src/main/res/drawable/ic_user.xml
Normal file
11
vector/src/main/res/drawable/ic_user.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<vector android:height="24dp" android:viewportHeight="16"
|
||||
android:viewportWidth="15" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#00000000" android:fillType="evenOdd"
|
||||
android:pathData="M14,15L14,13.4444C14,11.7262 12.5449,10.3333 10.75,10.3333L4.25,10.3333C2.4551,10.3333 1,11.7262 1,13.4444L1,15"
|
||||
android:strokeColor="#7E899C" android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" android:strokeWidth="1.16666667"/>
|
||||
<path android:fillColor="#00000000" android:fillType="evenOdd"
|
||||
android:pathData="M4.25,4.1111a3.25,3.1111 0,1 0,6.5 0a3.25,3.1111 0,1 0,-6.5 0z"
|
||||
android:strokeColor="#7E899C" android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" android:strokeWidth="1.16666667"/>
|
||||
</vector>
|
5
vector/src/main/res/layout/activity_simple.xml
Normal file
5
vector/src/main/res/layout/activity_simple.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/simpleFragmentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
65
vector/src/main/res/layout/fragment_room_directory.xml
Normal file
65
vector/src/main/res/layout/fragment_room_directory.xml
Normal file
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/pale_grey">
|
||||
|
||||
<com.airbnb.epoxy.EpoxyRecyclerView
|
||||
android:id="@+id/roomDirectoryList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:listitem="@layout/item_room_directory" />
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:expandedTitleGravity="top"
|
||||
app:layout_scrollFlags="scroll|enterAlways|exitUntilCollapsed|snap">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/roomDirectoryFilter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/layout_horizontal_margin"
|
||||
android:layout_marginRight="@dimen/layout_horizontal_margin"
|
||||
android:hint="@string/home_filter_placeholder_rooms" />
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<Button
|
||||
android:id="@+id/createNewRoom"
|
||||
style="@style/VectorButtonStyleFlat"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:drawableStart="@drawable/ic_plus_circle"
|
||||
android:drawableLeft="@drawable/ic_plus_circle"
|
||||
android:drawablePadding="13dp"
|
||||
android:text="@string/create_new_room" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
30
vector/src/main/res/layout/item_error_retry.xml
Normal file
30
vector/src/main/res/layout/item_error_retry.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<?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/progressBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/itemErrorRetryText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Error" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/itemErrorRetryButton"
|
||||
style="@style/VectorButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="@string/global_retry"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/itemErrorRetryText" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
8
vector/src/main/res/layout/item_no_result.xml
Normal file
8
vector/src/main/res/layout/item_no_result.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/itemNoResultText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:text="@string/no_result_placeholder" />
|
105
vector/src/main/res/layout/item_room_directory.xml
Normal file
105
vector/src/main/res/layout/item_room_directory.xml
Normal file
@ -0,0 +1,105 @@
|
||||
<?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/itemRoomDirectoryLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_room_item"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/itemRoomDirectoryAvatar"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/itemRoomDirectoryBottomSeparator"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/itemRoomDirectoryName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:textColor="#2E2F3E"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@+id/itemRoomDirectoryBottomSeparator"
|
||||
app:layout_constraintEnd_toStartOf="@id/itemRoomDirectoryMembersCount"
|
||||
app:layout_constraintStart_toEndOf="@id/itemRoomDirectoryAvatar"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/itemRoomDirectoryMembersCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:drawableStart="@drawable/ic_user"
|
||||
android:drawableLeft="@drawable/ic_user"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:minWidth="40dp"
|
||||
android:textColor="#7E899C"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/itemRoomDirectoryBottomSeparator"
|
||||
app:layout_constraintEnd_toStartOf="@id/itemRoomDirectoryJoin"
|
||||
app:layout_constraintStart_toEndOf="@id/itemRoomDirectoryName"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="148" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/itemRoomDirectoryJoin"
|
||||
style="@style/VectorButtonStyleFlat"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/join"
|
||||
app:layout_constraintBottom_toTopOf="@+id/itemRoomDirectoryBottomSeparator"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/itemRoomDirectoryJoined"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_tick"
|
||||
app:layout_constraintBottom_toTopOf="@+id/itemRoomDirectoryBottomSeparator"
|
||||
app:layout_constraintEnd_toEndOf="@+id/itemRoomDirectoryJoin"
|
||||
app:layout_constraintStart_toStartOf="@+id/itemRoomDirectoryJoin"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/itemRoomDirectoryJoining"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="24dp"
|
||||
android:scaleType="center"
|
||||
app:layout_constraintBottom_toTopOf="@+id/itemRoomDirectoryBottomSeparator"
|
||||
app:layout_constraintEnd_toEndOf="@+id/itemRoomDirectoryJoin"
|
||||
app:layout_constraintStart_toStartOf="@+id/itemRoomDirectoryJoin"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/itemRoomDirectoryBottomSeparator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="#E9EDF1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -16,4 +16,9 @@
|
||||
android:id="@+id/tmp_menu_create_room"
|
||||
android:title="@string/room_recents_create_room" />
|
||||
|
||||
<!-- TODO Temporary code -->
|
||||
<item
|
||||
android:id="@+id/tmp_menu_open_room_directory"
|
||||
android:title="Open room directory" />
|
||||
|
||||
</menu>
|
@ -17,4 +17,7 @@
|
||||
<string name="event_redacted_by_admin_reason">Event moderated by room admin</string>
|
||||
<string name="last_edited_info_message">Last edited by %s on %s</string>
|
||||
|
||||
|
||||
<string name="create_new_room">Create New Room</string>
|
||||
|
||||
</resources>
|
Reference in New Issue
Block a user