Info sheet in media viewer (AND-109)

This commit is contained in:
Grishka
2023-12-04 21:33:25 +03:00
parent b08cd1eb4b
commit 5d7c37262e
26 changed files with 645 additions and 235 deletions

View File

@@ -1,15 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<item android:bottom="-28dp">
<shape android:tint="@color/m3_primary_alpha5" android:tintMode="src_over">
<solid android:color="?colorM3Surface"/>
<corners android:topLeftRadius="28dp" android:topRightRadius="28dp"/>
</shape>
</item>
<item>
<shape android:tint="?colorM3Primary">
<solid android:color="#0D000000"/>
<corners android:topLeftRadius="28dp" android:topRightRadius="28dp"/>
<corners android:radius="28dp"/>
</shape>
</item>
</layer-list>

View File

@@ -5,7 +5,7 @@
<item>
<shape>
<solid android:color="?colorM3Primary"/>
<corners android:radius="20dp"/>
<corners android:radius="100dp"/>
</shape>
</item>
</ripple>
@@ -13,7 +13,7 @@
<item>
<shape>
<solid android:color="?colorM3DisabledBackground"/>
<corners android:radius="20dp"/>
<corners android:radius="100dp"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/bg_button_m3_filled" android:inset="4dp">
</inset>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple android:color="@color/m3_primary_overlay" xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/mask">
<shape>
<solid android:color="#000"/>
<corners android:radius="8dp"/>
</shape>
</item>
</ripple>

View File

@@ -5,7 +5,7 @@
<item>
<shape>
<solid android:color="?colorM3SecondaryContainer"/>
<corners android:radius="20dp"/>
<corners android:radius="100dp"/>
</shape>
</item>
</ripple>
@@ -13,7 +13,7 @@
<item>
<shape>
<solid android:color="?colorM3DisabledBackground"/>
<corners android:radius="20dp"/>
<corners android:radius="100dp"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/bg_button_m3_tonal" android:inset="4dp">
</inset>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_bookmark_fill1_24px" android:state_selected="true"/>
<item android:drawable="@drawable/ic_bookmark_24px"/>
</selector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M5,21V5Q5,4.175 5.588,3.587Q6.175,3 7,3H17Q17.825,3 18.413,3.587Q19,4.175 19,5V21L12,18Z"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M11,17H13V11H11ZM12,9Q12.425,9 12.713,8.712Q13,8.425 13,8Q13,7.575 12.713,7.287Q12.425,7 12,7Q11.575,7 11.288,7.287Q11,7.575 11,8Q11,8.425 11.288,8.712Q11.575,9 12,9ZM12,22Q9.925,22 8.1,21.212Q6.275,20.425 4.925,19.075Q3.575,17.725 2.788,15.9Q2,14.075 2,12Q2,9.925 2.788,8.1Q3.575,6.275 4.925,4.925Q6.275,3.575 8.1,2.787Q9.925,2 12,2Q14.075,2 15.9,2.787Q17.725,3.575 19.075,4.925Q20.425,6.275 21.212,8.1Q22,9.925 22,12Q22,14.075 21.212,15.9Q20.425,17.725 19.075,19.075Q17.725,20.425 15.9,21.212Q14.075,22 12,22Z"/>
</vector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_star_fill1_24px" android:state_selected="true"/>
<item android:drawable="@drawable/ic_star_24px"/>
</selector>

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/alt_text_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|bottom"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:importantForAccessibility="noHideDescendants"
android:background="@drawable/bg_image_alt_overlay">
<TextView
android:id="@+id/alt_button"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="@style/m3_label_large"
android:textColor="#FFF"
android:gravity="center"
android:includeFontPadding="false"
android:text="ALT"
tools:ignore="HardcodedText" />
<ImageButton
android:id="@+id/alt_text_close"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="end|top"
android:src="@drawable/ic_baseline_close_24"
android:tint="#FFF"
android:background="?android:selectableItemBackgroundBorderless"/>
<org.joinmastodon.android.ui.views.NestableScrollView
android:id="@+id/alt_text_scroller"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:requiresFadingEdge="vertical"
android:fadingEdgeLength="16dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/alt_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:textAppearance="@style/m3_body_medium"
android:textColor="#FFF"
tools:text="Alt text goes here"/>
</LinearLayout>
</org.joinmastodon.android.ui.views.NestableScrollView>
</FrameLayout>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<org.joinmastodon.android.ui.views.CustomScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_bottom_sheet"
android:outlineProvider="background"
android:elevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp">
<View
android:id="@+id/handle"
android:layout_width="match_parent"
android:layout_height="36dp"
android:background="@drawable/bg_bottom_sheet_handle"/>
<LinearLayout
android:id="@+id/alt_text_title"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:layout_marginHorizontal="16dp">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginEnd="8dp"
android:singleLine="true"
android:ellipsize="end"
android:textSize="22dp"
android:textColor="?colorM3OnSurfaceVariant"
android:gravity="center_vertical|start"
android:text="@string/alt_text"/>
<ImageButton
android:id="@+id/alt_text_help"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:actionBarItemBackground"
android:tint="?colorM3OnSurfaceVariant"
android:contentDescription="@string/help"
android:src="@drawable/ic_help_24px"/>
</LinearLayout>
<TextView
android:id="@+id/alt_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:textAppearance="@style/m3_body_large"
android:textColor="?colorM3OnSurface"
tools:text="A cute black cat"/>
</LinearLayout>
</org.joinmastodon.android.ui.views.CustomScrollView>

View File

@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<org.joinmastodon.android.ui.views.CustomScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_bottom_sheet"
android:outlineProvider="background"
android:elevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp">
<View
android:id="@+id/handle"
android:layout_width="match_parent"
android:layout_height="36dp"
android:background="@drawable/bg_bottom_sheet_handle"/>
<HorizontalScrollView
android:id="@+id/buttons_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="64dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:baselineAligned="false">
<Button
android:id="@+id/btn_boost"
android:layout_width="64dp"
android:layout_height="64dp"
android:text="@string/button_reblog"
android:drawableTop="@drawable/ic_boost"
style="@style/Widget.Mastodon.M3.Button.IconWithLabel"/>
<Space
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"/>
<Button
android:id="@+id/btn_favorite"
android:layout_width="64dp"
android:layout_height="64dp"
android:text="@string/button_favorite"
android:drawableTop="@drawable/ic_star_24px_selector"
style="@style/Widget.Mastodon.M3.Button.IconWithLabel"/>
<Space
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"/>
<Button
android:id="@+id/btn_share"
android:layout_width="64dp"
android:layout_height="64dp"
android:text="@string/button_share"
android:drawableTop="@drawable/ic_share_24px"
style="@style/Widget.Mastodon.M3.Button.IconWithLabel"/>
<Space
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"/>
<Button
android:id="@+id/btn_bookmark"
android:layout_width="64dp"
android:layout_height="64dp"
android:text="@string/add_bookmark"
android:drawableTop="@drawable/ic_bookmark_24px_selector"
style="@style/Widget.Mastodon.M3.Button.IconWithLabel"/>
<Space
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"/>
<Button
android:id="@+id/btn_download"
android:layout_width="64dp"
android:layout_height="64dp"
android:text="@string/download"
android:drawableTop="@drawable/ic_download_24px"
style="@style/Widget.Mastodon.M3.Button.IconWithLabel"/>
</LinearLayout>
</HorizontalScrollView>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginVertical="4dp"
android:layout_marginHorizontal="16dp"
android:background="?colorM3OutlineVariant"/>
<LinearLayout
android:id="@+id/alt_text_title"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:layout_marginHorizontal="16dp">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginEnd="8dp"
android:singleLine="true"
android:ellipsize="end"
android:textSize="22dp"
android:textColor="?colorM3OnSurfaceVariant"
android:gravity="center_vertical|start"
android:text="@string/alt_text"/>
<ImageButton
android:id="@+id/alt_text_help"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:actionBarItemBackground"
android:tint="?colorM3OnSurfaceVariant"
android:contentDescription="@string/help"
android:src="@drawable/ic_help_24px"/>
</LinearLayout>
<TextView
android:id="@+id/alt_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:textAppearance="@style/m3_body_large"
android:textColor="?colorM3OnSurface"
tools:text="A cute black cat"/>
</LinearLayout>
</org.joinmastodon.android.ui.views.CustomScrollView>

View File

@@ -3,7 +3,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_bottom_sheet">
android:background="@drawable/bg_bottom_sheet"
android:outlineProvider="background"
android:elevation="1dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@@ -666,4 +666,8 @@
<string name="onboarding_recommendations_intro">You curate your own home feed.The more people you follow, the more active and interesting it will be.</string>
<string name="onboarding_recommendations_title">Personalize your home feed</string>
<string name="article_by_author">By %s</string>
<string name="info">Info</string>
<string name="button_reblogged">Boosted</string>
<string name="button_favorited">Favorited</string>
<string name="bookmarked">Bookmarked</string>
</resources>

View File

@@ -297,6 +297,18 @@
<item name="android:elevation">1dp</item>
</style>
<style name="Widget.Mastodon.M3.Button.IconWithLabel">
<item name="android:background">@drawable/bg_button_m3_icon_label</item>
<item name="android:textColor">@color/button_text_m3_text</item>
<item name="android:drawableTint">@color/button_text_m3_text</item>
<item name="android:drawablePadding">4dp</item>
<item name="android:textSize">11dp</item>
<item name="android:paddingLeft">0dp</item>
<item name="android:paddingRight">0dp</item>
<item name="android:paddingTop">11dp</item>
<item name="android:paddingBottom">11dp</item>
</style>
<style name="Widget.Mastodon.M3.Button.Outlined">
<item name="android:background">@drawable/bg_button_m3_outlined</item>
<item name="android:textColor">@color/button_text_m3_text</item>