Reporting M3 redesign

This commit is contained in:
Grishka
2023-05-22 17:08:04 +03:00
parent 34a2af8429
commit bd7157c172
75 changed files with 2371 additions and 488 deletions

View File

@@ -4,17 +4,15 @@
android:id="@+id/button_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:windowBackground"
android:outlineProvider="bounds"
android:elevation="3dp"
android:background="@drawable/bg_m3_bottom_bar"
tools:showIn="@layout/fragment_report_choice">
<Button
android:id="@+id/btn_next"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="40dp"
android:layout_margin="16dp"
style="?primaryLargeButtonStyle"
style="@style/Widget.Mastodon.M3.Button.Filled"
android:text="@string/next" />
</FrameLayout>

View File

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<org.joinmastodon.android.ui.views.CheckableRelativeLayout 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:paddingTop="16dp"
android:paddingRight="16dp"
android:paddingLeft="16dp"
android:clipToPadding="false">
<View
android:id="@+id/checkbox"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginStart="-4dp"
android:layout_marginTop="-8dp"
android:layout_marginEnd="12dp"
android:duplicateParentState="true"/>
<ImageView
android:id="@+id/more"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="-2dp"
android:layout_marginEnd="-2dp"
android:background="?android:selectableItemBackgroundBorderless"
android:scaleType="center"
android:tint="?colorM3OnSurfaceVariant"
android:contentDescription="@string/more_options"
android:src="@drawable/ic_more_vert_20px" />
<ImageView
android:id="@+id/avatar"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_toEndOf="@id/checkbox"
android:layout_marginTop="2dp"
android:layout_marginEnd="8dp" />
<org.joinmastodon.android.ui.views.HeaderSubtitleLinearLayout
android:id="@+id/name_wrap"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_toEndOf="@id/avatar"
android:layout_toStartOf="@id/more"
android:layout_marginEnd="8dp">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:ellipsize="end"
android:singleLine="true"
android:textAppearance="@style/m3_title_medium"
android:textColor="?colorM3OnSurface"
android:gravity="start|center_vertical"
tools:text="Eugen" />
<TextView
android:id="@+id/extra_text"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginStart="8dp"
android:ellipsize="end"
android:singleLine="true"
android:textAppearance="@style/m3_title_medium"
android:fontFamily="sans-serif"
android:textAlignment="viewStart"
android:textColor="?colorM3OnSurface"
tools:text="boosted your cat picture" />
</org.joinmastodon.android.ui.views.HeaderSubtitleLinearLayout>
<TextView
android:id="@+id/time_and_username"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_below="@id/name_wrap"
android:layout_toEndOf="@id/avatar"
android:singleLine="true"
android:ellipsize="end"
android:textAppearance="@style/m3_title_small"
android:gravity="center_vertical"
android:textColor="?colorM3OnSurfaceVariant"
tools:text="9h ago · \@Gargron@mastodon.social"/>
</org.joinmastodon.android.ui.views.CheckableRelativeLayout>

View File

@@ -3,13 +3,22 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/top_progress"
android:layout_width="match_parent"
android:layout_height="4dp"
android:indeterminate="false"
android:indeterminateOnly="false"
android:max="100"
android:progressDrawable="@drawable/m3_progress"/>
<me.grishka.appkit.views.UsableRecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="?android:colorBackground"/>
android:background="?colorM3Surface"/>
<include layout="@layout/button_bar_one" />

View File

@@ -1,9 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/top_progress"
android:layout_width="match_parent"
android:layout_height="4dp"
android:indeterminate="false"
android:indeterminateOnly="false"
android:max="100"
android:progressDrawable="@drawable/m3_progress"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
@@ -16,20 +27,74 @@
<include layout="@layout/item_list_header"/>
<EditText
android:id="@+id/text"
<org.joinmastodon.android.ui.views.FloatingHintEditTextLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:hint="@string/report_comment_hint"
android:inputType="textMultiLine|textCapSentences"
android:gravity="top|start"
android:minHeight="212dp"/>
android:paddingTop="4dp"
android:paddingBottom="12dp"
app:labelTextColor="@color/m3_outlined_text_field_label"
android:foreground="@drawable/bg_m3_outlined_text_field">
<EditText
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
android:padding="16dp"
android:background="@null"
android:elevation="0dp"
android:inputType="textMultiLine|textCapSentences"
android:hint="@string/report_comment_hint"/>
</org.joinmastodon.android.ui.views.FloatingHintEditTextLayout>
<RelativeLayout
android:id="@+id/forward_report"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp"
android:background="?android:selectableItemBackground">
<org.joinmastodon.android.ui.views.M3Switch
android:id="@+id/forward_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginStart="16dp"
android:checked="true"/>
<TextView
android:id="@+id/forward_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toStartOf="@id/forward_switch"
android:textAppearance="@style/m3_body_large"
android:textColor="?colorM3OnSurface"
android:minHeight="24dp"
android:gravity="center_vertical"
tools:text="Forward to %s"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/forward_title"
android:layout_alignLeft="@id/forward_title"
android:layout_alignRight="@id/forward_title"
android:textAppearance="@style/m3_body_medium"
android:textColor="?colorM3OnSurfaceVariant"
android:text="@string/forward_report_explanation"/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
<include layout="@layout/button_bar_two"/>
<include layout="@layout/button_bar_one"/>
</LinearLayout>

View File

@@ -5,6 +5,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/top_progress"
android:layout_width="match_parent"
android:layout_height="4dp"
android:indeterminate="false"
android:indeterminateOnly="false"
android:max="100"
android:progress="100"
android:progressDrawable="@drawable/m3_progress"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
@@ -20,110 +30,162 @@
android:clipToPadding="false"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:textAppearance="@style/m3_headline_medium"
android:minHeight="36dp"
android:gravity="center_vertical"
tools:text="Title"/>
<FrameLayout
android:id="@+id/ava_reported"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:layout_marginBottom="24dp"
android:layout_marginHorizontal="-16dp"
android:paddingHorizontal="16dp"
android:layout_marginTop="-32dp"
android:paddingTop="32dp"
android:clipToPadding="false">
<ImageView
android:id="@+id/avatar"
android:layout_width="104dp"
android:layout_height="104dp"
android:layout_width="96dp"
android:layout_height="96dp"
android:layout_gravity="center_horizontal"
android:importantForAccessibility="no"
tools:src="#0f0"/>
<View
android:id="@+id/reported_overlay"
android:layout_width="205dp"
android:layout_height="69dp"
<TextView
android:id="@+id/reported_stamp"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_gravity="center"
android:elevation="2dp"
android:background="@drawable/reported_overlay"/>
android:background="@drawable/bg_reported_stamp"
android:elevation="1dp"
android:gravity="center"
android:includeFontPadding="false"
android:outlineProvider="background"
android:paddingHorizontal="12dp"
android:rotation="-10"
android:text="@string/reported"
android:textAllCaps="true"
android:textColor="?colorM3OnPrimaryContainer"
android:fontFamily="sans-serif-condensed"
android:textStyle="bold"
android:letterSpacing="-0.03"
android:singleLine="true"
android:maxWidth="300dp"
android:textSize="28dp" />
</FrameLayout>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:textAppearance="@style/m3_headline_medium"
android:minHeight="36dp"
android:gravity="center_vertical"
android:textColor="?colorM3OnSurface"
tools:text="Title"/>
<TextView
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:textAppearance="@style/m3_title_medium"
android:textColor="?android:textColorSecondary"
android:textColor="?colorM3OnSurfaceVariant"
android:minHeight="24dp"
android:gravity="center_vertical"
tools:text="Subtitle"/>
<TextView
android:id="@+id/unfollow_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:textAppearance="@style/m3_title_medium"
tools:text="@string/unfollow_user"/>
<Button
<FrameLayout
android:id="@+id/unfollow_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
style="?secondaryLargeButtonStyle"
android:text="@string/unfollow"/>
android:layout_height="40dp"
android:background="@drawable/bg_button_m3_outlined">
<TextView
android:id="@+id/unfollow_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@null"
android:foreground="@null"
android:drawablePadding="8dp"
android:clickable="false"
android:focusable="false"
tools:text="@string/unfollow_user"
android:duplicateParentState="true"
style="@style/Widget.Mastodon.M3.Button.Outlined"/>
</FrameLayout>
<TextView
android:id="@+id/mute_title"
android:id="@+id/unfollow_explanation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:textAppearance="@style/m3_title_medium"
tools:text="@string/mute_user"/>
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:layout_marginHorizontal="8dp"
android:textAppearance="@style/m3_body_small"
android:textColor="?colorM3OnSurfaceVariant"
android:text="@string/report_unfollow_explanation"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="@style/m3_body_medium"
android:textColor="?android:textColorSecondary"
android:text="@string/mute_user_explain"/>
<Button
android:id="@+id/mute_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
style="?secondaryLargeButtonStyle"
android:text="@string/do_mute"/>
<TextView
android:id="@+id/block_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:textAppearance="@style/m3_title_medium"
tools:text="@string/block_user"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="@style/m3_body_medium"
android:textColor="?android:textColorSecondary"
android:text="@string/block_user_explain"/>
<Button
<FrameLayout
android:id="@+id/block_btn"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/bg_button_m3_outlined">
<TextView
android:id="@+id/block_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@null"
android:foreground="@null"
android:drawablePadding="8dp"
android:clickable="false"
android:focusable="false"
tools:text="@string/block_user"
android:duplicateParentState="true"
style="@style/Widget.Mastodon.M3.Button.Outlined"/>
</FrameLayout>
<TextView
android:id="@+id/block_explanation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
style="?secondaryLargeButtonStyle"
android:text="@string/do_block"/>
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:layout_marginHorizontal="8dp"
android:textAppearance="@style/m3_body_small"
android:textColor="?colorM3OnSurfaceVariant"
android:text="@string/block_user_explain"/>
<FrameLayout
android:id="@+id/mute_btn"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/bg_button_m3_outlined">
<TextView
android:id="@+id/mute_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@null"
android:foreground="@null"
android:drawablePadding="8dp"
android:clickable="false"
android:focusable="false"
tools:text="@string/mute_user"
android:duplicateParentState="true"
style="@style/Widget.Mastodon.M3.Button.Outlined"/>
</FrameLayout>
<TextView
android:id="@+id/mute_explanation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:layout_marginHorizontal="8dp"
android:textAppearance="@style/m3_body_small"
android:textColor="?colorM3OnSurfaceVariant"
android:text="@string/mute_user_explain"/>
</LinearLayout>

View File

@@ -6,10 +6,19 @@
android:orientation="vertical"
android:id="@+id/appkit_loader_root"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?android:colorBackground">
android:background="?colorM3Surface">
<include layout="@layout/appkit_toolbar"/>
<ProgressBar
android:id="@+id/top_progress"
android:layout_width="match_parent"
android:layout_height="4dp"
android:indeterminate="false"
android:indeterminateOnly="false"
android:max="100"
android:progressDrawable="@drawable/m3_progress"/>
<FrameLayout
android:id="@+id/appkit_loader_content"
android:layout_width="match_parent"
@@ -32,6 +41,6 @@
</FrameLayout>
<include layout="@layout/button_bar_two"/>
<include layout="@layout/button_bar_one"/>
</me.grishka.appkit.views.FragmentRootLinearLayout>

View File

@@ -4,28 +4,19 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="32dp"
android:paddingBottom="8dp">
<TextView
android:id="@+id/step_counter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:textAppearance="@style/m3_title_medium"
android:textColor="?android:textColorSecondary"
tools:text="@string/step_x_of_n"/>
android:paddingHorizontal="16dp"
android:paddingTop="14dp"
android:paddingBottom="16dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:layout_marginBottom="8dp"
android:textAppearance="@style/m3_headline_medium"
android:minHeight="36dp"
android:gravity="center_vertical"
android:textColor="?colorM3OnSurface"
tools:text="Title"/>
<TextView
@@ -33,7 +24,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_medium"
android:textColor="?android:textColorSecondary"
android:textColor="?colorM3OnSurfaceVariant"
android:minHeight="24dp"
android:gravity="center_vertical"
tools:text="Subtitle"/>
</LinearLayout>

View File

@@ -1,39 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<org.joinmastodon.android.ui.views.CheckableLinearLayout 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:padding="16dp">
android:orientation="horizontal"
android:paddingVertical="8dp"
android:paddingEnd="24dp"
android:gravity="center_vertical">
<ImageView
<View
android:id="@+id/checkbox"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:tint="?android:textColorSecondary"
android:src="@drawable/ic_round_checkbox"/>
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginHorizontal="12dp"
android:duplicateParentState="true"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<org.joinmastodon.android.ui.views.LinkedTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/checkbox"
android:layout_marginStart="16dp"
android:textAppearance="@style/m3_title_medium"
android:textAppearance="@style/m3_body_large"
android:textColor="?colorM3OnSurface"
android:textSize="16sp"
android:minHeight="24dp"
android:gravity="center_vertical"
tools:text="Title"/>
<TextView
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/checkbox"
android:layout_below="@id/title"
android:layout_marginStart="16dp"
android:textAppearance="@style/m3_body_medium"
android:textColor="?android:textColorSecondary"
android:textColor="?colorM3OnSurfaceVariant"
android:textSize="14sp"
android:minHeight="20dp"
android:gravity="center_vertical"
tools:text="Subtitle"/>
</RelativeLayout>
</LinearLayout>
</org.joinmastodon.android.ui.views.CheckableLinearLayout>

View File

@@ -28,12 +28,13 @@
android:ellipsize="end"
tools:text="@string/theme_true_black"/>
<Switch
<org.joinmastodon.android.ui.views.M3Switch
android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="12dp"
android:duplicateParentState="false"
android:focusable="false"
android:clickable="false"/>

View File

@@ -18,6 +18,7 @@
android:src="@drawable/ic_visibility_off_24px"/>
<TextView
android:id="@+id/sensitive_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"