Flair, spoiler and nsfw support for submitting posts.

This commit is contained in:
Alex Ning
2019-07-17 09:31:49 +08:00
parent 116ce0bb24
commit ebf542161e
27 changed files with 893 additions and 41 deletions

View File

@@ -54,6 +54,57 @@
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dividerColor" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_post_image_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/flair"
android:textColor="@color/primaryTextColor"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/textColorPrimaryDark"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_post_image_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/spoiler"
android:textColor="@color/primaryTextColor"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/textColorPrimaryDark"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_custom_text_view_post_image_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/nsfw"
android:textColor="@color/primaryTextColor"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/colorAccent"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"

View File

@@ -54,6 +54,57 @@
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dividerColor" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_post_link_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/flair"
android:textColor="@color/primaryTextColor"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/textColorPrimaryDark"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_post_link_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/spoiler"
android:textColor="@color/primaryTextColor"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/textColorPrimaryDark"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_custom_text_view_post_link_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/nsfw"
android:textColor="@color/primaryTextColor"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/colorAccent"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"

View File

@@ -54,6 +54,57 @@
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dividerColor" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_post_text_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/flair"
android:textColor="@color/primaryTextColor"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/textColorPrimaryDark"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_post_text_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/spoiler"
android:textColor="@color/primaryTextColor"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/textColorPrimaryDark"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_custom_text_view_post_text_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/nsfw"
android:textColor="@color/primaryTextColor"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/colorAccent"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"

View File

@@ -54,6 +54,57 @@
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dividerColor" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.libRG.CustomTextView
android:id="@+id/flair_custom_text_view_post_video_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/flair"
android:textColor="@color/primaryTextColor"
android:visibility="gone"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/textColorPrimaryDark"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/spoiler_custom_text_view_post_video_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/spoiler"
android:textColor="@color/primaryTextColor"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/textColorPrimaryDark"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<com.libRG.CustomTextView
android:id="@+id/nsfw_custom_text_view_post_video_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="4dp"
android:text="@string/nsfw"
android:textColor="@color/primaryTextColor"
app:lib_setRadius="3dp"
app:lib_setRoundedBorderColor="@color/colorAccent"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"

View File

@@ -0,0 +1,37 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".FlairBottomSheetFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/flair"
android:textSize="18sp" />
<ProgressBar
android:id="@+id/progress_bar_flair_bottom_sheet_fragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="36dp"
android:layout_gravity="center" />
<TextView
android:id="@+id/error_text_view_flair_bottom_sheet_fragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:padding="48dp"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/flair_text_view_item_flair"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:textColor="@color/primaryTextColor"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
</LinearLayout>

View File

@@ -7,7 +7,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/dialog_post_type"
android:text="@string/bottom_sheet_post_type"
android:textSize="18sp" />
<LinearLayout
@@ -31,7 +31,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/dialog_post_text"
android:text="@string/bottom_sheet_post_text"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
@@ -58,7 +58,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/dialog_post_link"
android:text="@string/bottom_sheet_post_link"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
@@ -85,7 +85,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/dialog_post_image"
android:text="@string/bottom_sheet_post_image"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
@@ -113,7 +113,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/dialog_post_video"
android:text="@string/bottom_sheet_post_video"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />

View File

@@ -107,15 +107,21 @@
<string name="subreddits">Subreddits</string>
<string name="users">Users</string>
<string name="dialog_post_type">Post</string>
<string name="dialog_post_text">Text</string>
<string name="dialog_post_link">Link</string>
<string name="dialog_post_image">Image</string>
<string name="dialog_post_video">Video</string>
<string name="bottom_sheet_post_type">Post</string>
<string name="bottom_sheet_post_text">Text</string>
<string name="bottom_sheet_post_link">Link</string>
<string name="bottom_sheet_post_image">Image</string>
<string name="bottom_sheet_post_video">Video</string>
<string name="select_from_gallery">Select a picture</string>
<string name="select_again">Select again</string>
<string name="error_getting_image">Error getting the image</string>
<string name="video_is_processing">Video is processing. Please wait.</string>
<string name="flair">Flair</string>
<string name="spoiler">Spoiler</string>
<string name="no_flair">No flair</string>
<string name="error_loading_flairs">Error loading flairs.\nTap to retry.</string>
</resources>