mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 13:38:49 +03:00
Add bottom sheet layout.
This commit is contained in:
parent
453aa28380
commit
88de113a4e
2 changed files with 106 additions and 0 deletions
|
@ -0,0 +1,46 @@
|
|||
<?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="@drawable/bg_live_location_users_bottom_sheet">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragmentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/bottomSheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_live_location_users_bottom_sheet"
|
||||
app:behavior_peekHeight="200dp"
|
||||
app:behavior_hideable="false"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
|
||||
|
||||
<View
|
||||
android:id="@+id/bottomSheetHandle"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/ic_bottom_sheet_handle"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/bottomSheetRecyclerView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/bottomSheetHandle"
|
||||
tools:listitem="@layout/item_live_location_users_bottom_sheet" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -0,0 +1,60 @@
|
|||
<?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:layout_width="match_parent"
|
||||
android:layout_height="80dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/itemUserAvatarImageView"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@sample/user_round_avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/itemUserDisplayNameTextView"
|
||||
style="@style/TextAppearance.Vector.Body.BottomSheetDisplayName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintStart_toEndOf="@id/itemUserAvatarImageView"
|
||||
app:layout_constraintTop_toTopOf="@id/itemUserAvatarImageView"
|
||||
tools:text="@sample/live_location_users.json/data/displayName" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/itemRemainingTimeTextView"
|
||||
style="@style/TextAppearance.Vector.Body.BottomSheetRemainingTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
app:layout_constraintStart_toStartOf="@id/itemUserDisplayNameTextView"
|
||||
app:layout_constraintTop_toBottomOf="@id/itemUserDisplayNameTextView"
|
||||
tools:text="@sample/live_location_users.json/data/remainingTime" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/itemLastUpdatedAtTextView"
|
||||
style="@style/TextAppearance.Vector.Body.BottomSheetLastUpdatedAt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
app:layout_constraintStart_toStartOf="@id/itemRemainingTimeTextView"
|
||||
app:layout_constraintTop_toBottomOf="@id/itemRemainingTimeTextView"
|
||||
tools:text="@sample/live_location_users.json/data/lastUpdatedAt" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/itemStopSharingButton"
|
||||
style="@style/Widget.Vector.Button.Text.BottomSheetStopSharing"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="@string/live_location_bottom_sheet_stop_sharing"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in a new issue