Commit Graph

95 Commits (1f633edd7d4436f20ead4ba657b1284b94cca0c6)

Author SHA1 Message Date
Brais Gabín 1f633edd7d For #23046 - Align detekt config between Fenix and Android Components
Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>
2 years ago
Gabriel Luong f1e7b49425 For #24252 - Rename primaryText attribute to textPrimary 2 years ago
Alexandru2909 7e1edc828e For #23719 - Replace preference framework strings with string resources 2 years ago
Gabriel Luong c3a2c355a2 For #23769 - Replace @color/destructive_normal_theme with @color/fx_mobile_text_color_warning 2 years ago
Alexandru2909 811375275b For #23272 - AddLoginFragment use showKeyboard from Components 2 years ago
mcarare afd13fec85 For #21744: Replace InputMethodManager's deprecated toggleSoftInput. 2 years ago
Grigory Kruglov d161e46383 Adjust logins diffing logic for recyclerview 2 years ago
Grigory Kruglov e67753fb4b Scroll to top of logins screen after list changes 2 years ago
Grigory Kruglov 1b305c1398 For #22795: Stop trimming login origins on sorting
Due to the async nature (??) of the trimming code, this is causing severe performance issues
during search.

Looking back through commits, doesn't seem like there's a particularly good reason we were trimming here. All I could find is #9986 (comment) which is lacking explanation of why this is actually useful.

And currently, we're dealing with an origin (not a full url when this was initially written, I think), i.e. https://accounts.firefox.com vs https://accounts.firefox.com/signin. So, the suffix stripping isn't even doing much beyond removing com in vast majority of cases.

So, seems like all of this trimming stuff can be cleaned up.
2 years ago
Alexandru2909 7b04eba324 For #19567 - Change SavedLogins and LoginDetail fragments to extend SecureFragment 2 years ago
mike a 46b5dd2706 Closes #10737: Searching a language/saved password displays a misplaced "x".
Setting max width for the search view in language settings and saved logins screens. Removed SyncAuthClosed event from LocaleSettingsFragment, an apparent copy-paste.
2 years ago
Ben Dean-Kawamura df953b0021 Make findDuplicate() suspend
findLoginToUpdate() should be suspend, but I didn't get mark it that way
on the initial logins work.  Let's make this one suspend, then I can
update findLoginToUpdate() in a-c.
3 years ago
Gabriel Luong 959a142c92 For #21973 - Use destructive_normal_theme in place of R.color.design_color 3 years ago
Sebastian Kaspari 170fa9705e Update Kotlin and Jetpack Compose versions. 3 years ago
Mugurell d3df7369e0
CI for 21827 (#22004)
* Remove redundant calls to setHasOptionsMenu(false)

Fix memory leaks for credit card and login fragments

* Fixes:

Add link to issue tracker
Use activity?.invalidateOptionsMenu() instead of setHasOptionsMenu(false)
Move it inside of 'if' statement to avoid unintended issues when called improperly
Revert changes to AddLoginFragment.kt

* Fix call invocation to redirectToReAuth() from AddLoginFragment.kt
Fix 'when' statement in redirectToReAuth() to use AddLoginFragment

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
3 years ago
Grisha Kruglov 0b5b1a738a Do less work while navigating Logins views
Fetching a set of logins from the store is quite expensive. This commit
avoids doing that while navigating back and forth between the list and
detail views:

- retain processes logins state when navigating into detail view
- use the `get` storage api to obtain specific login, instead of
  `list().filter {...}`
- avoid re-sorting retained logins when navigating back into the list
  view
3 years ago
Grisha Kruglov 97d93eb564 Make linters happy 3 years ago
Ben Dean-Kawamura 34ec442961 Updating Fenix to work with the new logins API
Switched to always using `Login` instead of the `SavedPassword` alias.

Made `MasterPasswordTipProvider.saveLogins()` call
`importLoginsAsync()`.  This is needed because it's the only method that
inputs a `Login` rather than a `LoginEntry`.

Moved the `SavedLoginsStorageController.kt.syncAndUpdateList` call
to inside `add()` and `update()`.  This simplifies the error handling a
bit.

Refactored dupe-checking code to use findLoginToUpdate()

Refactored `AddLoginFragment` / `EditLoginFragment` to put the username
error handling code all in 1 method.  I think it's easier to follow the
logic of showing/hiding the error labels when it's all in one place.
This fixes issues #24103 and #24104.  I would love to address #24102,
but I'm not sure what the correct behavior is there so I just kept that
the same.
3 years ago
Sebastian Kaspari 099e463b4f Issue #21102: Set compileSdkVersion to 31. 3 years ago
Elise Richards 7d481a7836
For #19947: manually add login (#21199)
* [WIP] New Layout for adding login and 'add login' button in 'SavedLoginsListView' to launch it.
Fixed bindings.

* [WIP] Removed "reveal password" button

* [WIP] Added interactor for the add login screen

* [WIP] Trying to check for duplicates

* [WIP] Renaming "addNew..." with "add..."

* [WIP] Check for duplicates

* [WIP] Fixes after merge

* Cleaning up the layout and making edit text for hostname selectable

* Error handling on add login screen. Tests for interactors and controllers

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
3 years ago
Sebastian Kaspari 846274b7cd Enable Android Autofill support in all build types. 3 years ago
Mugurell cb32b1437e For #17917 - Remove the `kotlin-android-extensions` plugin
This means no code will be generated by Kotlin Android Extensions for caching
views and also for @Parcelize annotated classes.

As recommended in the official documentation
https://developer.android.com/topic/libraries/view-binding/migration#gradle
we need to switch on using `kotlinx.parcelize.Parcelize` instead of
`import kotlinx.android.parcel.Parcelize`

For #17917 - Remove the `kotlin-android-extensions` plugin

This means no code will be generated by Kotlin Android Extensions for caching
views and also for @Parcelize annotated classes.

As recommended in the official documentation
https://developer.android.com/topic/libraries/view-binding/migration#gradle
we need to switch on using `kotlinx.parcelize.Parcelize` instead of
`import kotlinx.android.parcel.Parcelize`
3 years ago
Mugurell 621c388c12 For #17917 - Finish migrating all synthetics usages 3 years ago
codrut.topliceanu 34e063669a For #17917: Use View binding in Login Exceptions 3 years ago
Sebastian Kaspari 7fed8b4ab5 Add preference for enabling/disabling Android Autofill from within the app. 3 years ago
Sebastian Kaspari 971b419d77 Run ktlintFormat to adapt to latest formatting rules. 3 years ago
mcarare cca7892e91 For #17917: Use View binding in settings screens. 3 years ago
mcarare 8b13e382fd For #17917: Use View binding in lists. 3 years ago
Roger Yang 74c1cc82fb Closes #19921: Update appcompat and fragment dependencies to 1.3.x 3 years ago
Elise Richards 279d59897c
For #18264 - Add biometric prompt to credit card settings (#19505) 3 years ago
Codrut Topliceanu 277034546f
For #18262 - [Credit cards] Turn the "Sync cards across devices" button into a "Sync cards" toggle (#19207)
* For #18262 - Turns "Sync cards/logins" into toggle
3 years ago
Gabriel Luong 6eb528f912
For #18272 - [Edit card] Display a saved card information in the Edit card screen (#18884) 3 years ago
MarcLeclair 990bfa7e6d
16900 make navgraph inflation asynchronous (#18889)
* For #16900: implement async navgraph inflation

For #16900: removed nav graph from xml

For #16900: inflate navGraph programatically

For #16900: Made NavGraph inflation asynchronous

For #16900: Changed to block with runBlocking

For #16900: Refactored blocking call into a function

For 16900: NavGraph inflation is now async

We now attach the nav graph (or check if its attached) on every nav call ( an extension function for NavController).
This is done by checking the value of the job stored in PerfNavController.map which keeps track of the job with the NavController as a Key.
If the job hasn't been completed, it will block the main thread until the job is done. The job itself is responsible for attaching the navgraph
to the navcontroller (and the inflation of the latter too)

For 16900: rebased upstream master

For 16900: Rebase on master

For #16900: Fixed Async Navgraph navigation per review comments.

1)The Asynchronous method is now found in NavGraphProvider.kt. It creates a job on the IO dispatcher
2)The Job is tracked through a WeakHashMap from Controller --> NavGraph
3)The Coroutine scope doesn't use MainScope() anymore
4)The Coroutine is cancelled if the Activity is destroyed
5)The tests mockk the blockForNavGraphInflation method through the FenixReoboelectricTestApplication instead of calling the mock every setup()

For #16900: inflateNavGraphAsync now takes navController

For #16900: Pass lifecycleScope to NavGraphProvider

For #16900: removed unused mock

For #16900: Added linter rules for navigate calls

We need linting rules to make sure no one calls the NavController.navigate() methods

For #16900: Added TestRule to help abstract the mocks in the code

For 16900: Fix linting problems

For #16900: Cleaned duplicated code in tests

For #16900: cleaned up NavGraphTestRule for finished test

For #16900: had to revert an accidentally edited file

For #16900: rebased master

* For #16900: Review nits for async navgraph

This is composed of squash commits, the original messages can be found below:

-> DisableNavGraphProviderAssertionRule + kdoc.

Use test rule in RobolectricApplication.

Fix failing CrashReporterControllerTest

Fix blame by -> navigate in tests.

This commit was generated by the following commands only:
```
find app/src/test -type f -exec sed -i '' "/import org.mozilla.fenix.ext.navigateBlockingForAsyncNavGraph/d" {} \;
find app/src/test -type f -exec sed -i "" "s/navigateBlockingForAsyncNavGraph/navigate/g" {} \;
git checkout app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
```

Fix various blame

This is expected to be squashed into the first commit so, if so, it'd
fix the blame.

Move test rule to helpers pkg.

add missing license header

Add import change I missed

fix unused imports

Replace robolectricTestrunner with test rule.

Improve navGraphProvider docs

Remove unnecessary rule as defined by robolectric.

add clarifying comment to robolectric

remove unnecessary space

* For #16900: nit fixes for MozillaNavigateCheck and lint fixes

3 squash commits:
 *Changed violation message and fixed the lint rule for MozillaNavigateCheck
 *Added suppression to NavController.kt
 *Fixed detekt violations

* For 16900: Fixed failing tests

Co-authored-by: Michael Comella <michael.l.comella@gmail.com>
3 years ago
Gabriel Luong a31ce9bf67
For #18241 - Refactor SyncLoginsPreferenceView to SyncPreferenceView for reusability (#18383)
This refactors SyncLoginsPreferenceView to SyncPreferenceView so that it be can be used in the
Credit cards preference for the equivalent "Sync cards across devices" preference.
3 years ago
mcarare 05a14efda7 For #18228: Populate menu options in onResume along with toolbar init. 3 years ago
Gabriel Luong ccbca2cf78 For #18202 - Refactor BiometricPromptFeature out of logins into settings 3 years ago
Victor 2193be27b2 Solves Leaks on SavedLoginFragment
disables options menu to avoid leak
 removes on click listener to avoid leak
3 years ago
Abhinav Gupta 13f5df33a1 Hiding the usernameview if the data item.username is blank. 3 years ago
ekager f5b068a453 For #17785 - Use screenshots setting when adding secure flag 3 years ago
Hakkı Kaan Çalışkan e41cc5a414 For #17303: Move ext fun runIfFragmentIsAttached to utils
move to ext
3 years ago
Jonathan Almeida 78715c3020
For #13477 - Move BiometricPrompt to a separate feature (#16498)
Instead of simply fixing the memory leak for this issue by directly
removing references, it makes more sense to move the whole
BiometricPrompt out of the fragment and into it's own feature to be
re-usable.
4 years ago
Jocelyne Abi Haidar a5de2c0352 For #15675: Disable Save button when editing saved login until something has been changed
set save button state by calling invalidateOptionsMenu, causing onPrepareOptionsMenu to be called which will enable/disable the save button depending on if changes have been made or not
4 years ago
ekager 01eedd159a No issue: Update biometric, core, and recyclerview libraries 4 years ago
Grisha Kruglov 51dab196c4 Closes #15443: Use fragment's lifecycleScope for AlertDialog actions 4 years ago
Tiger Oakes 25f62f1c76 Extract locale settings initial state 4 years ago
Tiger Oakes acbad66f45 Add test for initial logins list state 4 years ago
Grisha Kruglov d98eba1d64 Closes #15432: Invoke UI updates on main thread in response to account events 4 years ago
Jocelyne d45e482373
For #11800: Hide reveal and clear password icons if the password is empty when editing a saved login (#15244)
Co-authored-by: Jocelyne Abi Haidar <jocelyne.abihaidar@gotocme.com>
4 years ago
ekager 83ffcac57e For #13926 - MP migration 4 years ago
Mugurell 75c496f237 For #13037 - Cleanup - have the camera check in just one place
This patch reverts a previous commit for the issue which added the camera check
in two places.
With a new solution to check if the device has camera only in
TurnOnSyncFragment we need to cleanup the previous checks.
4 years ago