Commit Graph

1753 Commits

Author SHA1 Message Date
that b2e8f672f3 gui: support string resources
storing strings in a map (for fast lookup) in resource manager

To define a string resource in <resources>:
<string name="foo">Hello</string>

To use a string, e.g.:
<text>%@foo%</text>

Not yet done: language-specific resources (should be solved not only for
strings, but for all kinds of resources - e.g. for localized images)

Change-Id: I3ba5cf5298c09e0d28a83973e9662f179271b33f
2015-03-11 07:38:37 -05:00
that 0f425069dc gui: allow specifying resource type in element name
e.g. '<image ...>' instead of '<resource type="image" ...>'

Change-Id: I5ce04ae0845351c8a4640d12e36f1aaf32e1ebc9
2015-03-11 07:31:40 -05:00
that 74ac6060cc gui: type safe resources part 2
- separate collections for fonts, images, animations
- no more ugly casts
- fix crash if main ui.xml did not define any resources but include did
- don't stop loading resources if one "type" attribute is missing

Change-Id: I70c1c9ca66ca65d9fba1ba3eded34f3d8a07488e
2015-03-11 07:21:37 -05:00
that 18e13a9063 gui: make scroll bars smaller and transparent
Not all themes tested.

To center the scrollbar horizontally on the line, the width must be
fastscroll_linew + 2 * something.

Change-Id: I3c2878734ffbd2e8ef3bc7c64b2f16d4f61aeda5
2015-03-06 05:18:18 +01:00
that 8d46c09ccf gui: kinetic scrolling for console
- Rebase console on ScrollList
- Add fastscroll bar to console
- ScrollList now has a mode that ignores selections
- Increase kinetic scrolling speed for lists showing many items

Change-Id: I6298d717d2e403f3e85e2c633d53c4284a066012
2015-03-05 04:50:33 +01:00
that 0af7795690 gui: introduce virtual RenderItem method in ScrollList
- so derived lists can draw whatever they want (multi-line etc.)
- replace GetListItem with RenderItem
- minor cleanup

Change-Id: I062e0a354f1c18ce0a5232b7542c4987b480e232
2015-03-05 04:46:10 +01:00
xiaolu e738da5e89 minuitwrp: fix crash issue, when the console use TTF font to display unicode font.
gui: fix terminal command unusual line breaks and missing characters at the end of a read buf.

Change-Id: I8d3d740b6066b1594c5148b2012f0e7bcbecc22b
2015-03-05 04:22:26 +01:00
Matt Mower 5aa29ab3c7 GUI: Terminal command: minor improvements
* Use mono font for terminal command input
* Recognize 'exit' command (go to main page)

Change-Id: I5f383cd8d19959a49d2ae0b18f839b86e4145693
2015-03-05 04:20:53 +01:00
Matt Mower 829315385f GUI: Use valid XML syntax
Safer handling:
& --> &amp;
> --> &gt;
< --> &lt;

Broken tags:
</function>      --> </action>
<folders="1"...> --> <filter folders="1"...>

Change-Id: Iaddaf9db163e08250cb4deefdfdb814c589ccb47
2015-03-05 04:16:26 +01:00
Matt Mower 2b18a53dc8 Address a few compiler warnings
Change-Id: I6e063fba8d58c8c53da6bca6292c84e3392aee50
2015-03-05 04:11:44 +01:00
Ethan Yonker 1a147a41ae Properly initialize Archive_Current_Size to 0 in twrpTar
Change-Id: I30b67787b1d529d6bdf462c8e0bf2338a9961eff
2015-02-27 13:14:44 -06:00
Matt Mower e057c2b101 GUI: Restore text input field for restore decrypt
The portrait placement was mistakenly removed in commit
I6e314efb4bb454d496555ff7e003d743063a1308

Change-Id: Ida5f908e61df0f99e0f5327c298e6a1a915d0f66
2015-02-25 15:39:22 -06:00
that 72b90e39db gui: fix missing icons in fileselector
Style support was missing.

Change-Id: I9a9a8c6a42e2a3d0dcdee871a639c9842a2ff668
2015-02-23 22:57:14 +01:00
bigbiff bf1d67245e Theme: Add ability to disable size checking before backup
(for compressed backup users with low space).
Clean up backup folder and copy only recovery.log for debugging.

Conflicts:
	gui/devices/watch/res/watch.xml

Change-Id: If8aa3580dbc082d0fe4882d4af8dc3cdb362a8b5
2015-02-23 15:49:02 +01:00
that ba75a0e73b gui: don't truncate values to 0 after scaling
Avoids invisible lines (e.g. input cursor) when scaling down.

Change-Id: I595e8bdb2fa468c30f104867ad77be2423ec287f
2015-02-23 15:39:15 +01:00
Ethan Yonker 72b90ab0d7 Fix reboot system on watch theme
Change-Id: I008664109360d937a31232c8cc15c7c9d3dd0ba5
2015-02-23 08:35:48 -06:00
Matt Mower e9e9ccdc96 Fix fsck_msdos symlink
Change-Id: I3dfc1c2e48b81bb6c41b6aaff6a40684649c656a
2015-02-21 15:36:39 +01:00
that a999821ad4 gui: proportional scrollbars
- Attribute "recth" in the <fastscroll> element is now the
*minimum* height for the scrollbar.
- Dragging the scrollbar moves the list.
- Touching outside the scrollbar jumps to the relative position.

Change-Id: Ic1f20b5ec68cf49e5be56be34f0c58c0f474618b
2015-02-21 15:34:19 +01:00
bigbiff 74a6d0d562 Replace Auto_Generated name spaces with underscores.
Change-Id: Ibc38940833f9d8eb584690ef767561d22f71a64d
2015-02-21 15:24:49 +01:00
Ethan Yonker 21ff02a693 GUI: Support styles in xml to reduce xml file size
Also allow sliders to have their own text label instead of
requiring a whole separate text object for the label in the xml.

Change-Id: I6e314efb4bb454d496555ff7e003d743063a1308
2015-02-21 08:14:24 -06:00
that 10ec0175c8 gui: make kinetic scrolling deceleration more awesome
Change-Id: Ia674676c847e429c41ddbe6de3e1778c3d5c8302
2015-02-15 23:52:28 +01:00
that 9876ac3361 gui: support scrollable lists without headers
If the <header> element doesn't exist, the header is not drawn.

- minuitwrp: add function for clipping all drawing to a rectangle
...and another one to cancel it.

Change-Id: If0f688a5debee6ebd9c457999fe571705a42c5cc
2015-02-15 22:12:29 +01:00
that f6ed8fc1f5 gui: make resources type safe
- add string, int, color and resource loading helpers
- use typed resource classes, and some cleanup in loading code
- remove abstract GetResource() to enforce type safe access
- add height and width query methods to resources and use them
- minor cleanup
- simplify LoadPlacement

Change-Id: I9b81785109a80b3806ad6b50cba4d893b87b0db1
2015-02-15 20:36:40 +01:00
Ethan Yonker cfd6509027 Retain and display previous selection for image flashing
Change-Id: Ib9963d8d393cf4428e43a3d6552d98ae67c1d7bf
2015-02-14 17:27:46 -06:00
that fa30aca94a gui: fix condition handling for lists
Base class must be called first, otherwise the condition can never
again become true. Fixes font size switching in Material theme.

Change-Id: I160a733549495e1bde3cead56b0a3582f0dc744c
2015-02-13 01:22:22 +01:00
that c26ba0d344 minuitwrp: fix file descriptor leak in open_png
This fixes missing images after reloading the material theme 3 times.

Change-Id: I9af2a76b16e465fd2218e5f479c36a294590fa62
2015-02-13 01:09:55 +01:00
Ethan Yonker f892d0501e 2.8.5.0
Change-Id: I88711ed77244e2275b268f9d3464c5d848aceef3
2015-02-11 21:20:39 -06:00
Ethan Yonker aee144c322 Fix handling of mapped zip files for OTA updates
AOSP started using the @ special character to pass to sysMapFile
to indicate that the zip file is actually mapped to unused blocks
on the data partition. Allow TWRP to do the same.

Change-Id: I5bf1355a5462588086401b02de1b17ab88ed3bcd
2015-02-11 16:49:44 -06:00
Ethan Yonker 727aeb8f70 Fix handling of GGLContext in res_scale_surface
Change-Id: I36eb1d5e4f6908bad5ebb1fec692d8510529a14c
2015-02-10 18:07:44 -06:00
Ethan Yonker 63e414fc8a Scale the GUI to fit the screen
With this patch set, if needed, we scale the images during early
boot. TTF support is needed to properly scale the font. No font
scaling is done on the old style fixed width font used in the
console.

Special thanks to _that for figuring out the scaling and blending
function calls to make this possible.

Change-Id: If2f79bef16d6db2e1298bfc3d00c9bcca2bee37a
2015-02-10 14:11:50 -06:00
Ethan Yonker 1b6199f8ed Remove deletes for images from scroll list GUI Elements
Resources are deleted by ~PageSet and do not need to be deleted
by the the scrollable list elements. This fixes a crash when
reloading the theme.

Also remove some deletes for items that should not be deleted in
button and input GUI elements.

Change-Id: Ie1c1b85c81c10f648d085746a5fdba6220468a5f
2015-02-10 13:42:48 -06:00
that de72b6d4d8 gui: avoid high CPU usage while waiting for input
- add a timeout to ev_get
- set timeout to 1 second when idle
- delay timeout for 15 frames to keep animation objects working
- stop kinetic scrolling immediately at end of list

Change-Id: I77138055c464b65b71e296f9c7ef63ea06809bc1
2015-02-09 16:53:21 +01:00
Ethan Yonker 3f15be40aa Reset data manager variables before running runPages
Fixes a problem where, if you decrypt the device, the promtp for
installing SuperSU appears briefly before it automatically
reboots without letting you confirm or deny.

Change-Id: I6f7b1c7096e788ccabd8f5aac9eb01d38bfbc0f7
2015-02-09 09:42:00 -06:00
Ethan Yonker 13f7ae9457 Fix erroneous infinite loop in MTP inotify_t
Change-Id: I60ce40bd08e2ce9b04beb5dc4876b86f3688861b
2015-02-09 09:33:40 -06:00
that 05360ba6b0 gui: fix console lockup when scrolling
Apparently fixing all the signed/unsigned warnings was good. :)

Change-Id: I62faa23179e8b2436fe0d24d2152af341cd42fe9
2015-02-06 00:58:16 +01:00
that ae4b12eaef gui: make kinetic scrolling more natural
Speeding up scrolling after releasing is distracting, get rid of it.
Instead reduce friction to its previous value.

Change-Id: I5c99cc71b631747697e967bd75669aa3d908c637
2015-02-06 00:23:05 +01:00
Ethan Yonker 0a3a98f892 Unify scrollable list code
The goal of this patch set is to eliminate the code duplication
caused by copy/paste of the code in the file selector, listbox,
and partition list GUI elements. Those classes will now utilize a
single GUIScrollList class that will handle rendering and
scrolling.

Change-Id: I0cb98ab36cf47178296034293435225658c779cd
2015-02-05 14:51:24 -06:00
Ethan Yonker 9132d91253 Disable stock recovery replacing TWRP during ORS
-Create a separate function to disable stock recovery flashing
-Add a call to that function to the reboot section of the ORS
 action so that an OTA update will not inadvertantly replace TWRP

Change-Id: I43eae81e0e76971b6e8d34c38785dc73772242d2
2015-02-02 18:23:25 +01:00
dhacker29 a3fa75fd66 Allow wiping f2fs to reserve space for a crypto footer
We will convert a -16384 to 16384 if needed because mkfs.f2fs
does not like negative numbers like make_ext4fs does. Also enable
trim by default on f2fs.

Change-Id: I8b41e65d1ff894433665c65d0569a51803c67891
2015-02-02 11:19:51 -06:00
Ethan Yonker 1b03920ca7 MTP: make MTP work even if unplugged and replugged
Set up a loop to keep trying to open / read the MTP device so that
MTP will work even if the device is unplugged during boot or
unplugged and replugged in.

Change-Id: I0d3a3b7c91ce84a8cbed16caa4b15efee35b3641
2015-02-02 15:45:51 +01:00
that 1a7ba9751f gui: simplify code in GUIKeyboard
- merge duplicated code into new ParseKey method
- convert some unsigned int to int to avoid warnings
- add local variable for current key in NotifyTouch to reduce clutter

Change-Id: I98ddbaca50d487c97ab6e98938df91ef03b9aed5
2015-02-01 19:48:19 +01:00
that 5fa54ce78b gui: fix potential invalid memory access
A single char should never be treated as a string.

Change-Id: I5f8459495f7d0f907ac7c0ae6dd73a3428d92d23
2015-02-01 16:15:29 +01:00
that f37aec20dd gui: fix hardware keyboard
- Power+voldown works again for taking screenshots
- Right shift key isn't stuck until users presses "s"
- Don't use DataManager for local variables
- Simplify handling of Shift keys
- Clean up #includes a bit

Change-Id: Iff0453107beaa336a9c04422b43e92225fdbe069
2015-02-01 13:38:35 +01:00
that c5837f3997 gui: fix lag (and event logging)
- Process multiple input events per frame even if rendering takes longer
than 33 ms. Limit minimum frames per second to 2 instead, allowing us
to catch up with the input events. The lag was especially visible when
using the mouse.

- Move blankTimer calls to the main input function so that moving
the mouse also unblanks.

- Fix a compile error with event logging.

Change-Id: If9e0360f5cc0562c4356611afc61b6d583fb1ec4
2015-02-01 01:59:43 +01:00
that 73a5295f69 gui: run cancel action in another thread
Some actions did not have an operation_end where needed especially
when dealing with cancel actions.

Cancel actions now do not run operation_start or operation_end
and let the original action handle the operation_end so that the
GUI waits until the original action acutally cancels.

Change-Id: I28e6260abb058acb982cecd108c09fc89e0ffeed
2015-01-30 16:12:21 +01:00
that 9fa5153aed gui: move input handling into a class
Change-Id: I97e08a23369af0112875af84b3fb529cf42e929e
2015-01-30 16:11:58 +01:00
Ethan Yonker e13fa63dc0 Move input handling into the main thread
This also makes the hardwarekeyboard.cpp file that I created for
the Asus Transformer tablets with a keyboard dock the default
hardware keyboard handler. USB keyboards should work properly now
if present for keyboard input.

Change-Id: I724606e91ffe2a55265a9d1cb1ec714de244d38b
2015-01-30 16:11:31 +01:00
Bogdan Seniuc d1372f732c Fixed screen flipping for devices where xres_virtual > xres
Change-Id: I3efc10e2c9759a358ded5b46f6125958e6d6bd66
2015-01-30 04:32:34 +01:00
that f8194e2924 gui: fix IsInRegion
(0,0) was inside the region of "locationless" action objects,
leading to all kinds of strange behavior when clicking in the
upper left corner.

Change-Id: I222db4ff499f3c30605b05267f005accb2e0dc99
2015-01-29 21:00:41 +01:00
Vojtech Bocek ecd8918634 Use macro to add actions to the action map
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: I283b33087817eb87dae916a3183a9024dd35effd
2015-01-29 15:34:52 +01:00