Notifications M3 redesign (+ read marker support)
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
<?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="wrap_content">
|
||||
|
||||
<include layout="@layout/item_discover_account"
|
||||
android:id="@+id/card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"/>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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="64dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:importantForAccessibility="no"
|
||||
tools:tint="#0f0"
|
||||
tools:src="@drawable/ic_repeat_24px"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="8dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
android:textColor="?colorM3OnSurface"
|
||||
android:singleLine="true"
|
||||
tools:text="Notification text"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,25 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<me.grishka.appkit.views.FragmentRootLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:id="@+id/appkit_loader_root"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="?colorM3Surface">
|
||||
|
||||
<org.joinmastodon.android.ui.tabs.TabLayout
|
||||
android:id="@+id/tabbar"
|
||||
<org.joinmastodon.android.ui.views.NestedRecyclerScrollView
|
||||
android:id="@+id/scroller"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicator="@drawable/mtrl_tabs_default_indicator"
|
||||
app:tabIndicatorAnimationMode="elastic"
|
||||
app:tabIndicatorColor="?android:textColorPrimary"
|
||||
app:tabMode="fixed"
|
||||
android:background="@drawable/bg_discover_tabs"/>
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true">
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
<org.joinmastodon.android.ui.views.TopBarsScrollAwayLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
<include layout="@layout/appkit_toolbar"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/tabbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tabbar_inner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_gravity="center"
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButtonContainer">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/mentions_tab"
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButton">
|
||||
<org.joinmastodon.android.ui.views.CheckIconSelectableTextView
|
||||
android:id="@+id/mentions_text"
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButtonText"
|
||||
android:text="@string/mentions"/>
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/all_tab"
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButton">
|
||||
<org.joinmastodon.android.ui.views.CheckIconSelectableTextView
|
||||
android:id="@+id/all_text"
|
||||
style="@style/Widget.Mastodon.M3.SegmentedButtonText"
|
||||
android:text="@string/all_notifications"/>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/appkit_loader_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<include layout="@layout/loading"
|
||||
android:id="@+id/loading"/>
|
||||
|
||||
<ViewStub android:layout="?errorViewLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/error"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/content_stub"/>
|
||||
|
||||
</FrameLayout>
|
||||
</org.joinmastodon.android.ui.views.TopBarsScrollAwayLinearLayout>
|
||||
</org.joinmastodon.android.ui.views.NestedRecyclerScrollView>
|
||||
|
||||
</me.grishka.appkit.views.FragmentRootLinearLayout>
|
||||
51
mastodon/src/main/res/layout/load_more_with_end_mark.xml
Normal file
51
mastodon/src/main/res/layout/load_more_with_end_mark.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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="76dip">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/load_more_progress"
|
||||
android:layout_width="32dip"
|
||||
android:layout_height="32dip"
|
||||
android:layout_margin="22dip"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/load_more_error"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="76dip"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dip">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textSize="14dip"
|
||||
android:textColor="#71757A"
|
||||
android:text="Some error text"
|
||||
android:singleLine="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error_retry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="Retry?"
|
||||
android:textAllCaps="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="12dip"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/end_mark"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="9dp"
|
||||
android:layout_marginVertical="16dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/thread_end_mark"/>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -73,6 +73,22 @@
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="?colorM3OnSurfaceVariant"
|
||||
android:src="@drawable/ic_notifications_24px"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notifications_badge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="-6dp"
|
||||
android:layout_marginEnd="-8dp"
|
||||
android:background="@drawable/bg_tabbar_badge"
|
||||
android:textColor="?colorM3OnPrimary"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:textAppearance="@style/m3_label_small"
|
||||
android:minWidth="16dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
tools:text="222"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user