aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res/layout
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-09-29 14:19:54 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-09-29 14:19:54 +0000
commit6e4519ef93f295178e0b850b739bd0085de6aa17 (patch)
tree882925d4680567193e06472e4c40e856f6c43acc /app/src/main/res/layout
parent8dd4759035bae9cff7a0d8bd0af1d1624193c796 (diff)
downloadinfinity-for-reddit-6e4519ef93f295178e0b850b739bd0085de6aa17.tar
infinity-for-reddit-6e4519ef93f295178e0b850b739bd0085de6aa17.tar.gz
infinity-for-reddit-6e4519ef93f295178e0b850b739bd0085de6aa17.tar.bz2
infinity-for-reddit-6e4519ef93f295178e0b850b739bd0085de6aa17.tar.lz
infinity-for-reddit-6e4519ef93f295178e0b850b739bd0085de6aa17.tar.xz
infinity-for-reddit-6e4519ef93f295178e0b850b739bd0085de6aa17.tar.zst
infinity-for-reddit-6e4519ef93f295178e0b850b739bd0085de6aa17.zip
Display search history in SearchActivity. Save suggested sort type and nsfw info in database for SubredditData. Fix an issue in parsing posts.
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r--app/src/main/res/layout/activity_search.xml74
-rw-r--r--app/src/main/res/layout/item_recent_search_query.xml19
2 files changed, 69 insertions, 24 deletions
diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml
index 0048e1fc..972ba2af 100644
--- a/app/src/main/res/layout/activity_search.xml
+++ b/app/src/main/res/layout/activity_search.xml
@@ -48,38 +48,64 @@
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
- <RelativeLayout
- android:id="@+id/subreddit_name_relative_layout_search_activity"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true"
- android:padding="16dp">
+ android:orientation="vertical">
- <TextView
- android:id="@+id/search_in_text_view_search_activity"
- android:layout_width="wrap_content"
+ <RelativeLayout
+ android:id="@+id/subreddit_name_relative_layout_search_activity"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/search_in"
- android:textColor="?attr/colorAccent"
- android:textSize="?attr/font_default"
- android:fontFamily="?attr/font_family" />
+ android:background="?attr/selectableItemBackground"
+ android:clickable="true"
+ android:focusable="true"
+ android:padding="16dp">
+
+ <TextView
+ android:id="@+id/search_in_text_view_search_activity"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/search_in"
+ android:textColor="?attr/colorAccent"
+ android:textSize="?attr/font_default"
+ android:fontFamily="?attr/font_family" />
+
+ <TextView
+ android:id="@+id/subreddit_name_text_view_search_activity"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:layout_marginStart="32dp"
+ android:layout_marginEnd="16dp"
+ android:layout_toEndOf="@id/search_in_text_view_search_activity"
+ android:text="@string/all_subreddits"
+ android:textColor="?attr/primaryTextColor"
+ android:textSize="?attr/font_default"
+ android:fontFamily="?attr/font_family" />
+
+ </RelativeLayout>
+
+ <View
+ android:id="@+id/divider_search_activity"
+ android:layout_width="match_parent"
+ android:layout_height="1dp" />
<TextView
- android:id="@+id/subreddit_name_text_view_search_activity"
+ android:id="@+id/recent_summary_text_view_search_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_centerVertical="true"
- android:layout_marginStart="32dp"
- android:layout_marginEnd="16dp"
- android:layout_toEndOf="@id/search_in_text_view_search_activity"
- android:text="@string/all_subreddits"
- android:textColor="?attr/primaryTextColor"
- android:textSize="?attr/font_default"
- android:fontFamily="?attr/font_family" />
-
- </RelativeLayout>
+ android:padding="16dp"
+ android:text="@string/recent_searches"
+ android:fontFamily="?attr/font_family"
+ android:visibility="gone" />
+
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/recycler_view_search_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
+ </LinearLayout>
</androidx.core.widget.NestedScrollView>
diff --git a/app/src/main/res/layout/item_recent_search_query.xml b/app/src/main/res/layout/item_recent_search_query.xml
new file mode 100644
index 00000000..f014e2fe
--- /dev/null
+++ b/app/src/main/res/layout/item_recent_search_query.xml
@@ -0,0 +1,19 @@
+<?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="wrap_content"
+ android:padding="16dp"
+ android:clickable="true"
+ android:focusable="true"
+ android:background="?attr/selectableItemBackground">
+
+ <TextView
+ android:id="@+id/recent_search_query_text_view_item_recent_search_query"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:fontFamily="?attr/font_family"
+ android:textSize="?attr/font_default"
+ android:drawablePadding="16dp" />
+
+</LinearLayout> \ No newline at end of file