Settings M3 redesign wip
This commit is contained in:
45
mastodon/src/main/res/layout/alert_title_with_help.xml
Normal file
45
mastodon/src/main/res/layout/alert_title_with_help.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="24dp">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/help"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:tint="@color/selectable_icon_tint"
|
||||
android:background="@drawable/bg_round_ripple"
|
||||
android:contentDescription="@string/help"
|
||||
android:src="@drawable/ic_help_selectable"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@id/help"
|
||||
style="?android:windowTitleStyle"
|
||||
android:singleLine="false"
|
||||
android:maxLines="2"
|
||||
android:minHeight="48dp"
|
||||
android:gravity="center_vertical"
|
||||
tools:text="Title"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/help_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_marginTop="16dp"
|
||||
android:textAppearance="@style/m3_body_medium"
|
||||
android:textColor="?colorM3OnSurfaceVariant"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
tools:text="Supporting text"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:windowTitleStyle"
|
||||
tools:text="Title"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subtitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:maxLines="2"
|
||||
android:textAppearance="@style/m3_body_medium"
|
||||
android:textColor="?colorM3OnSurfaceVariant"
|
||||
tools:text="Supporting text"/>
|
||||
|
||||
</LinearLayout>
|
||||
25
mastodon/src/main/res/layout/floating_hint_edit_text.xml
Normal file
25
mastodon/src/main/res/layout/floating_hint_edit_text.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.joinmastodon.android.ui.views.FloatingHintEditTextLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
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/edit"
|
||||
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:singleLine="true"
|
||||
android:textColorHint="?colorM3OnSurfaceVariant"
|
||||
android:inputType="textCapSentences"/>
|
||||
|
||||
</org.joinmastodon.android.ui.views.FloatingHintEditTextLayout>
|
||||
66
mastodon/src/main/res/layout/fragment_settings_server.xml
Normal file
66
mastodon/src/main/res/layout/fragment_settings_server.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<me.grishka.appkit.views.FragmentRootLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?android:windowBackground">
|
||||
|
||||
<org.joinmastodon.android.ui.views.NestedRecyclerScrollView
|
||||
android:id="@+id/scroller"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:takePriorityOverChildViews="true"
|
||||
android:fillViewport="true">
|
||||
<org.joinmastodon.android.ui.views.TopBarsScrollAwayLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/appkit_toolbar"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/real_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingTop="4dp"
|
||||
android:textAppearance="@style/m3_headline_small"
|
||||
android:textColor="?colorM3OnSurface"
|
||||
tools:text="mastodon.social"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.joinmastodon.android.ui.tabs.TabLayout
|
||||
android:id="@+id/tabbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicator="@drawable/tab_indicator_m3"
|
||||
app:tabIndicatorAnimationMode="elastic"
|
||||
app:tabIndicatorColor="?colorM3Primary"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
app:tabMinWidth="0dp"
|
||||
app:tabMode="fixed" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?colorM3SurfaceVariant"/>
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</org.joinmastodon.android.ui.views.TopBarsScrollAwayLinearLayout>
|
||||
</org.joinmastodon.android.ui.views.NestedRecyclerScrollView>
|
||||
|
||||
</me.grishka.appkit.views.FragmentRootLinearLayout>
|
||||
14
mastodon/src/main/res/layout/item_generic_list.xml
Normal file
14
mastodon/src/main/res/layout/item_generic_list.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="56dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="12dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<include layout="@layout/item_generic_list_content"/>
|
||||
|
||||
</LinearLayout>
|
||||
14
mastodon/src/main/res/layout/item_generic_list_checkable.xml
Normal file
14
mastodon/src/main/res/layout/item_generic_list_checkable.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.joinmastodon.android.ui.views.CheckableLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="56dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="12dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<include layout="@layout/item_generic_list_content"/>
|
||||
|
||||
</org.joinmastodon.android.ui.views.CheckableLinearLayout>
|
||||
41
mastodon/src/main/res/layout/item_generic_list_content.xml
Normal file
41
mastodon/src/main/res/layout/item_generic_list_content.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:showIn="@layout/item_generic_list">
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="?colorM3OnSurfaceVariant"
|
||||
tools:src="@drawable/ic_settings_24px"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="24dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
android:textColor="?colorM3OnSurface"
|
||||
tools:text="Title"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subtitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textAppearance="@style/m3_body_medium"
|
||||
android:textColor="?colorM3OnSurfaceVariant"
|
||||
tools:text="Subtitle"/>
|
||||
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
77
mastodon/src/main/res/layout/item_settings_banner.xml
Normal file
77
mastodon/src/main/res/layout/item_settings_banner.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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:layout_marginVertical="8dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:padding="16dp"
|
||||
android:clipToPadding="false"
|
||||
android:background="@drawable/bg_settings_banner">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:scaleType="center"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="?colorM3OnPrimaryContainer"
|
||||
android:background="@drawable/white_circle"
|
||||
android:backgroundTint="?colorM3PrimaryContainer"
|
||||
tools:src="@drawable/ic_notifications_paused_24px"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="24dp"
|
||||
android:layout_toEndOf="@id/icon"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:textAppearance="@style/m3_title_medium"
|
||||
android:textColor="?colorM3OnSurface"
|
||||
android:singleLine="true"
|
||||
android:gravity="center_vertical"
|
||||
tools:text="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:minHeight="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?colorM3OnSurface"
|
||||
tools:text="@string/pause_notifications_banner"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="28dp"
|
||||
android:layout_below="@id/text"
|
||||
android:layout_toEndOf="@id/icon"
|
||||
android:layout_marginStart="-8dp"
|
||||
android:layout_marginBottom="-4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
style="@style/Widget.Mastodon.M3.Button.Text"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:minWidth="0dp"
|
||||
tools:text="@string/resume_notifications_now"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/button2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="28dp"
|
||||
android:layout_below="@id/text"
|
||||
android:layout_toEndOf="@id/button"
|
||||
android:layout_marginBottom="-4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
style="@style/Widget.Mastodon.M3.Button.Text"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:minWidth="0dp"
|
||||
tools:text="Secondary action"/>
|
||||
|
||||
</RelativeLayout>
|
||||
Reference in New Issue
Block a user