Closed Bug 699312 Opened 11 years ago Closed 11 years ago

Selected tab should be bold in the tabs-list

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: sriram, Assigned: sriram)

Details

Attachments

(1 file, 2 obsolete files)

The selected tab should be shown in bold in the list of tabs shown.
Assignee: nobody → sriram
OS: Linux → Android
Hardware: x86 → ARM
Attached patch Patch (obsolete) — Splinter Review
This patch makes the selected tab bold in the list.

I tried make the title bold when the view is created. However, it had weird issues that I couldn't understand. The first item in the list is always bold along with the selected tab in the list. Probably some race conditions, I believe.

I tried using onWindowFocusChanged in activity -- as this is when the list gets populated -- however, this doesn't help us when the tabs gets updated in the background. The background changes of url/title, causes the list to render again, and we don't know if that has happened yet. thisList.setAdpater() doesn't ensure that views are created immediately after this call.

The last option was to use a Handler to update the views after a timeout. I've used a 10ms timeout and this works fine with my slow Nexus S.

There is a method addOnLayoutChangeListener() with ListView, but this is available only from API Level 11.

I would be happy to change the logic, if we can find a better solution by adding bold when view is created itself.
Attachment #571533 - Flags: review?(mark.finkle)
Attached patch Patch (obsolete) — Splinter Review
The previous patch had a wrong bug number in the message.
Attachment #571533 - Attachment is obsolete: true
Attachment #571533 - Flags: review?(mark.finkle)
Attachment #571534 - Flags: review?(mark.finkle)
Attached patch PatchSplinter Review
This works fine now :)
I forgot the "resusability" nature of convertView, which caused all issues initially.
Now, the views are not reused (and there is no need to reuse smaller views with text and image) and the fix is even simpler.
There is no flickering while tab updates in the background.
Attachment #571534 - Attachment is obsolete: true
Attachment #571534 - Flags: review?(mark.finkle)
Attachment #571560 - Flags: review?(mark.finkle)
Attachment #571560 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/projects/birch/rev/15595d5edb2c
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Mozilla/5.0 (Android; Linux armv7l; rv:10.0a1) Gecko/20111003 Firefox/10.0a1 Fennec/10.0a1
Samsung Nexus S (Android 2.3.6)
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.