chore: readd all the new bottom sheet code

This commit is contained in:
LucasGGamerM
2024-03-04 16:29:57 -03:00
parent 0d7e10ca8a
commit 71dd974d19
21 changed files with 1075 additions and 36 deletions

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<org.joinmastodon.android.ui.views.CustomScrollView 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_bottom_sheet"
android:outlineProvider="background"
android:elevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:id="@+id/sheet_handle"
android:layout_width="match_parent"
android:layout_height="36dp"
android:background="@drawable/bg_bottom_sheet_handle"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:background="@drawable/white_circle"
android:backgroundTint="?colorM3SecondaryContainer"
android:scaleType="center"
android:tint="?colorM3OnSecondaryContainer"
android:src="@drawable/ic_badge_24px"
android:importantForAccessibility="no"/>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_large"
android:fontFamily="sans-serif"
android:textColor="?colorM3OnSurface"
android:text="@string/handle_help_title"/>
</LinearLayout>
<LinearLayout
android:id="@+id/handle_wrap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:layout_marginHorizontal="16dp"
android:orientation="vertical"
android:background="@drawable/bg_handle_help"
android:clipChildren="false"
android:clipToPadding="false"
android:padding="12dp">
<TextView
android:id="@+id/handle_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_label_small"
android:textColor="?colorM3OnSurfaceVariant"
android:alpha="0.6"
tools:text="@string/handle_title"/>
<org.joinmastodon.android.ui.views.RippleAnimationTextView
android:id="@+id/handle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textAppearance="@style/m3_body_large"
android:textColor="?colorM3OnSurface"
tools:text="\@Gargron@mastodon.social"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/username_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:layout_marginBottom="16dp">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:importantForAccessibility="no"
android:scaleType="center"
android:tint="?colorM3Primary"
android:src="@drawable/ic_fluent_mention_24_regular"/>
<TextView
android:id="@+id/username_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:textAppearance="@style/m3_title_medium"
android:textColor="?colorM3OnSurface"
android:text="@string/username"/>
<TextView
android:id="@+id/username_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:layout_below="@id/username_title"
android:textAppearance="@style/m3_body_small"
android:textColor="?colorM3OnSurfaceVariant"
tools:text="@string/handle_username_explanation"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/server_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:layout_marginBottom="16dp">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:importantForAccessibility="no"
android:scaleType="center"
android:tint="?colorM3Primary"
android:src="@drawable/ic_fluent_earth_24_regular"/>
<TextView
android:id="@+id/server_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:textAppearance="@style/m3_title_medium"
android:textColor="?colorM3OnSurface"
android:text="@string/server"/>
<TextView
android:id="@+id/server_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:layout_below="@id/server_title"
android:textAppearance="@style/m3_body_small"
android:textColor="?colorM3OnSurfaceVariant"
tools:text="@string/handle_server_explanation"/>
</RelativeLayout>
<org.joinmastodon.android.ui.views.LinkedTextView
android:id="@+id/handle_explanation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginBottom="16dp"
android:textAppearance="@style/m3_body_medium"
android:textColor="?colorM3OnSurfaceVariant"
tools:text="@string/handle_explanation"/>
<Button
android:id="@+id/btn_cancel"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:layout_marginHorizontal="16dp"
style="@style/Widget.Mastodon.M3.Button.Filled"
android:text="@string/got_it"/>
</LinearLayout>
</org.joinmastodon.android.ui.views.CustomScrollView>

View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<org.joinmastodon.android.ui.views.CustomScrollView 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_bottom_sheet"
android:outlineProvider="background"
android:elevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp">
<View
android:id="@+id/handle"
android:layout_width="match_parent"
android:layout_height="36dp"
android:background="@drawable/bg_bottom_sheet_handle"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:layout_centerVertical="true"
android:background="@drawable/white_circle"
android:backgroundTint="?colorM3SecondaryContainer"
android:scaleType="center"
android:tint="?colorM3OnSecondaryContainer"
tools:src="@drawable/ic_waving_hand_24px"
android:importantForAccessibility="no"/>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:textAppearance="@style/m3_title_large"
android:fontFamily="sans-serif"
android:textColor="?colorM3OnSurface"
tools:text="@string/mute_user_confirm_title"/>
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon"
android:layout_below="@id/title"
android:textAppearance="@style/m3_body_medium"
android:textColor="?colorM3OnSurfaceVariant"
tools:text="\@username"/>
</RelativeLayout>
<LinearLayout
android:id="@+id/content_wrap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="32dp"
android:orientation="vertical"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<org.joinmastodon.android.ui.views.ProgressBarButton
android:id="@+id/btn_confirm"
android:layout_width="match_parent"
android:layout_height="40dp"
style="@style/Widget.Mastodon.M3.Button.Filled"
app:progressBar="@id/confirm_progress"
tools:text="@string/got_it"/>
<ProgressBar
android:id="@+id/confirm_progress"
style="?android:progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:elevation="10dp"
android:indeterminate="true"
android:outlineProvider="none"
android:visibility="gone"
tools:visibility="visible"/>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<org.joinmastodon.android.ui.views.ProgressBarButton
android:id="@+id/btn_secondary"
android:layout_width="match_parent"
android:layout_height="40dp"
style="@style/Widget.Mastodon.M3.Button.Tonal"
app:progressBar="@id/secondary_progress"
tools:text="@string/got_it"/>
<ProgressBar
android:id="@+id/secondary_progress"
style="?android:progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:elevation="10dp"
android:indeterminate="true"
android:outlineProvider="none"
android:visibility="gone"
tools:visibility="visible"/>
</FrameLayout>
<Button
android:id="@+id/btn_cancel"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
style="@style/Widget.Mastodon.M3.Button.Text"
android:text="@string/cancel"/>
</LinearLayout>
</org.joinmastodon.android.ui.views.CustomScrollView>