aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorFabian Henneke <FabianHenneke@users.noreply.github.com>2020-04-06 22:56:52 +0200
committerGitHub <noreply@github.com>2020-04-07 02:26:52 +0530
commite3a49e2632cfda9c548728ae306ceb06374855ea (patch)
tree2f822eb194f6b4e0e74ab68f5009571d35c2a8e0 /app/src/main/res
parent034babcbf40517e6abfce5aa7ae5ca647033f971 (diff)
Modernize file listing and search in AutofillFilterActivity (#683)
* WIP: Modernize file listing and search * Refactor * Implement fuzzy search * Improve ViewModel API and introduce Adapter * Integrate new search into AutofillFilterActivity and dedebounce * Improve no results layout * Reformat * Highlight origin in FileBased directory structure * Extract highlighting logic into DirectoryStructure * Trim whitespace before searching * Remove debug logging * Remove more debug logging * Organize imports * Remove imports * Update app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt Co-Authored-By: Harsh Shandilya <me@msfjarvis.dev> * Address review comments Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/layout/activity_oreo_autofill_filter.xml33
-rw-r--r--app/src/main/res/values/strings.xml1
2 files changed, 25 insertions, 9 deletions
diff --git a/app/src/main/res/layout/activity_oreo_autofill_filter.xml b/app/src/main/res/layout/activity_oreo_autofill_filter.xml
index fb745afc..7c8740c3 100644
--- a/app/src/main/res/layout/activity_oreo_autofill_filter.xml
+++ b/app/src/main/res/layout/activity_oreo_autofill_filter.xml
@@ -28,7 +28,7 @@
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
app:endIconMode="clear_text"
- app:layout_constraintBottom_toTopOf="@id/rvPassword"
+ app:layout_constraintBottom_toTopOf="@id/rvPasswordSwitcher"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cover">
@@ -42,19 +42,34 @@
android:inputType="text"
tools:text="example.com" />
</com.google.android.material.textfield.TextInputLayout>
-
- <androidx.recyclerview.widget.RecyclerView
- android:id="@+id/rvPassword"
+ <ViewSwitcher
+ android:id="@+id/rvPasswordSwitcher"
android:layout_width="0dp"
- android:layout_height="0dp"
android:layout_marginTop="@dimen/activity_vertical_margin"
- android:scrollbars="vertical"
app:layout_constraintBottom_toTopOf="@id/shouldMatch"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/searchLayout"
- tools:itemCount="5"
- tools:listitem="@layout/password_row_layout" />
+ android:layout_height="0dp">
+
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/rvPassword"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scrollbars="vertical"
+ tools:itemCount="5"
+ tools:listitem="@layout/password_row_layout" />
+
+ <TextView
+ android:id="@+id/rvPasswordEmpty"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginStart="@dimen/activity_horizontal_margin"
+ android:layout_marginTop="@dimen/activity_vertical_margin"
+ android:text="@string/oreo_autofill_filter_no_results"
+ android:textSize="18sp" />
+
+ </ViewSwitcher>
<Switch
android:id="@+id/shouldMatch"
@@ -67,7 +82,7 @@
app:layout_constraintBottom_toTopOf="@id/shouldClear"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/rvPassword"
+ app:layout_constraintTop_toBottomOf="@id/rvPasswordSwitcher"
app:layout_constraintVertical_bias="1.0"
tools:text="Match with example.org" />
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ff9a2ea8..87d97d5b 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -247,6 +247,7 @@
<!-- Oreo Autofill -->
<string name="oreo_autofill_match_with">Match with %1$s</string>
<string name="oreo_autofill_matches_clear_existing">Clear existing matches</string>
+ <string name="oreo_autofill_filter_no_results">No results.</string>
<string name="oreo_autofill_search_in_store">Search in storeā€¦</string>
<string name="oreo_autofill_save_internal_error">Save failed due to an internal error</string>
<string name="oreo_autofill_save_app_not_supported">This app is currently not supported</string>