5332: For #2483#2629: Close tab with no history on back press and return to parent if available r=ekager a=mawen7
Co-authored-by: mawen7 <mawen7@users.noreply.github.com>
* For #4596: move code from CollectionCreationComponent to CollectionCreationStore
Other than adding comments, no changes were made. The code will be updated in a following commit. This is in order to make the commit diff more readable.
* For 4596: update CollectionCreateStore to libstate
* For 4596: copied CollectionCreationUIView into CollectionCreationView
Otherwise, no code was changed. The next commit will update this code. This is in order to make the commit diff more readable.
* For 4596: update CollectionCreationView to LibState
Note that the minimal changes possible to enable migration were made. Refactoring will happen in a later commit.
* For 4596: updated CollectionCreationTabListAdapter to work with the new View
* For 4596: updated SaveCollectionListAdapter to work with the new View
* For 4596: implemented CollectionCreationController
For now, it has an identical interface to the interactor. In a later commit several of its responsibilities will be moved around, some to the interactor and some to the reducer
* For 4596: copied over previous reducer code
No other changes were made. The code will be updated in the following commit. This is done to make changes more readable for the reviewer
* For 4596: update reducer code param names
Otherwise, no changes at this time
* For 4596: add arguments to CreateCollectionFragment in nav_graph
These will be used to replace the current CreateCollectionViewModel, which shares data between fragments in a way that doesn't fit within our architecture.
* For 4596: pass arguments to collection via transaction instead of VM
The VM will be removed in a later commit
* For 4596: update BrowserToolbarController to share state to collection via its Direction
* For 4596: removed CreateCollectionViewModel
* For 4596: test tab retrieval in CreateCollectionFragment
* For 4596: fix crashing CreateCollectionFragmentTest
* For 4596: removed classes create collection classes used by old architecture
* For 4596: collection interactor rename + kdoc
* For 4596: moved collection interactor interface
* For 4596: renamed CreateCollectionFragment
All related classes followed the pattern of CollectionCreationX
* For 4596: kdoc CollectionCreationController
There's no effective difference between these calls and their interactor equivalent, so I linked to them
* For 4596: fix bug that caused rename to not work
* For 4596: removed unused collection actions
These were unused before the LibState refactor
* For 4596: kdoc StepChanged
* For 4596: removed todos about moving logic to the reducer
saveTabsToCollection: this could be moved, but that would involve creating a new action. SaveCollectionStep should probably be refactored out, so adding this layer of indirection seemed counterproductive
handleBackPress: needs to be able to call dismiss(). The reducer doesn't (and shouldn't) be able to do that, so this needs to live here
stepBack: called by handleBackPress. See above
* For 4596: wrote tests for CollectionCreationController#stepback
* For 4596: fixed tests broken by changes to collections
* For 4596: small readability refactor for CollectionController#stepBack
No change to functionality (see tests)
* For 4596: broke apart CollectionView#update
There's probably a lot more that could be done here, but smaller changes were made to reduce scope
* For 4596: remove unnecessary todos
It looks like we don't follow the suggested pattern in this project
* For 4596: test CollectionCreationController#normalSessionSize
* For 4596: updated naming in CollectionCreationController per review
* Closes mozilla-mobile#2435 Change edit icon to share icon on the bookmark toolbar
* Closes mozilla-mobile#2435 Changed raw string to string resources
* Pass bookmark arguments to share fragment
* Closes mozilla-mobile#2435 add orEmpty
6102: For #6018 Re-add Search Shortcuts Button r=boek a=BranescuMihai
6106: For #5872 & #6075: Set TabHeader buttons to invisible instead of gone. r=boek a=mcarare
At least one button has to be invisible instead of gone to keep layout height.
Tabs overflow button kept gone to avoid empty space on view end in private mode.
Co-authored-by: Mihai Branescu <branescu.mihai2@gmail.com>
Co-authored-by: mcarare <mihai.carare.dev@gmail.com>
6107: Fix#3122 - Hide the "Bookmark saved" Snackbar when user closes BrowserFragment r=boek a=Mugurell
Previously the Snackbar was being inflated in the parent of this Fragment so
surviving it being closed.
Tying the Snackbar with the Fragment from which it is shown ensures it will be
effectively hidden whenever the user navigates from the Fragment.
Co-authored-by: Mugurell <mugurell@users.noreply.github.com>
At least one button has to be invisible instead of gone to keep layout height.
Tabs overflow button kept gone to avoid empty space on view end in private mode.
Previously the Snackbar was being inflated in the parent of this Fragment so
surviving it being closed.
Tying the Snackbar with the Fragment from which it is shown ensures it will be
effectively hidden whenever the user navigates from the Fragment.
6025: For #5063: Added parameter customTabSessionId into ContextMenuFeature r=ekager a=ValentinTimisica
Added parameter customTabSessionId into ContextMenuFeature in
BaseBrowserFragment in order to show the context menu in a custom tab.
6032: For #5990: Revert sessionTokenScope to fix broken QR pairing flow r=ekager a=grigoryk
Seems like addition of sessionTokenScope is causing issues with pairing. For now, we can revert that change until the underlying issue is fixed.
For #5990.
Co-authored-by: ValentinTimisica <valentin.timisica@softvision.ro>
Co-authored-by: Grisha Kruglov <gkruglov@mozilla.com>
5775: Closes#5233, don't display private-browsing-shortcut creation items if shortcut already exists r=NotWoods a=bswe
Closes issue #5233:
Added doesPrivateBrowsingPinnedShortcutExist() method to the PrivateShortcutCreateManager class to check for the existence of the shortcut. Code only works on devices with API 25 or higher, so a check for that condition was also included in the new method.
Calls to the new method were added to the SettingsFragment and HomeFragment classes to determine whether the settings menu item and the recommendation dialog should be displayed.
**Quality**: The pre-push test failed to start on my windows 10 OS, but this code has been thoroughly tested manually on simulators and physical devices.
**Tests**: This code only effects UI appearance so not sure how to test for that and no tests were written.
**Screenshots**: This code does not add anything new to the UI, it only controls whether to display existing items.
Co-authored-by: bswe <bbollenbacher@mindspring.com>
5908: Closes#5876: Removed @ObsoleteCoroutinesApi in tests r=sblatz a=shldhll
### Pull Request checklist
<!-- Before submitting the PR, please address each item -->
- [x] **Quality**: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
- [ ] **Tests**: This PR includes thorough tests or an explanation of why it does not
- [ ] **Screenshots**: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
- [ ] **Accessibility**: The code in this PR follows [accessibility best practices](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) or does not include any user facing features
### After merge
- [ ] **Milestone**: Make sure issues finished by this pull request are added to the [milestone](https://github.com/mozilla-mobile/fenix/milestones) of the version currently in development.
### To download an APK when reviewing a PR:
1. click on Show All Checks,
2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
3. click on the "Fenix - assemble" task, then click "Run Artifacts".
4. the APK links should be on the left side of the screen, named for each CPU architecture
Co-authored-by: shldhll <iam.shldhll@gmail.com>
5507: For #1383 Added tab title to close button content description r=ekager a=mcarare
### Pull Request checklist
<!-- Before submitting the PR, please address each item -->
- [x] **Quality**: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
- [ ] **Tests**: This PR includes thorough tests or an explanation of why it does not
- [x] **Screenshots**: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
- [x] **Accessibility**: The code in this PR follows [accessibility best practices](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) or does not include any user facing features
### After merge
- [ ] **Milestone**: Make sure issues finished by this pull request are added to the [milestone](https://github.com/mozilla-mobile/fenix/milestones) of the version currently in development.
### To download an APK when reviewing a PR:
1. click on Show All Checks,
2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
3. click on the "Fenix - assemble" task, then click "Run Artifacts".
4. the APK links should be on the left side of the screen, named for each CPU architecture
5846: For #3604 Snackbar messages for closing tabs use closed instead of deleted r=sblatz a=mcarare
### Pull Request checklist
<!-- Before submitting the PR, please address each item -->
- [x] **Quality**: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
- [x] **Tests**: This PR includes thorough tests or an explanation of why it does not
- [x] **Screenshots**: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
- [x] **Accessibility**: The code in this PR follows [accessibility best practices](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) or does not include any user facing features
### After merge
- [ ] **Milestone**: Make sure issues finished by this pull request are added to the [milestone](https://github.com/mozilla-mobile/fenix/milestones) of the version currently in development.
### To download an APK when reviewing a PR:
1. click on Show All Checks,
2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
3. click on the "Fenix - assemble" task, then click "Run Artifacts".
4. the APK links should be on the left side of the screen, named for each CPU architecture
Co-authored-by: mcarare <mihai.carare.dev@gmail.com>
5633: Add fxa/sync integration tests r=csadilek a=isabelrios
Pull Request checklist
<!-- Before submitting the PR, please address each item -->
- [x] **Quality**: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
- [x] **Tests**: This PR includes thorough tests or an explanation of why it does not
- [-] **Screenshots**: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
- [-] **Accessibility**: The code in this PR follows [accessibility best practices](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) or does not include any user facing features
This PR tries to add new tests, sync integration tests, to check the sync process Desktop<->Fenix, first for Bookmarks and in the future for more.
Co-authored-by: Isabel Rios <isabelrios@mackbookirios.home>
Co-authored-by: isabelrios <isabelrios@gmail.com>
5882: For #5873 Added on/off indicator for delete browsing data on exit pref r=sblatz a=mcarare
### Pull Request checklist
<!-- Before submitting the PR, please address each item -->
- [x] **Quality**: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
- [x] **Tests**: This PR includes thorough tests or an explanation of why it does not
- [x] **Screenshots**: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
- [x] **Accessibility**: The code in this PR follows [accessibility best practices](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) or does not include any user facing features
### After merge
- [ ] **Milestone**: Make sure issues finished by this pull request are added to the [milestone](https://github.com/mozilla-mobile/fenix/milestones) of the version currently in development.
### To download an APK when reviewing a PR:
1. click on Show All Checks,
2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
3. click on the "Fenix - assemble" task, then click "Run Artifacts".
4. the APK links should be on the left side of the screen, named for each CPU architecture
Co-authored-by: mcarare <mihai.carare.dev@gmail.com>
Could have implemented this check (if menu is showing) inside the show() method
of BrowserMenu but this would mean the client (us) would go to the process of
building a new menu and then trying to have it displayed only for this to be
ignored by BrowserMenu in a somewhat opaque way.
Having this check done as soon as possible offers us full control and avoids
the unnecessary steps for building an already shown menu.
As an added bonus, this makes the temporal coupling between `setPrivateModeIfNecessary` and `setupThemeAndBrowsingMode` explicit. They previously would have broken if called in reverse order, now it will fail to compile.
This didn't function when 'open links in a private tab' was set. Rather than adding another sketchy fix for the edge case, following commits will change `usePrivateMode` to be maintained in memory, instead of in Settings.
* Do not launch in Private Mode
When the app launches do not launch in Private Mode in order to prevent usage leaks to other users of the device.
* Issue #4780: add comments to use private mode
* For #4780: write tests for clear private mode on create app
* For #4780: clear private mode when privacy notification is removed
This patch includes:
- WebChannels support enabled by default, with ability to disable it via remote flag
- expanded FxA telemetry (closes#4971)
Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com>
Moved the deletion to a CoroutineScope(IO) to decouple from fragment lifecycle
Used local val tempStorage to keep reference to bookmarkStorage of outside class
Ran deletions with awaitAll to avoid concurrency issues on storage
This was added to the state object as a top level param because it could reasonably coexist with any value of `tree` or `mode`. Even if we don't now, we may someday want to display a loading indicator while also showing cached bookmarks.
For now, we set isLoading to false whenever we receive any bookmarks
The mismatch here was creating potentially inconsistent states. When first put into a CREATED or STARTED state, the listener would not be active, however after going through onResume it would then stay active until destroyed.
We should only be navigating to bookmarks when in a RESUMED state, so this change should be safe. I tried it a few times to verify. But I've been wrong before!
* For #2754 Add tab cards to share sheet
* For #2754: Fix background near rounded corners and ShareButtonAppearanceTest
* Add license to share_tab_item
* Upgrade to Mozilla Android components 15.0.0-SNAPSHOT
* Update findinpage integration to use browser-state
* Use new UseCases APIs after download migration.
* For #5092 - Show a Snackbar with retry option if sharing to devices fails
ShareController will contain all the business logic for checking the result
status of the `share to device` operations. When this fails it will show a
snackbar which also offer the possibility to retry the just failed operation.
To allow this even in the event the user has closed the share fragment we'll
use a GlobalScope's coroutine.
Refactored out the TabsSharedCallback from ShareFragment because otherwise we
would have neede to sent through that the just failed operation. After the
refactor the ShareController is solely responsable for showing the right
snackbar and handling the retry actions.
* For #5092 - Refactor ShareControllerTest
* For #5092: Adds color theming of snackbars
This introduces test coverage, using the Glean SDK
testing API, for the metrics that are set at startup
by Fenix in the GleanMetricsService.
This additional adds a basic test for the translation
of the `app_opened` event.
Added separate TextView for link text
Used UnderlineSpan to show text as link
Split string private_browsing_placeholder, one for each TextView
Set clickListener on TextView so it can be accessed via Talkback
This patch includes:
- WebChannels support enabled by default, with ability to disable it via remote flag
- expanded FxA telemetry (closes#4971)
Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com>
Show or hide overflow menu for entire list is triggered when mode is changed
For bookmarks, due to implementation of selection and diffUtil,
additional check is necessary for current item (last selected) that is redrawn
There is a "unused" lint suppression in place with the comment
"Referenced from XML". I found no such usage.
It's documentation says that this Behavior will always position FindInPageBar
above BrowserToolbar but the current code ensures
BrowserToolbar.visibility == GONE when FindInPageBar.visibility == VISIBLE
so there's no need for such behavior.
FindInPageFeature is used inside the app as a LifecycleAwareFeature and as such
it receives the onStart / onStop lifecycle calls.
The onStart() lifecycle call would not get passed to the feature but in
onStop() FindInPageFeature will detach it's Presenter and Interactor so when
the user comes back to the screen she could not interact anymore with the
feature.
To fix this we'll propagate LifecycleAwareFeature's onStart() to the inner
feature which is to rebind it's Presenter and Interactor in onStart().
This behavior is common to all the other features so all of them who implement
LifecycleAwareFeature will now get the onStart() call also.
* fixes#4193 - made close button for tabs more accessible.
set recommended minimum size for accessibility 48x48, while keeping image size the same
removed margin from button and text as it was not needed anymore
aligned close button in center of tab to be visual consistent with alignment of favicon and more visual accessible
* Fix margins
We currently do not use thumbnails anywhere in the app. Not using the feature means we are
not taking thumbnails on every page load which means we are saving memory and CPU cycles.
Navigation between app fragments uses ShareTab as arguments. The newly used
SendTabUseCases uses TabData which is not Parcelable.
For minimal changes we'll keep both data classes and ShareController will know
how to map between the two.
Removed the `sessionId` property of ShareTab as it isn't needed anymore.
Since we are now able to build against GeckoView Nightly and GeckoView Beta,
we should create the GeckoRuntime from a flavor-specific source set.
Creating the runtime is not covered by the AC abstraction and so API changes
in GeckoView Nightly can break the build and leaves us with no option to fix
it from a shared code base. Separating the creation of GeckoRuntime
allows us to adapt individually and also to configure the runtimes
differently.
`ShareController` defines a contract with all possible `ShareFragment`'s
behavior changes and comes with a default implementation -
`DefaultShareController`.
It is to be delegated by all `ShareFragment`s contained Views' Interactors
following any user interactions.
ShareFragment which acts as a container would contain all business logic needed
for populating it's Views.
Data initialization should be done only once since the app state has no reason
to change after the ShareFragment is created and is done as soon as possible,
in onAttach().
Because of the expected short lifespan of this fragment, given the fact that
the state has no reason to change and we handle orientation changes ourselves
to keep things simple I didn't use a ViewModel to persist the state.
In an effort to respect the initial MVI architecture I've broken the
complex `AppShareView` in 3 separate Views
- `ShareCloseView`
- `ShareToAccountDevicesView`
- `ShareToAppsView`
They are standalone Views (extending LayoutContainer) which know nothing about
each other or their parent and so offer their container the possibility to
order or display them in any form later.
According to the lib-state contract they are only responsible to
- inflate themselves in their injected containerView
- render a certain state (to be added in later commits)
- delegate all user interaction to an associated Interactor
As per #4341.
Also reformatted layouts to have a more consistent style.
Also refactored `AppShareRecyclerView` and `AccountDevicesShareRecyclerView` by
defining their LayoutManager in XML to reduce code complexity.
Removed drawableStart and added ImageView in layouts
Set ImageView logo programmatically: bitmap for SDK<24, vector for SDK>=24
Added onClickPendingIntent for ImageView in large and medium layouts
* Fixes#4067 besides snackbar
Makes layout hierarchy more shallow to increase performance.
* Fix#4067 Feedback
Make sure quick_action_overlay appears on top and use horizontal chain in tab_header.
The previous solution would result in a crash because the passed in
viewTreeObserver that would trigger onPreDraw would be invalid.
The proposed solution is simpler and ensures we'll always use the right
viewTreeObserver.
`FragmentPreDrawManager` is general enough that can be used by other Fragments
also, so I've added it to the `utils` package.
* Fixes#4704. Overrides `setEnabled` for DeleteBrowsingDataItem to change view alpha when disabled and to toggle the checkbox `isEnabled` behavior based on the value provided.
* Updates CHANGELOG.md
* Removes unnecessary disabling of checkbox in DeleteBrowsingDataItem.kt
Updates CHANGELOG.md to reflect the component changed.
* For #4396 - Rename BookmarkInteractor methods
Following the naming model used in other Interactors this too will use reactive
method names in the form of "on..." instead of the previous imperative model.
Kept the imperative naming model for the methods from `SelectionInteractor` as
they are a new addition and I'm not sure about the future direction.
* For #4396 - Add a BookmarkController
It abstracts the Fragment behavior in a contract through which various
Interactors can inform about the specific View changes and can ask for
modifications in their container Fragment.
This contract and it's implementation - `DefaultBookmarkController` are the
result of extracting the container Fragment's business logic from
`BookmarkFragmentInteractor` in it's own standalone component.
* For #4396 - Refactored Bookmark related tests
Added a new `BookmarkControllerTest` tests class which complements the new
`BookmarkController` to ensure that it properly operates on `BookmarkFragment`
Also refactored the existing `BookmarkFragmentInteractorTest` to accommodate
`BookmarkFragmentInteractor`'s now more specialized behavior.
* Add no-op experiment to test service-experiments integration
* Shorten metric name to meet schema
* Add active_experiment metric to docs
* Add approved data review
The user has the option to go to 'Shortcuts' -> 'Search engine settings' to
modify the default search engine. When returning from that settings screen we
need to update it to account for any changes.
For this we will check the current default engine against a previously stored
value in a newly added 'defaultEngineSource' property from SearchState class.
Also, I modified 'SearchStoreTest' by adding the new parameter to the
'SearchState' constructor.
setting menu title should also set content description. I added the setContentDescription programmatically in order to ensure that the content description is being set. If content description matches title it won't be read twice
With the PublicSuffixList class in Utilities, the first instantiation
of it (prefetching in onCreate), causes the Utilities to instantiate
and thus slowing down startup by needing the SearchEngineManager from
instantiating as well.
Moving this back to the root component fixes the immediate perf issue.
Co-authored-by: Will Hawkins <whh8b@obs.cr>
Instead of taking notification manager as a parameter
(from the utils class), create one private to the
BackgroundServices class. This means that we do not need
to create the entirety of utilities just to use
the notification manager.
changed setting of text to be done before transition, preventing transition to make textView unclickable;
added renaming situation to showKeyboard in onResume();
changed title text when renaming, from: "Name collection" to "Rename collection".
changed setting of text to be done before transition, preventing transition to make textView unclickable;
added renaming situation to showKeyboard in onResume();
changed title text when renaming, from: "Name collection" to "Rename collection".
The flow we are currently using involves setting a new title for the containing
Activity when the user navigates to a new Fragment.
This happened for SitePermissionsDetailsExceptionsFragment in it's onCreate().
Opening a permission (SitePermissionsManageExceptionsPhoneFeatureFragment) will
set a new title in it's onCreate() but going back from this new Fragment will
not create again a new SitePermissionsDetailsExceptionsFragment.
As a workaround I moved the call to set Activity's title in onResume().
With this we can remove the `whenStarted` workaround. This new API
internally creates (and uses) a scope bound to the fragment's view and
will not invoked the lambda (send state updates) when the view is
detached or the fragment's lifecylce is stopped or destroyed.
To make this match the style of the other button I applied the same style to it
and also changed it to be a MaterialButton.
I also decided to extract the margin and padding values of the button.
Previously we needed to set a static launch function to be invoked when the find in page
integration should be launched. Now we can access the integration class directly and
can avoid the static property that caused issues when used by multiple activities.
* For #3633 - Adds SearchStore
* For #3633 - Refactors AwesomeBarUIView
* For #3633 - Refactors ToolbarUIView to use lib-state
* For #3633 - Fixes a couple of state bugs
* For #3633 - Moves all user interaction to SearchInteractor
* For #3633 - Adds kdocs to SearchStore and SearchInteractor
* For #3633 - Adds documentation for the properties on SearchState
Also removes uneccessary property
* For #3633 - Creates `StateViewModel` to handle state restoration
* For #3633 - Adds a test for onTextChanged
* For #3633 - Adds tests for SearchInteractor
* For #3633 - Fixes bugs and adds documentation
HomeFragment's onboarding items included drawableStart values, but also
built drawables in the view holders to replace them. Instead, we should
just use ImageViews so that work isn't duplicated.
* Doesnt print gecko emoji on android ver < 7
* fixed typo on maybeGecko variable
* Closes#3076: Lizard char now doesn't appear if not supported androidver
* Closes#3115: Prints string instead of gecko emoji in unsupported
android versions