Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
798: routing back to itemlist on login/search/feedback forms (#890)
Browse files Browse the repository at this point in the history
* Investigation

* Add locking routes.

* Explicitly ignore autofill on search and edit fields

* Ignore autofill on webviews

* Remove comments and clean up lint
  • Loading branch information
Elise Richards authored Sep 9, 2019
1 parent b07e161 commit fea2a77
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ class LockboxAutofillService(
lateinit var dataStore: DataStore

override fun onConnected() {
dispatcher.dispatch(LifecycleAction.AutofillStart)
telemetryStore.injectContext(this)
accountStore.injectContext(this)
fxaSupport.injectContext(this)
dataStore = DataStore.shared
dispatcher.dispatch(LifecycleAction.AutofillStart)
}

override fun onDisconnected() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/mozilla/lockbox/action/DialogAction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ sealed class DialogAction(
R.color.red
),
listOf(
ItemDetail(itemId)
ItemList
)
)
}
15 changes: 10 additions & 5 deletions app/src/main/java/mozilla/lockbox/presenter/AppRoutePresenter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ class AppRoutePresenter(
R.id.fragment_fxa_login to R.id.fragment_autofill_onboarding -> R.id.action_fxaLogin_to_autofill_onboarding
R.id.fragment_fxa_login to R.id.fragment_onboarding_confirmation -> R.id.action_fxaLogin_to_onboarding_confirmation

R.id.fragment_fingerprint_onboarding to R.id.fragment_onboarding_confirmation ->
R.id.action_fingerprint_onboarding_to_confirmation
R.id.fragment_fingerprint_onboarding to R.id.fragment_autofill_onboarding ->
R.id.action_onboarding_fingerprint_to_autofill
R.id.fragment_fingerprint_onboarding to R.id.fragment_onboarding_confirmation -> R.id.action_fingerprint_onboarding_to_confirmation
R.id.fragment_fingerprint_onboarding to R.id.fragment_autofill_onboarding -> R.id.action_onboarding_fingerprint_to_autofill

R.id.fragment_autofill_onboarding to R.id.fragment_item_list -> R.id.action_to_itemList
R.id.fragment_autofill_onboarding to R.id.fragment_onboarding_confirmation -> R.id.action_autofill_onboarding_to_confirmation
Expand All @@ -143,13 +141,20 @@ class AppRoutePresenter(
R.id.fragment_item_detail to R.id.fragment_webview -> R.id.action_to_webview
R.id.fragment_item_detail to R.id.fragment_item_list -> R.id.action_to_itemList
R.id.fragment_item_detail to R.id.fragment_item_edit -> R.id.action_itemDetail_to_edit
R.id.fragment_item_detail to R.id.fragment_locked -> R.id.action_itemDetail_to_locked

R.id.fragment_item_edit to R.id.fragment_item_detail -> R.id.action_itemEdit_to_itemDetail
R.id.fragment_item_edit to R.id.fragment_item_list -> R.id.action_itemEdit_to_itemList
R.id.fragment_item_edit to R.id.fragment_locked -> R.id.action_itemEdit_to_locked

R.id.fragment_setting to R.id.fragment_webview -> R.id.action_to_webview
R.id.fragment_setting to R.id.fragment_locked -> R.id.action_settings_to_locked

R.id.fragment_account_setting to R.id.fragment_welcome -> R.id.action_to_welcome

R.id.fragment_filter to R.id.fragment_item_detail -> R.id.action_filter_to_itemDetail
R.id.fragment_filter to R.id.fragment_item_list -> R.id.action_filter_to_itemList
R.id.fragment_filter to R.id.fragment_locked -> R.id.action_filter_to_locked

R.id.fragment_filter_backdrop to R.id.fragment_item_detail -> R.id.action_filter_to_itemDetail

else -> null
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/res/layout/fragment_filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:backgroundTint="@color/background_grey"
tools:context=".view.FilterFragment">
android:importantForAutofill="noExcludeDescendants"
tools:context=".view.FilterFragment"
tools:ignore="UnusedAttribute">

<include layout="@layout/include_backable_filter"/>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/entriesView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
tools:ignore="Autofill"/>
</LinearLayout>
6 changes: 4 additions & 2 deletions app/src/main/res/layout/fragment_item_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fragment_item_detail"
android:background="@color/background_grey" >
android:background="@color/background_grey"
android:importantForAutofill="noExcludeDescendants"
tools:ignore="UnusedAttribute">

<include layout="@layout/fragment_warning"
android:layout_width="match_parent"
Expand Down Expand Up @@ -213,7 +215,7 @@
card_view:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/inputLayoutUsername"
tools:ignore="RtlSymmetry">
<androidx.appcompat.widget.AppCompatEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputPassword"
style="@style/EditTextStyle"
android:layout_width="match_parent"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_item_edit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
android:overScrollMode="ifContentScrolls"
android:windowSoftInputMode="adjustPan"
android:background="@color/background_grey"
android:importantForAutofill="noExcludeDescendants"
tools:ignore="UnusedAttribute"
style="@style/EditItemDetail" >

<androidx.appcompat.widget.Toolbar
Expand Down Expand Up @@ -106,7 +108,7 @@
card_view:layout_constraintEnd_toEndOf="parent"
tools:ignore="RtlSymmetry">

<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputName"
style="@style/EditTextStyle"
android:layout_width="match_parent"
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/res/layout/fragment_webview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
android:layout_height="match_parent"
android:id="@+id/fragment_webview"
android:orientation="vertical"
tools:context=".view.AppWebPageFragment">
android:importantForAutofill="noExcludeDescendants"
tools:context=".view.AppWebPageFragment"
tools:ignore="UnusedAttribute">

<include layout="@layout/include_backable"
app:layout_constraintVertical_chainStyle="packed"/>
Expand All @@ -31,6 +33,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="ifContentScrolls"
android:importantForAutofill="noExcludeDescendants"
tools:ignore="Autofill"
app:layout_constraintTop_toBottomOf="@id/toolbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_chainStyle="packed"
Expand Down
23 changes: 21 additions & 2 deletions app/src/main/res/navigation/graph_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@
app:launchSingleTop="true"
app:popUpTo="@id/fragment_item_edit"
app:popUpToInclusive="true"/>
<action
android:id="@+id/action_itemDetail_to_locked"
app:destination="@id/fragment_locked"
app:popUpToInclusive="true"/>
</fragment>

<fragment
Expand All @@ -164,8 +168,12 @@
android:defaultValue="MISSING_ID"
app:argType="string"/>
<action
android:id="@+id/action_itemEdit_to_itemDetail"
app:destination="@id/fragment_item_detail"
android:id="@+id/action_itemEdit_to_itemList"
app:destination="@id/fragment_item_list"
app:popUpToInclusive="true"/>
<action
android:id="@+id/action_itemEdit_to_locked"
app:destination="@id/fragment_locked"
app:popUpToInclusive="true"/>
</fragment>

Expand All @@ -174,6 +182,10 @@
android:name="mozilla.lockbox.view.SettingFragment"
android:label="@string/nav_menu_settings"
tools:layout="@layout/fragment_setting">
<action
android:id="@+id/action_settings_to_locked"
app:destination="@id/fragment_locked"
app:popUpToInclusive="true"/>
</fragment>

<fragment
Expand Down Expand Up @@ -203,6 +215,13 @@
<action
android:id="@+id/action_filter_to_itemDetail"
app:destination="@id/fragment_item_detail"/>
<action
android:id="@+id/action_filter_to_itemList"
app:destination="@id/fragment_item_list"/>
<action
android:id="@+id/action_filter_to_locked"
app:destination="@id/fragment_locked"
app:popUpToInclusive="true"/>
</fragment>

<fragment
Expand Down

0 comments on commit fea2a77

Please sign in to comment.