Closed Bug 1289579 Opened 8 years ago Closed 8 years ago

Modify PagerTabStrip to allow layouting separately from the ViewPager

Categories

(Firefox for Android Graveyard :: Awesomescreen, defect, P1)

defect

Tracking

(firefox50 affected)

RESOLVED INVALID
Tracking Status
firefox50 --- affected

People

(Reporter: ahunt, Assigned: ahunt)

References

Details

(Whiteboard: [MobileAS])

We want a PagerTabStrip for the Activity Stream Detail activity (see Bug 1289242). PagerTabStrip expects to be layouted inside the ViewPager it's linked to, however we want to layout it in a bar that also contains search and exit buttons. I think it's easiest to copy PagerTabStrip / PagerTitleStrip from the Android sources, and modify them as needed (we only need to override onAttachedToWindow - that method requires access to the PagerTitleStrip internals hence we need to modify the underlying classes, instead of just extending them).
Assignee: nobody → ahunt
Blocks: 1289242
Actually, it looks like it might be better to grab the existing TabMenuStrip (which we use for HomePager), but modify it so it can also be used outside the ViewPager.
Let's see if we can use TabLayout from the Android Design Library: * https://developer.android.com/reference/android/support/design/widget/TabLayout.html * http://android-developers.blogspot.de/2015/05/android-design-support-library.html Eventually we would like to get rid of our own implementation and use the one from the support library; see bug 1210371 for example.
(In reply to Sebastian Kaspari (:sebastian) from comment #2) > Let's see if we can use TabLayout from the Android Design Library: > * > https://developer.android.com/reference/android/support/design/widget/ > TabLayout.html > * > http://android-developers.blogspot.de/2015/05/android-design-support-library. > html > > Eventually we would like to get rid of our own implementation and use the > one from the support library; see bug 1210371 for example. I wish I'd known about this earlier (and/or searched through the libraries better)! TabLayout can be plugged directly into viewpager AND doesn't need to be layouted within the ViewPager (placing it within the ViewPager means it gets automatically connected, but you can just use setupWithViewPager() otherwise). In other words minimal code needed to get it working. (TabMenuStrip had various issues including crashing when restoring when I used it within my own activity == crash on rotation - it's good I don't have to debug that anymore)
Whiteboard: [MobileAS s1.1]
We don't need this thanks to TabLayout.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Priority: -- → P1
Whiteboard: [MobileAS s1.1] → [MobileAS]
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.