Copy post title and content in ViewPostDetailActivity.

This commit is contained in:
Alex Ning
2020-01-29 12:43:57 +08:00
parent cb91543690
commit 5e401a6a96
10 changed files with 248 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/text_view_copy_text_material_dialog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:textIsSelectable="true"
android:enabled="true"
android:focusable="true"
android:longClickable="true" />
</ScrollView>

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:overScrollMode="never"
tools:context=".Fragment.SortTimeBottomSheetFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/copy_raw_text_text_view_copy_text_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/copy_raw_text"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/copy_markdown_text_view_copy_text_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/copy_markdown"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/copy_all_raw_text_text_view_copy_text_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/copy_all_raw_text"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/copy_all_markdown_text_view_copy_text_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/copy_all_markdown"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@@ -79,7 +79,11 @@
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/title_font_18" />
android:textSize="?attr/title_font_18"
android:textIsSelectable="true"
android:enabled="true"
android:focusable="true"
android:longClickable="true" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/content_markdown_view_item_post_detail"

View File

@@ -405,4 +405,10 @@
<string name="copy_success">Copied</string>
<string name="copy_failed">Cannot copy the link</string>
<string name="copy_text">Copy</string>
<string name="copy_all">Copy All</string>
<string name="copy_markdown">Copy Markdown</string>
<string name="copy_raw_text">Copy Raw Text</string>
<string name="copy_all_markdown">Copy All Markdown</string>
<string name="copy_all_raw_text">Copy All Raw Text</string>
</resources>

View File

@@ -58,6 +58,12 @@
<item name="buttonBarNegativeButtonStyle">@style/MaterialAlertDialogNegativeButtonStyle</item>
</style>
<style name="CopyTextMaterialAlertDialogTheme">
<item name="android:textSize">?attr/font_default</item>
<item name="materialAlertDialogTitleTextStyle">@style/MaterialAlertDialogTitleTextStyle</item>
<item name="buttonBarNegativeButtonStyle">@style/MaterialAlertDialogNegativeButtonStyle</item>
</style>
<style name="MaterialAlertDialogPositiveButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
<item name="android:textColor">@color/colorAccent</item>
</style>