summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2011-03-02 19:38:02 +0100
committerDoug Zongker <dougz@android.com>2011-03-02 19:38:02 +0100
commitbe6d4d10529860037c165e4441a2d23f539e7b00 (patch)
treece15de15a5f1dab086f5a381993f44df966a3b92
parentmake recovery UI images more general; allow for installation animation (diff)
downloadandroid_bootable_recovery-be6d4d10529860037c165e4441a2d23f539e7b00.tar
android_bootable_recovery-be6d4d10529860037c165e4441a2d23f539e7b00.tar.gz
android_bootable_recovery-be6d4d10529860037c165e4441a2d23f539e7b00.tar.bz2
android_bootable_recovery-be6d4d10529860037c165e4441a2d23f539e7b00.tar.lz
android_bootable_recovery-be6d4d10529860037c165e4441a2d23f539e7b00.tar.xz
android_bootable_recovery-be6d4d10529860037c165e4441a2d23f539e7b00.tar.zst
android_bootable_recovery-be6d4d10529860037c165e4441a2d23f539e7b00.zip
Diffstat (limited to '')
-rw-r--r--make-overlay.py102
-rw-r--r--[-rwxr-xr-x]res/images/icon_error.pngbin10398 -> 28117 bytes
-rw-r--r--[-rwxr-xr-x]res/images/icon_installing.pngbin11493 -> 14222 bytes
-rw-r--r--res/images/icon_installing_overlay01.pngbin0 -> 32367 bytes
-rw-r--r--res/images/icon_installing_overlay02.pngbin0 -> 32545 bytes
-rw-r--r--res/images/icon_installing_overlay03.pngbin0 -> 32693 bytes
-rw-r--r--res/images/icon_installing_overlay04.pngbin0 -> 32515 bytes
-rw-r--r--res/images/icon_installing_overlay05.pngbin0 -> 32160 bytes
-rw-r--r--res/images/icon_installing_overlay06.pngbin0 -> 32537 bytes
-rw-r--r--res/images/icon_installing_overlay07.pngbin0 -> 32399 bytes
-rw-r--r--res/images/indeterminate01.pngbin0 -> 929 bytes
-rw-r--r--res/images/indeterminate02.pngbin0 -> 972 bytes
-rw-r--r--res/images/indeterminate03.pngbin0 -> 976 bytes
-rw-r--r--res/images/indeterminate04.pngbin0 -> 977 bytes
-rw-r--r--res/images/indeterminate05.pngbin0 -> 1024 bytes
-rw-r--r--res/images/indeterminate06.pngbin0 -> 968 bytes
-rw-r--r--res/images/indeterminate1.pngbin1919 -> 0 bytes
-rw-r--r--res/images/indeterminate2.pngbin1912 -> 0 bytes
-rw-r--r--res/images/indeterminate3.pngbin1917 -> 0 bytes
-rw-r--r--res/images/indeterminate4.pngbin1912 -> 0 bytes
-rw-r--r--res/images/indeterminate5.pngbin1902 -> 0 bytes
-rw-r--r--res/images/indeterminate6.pngbin1914 -> 0 bytes
-rw-r--r--res/images/progress_empty.pngbin361 -> 1117 bytes
-rw-r--r--res/images/progress_fill.pngbin286 -> 2885 bytes
-rw-r--r--ui.c20
25 files changed, 111 insertions, 11 deletions
diff --git a/make-overlay.py b/make-overlay.py
new file mode 100644
index 000000000..7f931b373
--- /dev/null
+++ b/make-overlay.py
@@ -0,0 +1,102 @@
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Script to take a set of frames (PNG files) for a recovery
+"installing" icon animation and turn it into a base image plus a set
+of overlays, as needed by the recovery UI code. Run with the names of
+all the input frames on the command line, in order."""
+
+import sys
+try:
+ import Image
+except ImportError:
+ print "This script requires the Python Imaging Library to be installed."
+ sys.exit(1)
+
+# Find the smallest box that contains all the pixels which change
+# between images.
+
+print "reading", sys.argv[1]
+base = Image.open(sys.argv[1])
+
+minmini = base.size[0]-1
+maxmaxi = 0
+minminj = base.size[1]-1
+maxmaxj = 0
+
+for top_name in sys.argv[2:]:
+ print "reading", top_name
+ top = Image.open(top_name)
+
+ assert base.size == top.size
+
+ mini = base.size[0]-1
+ maxi = 0
+ minj = base.size[1]-1
+ maxj = 0
+
+ h, w = base.size
+ for j in range(w):
+ for i in range(h):
+ b = base.getpixel((i,j))
+ t = top.getpixel((i,j))
+ if b != t:
+ if i < mini: mini = i
+ if i > maxi: maxi = i
+ if j < minj: minj = j
+ if j > maxj: maxj = j
+
+ minmini = min(minmini, mini)
+ maxmaxi = max(maxmaxi, maxi)
+ minminj = min(minminj, minj)
+ maxmaxj = max(maxmaxj, maxj)
+
+w = maxmaxi - minmini + 1
+h = maxmaxj - minminj + 1
+
+# Now write out an image containing just that box, for each frame.
+
+for num, top_name in enumerate(sys.argv[1:]):
+ top = Image.open(top_name)
+
+ out = Image.new("RGB", (w, h))
+ for i in range(w):
+ for j in range(h):
+ t = top.getpixel((i+minmini, j+minminj))
+ out.putpixel((i, j), t)
+
+ fn = "icon_installing_overlay%02d.png" % (num+1,)
+ out.save(fn)
+ print "saved", fn
+
+# Write out the base icon, which is the first frame with that box
+# blacked out (just to make the file smaller, since it's always
+# displayed with one of the overlays on top of it).
+
+for i in range(w):
+ for j in range(h):
+ base.putpixel((i+minmini, j+minminj), (0, 0, 0))
+fn = "icon_installing.png"
+base.save(fn)
+print "saved", fn
+
+# The device_ui_init() function needs to tell the recovery UI the
+# position of the overlay box.
+
+print
+print "add this to your device_ui_init() function:"
+print "-" * 40
+print " ui_parameters->install_overlay_offset_x = %d;" % (minmini,)
+print " ui_parameters->install_overlay_offset_y = %d;" % (minminj,)
+print "-" * 40
diff --git a/res/images/icon_error.png b/res/images/icon_error.png
index 90c8d878a..6cfcc8a61 100755..100644
--- a/res/images/icon_error.png
+++ b/res/images/icon_error.png
Binary files differ
diff --git a/res/images/icon_installing.png b/res/images/icon_installing.png
index d428f57d1..2866b044a 100755..100644
--- a/res/images/icon_installing.png
+++ b/res/images/icon_installing.png
Binary files differ
diff --git a/res/images/icon_installing_overlay01.png b/res/images/icon_installing_overlay01.png
new file mode 100644
index 000000000..c71d8406f
--- /dev/null
+++ b/res/images/icon_installing_overlay01.png
Binary files differ
diff --git a/res/images/icon_installing_overlay02.png b/res/images/icon_installing_overlay02.png
new file mode 100644
index 000000000..4c97c7822
--- /dev/null
+++ b/res/images/icon_installing_overlay02.png
Binary files differ
diff --git a/res/images/icon_installing_overlay03.png b/res/images/icon_installing_overlay03.png
new file mode 100644
index 000000000..ff4ee946f
--- /dev/null
+++ b/res/images/icon_installing_overlay03.png
Binary files differ
diff --git a/res/images/icon_installing_overlay04.png b/res/images/icon_installing_overlay04.png
new file mode 100644
index 000000000..48998ce5b
--- /dev/null
+++ b/res/images/icon_installing_overlay04.png
Binary files differ
diff --git a/res/images/icon_installing_overlay05.png b/res/images/icon_installing_overlay05.png
new file mode 100644
index 000000000..9f056b1e5
--- /dev/null
+++ b/res/images/icon_installing_overlay05.png
Binary files differ
diff --git a/res/images/icon_installing_overlay06.png b/res/images/icon_installing_overlay06.png
new file mode 100644
index 000000000..e5872fd6c
--- /dev/null
+++ b/res/images/icon_installing_overlay06.png
Binary files differ
diff --git a/res/images/icon_installing_overlay07.png b/res/images/icon_installing_overlay07.png
new file mode 100644
index 000000000..4ad8bf3ec
--- /dev/null
+++ b/res/images/icon_installing_overlay07.png
Binary files differ
diff --git a/res/images/indeterminate01.png b/res/images/indeterminate01.png
new file mode 100644
index 000000000..84f04b0d2
--- /dev/null
+++ b/res/images/indeterminate01.png
Binary files differ
diff --git a/res/images/indeterminate02.png b/res/images/indeterminate02.png
new file mode 100644
index 000000000..21d012168
--- /dev/null
+++ b/res/images/indeterminate02.png
Binary files differ
diff --git a/res/images/indeterminate03.png b/res/images/indeterminate03.png
new file mode 100644
index 000000000..8a190a8c6
--- /dev/null
+++ b/res/images/indeterminate03.png
Binary files differ
diff --git a/res/images/indeterminate04.png b/res/images/indeterminate04.png
new file mode 100644
index 000000000..baf8d63e4
--- /dev/null
+++ b/res/images/indeterminate04.png
Binary files differ
diff --git a/res/images/indeterminate05.png b/res/images/indeterminate05.png
new file mode 100644
index 000000000..5653c7b06
--- /dev/null
+++ b/res/images/indeterminate05.png
Binary files differ
diff --git a/res/images/indeterminate06.png b/res/images/indeterminate06.png
new file mode 100644
index 000000000..858de85a5
--- /dev/null
+++ b/res/images/indeterminate06.png
Binary files differ
diff --git a/res/images/indeterminate1.png b/res/images/indeterminate1.png
deleted file mode 100644
index 90cb9fba9..000000000
--- a/res/images/indeterminate1.png
+++ /dev/null
Binary files differ
diff --git a/res/images/indeterminate2.png b/res/images/indeterminate2.png
deleted file mode 100644
index f7fb28989..000000000
--- a/res/images/indeterminate2.png
+++ /dev/null
Binary files differ
diff --git a/res/images/indeterminate3.png b/res/images/indeterminate3.png
deleted file mode 100644
index ba10dfa53..000000000
--- a/res/images/indeterminate3.png
+++ /dev/null
Binary files differ
diff --git a/res/images/indeterminate4.png b/res/images/indeterminate4.png
deleted file mode 100644
index ad5d9a542..000000000
--- a/res/images/indeterminate4.png
+++ /dev/null
Binary files differ
diff --git a/res/images/indeterminate5.png b/res/images/indeterminate5.png
deleted file mode 100644
index 8c19c8d57..000000000
--- a/res/images/indeterminate5.png
+++ /dev/null
Binary files differ
diff --git a/res/images/indeterminate6.png b/res/images/indeterminate6.png
deleted file mode 100644
index c0c66386a..000000000
--- a/res/images/indeterminate6.png
+++ /dev/null
Binary files differ
diff --git a/res/images/progress_empty.png b/res/images/progress_empty.png
index 4cb4998dd..c6820159b 100644
--- a/res/images/progress_empty.png
+++ b/res/images/progress_empty.png
Binary files differ
diff --git a/res/images/progress_fill.png b/res/images/progress_fill.png
index eb71754db..9748435f5 100644
--- a/res/images/progress_fill.png
+++ b/res/images/progress_fill.png
Binary files differ
diff --git a/ui.c b/ui.c
index 054e53f60..5a2a83715 100644
--- a/ui.c
+++ b/ui.c
@@ -39,10 +39,10 @@
#define UI_WAIT_KEY_TIMEOUT_SEC 120
UIParameters ui_parameters = {
- 6, // indeterminate progress bar frames
- 15, // fps
- 0, // installation icon frames (0 == static image)
- 0, 0, // installation icon overlay offset
+ 6, // indeterminate progress bar frames
+ 20, // fps
+ 7, // installation icon frames (0 == static image)
+ 23, 83, // installation icon overlay offset
};
static pthread_mutex_t gUpdateMutex = PTHREAD_MUTEX_INITIALIZER;
@@ -386,10 +386,8 @@ void ui_init(void)
sizeof(gr_surface));
for (i = 0; i < ui_parameters.indeterminate_frames; ++i) {
char filename[40];
- // "indeterminateN" if fewer than 10 frames, else "indeterminateNN".
- sprintf(filename, "indeterminate%0*d",
- ui_parameters.indeterminate_frames < 10 ? 1 : 2,
- i+1);
+ // "indeterminate01.png", "indeterminate02.png", ...
+ sprintf(filename, "indeterminate%02d", i+1);
int result = res_create_surface(filename, gProgressBarIndeterminate+i);
if (result < 0) {
LOGE("Missing bitmap %s\n(Code %d)\n", filename, result);
@@ -401,9 +399,9 @@ void ui_init(void)
sizeof(gr_surface));
for (i = 0; i < ui_parameters.installing_frames; ++i) {
char filename[40];
- sprintf(filename, "icon_installing_overlay%0*d",
- ui_parameters.installing_frames < 10 ? 1 : 2,
- i+1);
+ // "icon_installing_overlay01.png",
+ // "icon_installing_overlay02.png", ...
+ sprintf(filename, "icon_installing_overlay%02d", i+1);
int result = res_create_surface(filename, gInstallationOverlay+i);
if (result < 0) {
LOGE("Missing bitmap %s\n(Code %d)\n", filename, result);