Add a time option to some sort types. Remember the last sort type.

This commit is contained in:
Alex Ning
2019-10-14 00:08:21 +08:00
parent d82b1e6305
commit fdca23fa14
38 changed files with 869 additions and 241 deletions

View File

@@ -0,0 +1,100 @@
<?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"
android:paddingBottom="8dp"
tools:context=".Fragment.SortTimeBottomSheetFragment">
<TextView
android:id="@+id/hour_text_view_sort_time_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_time_hour"
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/day_text_view_sort_time_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_time_day"
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/week_text_view_sort_time_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_time_week"
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/month_text_view_sort_time_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_time_month"
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/year_text_view_sort_time_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_time_year"
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/all_time_text_view_sort_time_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_time_all_time"
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>

View File

@@ -188,6 +188,12 @@
<string name="sort_relevance">Relevance</string>
<string name="sort_comments">Comments</string>
<string name="sort_activity">Activity</string>
<string name="sort_time_hour">Hour</string>
<string name="sort_time_day">Day</string>
<string name="sort_time_week">Week</string>
<string name="sort_time_month">Month</string>
<string name="sort_time_year">Year</string>
<string name="sort_time_all_time">All Time</string>
<string name="open_link_with">Open link with</string>
<string name="no_browser_found">No browser found</string>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/app_label"
android:value="@string/app_label"
android:hint="@string/search_hint"
android:voiceSearchMode="showVoiceSearchButton|launchRecognizer" >
</searchable>