introduce separate tonal selector backgrounds

This commit is contained in:
sk 2023-10-20 11:43:15 +02:00
parent 59026286a1
commit b5eae13a16
10 changed files with 73 additions and 21 deletions

View File

@ -34,7 +34,6 @@ import me.grishka.appkit.api.Callback;
import me.grishka.appkit.api.ErrorResponse; import me.grishka.appkit.api.ErrorResponse;
import me.grishka.appkit.imageloader.ViewImageLoader; import me.grishka.appkit.imageloader.ViewImageLoader;
import me.grishka.appkit.imageloader.requests.UrlImageLoaderRequest; import me.grishka.appkit.imageloader.requests.UrlImageLoaderRequest;
import me.grishka.appkit.utils.CubicBezierInterpolator;
import me.grishka.appkit.utils.V; import me.grishka.appkit.utils.V;
public class ReportDoneFragment extends MastodonToolbarFragment{ public class ReportDoneFragment extends MastodonToolbarFragment{

View File

@ -3,19 +3,13 @@
android:color="@color/m3_primary_overlay"> android:color="@color/m3_primary_overlay">
<item android:gravity="center_vertical" android:height="40dp"> <item android:gravity="center_vertical" android:height="40dp">
<selector> <selector>
<item android:state_enabled="true" android:state_selected="true"> <item android:state_enabled="true">
<shape> <shape>
<solid android:color="?colorM3SecondaryContainer"/> <solid android:color="?colorM3SecondaryContainer"/>
<corners android:radius="20dp"/> <corners android:radius="20dp"/>
</shape> </shape>
</item> </item>
<item android:state_selected="false"> <item>
<shape>
<stroke android:color="@color/m3_on_surface_overlay" android:width="1dp"/>
<corners android:radius="20dp"/>
</shape>
</item>
<item android:state_enabled="false">
<shape> <shape>
<solid android:color="?colorM3DisabledBackground"/> <solid android:color="?colorM3DisabledBackground"/>
<corners android:radius="20dp"/> <corners android:radius="20dp"/>

View File

@ -3,19 +3,13 @@
android:color="@color/m3_primary_overlay"> android:color="@color/m3_primary_overlay">
<item android:gravity="center" android:height="40dp" android:width="40dp"> <item android:gravity="center" android:height="40dp" android:width="40dp">
<selector> <selector>
<item android:state_enabled="true" android:state_selected="true"> <item android:state_enabled="true">
<shape> <shape>
<solid android:color="?colorM3SecondaryContainer"/> <solid android:color="?colorM3SecondaryContainer"/>
<corners android:radius="20dp"/> <corners android:radius="20dp"/>
</shape> </shape>
</item> </item>
<item android:state_selected="false"> <item>
<shape>
<stroke android:color="@color/m3_on_surface_overlay" android:width="1dp"/>
<corners android:radius="20dp"/>
</shape>
</item>
<item android:state_enabled="false">
<shape> <shape>
<solid android:color="?colorM3DisabledBackground"/> <solid android:color="?colorM3DisabledBackground"/>
<corners android:radius="20dp"/> <corners android:radius="20dp"/>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/m3_primary_overlay">
<item android:gravity="center" android:height="40dp" android:width="40dp">
<selector>
<item android:state_enabled="true" android:state_selected="true">
<shape>
<solid android:color="?colorM3SecondaryContainer"/>
<corners android:radius="20dp"/>
</shape>
</item>
<item android:state_selected="false">
<shape>
<stroke android:color="@color/m3_on_surface_overlay" android:width="1dp"/>
<corners android:radius="20dp"/>
</shape>
</item>
<item android:state_enabled="false">
<shape>
<solid android:color="?colorM3DisabledBackground"/>
<corners android:radius="20dp"/>
</shape>
</item>
</selector>
</item>
<item android:id="@android:id/mask" android:gravity="center" android:height="40dp" android:width="40dp">
<shape>
<solid android:color="#000"/>
<corners android:radius="20dp"/>
</shape>
</item>
</ripple>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/m3_primary_overlay">
<item android:gravity="center_vertical" android:height="40dp">
<selector>
<item android:state_enabled="true" android:state_selected="true">
<shape>
<solid android:color="?colorM3SecondaryContainer"/>
<corners android:radius="20dp"/>
</shape>
</item>
<item android:state_selected="false">
<shape>
<stroke android:color="@color/m3_on_surface_overlay" android:width="1dp"/>
<corners android:radius="20dp"/>
</shape>
</item>
<item android:state_enabled="false">
<shape>
<solid android:color="?colorM3DisabledBackground"/>
<corners android:radius="20dp"/>
</shape>
</item>
</selector>
</item>
<item android:id="@android:id/mask" android:gravity="center_vertical" android:height="40dp">
<shape>
<solid android:color="#000"/>
<corners android:radius="20dp"/>
</shape>
</item>
</ripple>

View File

@ -30,7 +30,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="48dp" android:minHeight="48dp"
android:minWidth="48dp" android:minWidth="48dp"
android:background="@drawable/bg_button_m3_tonal_circle" android:background="@drawable/bg_button_m3_tonal_circle_selector"
android:tooltipText="@string/sk_button_react" android:tooltipText="@string/sk_button_react"
android:contentDescription="@string/sk_button_react" android:contentDescription="@string/sk_button_react"
android:src="@drawable/ic_fluent_add_24_filled" /> android:src="@drawable/ic_fluent_add_24_filled" />

View File

@ -49,7 +49,7 @@
<Button <Button
android:id="@+id/advanced" android:id="@+id/advanced"
style="@style/Widget.Mastodon.M3.Button.Outlined" style="@style/Widget.Mastodon.M3.Button.Outlined"
android:background="@drawable/bg_button_m3_tonal" android:background="@drawable/bg_button_m3_tonal_selector"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp" android:layout_marginHorizontal="24dp"

View File

@ -366,6 +366,7 @@
<Button <Button
style="@style/Widget.Mastodon.M3.Button.Tonal.Icon" style="@style/Widget.Mastodon.M3.Button.Tonal.Icon"
android:background="@drawable/bg_button_m3_tonal_selector"
android:id="@+id/sensitive_item" android:id="@+id/sensitive_item"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -93,7 +93,7 @@
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
style="@style/Widget.Mastodon.M3.Button.Tonal" style="@style/Widget.Mastodon.M3.Button.Tonal"
android:background="@drawable/bg_button_m3_tonal_circle" android:background="@drawable/bg_button_m3_tonal_circle_selector"
android:paddingStart="12dp" android:paddingStart="12dp"
android:drawableStart="@drawable/ic_fluent_alert_24_selector" /> android:drawableStart="@drawable/ic_fluent_alert_24_selector" />

View File

@ -23,5 +23,5 @@
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:drawableTint="@null" android:drawableTint="@null"
android:drawableStart="@drawable/image_placeholder" android:drawableStart="@drawable/image_placeholder"
android:background="@drawable/bg_button_m3_tonal"/> android:background="@drawable/bg_button_m3_tonal_selector"/>
</FrameLayout> </FrameLayout>