Link previews for detail statuses (#424)
* implement link preview cards on detail statuses * cleanup code
This commit is contained in:
parent
df4dfa7766
commit
5cbc7217ff
14 changed files with 420 additions and 35 deletions
6
app/src/main/res/drawable/card_frame_dark.xml
Normal file
6
app/src/main/res/drawable/card_frame_dark.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="5dp" />
|
||||
<stroke android:color="@color/text_color_tertiary_dark" android:width="1px" />
|
||||
<padding android:bottom="1px" android:top="1px" android:left="1px" android:right="1px"/>
|
||||
</shape>
|
6
app/src/main/res/drawable/card_frame_light.xml
Normal file
6
app/src/main/res/drawable/card_frame_light.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="5dp" />
|
||||
<stroke android:color="@color/text_color_tertiary_light" android:width="1px" />
|
||||
<padding android:bottom="1px" android:top="1px" android:left="1px" android:right="1px"/>
|
||||
</shape>
|
|
@ -104,11 +104,72 @@
|
|||
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"
|
||||
android:textColor="?android:textColorPrimary" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/status_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_toEndOf="@+id/status_avatar"
|
||||
android:layout_toRightOf="@+id/status_avatar"
|
||||
android:background="?attr/card_background"
|
||||
android:clipChildren="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/card_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp"
|
||||
android:background="?attr/card_image_background" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/card_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="6dp"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingTop="6dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/card_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:lines="1"
|
||||
android:textColor="?android:textColorPrimary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/card_description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:ellipsize="end"
|
||||
android:lineSpacingMultiplier="1.1"
|
||||
android:maxLines="2"
|
||||
android:textColor="?android:textColorSecondary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/card_link"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="?android:textColorTertiary" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/status_media_preview_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/status_content"
|
||||
android:layout_below="@+id/card_view"
|
||||
android:layout_toEndOf="@+id/status_avatar"
|
||||
android:layout_toRightOf="@+id/status_avatar">
|
||||
|
||||
|
|
|
@ -39,5 +39,7 @@
|
|||
<attr name="compose_image_button_tint" format="reference|color" />
|
||||
<attr name="report_status_background_color" format="reference|color" />
|
||||
<attr name="report_status_divider_drawable" format="reference" />
|
||||
<attr name="card_background" format="reference|color" />
|
||||
<attr name="card_image_background" format="reference|color" />
|
||||
|
||||
</resources>
|
|
@ -21,4 +21,8 @@
|
|||
<dimen name="status_left_line_margin">38dp</dimen>
|
||||
<dimen name="text_content_margin">16dp</dimen>
|
||||
<dimen name="status_sensitive_media_button_padding">5dp</dimen>
|
||||
|
||||
<dimen name="card_image_vertical_height">160dp</dimen>
|
||||
<dimen name="card_image_horizontal_width">100dp</dimen>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -80,6 +80,10 @@
|
|||
<item name="material_drawer_selected">@color/color_primary_dark</item>
|
||||
<item name="material_drawer_selected_text">@color/text_color_primary_dark</item>
|
||||
<item name="material_drawer_header_selection_text">@color/text_color_primary_dark</item>
|
||||
|
||||
<item name="card_background">@drawable/card_frame_dark</item>
|
||||
<item name="card_image_background">@color/text_color_tertiary_dark</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.ImageButton.Dark" parent="@style/Widget.AppCompat.Button.Borderless.Colored">
|
||||
|
@ -156,6 +160,10 @@
|
|||
<item name="material_drawer_selected">@color/color_primary_light</item>
|
||||
<item name="material_drawer_selected_text">@color/text_color_primary_light</item>
|
||||
<item name="material_drawer_header_selection_text">@color/text_color_primary_dark</item> <!--Intentionally dark so it can be overlayed over the account's header image.-->
|
||||
|
||||
<item name="card_background">@drawable/card_frame_light</item>
|
||||
<item name="card_image_background">@color/text_color_tertiary_light</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.ImageButton.Light" parent="Widget.AppCompat.Button.Borderless.Colored">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue