summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2014-06-26 20:02:57 -0700
committerDeepanshu Gupta <deepanshu@google.com>2014-06-27 11:52:45 -0700
commit1076be31f1c14f39295cc2ce7a747ee9ad96ee73 (patch)
tree5b85af21f0d282ce9c802a1b85084c9a5e80ae9e /tools
parent48d41ea0bee27147273fec6d753332c181861c77 (diff)
downloadframeworks_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/README1
-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)bin1053 -> 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)bin1064 -> 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)bin711 -> 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)bin904 -> 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)bin533 -> 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)bin617 -> 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)bin423 -> 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)bin1250 -> 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)bin552 -> 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)bin774 -> 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)bin836 -> 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)bin591 -> 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)bin1421 -> 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)bin1421 -> 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)bin749 -> 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)bin2980 -> 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)bin3653 -> 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)bin1396 -> 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)bin1040 -> 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)bin2436 -> 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)bin3233 -> 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)bin3026 -> 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)bin1803 -> 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)bin4375 -> 4375 bytes
-rw-r--r--tools/layoutlib/bridge/resources/bars/v21/ldrtl-xxhdpi/ic_sysbar_back.pngbin0 -> 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)bin1845 -> 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)bin2372 -> 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)bin1148 -> 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)bin762 -> 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)bin1430 -> 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)bin204 -> 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)bin4218 -> 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)bin5365 -> 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)bin1754 -> 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)bin1332 -> 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)bin3485 -> 3485 bytes
-rw-r--r--tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_back.pngbin0 -> 7195 bytes
-rw-r--r--tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_home.pngbin0 -> 8635 bytes
-rw-r--r--tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_recent.pngbin0 -> 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.java88
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/StatusBar.java1
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java1
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
new file mode 100644
index 0000000..6b19593
--- /dev/null
+++ b/tools/layoutlib/bridge/resources/bars/v21/ldrtl-xxhdpi/ic_sysbar_back.png
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
new file mode 100644
index 0000000..77969b8
--- /dev/null
+++ b/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_back.png
Binary files differ
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
new file mode 100644
index 0000000..d60229f
--- /dev/null
+++ b/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_home.png
Binary files differ
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
new file mode 100644
index 0000000..a261f85
--- /dev/null
+++ b/tools/layoutlib/bridge/resources/bars/v21/xxhdpi/ic_sysbar_recent.png
Binary files differ
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;