fix see new posts button design

This commit is contained in:
sk
2023-10-21 01:00:51 +02:00
parent c33c3d9112
commit 47d1b182ac
6 changed files with 84 additions and 52 deletions

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/switcher_btn"
style="@style/Widget.Mastodon.M3.Button.Text"
android:orientation="horizontal"
android:id="@+id/switcher_btn"
style="@style/Widget.Mastodon.M3.Button.Text"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical|start"
@@ -14,54 +14,44 @@
android:tooltipText="@string/sk_switch_timeline"
android:paddingStart="12dp"
android:paddingEnd="12dp">
<ImageView
android:id="@+id/timeline_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_fluent_home_24_regular" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
<ImageView
android:id="@+id/collapsed_chevron"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_fluent_chevron_down_16_filled"
android:visibility="gone" />
<TextView
android:id="@+id/timeline_title"
style="@style/action_bar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:drawablePadding="8dp"
android:drawableEnd="@drawable/ic_fluent_chevron_down_16_filled" />
</FrameLayout>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/show_new_posts_btn"
style="@style/Widget.Mastodon.M3.Button.Tonal.Icon"
<ImageView
android:id="@+id/timeline_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_fluent_home_24_regular"/>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
<ImageView
android:id="@+id/collapsed_chevron"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_fluent_chevron_down_16_filled"
android:visibility="gone"/>
<TextView
style="@style/action_bar_title"
android:id="@+id/timeline_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:drawablePadding="8dp"
android:drawableEnd="@drawable/ic_fluent_chevron_down_16_filled"/>
</FrameLayout>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
style="?toolbarActionButtonStyle"
android:id="@+id/show_new_posts_btn"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/bg_button_m3_tonal_selector"
android:maxLines="1"
android:ellipsize="end"
android:textAppearance="@style/m3_title_medium"
android:textSize="16sp"
android:text="@string/see_new_posts"
android:drawableStart="@drawable/ic_fluent_arrow_up_16_filled"
android:layout_gravity="center" />
<!--
using the selector background because..
the selected=false state's border looks better than the one from the outline style
(as per m3 spec) :( i should probably fix this at some point
-->
</FrameLayout>
android:drawableStart="@drawable/ic_fluent_arrow_up_16_filled"
android:layout_gravity="center"/>
</FrameLayout>
</FrameLayout>