From d17ff0d9251bd2ad84778535dabe4884a4cf9d76 Mon Sep 17 00:00:00 2001 From: Aditya Wasan Date: Fri, 19 Feb 2021 13:57:57 +0530 Subject: [PATCH] Parse extra content into key value pairs (#1321) * ui: add skeleton recyclerview to parse extra content Signed-off-by: Aditya Wasan * ui: add recyclerview and update PasswordEntry to create map of key-value pairs Signed-off-by: Aditya Wasan * password-entry: When key-value pair is not correctly formed, display it as Extra Content Signed-off-by: Aditya Wasan * Fix formatting Signed-off-by: Aditya Wasan * bug: update otp code on main thread Signed-off-by: Aditya Wasan * Add complete string if key-value pair cannot be formed Signed-off-by: Aditya Wasan * test: add a few tests for key-value parsing logic Signed-off-by: Aditya Wasan * prefs: remove SHOW_EXTRA_CONTENT from shared preferences Signed-off-by: Aditya Wasan * Update CHANGELOG.md * Cleanup and refactor Signed-off-by: Harsh Shandilya * PasswordEntryTest: silence nullability warning Signed-off-by: Harsh Shandilya * PasswordEntry: simplify constructor Signed-off-by: Harsh Shandilya * PasswordEntry: annotate test-enablement visibility Signed-off-by: Harsh Shandilya * Reintroduce the catch-all field Signed-off-by: Harsh Shandilya * update parsing logic Signed-off-by: Aditya Wasan * add one more test case Signed-off-by: Aditya Wasan * Add missing newlines Signed-off-by: Harsh Shandilya * Remove unnecessary scrollview Signed-off-by: Harsh Shandilya * rv: do not return if hasExtraContent is false Signed-off-by: Aditya Wasan * Don't anchor RV to bottom Signed-off-by: Harsh Shandilya Co-authored-by: Harsh Shandilya --- .idea/codeStyles/Project.xml | 3 + CHANGELOG.md | 1 + .../msfjarvis/aps/data/password/FieldItem.kt | 27 +++ .../aps/data/password/PasswordEntry.kt | 98 +++++++-- .../aps/ui/adapters/FieldItemAdapter.kt | 85 ++++++++ .../aps/ui/crypto/DecryptActivity.kt | 116 ++++------ .../aps/ui/settings/PasswordSettings.kt | 5 - .../aps/util/settings/PreferenceKeys.kt | 1 - app/src/main/res/layout/decrypt_layout.xml | 199 +++++------------- app/src/main/res/layout/item_field.xml | 27 +++ .../aps/data/password/PasswordEntryTest.kt | 34 ++- 11 files changed, 357 insertions(+), 239 deletions(-) create mode 100644 app/src/main/java/dev/msfjarvis/aps/data/password/FieldItem.kt create mode 100644 app/src/main/java/dev/msfjarvis/aps/ui/adapters/FieldItemAdapter.kt create mode 100644 app/src/main/res/layout/item_field.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index f831e10b..c21a1678 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -36,6 +36,9 @@