Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Tab switcher UI issues #5736

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open

Conversation

0nko
Copy link
Member

@0nko 0nko commented Mar 5, 2025

Task/Issue URL: https://app.asana.com/0/1207418217763355/1209581022862153

Description

This PR fixes a couple of minor UI issues in the tab switcher:

Steps to test this PR

Tab switcher item layout

Tab switcher item layout

  • Open the tab switcher
  • Verify the screen scrolls to the current tab
  • Scroll away from the current tab
  • Switch the tab layout
  • Verify the screen keeps the previous scroll position (doesn't scroll to current tab)

Tab preview image

  • Make sure you have a few tabs
  • Swipe between them
  • Open the tab switcehr
  • Verify they have a preview image

@0nko 0nko requested a review from mikescamell March 5, 2025 17:55
@mikescamell mikescamell self-assigned this Mar 6, 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.

I've noticed that in some instances we animate to the selected tab rather than being on it immediately. I need to look into how to reproduce.

Screen_recording_20250306_093644.mp4

@@ -92,6 +92,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/title" />

<ImageView
Copy link
Contributor

Choose a reason for hiding this comment

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

❓Why do we need a new ImageView to load the dax logo into? What was stopping us from using the existing tabPreview ImageView and adjusting as needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

The webpage previews need to use matrix scaling, which doesn't work for the logo. I thought it'd be complicating things trying to change it on the fly when views are recycled. But after giving it another thought it's not that bad: Use a single ImageView for all tabs

@@ -219,6 +219,7 @@ open class BrowserActivity : DuckDuckGoActivity() {
if (wasSwipingStarted) {
wasSwipingStarted = false

currentTab?.onTabSwipedAway()
viewModel.onTabsSwiped()
Copy link
Contributor

Choose a reason for hiding this comment

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

💡Could we not make this part of onTabPageSwiped? Feels like this belongs there as well

app:layout_constraintHorizontal_bias="0.0"
app:typography="h5"
tools:text="Slashdot" />
tools:text="Slashdot test tes tes tes tes tes tew tes tes tes tes tes tes tes" />

Copy link
Contributor

Choose a reason for hiding this comment

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

🔍Maybe we can reduce this a bit? 😅

android:layout_marginEnd="7dp"
android:layout_marginBottom="10dp">
android:layout_marginHorizontal="@dimen/keyline_2"
android:layout_marginVertical="6dp"
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed on MM, it's probably worth following up and finding out why our List item does not currently match the designs and if there is any good reason why 👍

app:layout_constraintTop_toTopOf="parent" />
android:src="@drawable/ic_dax_icon"
android:layout_marginStart="@dimen/keyline_2"
app:layout_constraintTop_toTopOf="@id/close"
Copy link
Contributor

Choose a reason for hiding this comment

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

❓Shouldn't this be keyline_3 (12dp)?

Copy link
Member Author

@0nko 0nko Mar 6, 2025

Choose a reason for hiding this comment

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

I don't think so. It seems like the 12dp margin in the spec is used to compensate for the narrow icon used. Yes. Fixed.

@0nko 0nko requested review from malmstein and nalcalag as code owners March 6, 2025 11:13
@0nko 0nko requested a review from mikescamell March 6, 2025 11:13
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