aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-03-27 10:08:58 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-03-27 10:08:58 +0000
commit1cfdaf41fa7d4ce4cf7065d13667bef32c27066a (patch)
treea2b36c50cedc72479f7ee03f40503e3d7ad70c1f /app/src/main/res
parentf40b9cbde003d9c3cc0eaa0d3c4eadb072f67c4a (diff)
downloadinfinity-for-reddit-1cfdaf41fa7d4ce4cf7065d13667bef32c27066a.tar
infinity-for-reddit-1cfdaf41fa7d4ce4cf7065d13667bef32c27066a.tar.gz
infinity-for-reddit-1cfdaf41fa7d4ce4cf7065d13667bef32c27066a.tar.bz2
infinity-for-reddit-1cfdaf41fa7d4ce4cf7065d13667bef32c27066a.tar.lz
infinity-for-reddit-1cfdaf41fa7d4ce4cf7065d13667bef32c27066a.tar.xz
infinity-for-reddit-1cfdaf41fa7d4ce4cf7065d13667bef32c27066a.tar.zst
infinity-for-reddit-1cfdaf41fa7d4ce4cf7065d13667bef32c27066a.zip
Implemented share and import themes. Fixed some issues of custom theme.
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/drawable-night/ic_import_day_night_24dp.xml9
-rw-r--r--app/src/main/res/drawable/ic_import_day_night_24dp.xml9
-rw-r--r--app/src/main/res/layout/activity_custom_theme_listing.xml1
-rw-r--r--app/src/main/res/layout/activity_rules.xml3
-rw-r--r--app/src/main/res/layout/activity_search_result.xml19
-rw-r--r--app/src/main/res/layout/activity_subscribed_subreddits_multiselection.xml3
-rw-r--r--app/src/main/res/layout/activity_subscribed_thing_listing.xml3
-rw-r--r--app/src/main/res/layout/fragment_create_theme_bottom_sheet.xml (renamed from app/src/main/res/layout/fragment_select_base_theme_bottom_sheet.xml)24
-rw-r--r--app/src/main/res/layout/item_user_custom_theme.xml12
-rw-r--r--app/src/main/res/values/strings.xml16
10 files changed, 81 insertions, 18 deletions
diff --git a/app/src/main/res/drawable-night/ic_import_day_night_24dp.xml b/app/src/main/res/drawable-night/ic_import_day_night_24dp.xml
new file mode 100644
index 00000000..eb39e3f3
--- /dev/null
+++ b/app/src/main/res/drawable-night/ic_import_day_night_24dp.xml
@@ -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:pathData="M13,5v6h1.17L12,13.17 9.83,11L11,11L11,5h2m2,-2L9,3v6L5,9l7,7 7,-7h-4L15,3zM19,18L5,18v2h14v-2z"
+ android:fillColor="#FFFFFF"/>
+</vector>
diff --git a/app/src/main/res/drawable/ic_import_day_night_24dp.xml b/app/src/main/res/drawable/ic_import_day_night_24dp.xml
new file mode 100644
index 00000000..ad852174
--- /dev/null
+++ b/app/src/main/res/drawable/ic_import_day_night_24dp.xml
@@ -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:pathData="M13,5v6h1.17L12,13.17 9.83,11L11,11L11,5h2m2,-2L9,3v6L5,9l7,7 7,-7h-4L15,3zM19,18L5,18v2h14v-2z"
+ android:fillColor="#000000"/>
+</vector>
diff --git a/app/src/main/res/layout/activity_custom_theme_listing.xml b/app/src/main/res/layout/activity_custom_theme_listing.xml
index 37b8f878..5b35b48c 100644
--- a/app/src/main/res/layout/activity_custom_theme_listing.xml
+++ b/app/src/main/res/layout/activity_custom_theme_listing.xml
@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:id="@+id/coordinator_layout_custom_theme_listing_activity"
tools:context=".Activity.CustomThemeListingActivity">
<com.google.android.material.appbar.AppBarLayout
diff --git a/app/src/main/res/layout/activity_rules.xml b/app/src/main/res/layout/activity_rules.xml
index 36d057db..91f35cf2 100644
--- a/app/src/main/res/layout/activity_rules.xml
+++ b/app/src/main/res/layout/activity_rules.xml
@@ -27,7 +27,8 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
- app:popupTheme="@style/AppTheme.PopupOverlay" />
+ app:popupTheme="@style/AppTheme.PopupOverlay"
+ app:navigationIcon="?attr/homeAsUpIndicator" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
diff --git a/app/src/main/res/layout/activity_search_result.xml b/app/src/main/res/layout/activity_search_result.xml
index c4b132c7..63c8212e 100644
--- a/app/src/main/res/layout/activity_search_result.xml
+++ b/app/src/main/res/layout/activity_search_result.xml
@@ -14,12 +14,21 @@
android:background="?attr/toolbarAndTabBackgroundColor"
android:theme="@style/AppTheme.AppBarOverlay">
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/toolbar_search_result_activity"
+ <com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
- android:layout_height="?attr/actionBarSize"
- app:popupTheme="@style/AppTheme.PopupOverlay"
- app:navigationIcon="?attr/homeAsUpIndicator" />
+ android:layout_height="match_parent"
+ app:layout_scrollFlags="scroll|enterAlways"
+ app:titleEnabled="false"
+ app:toolbarId="@+id/toolbar_search_result_activity">
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar_search_result_activity"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ app:popupTheme="@style/AppTheme.PopupOverlay"
+ app:navigationIcon="?attr/homeAsUpIndicator" />
+
+ </com.google.android.material.appbar.CollapsingToolbarLayout>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout_search_result_activity"
diff --git a/app/src/main/res/layout/activity_subscribed_subreddits_multiselection.xml b/app/src/main/res/layout/activity_subscribed_subreddits_multiselection.xml
index ee0ae427..d552fb84 100644
--- a/app/src/main/res/layout/activity_subscribed_subreddits_multiselection.xml
+++ b/app/src/main/res/layout/activity_subscribed_subreddits_multiselection.xml
@@ -28,7 +28,8 @@
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
- app:popupTheme="@style/AppTheme.PopupOverlay" />
+ app:popupTheme="@style/AppTheme.PopupOverlay"
+ app:navigationIcon="?attr/homeAsUpIndicator" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
diff --git a/app/src/main/res/layout/activity_subscribed_thing_listing.xml b/app/src/main/res/layout/activity_subscribed_thing_listing.xml
index 183a0b61..460b1ba6 100644
--- a/app/src/main/res/layout/activity_subscribed_thing_listing.xml
+++ b/app/src/main/res/layout/activity_subscribed_thing_listing.xml
@@ -28,7 +28,8 @@
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
- app:popupTheme="@style/AppTheme.PopupOverlay" />
+ app:popupTheme="@style/AppTheme.PopupOverlay"
+ app:navigationIcon="?attr/homeAsUpIndicator" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
diff --git a/app/src/main/res/layout/fragment_select_base_theme_bottom_sheet.xml b/app/src/main/res/layout/fragment_create_theme_bottom_sheet.xml
index d0adbd83..c5ac6fda 100644
--- a/app/src/main/res/layout/fragment_select_base_theme_bottom_sheet.xml
+++ b/app/src/main/res/layout/fragment_create_theme_bottom_sheet.xml
@@ -11,7 +11,25 @@
android:orientation="vertical">
<TextView
- android:id="@+id/light_theme_text_view_select_base_theme_bottom_sheet_fragment"
+ android:id="@+id/import_theme_text_view_create_theme_bottom_sheet_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
+ android:text="@string/import_theme"
+ android:textColor="?attr/primaryTextColor"
+ android:textSize="?attr/font_default"
+ android:drawableStart="@drawable/ic_import_day_night_24dp"
+ android:drawablePadding="48dp"
+ android:clickable="true"
+ android:focusable="true"
+ android:background="?attr/selectableItemBackground" />
+
+ <TextView
+ android:id="@+id/light_theme_text_view_create_theme_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
@@ -29,7 +47,7 @@
android:background="?attr/selectableItemBackground" />
<TextView
- android:id="@+id/dark_theme_text_view_select_base_theme_bottom_sheet_fragment"
+ android:id="@+id/dark_theme_text_view_create_theme_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
@@ -47,7 +65,7 @@
android:background="?attr/selectableItemBackground" />
<TextView
- android:id="@+id/amoled_theme_text_view_select_base_theme_bottom_sheet_fragment"
+ android:id="@+id/amoled_theme_text_view_create_theme_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
diff --git a/app/src/main/res/layout/item_user_custom_theme.xml b/app/src/main/res/layout/item_user_custom_theme.xml
index 55891961..e8c4dc65 100644
--- a/app/src/main/res/layout/item_user_custom_theme.xml
+++ b/app/src/main/res/layout/item_user_custom_theme.xml
@@ -24,21 +24,21 @@
android:textColor="?attr/primaryTextColor" />
<ImageView
- android:id="@+id/add_image_view_item_user_custom_theme"
+ android:id="@+id/share_image_view_item_user_custom_theme"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
- android:layout_marginStart="32dp"
- android:src="@drawable/ic_add_day_night_24dp"
+ android:layout_marginStart="16dp"
+ android:src="@drawable/ic_share_24dp"
android:background="?attr/selectableItemBackgroundBorderless" />
<ImageView
- android:id="@+id/share_image_view_item_user_custom_theme"
+ android:id="@+id/add_image_view_item_user_custom_theme"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
- android:layout_marginStart="16dp"
- android:src="@drawable/ic_share_24dp"
+ android:layout_marginStart="32dp"
+ android:src="@drawable/ic_add_day_night_24dp"
android:background="?attr/selectableItemBackgroundBorderless" />
</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 22b971ff..a28dfd34 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -431,7 +431,7 @@
<string name="copy_link">Copy Link</string>
<string name="copy_success">Copied</string>
- <string name="copy_failed">Cannot copy the link</string>
+ <string name="copy_link_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>
@@ -620,6 +620,20 @@
<string name="delete_theme_dialog_message">Are you sure to delete %1$s?</string>
<string name="share_theme">Share Theme</string>
<string name="change_theme_name">Change Name</string>
+ <string name="theme_copied">Copied! Paste and share it to other people.</string>
+ <string name="copy_theme_faied">Cannot copy the theme configuration</string>
+ <string name="cannot_find_theme">Cannot find this theme</string>
+ <string name="import_theme">Import Theme</string>
+ <string name="no_data_in_clipboard">Cannot find data in clipboard</string>
+ <string name="import_theme_success">Import theme successful</string>
+ <string name="parse_theme_failed">Parse Theme Failed</string>
+ <string name="share_theme_to_subreddit_dialog_title">Share it to r/Infinity_For_Reddit?</string>
+ <string name="share_theme_to_subreddit_dialog_message">The theme configuration is copied!
+ Do you want to share it to r/Infinity so that other people can use it?</string>
+ <string name="duplicate_theme_name_dialog_title">Duplicate Theme Found</string>
+ <string name="duplicate_theme_name_dialog_message">A theme in the database is also called %1$s. Do you want to change the name of this imported theme?</string>
+ <string name="rename">Rename</string>
+ <string name="override">Override</string>
<string name="color_picker">Color Picker</string>
<string name="invalid_color">Invalid Color</string>