aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-07-28 16:52:08 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-07-28 16:52:08 +0000
commit111ba8e5fc95c3fb5dbbff472e1a8dbbb52a28af (patch)
tree426b3e0188d931189b69e051f54fe3c4bb319c6c /app/src/main/res
parent40fc423b337352e1a47e361dac052213bb81ee26 (diff)
downloadinfinity-for-reddit-111ba8e5fc95c3fb5dbbff472e1a8dbbb52a28af.tar
infinity-for-reddit-111ba8e5fc95c3fb5dbbff472e1a8dbbb52a28af.tar.gz
infinity-for-reddit-111ba8e5fc95c3fb5dbbff472e1a8dbbb52a28af.tar.bz2
infinity-for-reddit-111ba8e5fc95c3fb5dbbff472e1a8dbbb52a28af.tar.lz
infinity-for-reddit-111ba8e5fc95c3fb5dbbff472e1a8dbbb52a28af.tar.xz
infinity-for-reddit-111ba8e5fc95c3fb5dbbff472e1a8dbbb52a28af.tar.zst
infinity-for-reddit-111ba8e5fc95c3fb5dbbff472e1a8dbbb52a28af.zip
Sorting in SearchResultActivity is available. Switch DataSource instead of replacing fragments when changing sorting types. Minor bugs fixed.
Diffstat (limited to '')
-rw-r--r--app/src/main/res/layout/fragment_post_type_bottom_sheet.xml35
-rw-r--r--app/src/main/res/layout/fragment_search_post_sort_type_bottom_sheet.xml77
-rw-r--r--app/src/main/res/layout/fragment_search_user_and_subreddit_sort_type_bottom_sheet.xml36
-rw-r--r--app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml18
-rw-r--r--app/src/main/res/menu/search_result_activity.xml11
-rw-r--r--app/src/main/res/values-night/colors.xml4
-rw-r--r--app/src/main/res/values/colors.xml2
-rw-r--r--app/src/main/res/values/dimens.xml1
-rw-r--r--app/src/main/res/values/strings.xml6
9 files changed, 153 insertions, 37 deletions
diff --git a/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml
index 1e3659d1..81f20963 100644
--- a/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml
+++ b/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml
@@ -1,18 +1,9 @@
<?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_width="match_parent"
android:layout_height="match_parent"
- android:paddingBottom="8dp">
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="24dp"
- android:paddingBottom="16dp"
- android:paddingStart="32dp"
- android:paddingEnd="32dp"
- android:text="@string/bottom_sheet_post_type"
- android:textSize="18sp" />
+ android:paddingBottom="8dp"
+ android:orientation="vertical">
<LinearLayout
android:id="@+id/text_type_linear_layout_post_type_bottom_sheet_fragment"
@@ -30,7 +21,7 @@
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="center_vertical"
- android:layout_marginEnd="32dp"
+ android:layout_marginEnd="48dp"
android:src="@drawable/ic_outline_text_24px"
android:tint="@color/primaryTextColor" />
@@ -38,7 +29,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:text="@string/bottom_sheet_post_text" />
+ android:text="@string/bottom_sheet_post_text"
+ android:textColor="@color/primaryTextColor" />
</LinearLayout>
@@ -58,7 +50,7 @@
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="center_vertical"
- android:layout_marginEnd="32dp"
+ android:layout_marginEnd="48dp"
android:src="@drawable/ic_link"
android:tint="@color/primaryTextColor" />
@@ -66,7 +58,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:text="@string/bottom_sheet_post_link" />
+ android:text="@string/bottom_sheet_post_link"
+ android:textColor="@color/primaryTextColor" />
</LinearLayout>
@@ -86,7 +79,7 @@
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="center_vertical"
- android:layout_marginEnd="32dp"
+ android:layout_marginEnd="48dp"
android:src="@drawable/ic_menu_gallery"
android:tint="@color/primaryTextColor" />
@@ -94,7 +87,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:text="@string/bottom_sheet_post_image" />
+ android:text="@string/bottom_sheet_post_image"
+ android:textColor="@color/primaryTextColor" />
</LinearLayout>
@@ -114,7 +108,7 @@
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
- android:layout_marginEnd="32dp"
+ android:layout_marginEnd="48dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_outline_video_label_24px"
android:tint="@color/primaryTextColor" />
@@ -123,7 +117,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:text="@string/bottom_sheet_post_video" />
+ android:text="@string/bottom_sheet_post_video"
+ android:textColor="@color/primaryTextColor" />
</LinearLayout>
diff --git a/app/src/main/res/layout/fragment_search_post_sort_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_search_post_sort_type_bottom_sheet.xml
new file mode 100644
index 00000000..1db23d62
--- /dev/null
+++ b/app/src/main/res/layout/fragment_search_post_sort_type_bottom_sheet.xml
@@ -0,0 +1,77 @@
+<?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="match_parent"
+ android:paddingBottom="8dp">
+
+ <TextView
+ android:id="@+id/relevance_type_text_view_search_sort_type_bottom_sheet_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/sort_relevance"
+ android:textColor="@color/primaryTextColor"
+ 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/hot_type_text_view_search_sort_type_bottom_sheet_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/sort_hot"
+ android:textColor="@color/primaryTextColor"
+ 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/top_type_text_view_search_sort_type_bottom_sheet_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/sort_top"
+ android:textColor="@color/primaryTextColor"
+ 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/new_type_text_view_search_sort_type_bottom_sheet_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/sort_new"
+ android:textColor="@color/primaryTextColor"
+ 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/comments_type_text_view_search_sort_type_bottom_sheet_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/sort_comments"
+ android:textColor="@color/primaryTextColor"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
+ android:clickable="true"
+ android:focusable="true"
+ android:background="?attr/selectableItemBackground" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_search_user_and_subreddit_sort_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_search_user_and_subreddit_sort_type_bottom_sheet.xml
new file mode 100644
index 00000000..acc7e65a
--- /dev/null
+++ b/app/src/main/res/layout/fragment_search_user_and_subreddit_sort_type_bottom_sheet.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingBottom="8dp"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/relevance_type_text_view_search_user_and_subreddit_sort_type_bottom_sheet_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/sort_relevance"
+ android:textColor="@color/primaryTextColor"
+ 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/activity_type_text_view_search_user_and_subreddit_sort_type_bottom_sheet_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/sort_activity"
+ android:textColor="@color/primaryTextColor"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
+ android:clickable="true"
+ android:focusable="true"
+ android:background="?attr/selectableItemBackground" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml
index d3977d81..e059a36b 100644
--- a/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml
+++ b/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml
@@ -5,21 +5,11 @@
android:paddingBottom="8dp">
<TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="24dp"
- android:paddingBottom="16dp"
- android:paddingStart="32dp"
- android:paddingEnd="32dp"
- android:text="@string/sort"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp" />
-
- <TextView
android:id="@+id/best_type_text_view_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_best"
+ android:textColor="@color/primaryTextColor"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
@@ -33,6 +23,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_hot"
+ android:textColor="@color/primaryTextColor"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
@@ -46,6 +37,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_new"
+ android:textColor="@color/primaryTextColor"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
@@ -59,6 +51,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_random"
+ android:textColor="@color/primaryTextColor"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
@@ -72,6 +65,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_rising"
+ android:textColor="@color/primaryTextColor"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
@@ -85,6 +79,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_top"
+ android:textColor="@color/primaryTextColor"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
@@ -98,6 +93,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_controversial"
+ android:textColor="@color/primaryTextColor"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
diff --git a/app/src/main/res/menu/search_result_activity.xml b/app/src/main/res/menu/search_result_activity.xml
index 1fe4fd88..b4db6c93 100644
--- a/app/src/main/res/menu/search_result_activity.xml
+++ b/app/src/main/res/menu/search_result_activity.xml
@@ -2,15 +2,22 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
- android:id="@+id/action_search_search_result_activity"
+ android:id="@+id/action_sort_search_result_activity"
android:orderInCategory="1"
android:title="@string/action_search"
+ android:icon="@drawable/ic_outline_sort_24px"
+ app:showAsAction="ifRoom" />
+
+ <item
+ android:id="@+id/action_search_search_result_activity"
+ android:orderInCategory="2"
+ android:title="@string/action_search"
android:icon="@drawable/ic_search_white_24dp"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_refresh_search_result_activity"
- android:orderInCategory="2"
+ android:orderInCategory="3"
android:title="@string/action_refresh"
app:showAsAction="never" />
</menu> \ No newline at end of file
diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml
index 6b6e8290..a08dfe08 100644
--- a/app/src/main/res/values-night/colors.xml
+++ b/app/src/main/res/values-night/colors.xml
@@ -23,4 +23,8 @@
<color name="backgroundColor">#121212</color>
<color name="backgroundColorPrimaryDark">#1565C0</color>
+
+ <color name="roundedBottomSheetPrimaryBackground">#242424</color>
+
+ <color name="roundedBottomSheetPrimaryNavigationBarColor">#000000</color>
</resources>
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index a4f27cd2..ff024d93 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -24,5 +24,7 @@
<color name="backgroundColorPrimaryDark">@color/colorPrimaryDark</color>
+ <color name="roundedBottomSheetPrimaryBackground">#FFFFFF</color>
+
<color name="roundedBottomSheetPrimaryNavigationBarColor">#000000</color>
</resources>
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index ddc21110..eabd373e 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -7,7 +7,6 @@
<dimen name="fab_margin">16dp</dimen>
<dimen name="app_bar_height">180dp</dimen>
<dimen name="text_margin">16dp</dimen>
- <dimen name="roundedBottomSheetCornerRadiusTopPadding">0dp</dimen>
<dimen name="roundedBottomSheetCornerRadiusLeftPadding">0dp</dimen>
<dimen name="roundedBottomSheetCornerRadiusRightPadding">0dp</dimen>
</resources> \ 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 80775602..8be8345e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -142,7 +142,7 @@
<string name="sort_rising">Rising</string>
<string name="sort_top">Top</string>
<string name="sort_controversial">Controversial</string>
-
- <!-- TODO: Remove or change this placeholder text -->
- <string name="hello_blank_fragment">Hello blank fragment</string>
+ <string name="sort_relevance">Relevance</string>
+ <string name="sort_comments">Comments</string>
+ <string name="sort_activity">Activity</string>
</resources>