Titanium JIRA Archive
Alloy (ALOY)

[ALOY-290] Android Screen Density based resourses

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2013-11-07T13:24:24.000+0000
Affected Version/s2012 Sprint 19
Fix Version/sn/a
ComponentsTitanium SDK
Labelsandroid, density, resources, screen
ReporterVinicius Souza
AssigneeTony Lukasavage
Created2012-09-21T06:57:03.000+0000
Updated2014-01-28T23:28:53.000+0000

Description

At the @0.2.34 version we found the platform specific folders for views/styles/controllers and with the formFactor attribute we can develop thinking in specific platform (handheld or tablet). But the Android Platform has 4 groups of screen (LDPI, MDPI, HDPI and XHDPI) and it's a bit hard to build different views for different screen density. Like @tonylukasavage says, The purpouse of this Issue: be able to use alloy views/controllers/styles not only based on platform, but also in the case of android, based on screen density. Such as the image attached (Screen Shot 2012-09-21 at 8.47.27 AM.png). It will help us to build apps more flexible for each platform and screen density (in the case of Android). One example for this use: For LDPI Android screens, we can build screens more focused on the base application task only (in my case an app for soccer lovers) and split the features in other screens/actions, but with HDPI we can use the large height screen and shows more information about the team, players, use images with more details and bigger!

Attachments

FileDateSize
Screen Shot 2012-09-21 at 8.47.27 AM.png2012-09-21T06:57:03.000+000016927

Comments

  1. Rick Blalock 2012-12-11

    It would be nice to have this more fragment-based as well. For instance, I wouldn't necessarily want to have a completely separate view for different densities...but I might want to have different views inside: Likewise, having the flexibility for something in TSS makes sense too: "#myView[density=HDPI]": { } A shortcut for the density in the Alloy namespace makes sense as well (I know it's easy to get in the Ti API's but it makes sense to cache that for Android and access via Alloy).
  2. Vinicius Souza 2012-12-11

    @Rick Blalock, your solution sounds good and more looks more simple to implement by TI-ALLOY Dev Team. I'm finishing my iOS UI versions of my app and i'm ready to start my Android UI. This density attribute'll help me save lot of time of coding...
  3. Tony Lukasavage 2013-11-07

    This will be handled in ALOY-871

JSON Source