Link cards
This commit is contained in:
4
mastodon/src/main/res/color/window_bg_alpha95.xml
Normal file
4
mastodon/src/main/res/color/window_bg_alpha95.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?colorWindowBackground" android:alpha="0.95"/>
|
||||
</selector>
|
||||
4
mastodon/src/main/res/drawable/window_bg_alpha95.xml
Normal file
4
mastodon/src/main/res/drawable/window_bg_alpha95.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/window_bg_alpha95"/>
|
||||
</shape>
|
||||
54
mastodon/src/main/res/layout/display_item_link_card.xml
Normal file
54
mastodon/src/main/res/layout/display_item_link_card.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.joinmastodon.android.ui.views.MaxWidthFrameLayout
|
||||
android:id="@+id/inner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:foreground="?android:selectableItemBackground"
|
||||
android:maxWidth="400dp">
|
||||
<ImageView
|
||||
android:id="@+id/photo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="#0f0"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/window_bg_alpha95">
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
tools:text="Link title"/>
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="@style/m3_body_medium"
|
||||
tools:text="Link description"/>
|
||||
<TextView
|
||||
android:id="@+id/domain"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_body_medium"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
tools:text="example.com"/>
|
||||
</LinearLayout>
|
||||
</org.joinmastodon.android.ui.views.MaxWidthFrameLayout>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -7,5 +7,10 @@
|
||||
<attr name="colorDarkIcon" format="color"/>
|
||||
<attr name="colorPollMostVoted" format="color"/>
|
||||
<attr name="colorPollVoted" format="color"/>
|
||||
<attr name="colorWindowBackground" format="color"/>
|
||||
<attr name="secondaryButtonStyle" format="reference"/>
|
||||
|
||||
<declare-styleable name="MaxWidthFrameLayout">
|
||||
<attr name="android:maxWidth" format="dimension"/>
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
@@ -6,6 +6,7 @@
|
||||
<item name="android:enforceStatusBarContrast" tools:ignore="NewApi">false</item>
|
||||
<item name="appkitBackDrawable">@drawable/ic_fluent_arrow_left_24_regular</item>
|
||||
<item name="android:splitMotionEvents">false</item>
|
||||
<item name="android:windowBackground">?colorWindowBackground</item>
|
||||
|
||||
<item name="android:buttonStyle">@style/Widget.Mastodon.Button.Primary_DarkOnLight</item>
|
||||
<item name="secondaryButtonStyle">@style/Widget.Mastodon.Button.Secondary_DarkOnLight</item>
|
||||
@@ -19,7 +20,7 @@
|
||||
<item name="colorBackgroundLight">@color/gray_50</item>
|
||||
<item name="colorBackgroundLightest">@color/gray_25</item>
|
||||
<item name="colorDarkIcon">@color/gray_900</item>
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="colorWindowBackground">@color/white</item>
|
||||
<item name="android:statusBarColor">@color/actionbar_bg</item>
|
||||
<item name="android:navigationBarColor">@color/navigation_bar_bg</item>
|
||||
<item name="android:actionBarTheme">@style/Theme.Mastodon.Toolbar</item>
|
||||
@@ -37,6 +38,7 @@
|
||||
<item name="android:enforceStatusBarContrast" tools:ignore="NewApi">false</item>
|
||||
<item name="appkitBackDrawable">@drawable/ic_fluent_arrow_left_24_regular</item>
|
||||
<item name="android:splitMotionEvents">false</item>
|
||||
<item name="android:windowBackground">?colorWindowBackground</item>
|
||||
|
||||
<item name="android:buttonStyle">@style/Widget.Mastodon.Button.Primary_LightOnDark</item>
|
||||
<item name="secondaryButtonStyle">@style/Widget.Mastodon.Button.Secondary_LightOnDark</item>
|
||||
@@ -50,7 +52,7 @@
|
||||
<item name="colorBackgroundLight">@color/gray_700</item>
|
||||
<item name="colorBackgroundLightest">@color/gray_700</item>
|
||||
<item name="colorDarkIcon">@color/gray_25</item>
|
||||
<item name="android:windowBackground">@color/gray_800</item>
|
||||
<item name="colorWindowBackground">@color/gray_800</item>
|
||||
<item name="android:statusBarColor">@color/actionbar_bg_dark</item>
|
||||
<item name="android:navigationBarColor">@color/actionbar_bg_dark</item>
|
||||
<item name="android:actionBarTheme">@style/Theme.Mastodon.Toolbar.Dark</item>
|
||||
|
||||
Reference in New Issue
Block a user