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)

All
Android
defect
Not set
normal

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.
This would be a good thing to look into for the tablet redesign.
Assignee: nobody → lucasr.at.mozilla
No need to block v1 on this. Moving to v2.
Blocks: new-tablet-v2
No longer blocks: new-tablet-v1
Assignee: lucasr.at.mozilla → nobody
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: nobody → michael.l.comella
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.