diff options
author | Deepanshu Gupta <deepanshu@google.com> | 2014-06-26 20:02:57 -0700 |
---|---|---|
committer | Deepanshu Gupta <deepanshu@google.com> | 2014-06-27 11:52:45 -0700 |
commit | 1076be31f1c14f39295cc2ce7a747ee9ad96ee73 (patch) | |
tree | 5b85af21f0d282ce9c802a1b85084c9a5e80ae9e /tools | |
parent | 48d41ea0bee27147273fec6d753332c181861c77 (diff) | |
download | frameworks_base-1076be31f1c14f39295cc2ce7a747ee9ad96ee73.zip frameworks_base-1076be31f1c14f39295cc2ce7a747ee9ad96ee73.tar.gz frameworks_base-1076be31f1c14f39295cc2ce7a747ee9ad96ee73.tar.bz2 |
Update system icon resolution in LayoutLib.
This fixes some bugs with the resolution of icons for Status Bar and
Navigation Bar by separating the icons into v21 and v11 directories. An
icon is searched in v21 directory by default. For simulating older
platforms, v11 directory is searched first and then v21 is used as a
fallback.
This also adds xxhdpi versions of home, back and recent icons.
Change-Id: Ia6eafc83856eacafc4fb0b13d87793d4aa24f106
Diffstat (limited to 'tools')
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/README | 1 | ||||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/hdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/hdpi/ic_sysbar_back.png) | bin | 1053 -> 1053 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/hdpi/ic_sysbar_home.png (renamed from tools/layoutlib/bridge/resources/bars/hdpi/ic_sysbar_home.png) | bin | 1064 -> 1064 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/hdpi/ic_sysbar_recent.png (renamed from tools/layoutlib/bridge/resources/bars/hdpi/ic_sysbar_recent.png) | bin | 711 -> 711 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/ldrtl-hdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/ldrtl-hdpi/ic_sysbar_back.png) | bin | 904 -> 904 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/ldrtl-hdpi/ic_sysbar_recent.png (renamed from tools/layoutlib/bridge/resources/bars/ldrtl-hdpi/ic_sysbar_recent.png) | bin | 533 -> 533 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/ldrtl-mdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/ldrtl-mdpi/ic_sysbar_back.png) | bin | 617 -> 617 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/ldrtl-mdpi/ic_sysbar_recent.png (renamed from tools/layoutlib/bridge/resources/bars/ldrtl-mdpi/ic_sysbar_recent.png) | bin | 423 -> 423 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/ldrtl-xhdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/ldrtl-xhdpi/ic_sysbar_back.png) | bin | 1250 -> 1250 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/ldrtl-xhdpi/ic_sysbar_recent.png (renamed from tools/layoutlib/bridge/resources/bars/ldrtl-xhdpi/ic_sysbar_recent.png) | bin | 552 -> 552 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/mdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/mdpi/ic_sysbar_back.png) | bin | 774 -> 774 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/mdpi/ic_sysbar_home.png (renamed from tools/layoutlib/bridge/resources/bars/mdpi/ic_sysbar_home.png) | bin | 836 -> 836 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/mdpi/ic_sysbar_recent.png (renamed from tools/layoutlib/bridge/resources/bars/mdpi/ic_sysbar_recent.png) | bin | 591 -> 591 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/xhdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/xhdpi/ic_sysbar_back.png) | bin | 1421 -> 1421 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/xhdpi/ic_sysbar_home.png (renamed from tools/layoutlib/bridge/resources/bars/xhdpi/ic_sysbar_home.png) | bin | 1421 -> 1421 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v11/xhdpi/ic_sysbar_recent.png (renamed from tools/layoutlib/bridge/resources/bars/xhdpi/ic_sysbar_recent.png) | bin | 749 -> 749 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/hdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/hdpi-v21/ic_sysbar_back.png) | bin | 2980 -> 2980 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/hdpi/ic_sysbar_home.png (renamed from tools/layoutlib/bridge/resources/bars/hdpi-v21/ic_sysbar_home.png) | bin | 3653 -> 3653 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/hdpi/ic_sysbar_recent.png (renamed from tools/layoutlib/bridge/resources/bars/hdpi-v21/ic_sysbar_recent.png) | bin | 1396 -> 1396 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/hdpi/stat_sys_battery_charge_anim100.png (renamed from tools/layoutlib/bridge/resources/bars/hdpi/stat_sys_battery_charge_anim100.png) | bin | 1040 -> 1040 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/hdpi/stat_sys_wifi_signal_4_fully.png (renamed from tools/layoutlib/bridge/resources/bars/hdpi/stat_sys_wifi_signal_4_fully.png) | bin | 2436 -> 2436 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/hdpi/status_bar_background.9.png (renamed from tools/layoutlib/bridge/resources/bars/hdpi/status_bar_background.9.png) | bin | 3233 -> 3233 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/ldrtl-hdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/ldrtl-hdpi-v21/ic_sysbar_back.png) | bin | 3026 -> 3026 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/ldrtl-mdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/ldrtl-mdpi-v21/ic_sysbar_back.png) | bin | 1803 -> 1803 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/ldrtl-xhdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/ldrtl-xhdpi-v21/ic_sysbar_back.png) | bin | 4375 -> 4375 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/ldrtl-xxhdpi/ic_sysbar_back.png | bin | 0 -> 2062 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/mdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/mdpi-v21/ic_sysbar_back.png) | bin | 1845 -> 1845 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/mdpi/ic_sysbar_home.png (renamed from tools/layoutlib/bridge/resources/bars/mdpi-v21/ic_sysbar_home.png) | bin | 2372 -> 2372 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/mdpi/ic_sysbar_recent.png (renamed from tools/layoutlib/bridge/resources/bars/mdpi-v21/ic_sysbar_recent.png) | bin | 1148 -> 1148 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/mdpi/stat_sys_battery_charge_anim100.png (renamed from tools/layoutlib/bridge/resources/bars/mdpi/stat_sys_battery_charge_anim100.png) | bin | 762 -> 762 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/mdpi/stat_sys_wifi_signal_4_fully.png (renamed from tools/layoutlib/bridge/resources/bars/mdpi/stat_sys_wifi_signal_4_fully.png) | bin | 1430 -> 1430 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/mdpi/status_bar_background.9.png (renamed from tools/layoutlib/bridge/resources/bars/mdpi/status_bar_background.9.png) | bin | 204 -> 204 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/xhdpi/ic_sysbar_back.png (renamed from tools/layoutlib/bridge/resources/bars/xhdpi-v21/ic_sysbar_back.png) | bin | 4218 -> 4218 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/xhdpi/ic_sysbar_home.png (renamed from tools/layoutlib/bridge/resources/bars/xhdpi-v21/ic_sysbar_home.png) | bin | 5365 -> 5365 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/xhdpi/ic_sysbar_recent.png (renamed from tools/layoutlib/bridge/resources/bars/xhdpi-v21/ic_sysbar_recent.png) | bin | 1754 -> 1754 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/xhdpi/stat_sys_battery_charge_anim100.png (renamed from tools/layoutlib/bridge/resources/bars/xhdpi/stat_sys_battery_charge_anim100.png) | bin | 1332 -> 1332 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/xhdpi/stat_sys_wifi_signal_4_fully.png (renamed from tools/layoutlib/bridge/resources/bars/xhdpi/stat_sys_wifi_signal_4_fully.png) | bin | 3485 -> 3485 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_back.png | bin | 0 -> 7195 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_home.png | bin | 0 -> 8635 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_recent.png | bin | 0 -> 2369 bytes | |||
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/Config.java (renamed from tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Config.java) | 15 | ||||
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java | 88 | ||||
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/StatusBar.java | 1 | ||||
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java | 1 |
44 files changed, 73 insertions, 33 deletions
diff --git a/tools/layoutlib/bridge/resources/bars/v11/README b/tools/layoutlib/bridge/resources/bars/v11/README new file mode 100644 index 0000000..ae094e2 --- /dev/null +++ b/tools/layoutlib/bridge/resources/bars/v11/README @@ -0,0 +1 @@ +Resources for Api level 11-20 diff --git a/tools/layoutlib/bridge/resources/bars/hdpi/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v11/hdpi/ic_sysbar_back.png Binary files differindex 84e6bc8..84e6bc8 100644 --- a/tools/layoutlib/bridge/resources/bars/hdpi/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v11/hdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/hdpi/ic_sysbar_home.png b/tools/layoutlib/bridge/resources/bars/v11/hdpi/ic_sysbar_home.png Binary files differindex 38e4f45..38e4f45 100644 --- a/tools/layoutlib/bridge/resources/bars/hdpi/ic_sysbar_home.png +++ b/tools/layoutlib/bridge/resources/bars/v11/hdpi/ic_sysbar_home.png diff --git a/tools/layoutlib/bridge/resources/bars/hdpi/ic_sysbar_recent.png b/tools/layoutlib/bridge/resources/bars/v11/hdpi/ic_sysbar_recent.png Binary files differindex bf9f300..bf9f300 100644 --- a/tools/layoutlib/bridge/resources/bars/hdpi/ic_sysbar_recent.png +++ b/tools/layoutlib/bridge/resources/bars/v11/hdpi/ic_sysbar_recent.png diff --git a/tools/layoutlib/bridge/resources/bars/ldrtl-hdpi/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-hdpi/ic_sysbar_back.png Binary files differindex 782ebfe..782ebfe 100644 --- a/tools/layoutlib/bridge/resources/bars/ldrtl-hdpi/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-hdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/ldrtl-hdpi/ic_sysbar_recent.png b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-hdpi/ic_sysbar_recent.png Binary files differindex 677b471..677b471 100644 --- a/tools/layoutlib/bridge/resources/bars/ldrtl-hdpi/ic_sysbar_recent.png +++ b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-hdpi/ic_sysbar_recent.png diff --git a/tools/layoutlib/bridge/resources/bars/ldrtl-mdpi/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-mdpi/ic_sysbar_back.png Binary files differindex a1b8062..a1b8062 100644 --- a/tools/layoutlib/bridge/resources/bars/ldrtl-mdpi/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-mdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/ldrtl-mdpi/ic_sysbar_recent.png b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-mdpi/ic_sysbar_recent.png Binary files differindex fcdbefe..fcdbefe 100644 --- a/tools/layoutlib/bridge/resources/bars/ldrtl-mdpi/ic_sysbar_recent.png +++ b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-mdpi/ic_sysbar_recent.png diff --git a/tools/layoutlib/bridge/resources/bars/ldrtl-xhdpi/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-xhdpi/ic_sysbar_back.png Binary files differindex 633d864..633d864 100644 --- a/tools/layoutlib/bridge/resources/bars/ldrtl-xhdpi/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-xhdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/ldrtl-xhdpi/ic_sysbar_recent.png b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-xhdpi/ic_sysbar_recent.png Binary files differindex 4665e2a..4665e2a 100644 --- a/tools/layoutlib/bridge/resources/bars/ldrtl-xhdpi/ic_sysbar_recent.png +++ b/tools/layoutlib/bridge/resources/bars/v11/ldrtl-xhdpi/ic_sysbar_recent.png diff --git a/tools/layoutlib/bridge/resources/bars/mdpi/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v11/mdpi/ic_sysbar_back.png Binary files differindex a00bc5b..a00bc5b 100644 --- a/tools/layoutlib/bridge/resources/bars/mdpi/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v11/mdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/mdpi/ic_sysbar_home.png b/tools/layoutlib/bridge/resources/bars/v11/mdpi/ic_sysbar_home.png Binary files differindex dc3183b..dc3183b 100644 --- a/tools/layoutlib/bridge/resources/bars/mdpi/ic_sysbar_home.png +++ b/tools/layoutlib/bridge/resources/bars/v11/mdpi/ic_sysbar_home.png diff --git a/tools/layoutlib/bridge/resources/bars/mdpi/ic_sysbar_recent.png b/tools/layoutlib/bridge/resources/bars/v11/mdpi/ic_sysbar_recent.png Binary files differindex b07f611..b07f611 100644 --- a/tools/layoutlib/bridge/resources/bars/mdpi/ic_sysbar_recent.png +++ b/tools/layoutlib/bridge/resources/bars/v11/mdpi/ic_sysbar_recent.png diff --git a/tools/layoutlib/bridge/resources/bars/xhdpi/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v11/xhdpi/ic_sysbar_back.png Binary files differindex bd60cd6..bd60cd6 100644 --- a/tools/layoutlib/bridge/resources/bars/xhdpi/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v11/xhdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/xhdpi/ic_sysbar_home.png b/tools/layoutlib/bridge/resources/bars/v11/xhdpi/ic_sysbar_home.png Binary files differindex c5bc5c9..c5bc5c9 100644 --- a/tools/layoutlib/bridge/resources/bars/xhdpi/ic_sysbar_home.png +++ b/tools/layoutlib/bridge/resources/bars/v11/xhdpi/ic_sysbar_home.png diff --git a/tools/layoutlib/bridge/resources/bars/xhdpi/ic_sysbar_recent.png b/tools/layoutlib/bridge/resources/bars/v11/xhdpi/ic_sysbar_recent.png Binary files differindex f621d9c..f621d9c 100644 --- a/tools/layoutlib/bridge/resources/bars/xhdpi/ic_sysbar_recent.png +++ b/tools/layoutlib/bridge/resources/bars/v11/xhdpi/ic_sysbar_recent.png diff --git a/tools/layoutlib/bridge/resources/bars/hdpi-v21/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v21/hdpi/ic_sysbar_back.png Binary files differindex b28624f..b28624f 100644 --- a/tools/layoutlib/bridge/resources/bars/hdpi-v21/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v21/hdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/hdpi-v21/ic_sysbar_home.png b/tools/layoutlib/bridge/resources/bars/v21/hdpi/ic_sysbar_home.png Binary files differindex 3f3e288..3f3e288 100644 --- a/tools/layoutlib/bridge/resources/bars/hdpi-v21/ic_sysbar_home.png +++ b/tools/layoutlib/bridge/resources/bars/v21/hdpi/ic_sysbar_home.png diff --git a/tools/layoutlib/bridge/resources/bars/hdpi-v21/ic_sysbar_recent.png b/tools/layoutlib/bridge/resources/bars/v21/hdpi/ic_sysbar_recent.png Binary files differindex 06dcd20..06dcd20 100644 --- a/tools/layoutlib/bridge/resources/bars/hdpi-v21/ic_sysbar_recent.png +++ b/tools/layoutlib/bridge/resources/bars/v21/hdpi/ic_sysbar_recent.png diff --git a/tools/layoutlib/bridge/resources/bars/hdpi/stat_sys_battery_charge_anim100.png b/tools/layoutlib/bridge/resources/bars/v21/hdpi/stat_sys_battery_charge_anim100.png Binary files differindex 829378e..829378e 100644 --- a/tools/layoutlib/bridge/resources/bars/hdpi/stat_sys_battery_charge_anim100.png +++ b/tools/layoutlib/bridge/resources/bars/v21/hdpi/stat_sys_battery_charge_anim100.png diff --git a/tools/layoutlib/bridge/resources/bars/hdpi/stat_sys_wifi_signal_4_fully.png b/tools/layoutlib/bridge/resources/bars/v21/hdpi/stat_sys_wifi_signal_4_fully.png Binary files differindex 931daed..931daed 100644 --- a/tools/layoutlib/bridge/resources/bars/hdpi/stat_sys_wifi_signal_4_fully.png +++ b/tools/layoutlib/bridge/resources/bars/v21/hdpi/stat_sys_wifi_signal_4_fully.png diff --git a/tools/layoutlib/bridge/resources/bars/hdpi/status_bar_background.9.png b/tools/layoutlib/bridge/resources/bars/v21/hdpi/status_bar_background.9.png Binary files differindex a4be298..a4be298 100644 --- a/tools/layoutlib/bridge/resources/bars/hdpi/status_bar_background.9.png +++ b/tools/layoutlib/bridge/resources/bars/v21/hdpi/status_bar_background.9.png diff --git a/tools/layoutlib/bridge/resources/bars/ldrtl-hdpi-v21/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v21/ldrtl-hdpi/ic_sysbar_back.png Binary files differindex e464347..e464347 100644 --- a/tools/layoutlib/bridge/resources/bars/ldrtl-hdpi-v21/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v21/ldrtl-hdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/ldrtl-mdpi-v21/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v21/ldrtl-mdpi/ic_sysbar_back.png Binary files differindex 1b578a6..1b578a6 100644 --- a/tools/layoutlib/bridge/resources/bars/ldrtl-mdpi-v21/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v21/ldrtl-mdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/ldrtl-xhdpi-v21/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v21/ldrtl-xhdpi/ic_sysbar_back.png Binary files differindex 373e84a..373e84a 100644 --- a/tools/layoutlib/bridge/resources/bars/ldrtl-xhdpi-v21/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v21/ldrtl-xhdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/v21/ldrtl-xxhdpi/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v21/ldrtl-xxhdpi/ic_sysbar_back.png Binary files differnew file mode 100644 index 0000000..6b19593 --- /dev/null +++ b/tools/layoutlib/bridge/resources/bars/v21/ldrtl-xxhdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/mdpi-v21/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v21/mdpi/ic_sysbar_back.png Binary files differindex f878093..f878093 100644 --- a/tools/layoutlib/bridge/resources/bars/mdpi-v21/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v21/mdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/mdpi-v21/ic_sysbar_home.png b/tools/layoutlib/bridge/resources/bars/v21/mdpi/ic_sysbar_home.png Binary files differindex 8e9583b..8e9583b 100644 --- a/tools/layoutlib/bridge/resources/bars/mdpi-v21/ic_sysbar_home.png +++ b/tools/layoutlib/bridge/resources/bars/v21/mdpi/ic_sysbar_home.png diff --git a/tools/layoutlib/bridge/resources/bars/mdpi-v21/ic_sysbar_recent.png b/tools/layoutlib/bridge/resources/bars/v21/mdpi/ic_sysbar_recent.png Binary files differindex e2a89c3..e2a89c3 100644 --- a/tools/layoutlib/bridge/resources/bars/mdpi-v21/ic_sysbar_recent.png +++ b/tools/layoutlib/bridge/resources/bars/v21/mdpi/ic_sysbar_recent.png diff --git a/tools/layoutlib/bridge/resources/bars/mdpi/stat_sys_battery_charge_anim100.png b/tools/layoutlib/bridge/resources/bars/v21/mdpi/stat_sys_battery_charge_anim100.png Binary files differindex 2773a70..2773a70 100644 --- a/tools/layoutlib/bridge/resources/bars/mdpi/stat_sys_battery_charge_anim100.png +++ b/tools/layoutlib/bridge/resources/bars/v21/mdpi/stat_sys_battery_charge_anim100.png diff --git a/tools/layoutlib/bridge/resources/bars/mdpi/stat_sys_wifi_signal_4_fully.png b/tools/layoutlib/bridge/resources/bars/v21/mdpi/stat_sys_wifi_signal_4_fully.png Binary files differindex 6e1ac91..6e1ac91 100644 --- a/tools/layoutlib/bridge/resources/bars/mdpi/stat_sys_wifi_signal_4_fully.png +++ b/tools/layoutlib/bridge/resources/bars/v21/mdpi/stat_sys_wifi_signal_4_fully.png diff --git a/tools/layoutlib/bridge/resources/bars/mdpi/status_bar_background.9.png b/tools/layoutlib/bridge/resources/bars/v21/mdpi/status_bar_background.9.png Binary files differindex eb7c1a4..eb7c1a4 100644 --- a/tools/layoutlib/bridge/resources/bars/mdpi/status_bar_background.9.png +++ b/tools/layoutlib/bridge/resources/bars/v21/mdpi/status_bar_background.9.png diff --git a/tools/layoutlib/bridge/resources/bars/xhdpi-v21/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v21/xhdpi/ic_sysbar_back.png Binary files differindex ec2951d..ec2951d 100644 --- a/tools/layoutlib/bridge/resources/bars/xhdpi-v21/ic_sysbar_back.png +++ b/tools/layoutlib/bridge/resources/bars/v21/xhdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/xhdpi-v21/ic_sysbar_home.png b/tools/layoutlib/bridge/resources/bars/v21/xhdpi/ic_sysbar_home.png Binary files differindex 254f757..254f757 100644 --- a/tools/layoutlib/bridge/resources/bars/xhdpi-v21/ic_sysbar_home.png +++ b/tools/layoutlib/bridge/resources/bars/v21/xhdpi/ic_sysbar_home.png diff --git a/tools/layoutlib/bridge/resources/bars/xhdpi-v21/ic_sysbar_recent.png b/tools/layoutlib/bridge/resources/bars/v21/xhdpi/ic_sysbar_recent.png Binary files differindex 8a8e941..8a8e941 100644 --- a/tools/layoutlib/bridge/resources/bars/xhdpi-v21/ic_sysbar_recent.png +++ b/tools/layoutlib/bridge/resources/bars/v21/xhdpi/ic_sysbar_recent.png diff --git a/tools/layoutlib/bridge/resources/bars/xhdpi/stat_sys_battery_charge_anim100.png b/tools/layoutlib/bridge/resources/bars/v21/xhdpi/stat_sys_battery_charge_anim100.png Binary files differindex c7fd719..c7fd719 100644 --- a/tools/layoutlib/bridge/resources/bars/xhdpi/stat_sys_battery_charge_anim100.png +++ b/tools/layoutlib/bridge/resources/bars/v21/xhdpi/stat_sys_battery_charge_anim100.png diff --git a/tools/layoutlib/bridge/resources/bars/xhdpi/stat_sys_wifi_signal_4_fully.png b/tools/layoutlib/bridge/resources/bars/v21/xhdpi/stat_sys_wifi_signal_4_fully.png Binary files differindex 625c61d..625c61d 100644 --- a/tools/layoutlib/bridge/resources/bars/xhdpi/stat_sys_wifi_signal_4_fully.png +++ b/tools/layoutlib/bridge/resources/bars/v21/xhdpi/stat_sys_wifi_signal_4_fully.png diff --git a/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_back.png b/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_back.png Binary files differnew file mode 100644 index 0000000..77969b8 --- /dev/null +++ b/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_back.png diff --git a/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_home.png b/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_home.png Binary files differnew file mode 100644 index 0000000..d60229f --- /dev/null +++ b/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_home.png diff --git a/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_recent.png b/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_recent.png Binary files differnew file mode 100644 index 0000000..a261f85 --- /dev/null +++ b/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_recent.png diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Config.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/Config.java index e8bc292..089cad3 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Config.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/Config.java @@ -14,13 +14,15 @@ * limitations under the License. */ -package com.android.layoutlib.bridge.impl; +package com.android.layoutlib.bridge.bars; /** * Various helper methods to simulate older versions of platform. */ public class Config { + public static final String DEFAULT_RESOURCE_DIR = "/bars/v21/"; + public static boolean showOnScreenNavBar(int platformVersion) { // return true if ICS or later. return platformVersion >= 14 || platformVersion == 0; @@ -30,4 +32,15 @@ public class Config { // return white for froyo and earlier; black otherwise. return platformVersion >= 9 || platformVersion == 0 ? 0xFF000000 : 0xFFFFFFFF; } + + public static boolean usesCustomResourceDir(int platformVersion) { + return platformVersion > 10 && platformVersion < 21; + } + + public static String getResourceDir(int platformVersion) { + if (usesCustomResourceDir(platformVersion)) { + return "/bars/v11/"; + } + return DEFAULT_RESOURCE_DIR; + } } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java index 9bc86a0..4da9f04 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java @@ -47,6 +47,8 @@ import android.widget.TextView; import java.io.IOException; import java.io.InputStream; +import static com.android.layoutlib.bridge.bars.Config.DEFAULT_RESOURCE_DIR; + /** * Base "bar" class for the window decor around the the edited layout. * This is basically an horizontal layout that loads a given layout on creation (it is read @@ -58,6 +60,12 @@ import java.io.InputStream; */ abstract class CustomBar extends LinearLayout { + // An upper-bound on the length of the path to the directory to find the icon in. + // This assumes that resource directory name for different api levels have same length. + private static final int ICON_PATH_LENGTH = DEFAULT_RESOURCE_DIR.length() + + LayoutDirection.RTL.getResourceValue().length() + 9; // 9 = "-xxxhdpi/".length + + private final int mSimulatedPlatformVersion; protected abstract TextView getStyleableTextView(); @@ -90,54 +98,71 @@ abstract class CustomBar extends LinearLayout { } private InputStream getIcon(String iconName, Density[] densityInOut, LayoutDirection direction, - String[] pathOut, boolean tryOtherDensities) { + StringBuilder[] pathOut, boolean tryOtherDensities) { + pathOut[0] = new StringBuilder(ICON_PATH_LENGTH + iconName.length()); + + if (Config.usesCustomResourceDir(mSimulatedPlatformVersion)) { + // current density. + Density density = densityInOut[0]; + InputStream stream = getIcon(iconName, Config.getResourceDir(mSimulatedPlatformVersion), + densityInOut, direction, pathOut, tryOtherDensities); + if (stream != null) { + return stream; + } + // reset the density. + densityInOut[0] = density; + } + return getIcon(iconName, DEFAULT_RESOURCE_DIR, densityInOut, direction, pathOut, + tryOtherDensities); + + } + + private InputStream getIcon(String iconName, String dir, Density[] densityInOut, + LayoutDirection direction, StringBuilder[] pathOut, boolean tryOtherDensities) { // current density Density density = densityInOut[0]; + pathOut[0].setLength(0); + // bitmap url relative to this class - if (direction != null) { - pathOut[0] = "/bars/" + direction.getResourceValue() + "-" + density.getResourceValue() - + "/" + iconName; + if (direction == LayoutDirection.RTL) { + pathOut[0].append(dir) + .append(direction.getResourceValue()) + .append('-') + .append(density.getResourceValue()) + .append('/') + .append(iconName); } else { - pathOut[0] = "/bars/" + density.getResourceValue() + "/" + iconName; + // Since we do not have any ldltr resource, skip the check. + pathOut[0].append(dir) + .append(density.getResourceValue()) + .append('/') + .append(iconName); } - // TODO: Change this with a more generic method. - InputStream stream = getIconWithApi(pathOut, iconName); + InputStream stream = getClass().getResourceAsStream(pathOut[0].toString()); if (stream == null && tryOtherDensities) { for (Density d : Density.values()) { if (d != density) { densityInOut[0] = d; - stream = getIcon(iconName, densityInOut, direction, pathOut, + stream = getIcon(iconName, dir, densityInOut, direction, pathOut, false /*tryOtherDensities*/); if (stream != null) { return stream; } } - // couldn't find resource with direction qualifier. try without. - if (direction != null) { - return getIcon(iconName, densityInOut, null, pathOut, true); - } + } + // couldn't find resource with direction qualifier, try without. + if (direction == LayoutDirection.RTL) { + densityInOut[0] = density; + stream = getIcon(iconName, dir, densityInOut, null, pathOut, + true /*tryOtherDensities*/); } } return stream; } - private InputStream getIconWithApi(String[] pathOut, String iconName) { - if (mSimulatedPlatformVersion == 0) { - String path = pathOut[0]; - String dirName = path.substring(0, path.lastIndexOf('/')); - path = dirName + "-v21" + "/" + iconName; - InputStream stream = getClass().getResourceAsStream(path); - if (stream != null) { - pathOut[0] = path; - return stream; - } - } - return getClass().getResourceAsStream(pathOut[0]); - } - protected void loadIcon(int index, String iconName, Density density) { loadIcon(index, iconName, density, false); } @@ -147,20 +172,21 @@ abstract class CustomBar extends LinearLayout { if (child instanceof ImageView) { ImageView imageView = (ImageView) child; - String[] pathOut = new String[1]; - Density[] densityInOut = new Density[] { density }; - LayoutDirection dir = isRtl ? LayoutDirection.RTL : LayoutDirection.LTR; + StringBuilder[] pathOut = new StringBuilder[1]; + Density[] densityInOut = new Density[]{density}; + LayoutDirection dir = isRtl ? LayoutDirection.RTL : null; InputStream stream = getIcon(iconName, densityInOut, dir, pathOut, true /*tryOtherDensities*/); density = densityInOut[0]; + String path = pathOut[0].toString(); if (stream != null) { // look for a cached bitmap - Bitmap bitmap = Bridge.getCachedBitmap(pathOut[0], true /*isFramework*/); + Bitmap bitmap = Bridge.getCachedBitmap(path, true /*isFramework*/); if (bitmap == null) { try { bitmap = Bitmap_Delegate.createBitmap(stream, false /*isMutable*/, density); - Bridge.setCachedBitmap(pathOut[0], bitmap, true /*isFramework*/); + Bridge.setCachedBitmap(path, bitmap, true /*isFramework*/); } catch (IOException e) { return; } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/StatusBar.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/StatusBar.java index c9dd777..4cbdd4d 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/StatusBar.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/StatusBar.java @@ -16,7 +16,6 @@ package com.android.layoutlib.bridge.bars; -import com.android.layoutlib.bridge.impl.Config; import com.android.resources.Density; import org.xmlpull.v1.XmlPullParserException; diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java index 8a58d35..871bc53 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java @@ -49,6 +49,7 @@ import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.android.BridgeContext; import com.android.layoutlib.bridge.android.BridgeLayoutParamsMapAttributes; import com.android.layoutlib.bridge.android.BridgeXmlBlockParser; +import com.android.layoutlib.bridge.bars.Config; import com.android.layoutlib.bridge.bars.NavigationBar; import com.android.layoutlib.bridge.bars.StatusBar; import com.android.layoutlib.bridge.bars.TitleBar; |