-
Notifications
You must be signed in to change notification settings - Fork 954
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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" /> | ||
|
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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.
ad1e231
to
f80c7ce
Compare
@0nko Still seeing the animated scroll every now and then with the selected tab but I still think it's better than not scrolling at all to the current selected tab Screen_recording_20250312_181815.mp4Also the favicon is not updating if I switch to the TabSwitcher before the website loads |
@mikescamell I've removed the tab switcher scroll bug fix and updated the favicon loading. Ready for another round. |
@0nko Grid and List items look good design wise now! ✅ But I'm still not seeing a favicon load when i switch to the tab switcher before the website has finished loading. Ign.com was the website I was using |
@mikescamell It's a timing issue -- the favicon isn't fetched when the tab switcher is displayed. I've added 3 retries, which should take care for the majority of cases. |
view.loadFavicon(bitmap, url, placeholder) | ||
|
||
// sometimes it takes a while to fetch a favicon, so we try to load it from disk again | ||
repeat(FAVICON_LOAD_RETRIES) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works now! But as discussed on MM this is probably not the best long term fix and we probably need a reactive solution that loads the Favicon when it's ready, as this may not work still on a slow connection. As we discussed probably worth creating a task in the Android backlog to look into this more on a hack days/quick win day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a task for us to come back to: https://app.asana.com/0/1202552961248957/1209728703137860/f
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
Tab preview image
Favicon
cnn.com
and don't wait for it to fully load and open the tab switcher