Project

General

Profile

Actions

Bug #1068

open

Closing first tab visually truncates the new first tab

Added by v ... 10 months ago. Updated 10 months ago.

Status:
New
Priority:
3.x
Start date:
08/16/2023
Due date:
% Done:

0%

Estimated time:

Description

  1. Open 4 or 5 tabs ;
  2. Select the first tab ;
  3. Close it through the X button on its left ;
  4. The focus goes to the previously second tab, which becomes now the new first tab ;
  5. Notice that only half of the tab is visible now (the bug).

When the focus is on a tab other than the first one, then closing it moves the focus to another tab which is entirely displayed on the view.
The bug only applies when closing the first tab.

See the two attached screenshots.


Files

Actions #1

Updated by Soren Stoutner 10 months ago

Yes, Android's TabView currently makes some interesting decisions about how to handle scrolling when some tabs are removed. This isn't anything I handle directly, and when I have tried to manually override the scroll position it has made it worse instead of better (the tools they have to control the scroll position are not very sophisticated). My current approach is just to let TabView do whatever it does naturally and let users scroll it back and forth if they want to.

Actions #2

Updated by Soren Stoutner 10 months ago

Here is the documentation on TabView if you are interested:

https://developer.android.com/reference/com/google/android/material/tabs/TabLayout.TabView

Actions #3

Updated by v ... 10 months ago

Thanks for the explanation.

Actions #4

Updated by v ... 10 months ago

Soren Stoutner wrote in #note-2:

Here is the documentation on TabView if you are interested:

https://developer.android.com/reference/com/google/android/material/tabs/TabLayout.TabView

It's not obvious for me where they are writing about tabs scrolling in the API documentation of TabView.

Actions #5

Updated by Soren Stoutner 10 months ago

That's exactly my point. They don't want to provide an easy way for developers to control the tab scroll position. You have to use the methods inherited from android.view.View (like setScrollX()).

Actions

Also available in: Atom PDF