Closed
Bug 1024717
Opened 10 years ago
Closed 8 years ago
Investigate defining device configuration (e.g. isLargeTablet) in resources
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1079874
People
(Reporter: mcomella, Assigned: mcomella, Mentored)
References
Details
via lucasr in bug 1022668:
Another (more general) option, is to change HardwardUtils.isTablet() to lean on the Android resource system more directly. This way we'd ensure both the layouts and the isTablet() values would come from the same code path in the resource system.
In practice, you'd do something like:
resources/values/bools.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="is_large_tablet">false</bool>
<bool name="is_small_tablet">false</bool>
</resources>
resources/values-large-v11/bools.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="is_large_tablet">false</bool>
<bool name="is_small_tablet">true</bool>
</resources>
resources/values-xlarge-v11/bools.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="is_large_tablet">true</bool>
<bool name="is_small_tablet">false</bool>
</resources>
Then in HardwardUtils we'd simply do:
Resources res = context.getResources()
sIsLargeTablet = res.getBoolean(R.bool.is_large_tablet);
sIsSmallTablet = res.getBoolean(R.bool.is_small_tablet);
Then you'd need the device in which this bug is happening to test if these changes make any difference. I'd prefer this approach over stool A because it would make our tablet checks generally more reliable/robust/consistent.
---
And a warning from rnewman, bug 1022668 comment 10:
I think that's a reasonable approach, though perhaps not in HardwareUtils! Not sure how acceptable it is to be loading resources in HardwareUtils early in startup from a perf perspective.
Assignee | ||
Comment 1•10 years ago
|
||
This would be a good thing to look into for the tablet redesign.
Blocks: new-tablet-v1
Updated•10 years ago
|
Assignee: nobody → lucasr.at.mozilla
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Updated•10 years ago
|
Updated•10 years ago
|
Assignee: lucasr.at.mozilla → nobody
Assignee | ||
Updated•10 years ago
|
Mentor: michael.l.comella, mhaigh
Assignee | ||
Updated•9 years ago
|
Assignee | ||
Comment 3•8 years ago
|
||
Implemented for BrowserToolbar in bug 1079874. There's a bug that bug 1079874 blocks that is to do this for *all* HardwareUtils code.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → michael.l.comella
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•