Skip to content

Conversation

@0nko
Copy link
Member

@0nko 0nko commented Jan 14, 2025

Task/Issue URL: https://app.asana.com/0/72649045549333/1207969573539951

Description

This PR adds the FAB to the tab switcher. It is hidden under a feature flag, which must be enabled first.

This PR demonstrates the 2 states of the FAB that will be used later in the multi-selection -- "New Tab" & "Close Tabs". Clicking the button will not actually change this in the actual implementation.

Steps to test this PR

  • Go to Settings -> Feature Flag Inventory
  • Type "multi"
  • Enable the feature flag
  • Leave the tab switcher activity if there already
  • Open the tab switcher activity
  • Notice the FAB is displayed
  • Verify the + icon is shown and the title is "New Tab"
  • Scroll up & down
  • Verify that the FAB shrink while scrolling down
  • Tap on the FAB
  • Verify the icon changes to x and title says "Close Tabs"

Copy link
Member Author

0nko commented Jan 14, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@0nko 0nko changed the title Add new FAB styles Add new FAB to the tab switcher Jan 14, 2025
@0nko 0nko marked this pull request as ready for review January 14, 2025 13:16
@0nko 0nko changed the title Add new FAB to the tab switcher Multi-selection: Add new FAB to the tab switcher Jan 14, 2025
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 0b382b2 to 8492b52 Compare January 15, 2025 17:28
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from 67aa25e to c303d4b Compare January 15, 2025 17:28
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 8492b52 to c4c3cf8 Compare January 27, 2025 10:12
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from 5916903 to 79bc6aa Compare January 27, 2025 10:12
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from c4c3cf8 to c3270a9 Compare January 27, 2025 10:19
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from 79bc6aa to 2acd9ec Compare January 27, 2025 10:19
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from c3270a9 to e6e2148 Compare January 31, 2025 15:26
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from d85d6d1 to 6c267e1 Compare January 31, 2025 15:27
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from e6e2148 to ff15dd9 Compare February 3, 2025 20:20
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from 6c267e1 to ae833dd Compare February 3, 2025 20:20
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from ae833dd to 88714c8 Compare February 13, 2025 10:54
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from ff15dd9 to 02fb482 Compare February 13, 2025 10:54
@0nko 0nko requested review from mikescamell and removed request for malmstein and nalcalag February 13, 2025 10:58
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 02fb482 to b238763 Compare February 14, 2025 09:42
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch 2 times, most recently from 3987163 to 195a3f0 Compare February 14, 2025 14:01
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from eab74f4 to 3d62cf6 Compare February 14, 2025 14:01
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 3d62cf6 to 01126c4 Compare February 27, 2025 17:15
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from 195a3f0 to 057e4d2 Compare February 27, 2025 17:15
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from 25ddd72 to c39f956 Compare March 5, 2025 10:01
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 3536b27 to 4b5cef8 Compare March 5, 2025 10:02
@mikescamell mikescamell self-assigned this Mar 5, 2025
Copy link
Contributor

@mikescamell mikescamell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just need confirmation on the testing step about whether the FAB should hide or not 👍

private fun updateFabType(fabType: TabSwitcherViewModel.ViewState.FabType) {
when (fabType) {
TabSwitcherViewModel.ViewState.FabType.NEW_TAB -> {
tabsFab.icon = AppCompatResources.getDrawable(this, com.duckduckgo.mobile.android.R.drawable.ic_add_24)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Add an import for the R class


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ If we're switching to a CoordinatorLayout, do we need the LinearLayout anymore?

I think app:layout_behavior="@string/appbar_scrolling_view_behavior" on the RecyclerView should take care of offsetting the RecyclerView from the Toolbar, from what I remember 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL! 😁

<item name="android:paddingStart">@dimen/keyline_2</item>
</style>

<style name="Widget.DuckDuckGo.ExtensibleFloatingActionButton" parent="Widget.MaterialComponents.ExtendedFloatingActionButton">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Are we calling it "Extensible" in our design system rather than "Extended"? 😁

Copy link
Contributor

@mikescamell mikescamell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just need confirmation on the testing step about whether the FAB should hide or not 👍

@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from c39f956 to 66bb476 Compare March 6, 2025 14:12
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 4b5cef8 to 32bdd14 Compare March 6, 2025 14:12
@0nko
Copy link
Member Author

0nko commented Mar 6, 2025

Thanks for the review! 🙇‍♂️

@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 32bdd14 to cf6b2b2 Compare March 10, 2025 10:07
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from 7e86453 to 8b1c367 Compare March 10, 2025 10:07
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from cf6b2b2 to d7318f0 Compare March 10, 2025 14:49
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection-fab branch from 8b1c367 to f237d70 Compare March 10, 2025 14:49
@0nko 0nko merged commit 096932e into feature/ondrej/tab-multi-selection Mar 10, 2025
4 of 9 checks passed
@0nko 0nko deleted the feature/ondrej/tab-multi-selection-fab branch March 10, 2025 17:35
0nko added a commit that referenced this pull request Mar 13, 2025
Task/Issue URL: https://app.asana.com/0/72649045549333/1207969573539951

### Description

This PR adds the FAB to the tab switcher. It is hidden under a feature
flag, which must be enabled first.

This PR demonstrates the 2 states of the FAB that will be used later in
the multi-selection -- "New Tab" & "Close Tabs". Clicking the button
will not actually change this in the actual implementation.

### Steps to test this PR

- [x] Go to Settings -> Feature Flag Inventory
- [x] Type "multi"
- [x] Enable the feature flag
- [x] Leave the tab switcher activity if there already
- [x] Open the tab switcher activity
- [x] Notice the FAB is displayed
- [x] Verify the `+` icon is shown and the title is "New Tab"
- [x] Scroll up & down
- [x] Verify that the FAB shrink while scrolling down
- [x] Tap on the FAB
- [x] Verify the icon changes to `x` and title says "Close Tabs"
This was referenced Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants