diff --git a/.classpath b/.classpath
index 68d0c3e676..4d14041bcc 100644
--- a/.classpath
+++ b/.classpath
@@ -3,9 +3,9 @@
-
-
+
+
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index c76db34f14..9f9085b691 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -16,8 +16,8 @@
+ android:versionCode="52"
+ android:versionName="2.7.6" >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout-xhdpi/navbar_app_dialog.xml b/res/layout-xhdpi/navbar_app_dialog.xml
new file mode 100644
index 0000000000..74056c112c
--- /dev/null
+++ b/res/layout-xhdpi/navbar_app_dialog.xml
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/slider_preference.xml b/res/layout/slider_preference.xml
index cef712b71f..a1829e9adb 100644
--- a/res/layout/slider_preference.xml
+++ b/res/layout/slider_preference.xml
@@ -21,7 +21,7 @@
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingLeft="6dp"
- android:paddingRight="6dp">
+ android:paddingRight="2dp">
+
+
+
+
+
\ No newline at end of file
diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml
index 7c40911ee6..20aec51987 100644
--- a/res/values-ar/strings.xml
+++ b/res/values-ar/strings.xml
@@ -377,7 +377,6 @@
اعدادات Pie
تفعيل اعدادات Pie
- اضهار زر البحث
حجم أزرار التنقل
مواقع التشغيل
يسار الشاشة
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index 8b144f121b..360e4971bb 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -7,6 +7,8 @@
Základní
Kruhový bez procent
Kruhový s procenty
+ KitKat bez procent
+ KitKat s procenty
Procentuální text stavu baterie
Žádný
@@ -35,8 +37,8 @@
Pohyb kurzoru tlačítky hlasitosti
Umožní pohyb kurzoru pomocí tlačítek hlasitosti v textových polích
Vypnuté
- Tlačítko nahoru/dolu pohybuje kurzorem doleva/doprava
- Tlačítko nahoru/dolu pohybuje kurzorem doprava/doleva
+ Tlačítko nahoru/dolů pohybuje kurzorem doleva/doprava
+ Tlačítko nahoru/dolů pohybuje kurzorem doprava/doleva
Ukončení aktuálních aplikací
Zobrazí tlačítko, které umožní ukončení všech aplikací najednou, v seznamu aktuálních aplikací
@@ -48,8 +50,8 @@
Použít v případě, když nastavení datumu a času padá (vyžaduje restart)
Opravit identifikátor volajícího
- Použít v případě, když není číslo volajícího identifikované během přijímání hovoru (vyžaduje restart)
- Aby se oprava projavila, je potřebné po restartu vymazat a znova přidat kontakty! V Nastavení / Aplikace / Všechny, vyhledejte \"Úložiště kontaktů\" a zvolte vymazání údajů. Ujistěte se nejdříve, že máte zálohu kontaktů.
+ Použít v případě, když není číslo volajícího identifikováno během přijímání hovoru (vyžaduje restart)
+ Aby se oprava projevila, je nutné po restartu vymazat a znova přidat kontakty! V Nastavení / Aplikace / Všechny, vyhledejte \"Úložiště kontaktů\" a zvolte vymazání údajů. Ujistěte se nejdříve, že máte zálohu kontaktů.
Opravit identifikátor odesílatele SMS
Použít v případě kdy dochází při přijetí SMS k vytváření duplicitních vláken konverzací pro ten samý kontakt (vyžaduje restart)
@@ -83,7 +85,7 @@
Bdění vyp
Wi-Fi
Wi-Fi vyp
- Nepřipojené
+ Nepřipojeno
Zapíná se…
@@ -98,7 +100,7 @@
GPS
GPS (CM styl)
Mobilní data
- Typ síte
+ Typ sítě
Využití dat
Zvukové profily
Jas
@@ -108,7 +110,7 @@
Wi-Fi Přístupový bod
Světlo
GravityBox
- Uspát
+ Uspat
Rychlý záznam zvuku
Hlasitost
Rozšířená plocha
@@ -144,12 +146,12 @@
Naprogramoval C3C076@XDA. Dotykem otevřete oficiální stránku.
Xposed framework
Naprogramoval rovo89@XDA. Dotykem otevřete oficiální stránku.
- Přispět
- Přispějte přes PayPal pokud si myslíte, že tato aplikace za to stojí! Zvažte též příspěvek pro rovo89 za jeho excelentní Xposed framework.
+ Podpořit vývoj
+ Dotykem podpoříte vývoj aplikace věnováním příspěvku libovolné hodnoty přes PayPal
- Váš %s bude restartovaný
- Váš %s bude restartovaný do režimu Recovery
+ Váš %s bude restartován
+ Váš %s bude restartován do režimu Recovery
CRT efekt vypnutí obrazovky
@@ -247,7 +249,7 @@
Akce tlačítek
- Umožňuje nastavení akcí pro hardvérová tlačítka
+ Umožňuje nastavení akcí pro hardwarová tlačítka
Dlouhé podržení Menu
Dvojité klepnutí na Menu
Dlouhé podržení Zpět
@@ -256,11 +258,11 @@
Hlasové vyhledávání
Přepnout na předcházející aplikaci
Zabít aplikaci v popředí
- Uspát
+ Uspat
Zpoždění zabití aplikace
- Vztahuje se na akci zabití aplikace v popředí dlouhým podržením tlačítka. Definuje, jak dlouho musí být tlačítko přidrženo aby došlo k provedení akce.
+ Vztahuje se na akci zabití aplikace v popředí dlouhým podržením tlačítka. Definuje, jak dlouho musí být tlačítko přidrženo, aby došlo k provedení akce.
Rychlost dvojitého klepnutí
- Vztahuje se na dvojité klepnutí na Menu. Definuje, jak rychle musí být provedeno dvojité klepnutí aby došlo k provedení akce.
+ Vztahuje se na dvojité klepnutí na Menu. Definuje, jak rychle musí být provedeno dvojité klepnutí, aby došlo k provedení akce.
Aplikace %s zabita
Není co zabít
Žádná předcházející aplikace
@@ -282,7 +284,7 @@
Počet dlaždic na řádek
- Definuje počet QuickSettings dlaždic zobrazených na 1 řádek. Velikost dlaždic bude upravená podle potřeby. Aplikovatelné na portrét režim.
+ Definuje počet QuickSettings dlaždic zobrazených na 1 řádek. Velikost dlaždic bude upravena podle potřeby. Aplikovatelné na portrét režim.
Zobrazit den v týdnu
@@ -297,7 +299,7 @@
Automatické zobrazení QuickSettings
- QuickSettings budou zobrazeny automaticky pokud se v oznamovacím panely nenacházejí žádné notifikace
+ QuickSettings budou zobrazena automaticky, pokud se v oznamovacím panely nenacházejí žádné notifikace
Rychlé zobrazení QuickSettings
@@ -345,12 +347,12 @@
Vypnout roaming indikátory
- Pokud vypnuto, R indikátory nebudou zobrazeny během roamingu. Použít s opatrností.
+ Pokud vypnuto, R indikátory nebudou zobrazeny během roamingu. Použít s rozmyslem.
Nabíjení (%d%%)
Nabito
- %d%% zůstává
+ %d%% zbývá
Bez signálu
@@ -360,7 +362,6 @@
Koláč
Zapnout koláč
- Povolit tlačítko hledání
Velikost koláče
Pozice koláče
Levý okraj obrazovky
@@ -378,15 +379,15 @@
Skrýt navigační lištu
- Skryje navigační lištu pokud je zapnutý koláč (pro zařízení s navigační lištou, vyžaduje restart)
+ Skryje navigační lištu, pokud je zapnutý koláč (pro zařízení s navigační lištou, vyžaduje restart)
Vyhlazené Holo pozadí
Nahradí standardní Holo pozadí vyhlazeným obrázkem za účelem eliminace pruhů barevného přechodu (vyžaduje restart)
-
- Zablokovat HW tlačítka
- Zablokuje MENU, ZPĚT, DOMŮ pokud je zapnutý koláč. Akce HW tlačítek budou nadále fungovat (pro zařízení s HW tlačítky)
+
+ Zablokovat navigační tlačítka
+ Zablokuje ťuknutí na tlačítka pokud je zapnutý koláč
Použít tmavé téma
@@ -444,10 +445,11 @@
Nastavení průhlednosti
- Stavového řádku pro launcher
- Stavového řádku pro lockscreen
- Navigační lišty pro launcher
- Navigační lišty pro lockscreen
+ Umožňuje nastavení úrovně průhlednosti pro stavový řádek a navigační lištu
+ Stavový řádek pro launcher
+ Stavový řádek pro lockscreen
+ Navigační lišta pro launcher
+ Navigační lišta pro lockscreen
Skrýt ikonu alarmu
@@ -522,7 +524,7 @@
Pro horizontální navigační lištu a orientaci na šířku
Šířka navigační lišty
Pro vertikální navigační lištu
- Vždy zobrazit menu tlačítko
+ Vždy zobrazit Menu tlačítko
Screenshot v menu napájení
@@ -557,7 +559,7 @@
Kopírovat barvu stock baterie
- Nastaví barvu hodin, procent baterie a kruhového indikátoru podle barvy stock baterie (v případě pokud je vypnuto vlastní vybarvování)
+ Nastaví barvu hodin, procent baterie a kruhového indikátoru podle barvy stock baterie (pokud je vypnuto vlastní vybarvování)
Režim dlaždice typu mobilní sítě
@@ -655,7 +657,7 @@
%1$s využitých
RAM lišta v seznamu spuštěných aplikací
Vypnuta
- Zobrazit nahoru
+ Zobrazit nahoře
Zobrazit dole
@@ -680,7 +682,7 @@
Tlačítko Menu
Tlačítko Domov
- Tlačítko Späť
+ Tlačítko Zpět
Tlačítko Spuštěné aplikace
Tlačítka ovládání hlasitosti
Další nastavení
@@ -688,4 +690,98 @@
Akce na ťuknutí
Akce na dvojité ťuknutí
+
+ Vypnout dvojité ťuknutí
+
+
+ Režim vybarvování signálu
+ Použít GravityBox ikony (s podporou úrovně signálu)
+ Použít originál ikony (bez podpory úrovně signálu)
+ Nevybarvovat
+
+
+ Spouštěč aplikací
+ Dialog s aplikacemi, který může být aktivován na akcii tlačítka, nebo přes dodatečné tlačítko navigační lišty, nebo z koláče
+ Aplikace %d
+ Nejsou přiřazeny žádné aplikace. Použijte GravityBox / Spouštěč aplikací pro přiřazení aplikací.
+
+
+ Tlačítko spouštěče aplikací
+
+
+ Zobrazit spouštěč aplikací
+
+
+ Volitelné tlačítko
+ Vypnuto
+ Hledat
+ Spouštěč aplikací
+
+
+ Barvy koláče
+ Barva pozadí
+ Barva ikon
+ Barva okraje
+ Barva aktivního tlačítka
+ Barva textu
+ Resetovat barvy
+
+
+ Povolit foto neznámého čísla
+ Nastavit foto neznámého čísla
+ Foto nastaveno
+ Foto nebylo nastaveno
+
+
+ Vaše obrazovka nemusí podporovat hodnoty jasu nižší než 20. Pokud se obrazovka nerozsvítí,
+ držte tlačítko Hlasitost+ po dobu 7 sekund pro rozsvícení obrazovky. Následně změňte nastavení minimálního jasu na vyšší hodnotu.
+
+
+ Plná délka posuvníků
+ Umožní posuvníkům využít celou délku panelu nastavení hlasitosti
+
+
+ Obecné
+ Navigační tlačítka
+ Barvy
+ Rozměry
+
+
+ Povolit barvy
+ Může vyžadovat restart po deaktivaci
+ Barva tlačítek
+ Efekt tlačítek
+ Barva pozadí lišty
+
+
+ Vypnout zatmavení
+ Vypne zatmavení obrazovky uzamčení
+
+
+ Režim průhlednosti
+ Vyžaduje restart
+ Vypnutý
+ Stavový řádek
+ Navigační lišta
+ Stavový řádek i navigační lišta
+
+
+ Barva sekundárního signálu
+ Nahradí původní oranžovou verzi ikony signálu
+ Sekundární indikátor datové aktivity
+ Nastaví barvu pro sekundární indikátor datové aktivity
+
+
+ Styl stavových ikon
+ Platí pro stavové ikony jako ikona vypnutého vyzvánění, vibrace, budíku, atd.
+ JellyBean
+ KitKat
+
+
+ Dvojité klepnutí na Zpět
+
+
+ Domů
+ Zpět
+
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 28e0284c0f..c3fc94876c 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -3,10 +3,12 @@
GravityBox
- Akkuanzeige-Stil
+ Akkuanzeige-Stil
Standard Akkuanzeige
Runde Akkuanzeige
Runde Akkuanzeige mit Prozentwert
+ KitKat Akkuanzeige
+ KitKat Akkuanzeige mit Prozentwert
Nur Prozentwert
Keine Anzeige
@@ -31,7 +33,7 @@
Erweitertes Neustart-Menü
Aktiviert erweitertes Neustart-Menü mit der Option direkt die Recovery zu starten
Recovery
- Bootloader
+ Bootloader
Cursor mittels Lautstärketasten bewegen
Den Cursor mit den Lautstärketasten in Textfeldern steuern
@@ -78,22 +80,22 @@
Erweitert
Wachhalten an
Wachhalten aus
- WLAN
+ WLAN
WLAN aus
Getrennt
- Aktiviere...
+ Aktiviere…
-
+
Schnelleinstellungs-Verknüpfungen in der Statusleiste
Erlaubt es, Schnelleinstellungs-Verknüpfungen in der Statusleiste anzuzeigen oder zu verstecken
Benutzerprofil
Flugmodus
Akku
WLAN
- WLAN (CM-Stil)
+ WLAN (CM-Stil)
Bluetooth
GPS
- GPS (CM-Stil)
+ GPS (CM-Stil)
Mobile Daten
Netzmodus
Mobiler Datenverkehr
@@ -108,24 +110,24 @@
Schlafmodus
Aufnahme
Einstellungen
- Lautstärke
+ Lautstärke
Erweiterter Desktop
Wachhalten
- Screenshot
+ Screenshot
Farbwähler
Zur Bestätigung auf Farbfeld drücken
-
+
Hintergrundfarbe der Statusleiste
- Erlaubt es, die Hintergrundfarbe und Transparenz der Statusleiste zu ändern
+ Erlaubt es, die Hintergrundfarbe der Statusleiste zu ändern
-
+
Behebt Spracheingabe-Einstellungen
Schaltet \'Sprachsuche\' und \'Text-in-Sprache-Ausgabe\' im \'Sprache & Eingabe\'-Einstellungsmenü frei (Neustart erforderlich)
-
+
Erweiterte Entwickler-Optionen
Schaltet erweiterte Entwickler-Optionen frei (Neustart erforderlich)
@@ -143,7 +145,7 @@
Xposed Framework
Programmiert von rovo89@XDA. Berühren, um den offiziellen Foreneintrag zu öffnen.
Spenden
- Bitte an mich Spenden, falls dir die App gefällt! Erwäge es auch an rovo89 für sein exzellentes Xposed Framework zu spenden.
+ Berühren, um die Entwicklung zu unterstützen, indem Sie per PayPal spenden
%s wird neu gestartet.
@@ -162,7 +164,7 @@
Dual-SIM Lautstärke
Startet eine Anwendung, die es erlaubt, für die beiden SIM-Karten unterschiedliche Rufton- und Benachrichtigungslautstärken einzustellen
-
+
Sperrbildschirm optimieren
Beinhaltet Optionen, um den Sperrbildschirm anzupassen
Sperrbildschirm-Hintergrund
@@ -180,11 +182,11 @@
Widgets maximieren
Wenn aktiviert, werden Widgets auf dem Sperrbildschirm maximiert
-
+
Ausschaltmenü optimieren
Beinhaltet energiebezogene Optionen, um das Ausschaltmenü anzupassen
-
+
Deaktiviere blinkende LED
Deaktivert aufdringlich blinkende LED, wenn der Akkustatus niedrig ist und nicht geladen wird.
@@ -196,7 +198,7 @@
Minimale Helligkeitsstufe
Erlaubt es, die minimale Helligkeitsstufe zu ändern. Wirkt sich auf die manuelle Helligkeitseinstellung aus. (Neustart erforderlich)
-
+
Automatische Helligkeitsstufen
Erlaubt es, für eine bestimmte Umgebungshelligkeit die Bildschirmhelligkeit zu bestimmen
Helligkeitsstufe
@@ -211,7 +213,7 @@
Werte für %s gesetzt
Neue automatische Helligkeitsregelung gespeichert
Neue automatische Helligkeitsregelung nicht gespeichert
- Übernehmen
+ Übernehmen
Aktiviere Sperrbildschirm-Rotation
@@ -264,7 +266,7 @@
Nichts zu beenden
Keine vorherige App gefunden
-
+
Anrufe optimieren
Beinhaltet Anruf-bezogene Optionen
@@ -274,11 +276,11 @@
Keine Aktion ausführen
Auf Lautlos stellen
Anruf ablehnen
-
-
+
+
Sanfter Neustart
-
+
Schwarzer Hintergrund
Benutze einen schwarzen Hintergrund für das Holo-System-Theme, anstelle des Schwarz-Grau Verlaufs (Neustart erforderlich)
@@ -286,7 +288,7 @@
Verknüpfungen pro Reihe
Legt fest, wie viele Schnelleinstellungs-Verknüpfungen in einer Reihe angezeigt werden sollen. Die Verknüpfungen werden in der Größe angepasst. Betrifft den Portrait-Modus (Hochformat).
-
+
Zeige den Wochentag an
@@ -362,7 +364,6 @@
Pie-Steuerung
Aktiviere Pie-Steuerung
- Suchschaltfläche anzeigen
Größe der Navigationstasten
Auslöse-Positionen
linker Bildschirmrand
@@ -382,13 +383,13 @@
Verstecke Navigationsleiste
Versteckt die Navigationsleiste, wenn Pie-Steuerung aktiviert ist (Für Geräte, die eine Navigationsleiste haben. Neustart erforderlich.)
-
+
Geditherter Holo-Hintergrund
Ersetzt den Standard Holo-Hintergrund mit einem geditherten, um Farbstreifenbildung zu minimieren (Neustart erforderlich)
-
- Deaktiviert Hardwaretasten
- Deaktiviert die Menü-, Zurück- & Home-Taste, wenn die Pie-Steuerung aktiviert ist. Hardwaretastenbelegung funktioniert weiterhin (lange drücken, doppelt drücken). (Für Geräte die Hardwaretasten besitzen)
+
+ Deaktiviert Navigationstasten
+ Deaktiviert einfachen Tastenklick, während Pie Controls aktiviert sind
Verwende dunkles Holo-Theme
@@ -446,10 +447,11 @@
Transparenz Einstellungen
+ Regelt die Transparenz der Status- und Navigationsleiste
Statusleisten Transparenz für den Launcher
Statusleisten Transparenz für den Sperrbildschirm
- Navigationsleisten Transparenz für den Launcher
- Navigationsleisten Transparenz für den Sperrbildschirm
+ Transparenz für den Launcher
+ Transparenz für den Sperrbildschirm
Verstecke Wecker Icon
@@ -461,8 +463,8 @@
Telefon
Tablet
-
-
+
+
Helligkeitseinstellungen
Aktiviere Helligkeitseinstellungen
Nur anwenden, falls Ihr Gerät standardmäßig Helligkeitsfunktionalitäten unterstützt. Bei auftretenden Problemen bitte wieder deaktivieren. (Neustart erforderlich)
@@ -502,8 +504,8 @@
Erweiterter Desktop
Erweiterter Desktop ist AN
Erweiterter Desktop ist AUS
-
-
+
+
Screenshot
@@ -576,8 +578,8 @@
Überschreibt das Verhalten ausgewählter Kacheln beim Drücken/langen Drücken (Neustart erforderlich)
- Network mode tile SIM slot
- Defines SIM slot to which network mode tile applies (%s)
+ Netzmodus-Kachel SIM-Steckplatz
+ Definiert SIM-Steckplatz, den die Netzmodus-Kachel verwendet (%s)
SIM-Steckplatz 1
SIM-Steckplatz 2
@@ -605,18 +607,18 @@
Anruf getrennt
Anruf wartend
Alle 45 Sekunden bei ausgehendem Anruf
-
-
+
+
Kachelanordnung ändern
Erlaubt die Neuanordnung der Schnelleinstellungs-Kacheln
-
-
+
+
Fortlaufende Benachrichtigungen blocken
Erlaubt es, fortlaufende Benachrichtigungen selektiv zu blockieren
Jede fortlaufende Benachrichtigung wird automatisch in die Liste eingetragen. Du kannst dann entscheiden, ob du die fortlaufende Benachrichtigung beim nächsten Erscheinen blockierst. Mit Vorsicht verwenden.
Liste zurücksetzen
Wollen Sie die Liste wirklich zurücksetzen? Löscht die aktuelle Liste und gibt alle Benachrichtigungen frei, die zuvor blockiert wurden.
- (Liste ist leer)
+ (Liste ist leer)
Schnelle Entsperrung
@@ -641,12 +643,12 @@
Position
Auto (Zentriert oder rechts, abhängig von der Uhrposition)
Links
- Rechts
+ Rechts
Größe
Normal
Kleiner
Sehr klein
- B
+ B
KB
MB
s
@@ -654,8 +656,8 @@
Widget-Beschränkung aufheben
Erlaubt es, eine unbeschränkte Anzahl an Sperrbildschirm-Widgets einzurichten
-
-
+
+
%1$s frei
@@ -670,15 +672,15 @@
Recents key long-press action
- Show battery arc
- Shows battery status arc drawn around unlock ring handle
+ Zeige Akku-Bogen
+ Zeigt einen Akkustatus-Bogen, der um den Entsperr-Ring angeordnet ist
Toggle torch
- Torch on home key long-press
- Toggles torch on/off when device locked. Screen has to be turned on if device lacks native wake by home key support.
+ Taschenlampe bei langem Druck auf die Home-Taste
+ Schaltet Taschenlampe An/Aus während das Gerät gesperrt ist. Screen has to be turned on if device lacks native wake by home key support.
Automatisches expandieren
@@ -689,9 +691,85 @@
Zurück-Taste
Recents key
Lautstärketasten
- Other settings
- Long-press action
- Single-tap action
- Double-tap action
-
+ Andere Einstellungen
+ Aktion bei langem Druck
+ Aktion beim Einzelklick
+ Aktion beim Doppelklick
+
+
+ Doppelklick deaktivieren
+
+
+ Signal color mode
+ Use GravityBox icons (with signal level support)
+ Use stock icons (without signal level support)
+ Farbe nicht anwenden
+
+
+ App-Launcher
+ Dialog allowing to define up to 8 apps which can be assigned as HW Key Action or used as additional navigation bar key
+ Application slot %d
+ Keine Apps zugeordnet. GravityBox / App-Launcher-Menü verwenden, um Apps zuzuordnen.
+
+
+ Zeige App-Launcher-Taste
+
+
+ Zeige App-Launcher
+
+
+ Zeige benutzerdefinierte Taste
+ Deaktiviert
+ Suchen
+ App-Launcher
+
+
+ Pie-Farben
+ Hintergrundfarbe
+ Vordergrundfarbe
+ Konturfarbe
+ Key selected color
+ Textfarbe
+ Farben zurücksetzen
+
+
+ Aktiviere Bild unbekannter Anrufer
+ Bild unbekannter Anrufer einstellen
+ Bild geändert
+ Bild nicht geändert
+
+
+ Ihr Bildschirm unterstützt möglicherweise keine Werte, die kleiner als 20 sind. Falls Ihr Bildschirm nicht aufleuchtet, halten Sie die Lautstärke+ Taste für wenigstens 7 Sekunden gedrückt, um die Helligkeit zurückzusetzen. Anschließend können Sie minimale Helligkeit einstellen, um höhere Werte zu verwenden.
+
+
+ Allgemein
+ Navigationstasten
+ Farben
+ Abmessungen
+
+
+ Aktiviere farbige Navigationsleiste
+ Erfordert nach Deaktivierung eventuell einen Neustart
+ Farbe der Navigationstaste
+ Leuchtfarbe der Navigationstaste
+ Hintergrundfarbe der Navigationsleiste
+
+
+ Deaktiviert Sperrbildschirm-Schattierung
+ Entfernt dunkle Tönung vom Sperrbildschirm
+
+
+ Transparenz-Manager-Modus
+ Erfordert Neustart
+ Deaktiviert
+ Statusleiste
+ Navigationsleiste
+ Beide
+
+
+ Secondary signal color
+ Overrides stock orange signal icon
+ Secondary data activity color
+ Sets color for secondary data activity indicators
+
\ No newline at end of file
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
new file mode 100644
index 0000000000..41c24f051e
--- /dev/null
+++ b/res/values-el/strings.xml
@@ -0,0 +1,723 @@
+
+
+
+
+
+ GravityBox
+
+ Τρόπος ένδειξης μπαταρίας
+ Εργοστασιακή ένδειξη μπαταρίας
+ Κυκλική μπαταρία
+ Κυκλική μπαταρία με ποσοστό
+ Νούμερο ποσοστού μπαταρίας
+ Καθόλου
+
+ Πλήκτρα έντασης για μεταπήδηση μουσικού κομματιού
+ Μεταπήδηση μουσικών κομματιών με παρατεταμένο πάτημα των πλήκτρων έντασης με σβηστή οθόνη
+
+ Προειδοποίηση χαμηλής στάθμης μπαταρίας
+ Αναδυόμενο παράθυρο και ήχος
+ Αναδυόμενο παράθυρο μόνο
+ Ήχος μόνο
+ Απενεργοποιημένη
+
+ Οι αλλαγές θα εφαρμοστούν μετά από επανεκκίνηση
+
+ Αυτόματη απόκρυψη προειδοποιητικών εικονιδίων
+ Αποκρύπτει αυτόματα προειδοποιητικά εικονίδια για τις θέσεις των καρτών SIM όταν κάποια κάρτα SIM δεν έχει εισαχθεί, απενεργοποιεί ειδοποιήσεις \"Δεν έχει εισαχθεί κάρτα SIM\"
+ Αυτόματη απόκρυψη θέσης SIM 1
+ Αυτόματη απόκρυψη θέσης SIM 2
+ Απενεργοποίηση ειδοποιήσεων
+ \"Δεν έχει εισαχθεί κάρτα SIM\" ειδοποιήσεις απενεργοποιήθηκαν
+
+ Μενού επανεκκίνησης για προχωρημένους
+ Ενεργοποιεί το μενού επανεκκίνησης για προχωρημένους με επιλογές για επανεκκίνιση σε recovery
+ Recovery
+ Bootloader
+
+ έλεγχος κέρσορα πλήκτρου έντασης
+ Ελέγχει τον κέρσορα χρησιμοποιώντας τα πλήκτρα έντασης σε πεδία κειμένου
+ Απενεργοποιημένο
+ Πλήκτρο έντασης Πάνω/Κάτω μετακινεί τον κέρσορα Αριστερά/Δεξιά
+ Πλήκτρο έντασης Πάνω/Κάτω μετακινεί τον κέρσορα Δεξιά/Αριστερά
+
+ Εκκαθάριση όλων των πρόσφατων εργασιών
+
+ Επιδιόρθωση ημερομηνίας&Οι ρυθμίσεις της ώρας καταρρίπτονται
+ Ενεργοποιήστε σε περίπτωση που παρατηρήσετε κατάρρευση κατά την πρόσβαση σε Ημερομηνία&Ρυθμίσεις Ώρας (απαιτείται επανεκκίνηση)
+
+ Επιδιόρθωση αναγνώρισης καλούντος για κλήση
+ Ενεργοποιήστε σε περίπτωση που η επαφή δεν συμπίπτει με την εισερχόμενη κλήση (απαιτείται επανεκκίνηση)
+ Μετά την επανεκκίνηση, θα πρέπει να καθαρίσετε και να προσθέσετε εκ νέου τις επαφές σας για την αλλαγή να τεθεί σε ισχύ! Χρησιμοποιήστε Ρυθμίσεις / Εφαρμογές / Όλες - για εκκαθάριση δεδομένων των Επαφών.
+
+ Επιδιόρθωση αναγνώρισης καλούντος για μηνύματα
+ Ενεργοποιήστε σε περίπτωση που παρατηρήσετε χωρισμένες συνομιλίες με την ίδια επαφή (απαιτείται επανεκκίνηση)
+ Μετά την επανεκκίνηση, πρέπει να διαγράψετε όλες τις χωρισμένες συνομιλίες για την αλλαγή να τεθεί σε ισχύ!
+
+ Επιδιόρθωση εφαρμογής ημερολογίου
+ Ενεργοποιήστε σε περίπτωση που παρατηρήσετε αυτόματη περιοδική ενεργοποίηση/απενεργοποίηση της οθόνης (απαιτείται επανεκκίνηση)
+
+ Σημαντικό
+
+ Εικόνα καλούντος σε πλήρη οθόνη
+ Εμφανίζει την εικόνα καλούντος σε πλήρη οθόνη κατά την κλήση
+
+
+ Συγρονισμός on
+ Συγρονισμός off
+ Wi-Fi AP on
+ Wi-Fi AP off
+ Φακός on
+ Φακός off
+ Αγίξτε για απενεργοποίηση
+ Αναπαραγωγή…
+ Καταγραφή…
+ Κατεγράφηκε
+ Παρατεταμένη πίεση για εγγραφή
+ Αγγίξτε για διακοπή εγγραφής
+ Απενεργοποιημένο
+ Κλασσικό
+ Διευρυμένο
+ Επαγρύπνηση ενεργοποιημένη
+ Επαγρύπνηση απενεργοποιημένη
+ Wi-Fi
+ Wi-Fi off
+ Δεν συνδέθηκε
+ Ενεργοποίηση...
+
+
+ Επιλογές QuickSettings στη Γραμμή Κατάστασης
+ Επιτρέπει την εμφάνιση ή απόκρυψη των QuickSettings στη Γραμμή Κατάστασης
+ Προφίλ χρήστη
+ Λειτουργία αεροπλάνου
+ Κατάσταση μπαταρίας
+ Wi-Fi
+ Wi-Fi (CM style)
+ Bluetooth
+ GPS
+ GPS (CM style)
+ Δεδομένα
+ Λειτουργία δικτύου
+ Χρήση δεδομένων
+ Προφίλ ήχου
+ Φωτεινότητα
+ Παύση οθόνης
+ Αυτόματη περιστροφή
+ Συγχρονισμός
+ Σημείο επαφής Wi-Fi
+ Φακός
+ GravityBox
+ Ύπνος
+ Γρήγορη Εγγραφή
+ Ρυθμίσεις
+ Ένταση
+ Διευρυμένη επιφάνεια εργασίας
+ Σε επαγρύπνηση
+ Εικόνα
+
+
+ Επιλογέας χρώματος
+ Πιέστε στο χρώμα για εφαρμογή
+
+
+ Χρώμα φόντου Γραμμής Κατάστασης
+ Επιτρέπει να ορίσετε το χρώμα φόντου της Γραμμής Κατάστασης και τη διαφάνεια
+
+
+ Επιδιόρθωση ρυθμίσεων ομιλίας
+ Ξεκλειδώνει τις ρυθμίσεις τη φωνητικής αναζήτησης και του κειμένου σε ομιλία στη Γλώσσα&Εισαγωγής (απαιτείται επανεκκίνηση)
+
+
+ Προχωρημένες επιλογές προγραμματιστή
+ Ξεκλειδώνει προχωρημένες επιλογές προγραμματιστή (απαιτείται επανεκκίνηση)
+
+
+ Βελτιώσεις της Γραμμής Κατάστασης
+ Περιέχει διάφορες βελτιώσεις της Γραμμής Κατάστασης
+ Διάφορες βελτιώσεις
+ Περιλαμβάνει όσες βελτιώσεις δεν ανήκουν σε συγκεκριμένη κατηγορία
+ Γενικές επιδιορθώσεις
+ Περιλαμβάνει συγκεκριμένες επιδιορθώσεις του MTK6589. Μόνο εάν είναι απαραίτητο.
+
+
+ Σχετικά
+ Coded by C3C076@XDA. Touch to visit official thread.
+ Xposed framework
+ Coded by rovo89@XDA. Touch to visit official thread.
+ Donate
+ Donate to me if you think this app is worth it! Also consider donating to rovo89 for his excellent Xposed framework.
+
+
+ Το %s θα επανεκκινήσει.
+ Το %s θα επανεκκινήσει σε recovery.
+ Το %s θα επανεκκινήσει σε bootloader.
+
+
+ CRT οθόνη off εφε
+ Ενεργοποιεί το γραφικό που προσομοιώνει παλιά CRT off εφε όταν σβήνει η οθόνη
+
+
+ Engineering mode
+ Ανοίγει την εφαρμογή Engineering mode
+
+
+ Dual SIM Ήχος κλήσης
+ Ανοίγει την εφαρμογή που επιτρέπει τον ορισμό ήχου κλήσης και ειδοποιήσεων ξεχωριστά για κάθε SIM
+
+
+ Βελτιώσεις κλειδώματος οθόνης
+ Περιλαμβάνει διάφορες βελτιώσεις κλειδώματος οθόνης
+ Κλείδωμα οθόνης φόντου
+ Φόντο style
+ Προεπιλεγμένη ταπετσαρία
+ Γέμισμα χρώματος
+ Προσαρμοσμένη εικόνα
+ Ορισμός προσαρμοσμένου χρώματος
+ Επιτρέπει τον ορισμό προσαρμοσμένου χρώματος φόντου για το κλείδωμα οθόνης
+ Ορισμός προσαρμοσμένης εικόνας
+ Επιτρέπει τον ορισμό προσαρμοσμένης εικόνας φόντου για το κλείδωμα οθόνης
+ Το φόντο άλλαξε
+ Το φόντο δεν άλλαξε
+ ʼλλο
+ Μεγιστοποίηση widgets
+ Όταν ενεργοποιηθεί, τα widgets του κλειδώματος οθόνης θα μεγιστοποιηθούν από προεπιλογή
+
+
+ βελτιώσεις Ενέργειας
+ Περιλαμβάνει διάφορες βελτιώσεις σχετικές με την Ενέργεια
+
+
+ Απενεργοποίηση αναβοσβησίματος LED
+ Απενεργοποιεί το αναβοσβήσιμο του LED όταν το επίπεδο της μπαταρίας είναι χαμηλό και δεν φορτίζει
+
+
+ Βελτώσεις προβολής
+ Περιλαμβάνει διάφορες βελτιώσεις προβολής
+
+
+ Ελάχιστο επίπεδο φωτεινότητας
+ Επιτρέπει τον ορισμό ελάχιστου επίπεδου φωτεινότητας. Εφαρμόζεται σε χειροκίνητη ρύθμιση φωτεινότητας. (απαιτείται επανεκκίνηση)
+
+
+ Επίπεδα αυτόματης φωτεινότητας
+ Επιτρέπει τον ορισμό γήινων επιπέδων φωτεινότητας και των αντίστοιχων τιμών του οπίσθιου φωτισμού LCD
+ Επίπεδο
+ Lux max
+ Φωτεινότητα (%d – 255)
+ Ο καθορισμένος αριθμός δεν είναι έγκυρος
+ Δεν συνιστάται να ρυθμίσετε τη φωτεινότητα χαμηλότερα από %d
+ Η φωτεινότητα δεν μπορεί να είναι μεγαλύτερη από 255
+ Οι τιμές δεν μπορούν να είναι μικρότερες ή ίσες με το μηδέν
+ Οι τιμές σε χαμηλότερα επίπεδα δεν μπορούν να είναι μεγαλύτερες από τιμές σε υψηλότερα επίπεδα
+ Οι τιμές σε υψηλότερα επίπεδα δεν μπορούν να είναι μικρότερες από τιμές σε χαμηλότερα επίπεδα
+ Οι τιμές για %s ορισμός
+ Νέα ρύθμιση αυτόματης φωτεινότητας αποθηκεύτηκε
+ Ρύθμιση αυτόματης φωτεινότητας δεν αποθηκεύτηκε
+ Ορισμός
+
+
+ Ενεργοποίηση περιστροφής κλειδώματος οθόνης
+ ΠΡΟΕΙΔΟΠΟΙΗΣΗ: μπορεί να αλλάξει ξεκλείδωτους κυκλικούς στόχους σε μερικές συσκευές σε περίπτωση που το AOSP κλείδωμα οθόνης έχει τροποποιηθεί από τον vendor
+
+
+ Ενεργοποίηση του πλήκτρου Μενού
+ Επιτρέπει στο πλήκτρο Μενού να χρησιμοποιείται για γρήγορο ξεκλείδωμα της συσκευής όταν είναι κλειδωμένη η οθόνη (απαιτείται επανεκκίνηση)
+
+
+ Επισκευή ξεκλειδώματος με μήνυμα
+ Εμποδίζει την ενεργοποίηση της οθόνης μετά από τη λήψη νέου μηνύματος (απαιτείται επανεκκίνηση)
+
+
+ Κεντρικό Ρολόι
+
+
+ Βελτιώσεις Media
+ Περιέχει διάφορες βελτιώσεις για media και audio
+
+
+ Περισσότερα επίπεδα έντασης μουσικής
+ Προσθέτει περισσότερα επίπεδα ήχου στην αναπαραγωγή μουσικής (απαιτείται επανεκκίνηση)
+
+
+ Ασφαλής ένταση ακουστικών
+ Ενεργοποιεί ή απενεργοποιεί τη λειτουργία ασφαλής έντασης ακουστικών
+
+
+ Απενεργοποίηση του LED φόρτισης
+ Απενεργοποιεί το LED κατά τη διάρκεια της φόρτισης
+
+
+ Ενέργειες των Hardware πλήκτρων
+ Επιτρέπει τη ρύθμιση τροποποιημένων ενεργειών για τα hardware πλήκτρα
+ Πλήκτρο Menu παρατεταμένο πάτημα action
+ Πλήκτρο Menu διπλό χτύπημα action
+ Πλήκτρο Back παρατεταμένο πάτημα action
+ Προεπιλεγμένο
+ Αναζήτηση
+ Φωνητική αναζήτηση
+ Εναλλαγή σε προηγούμενη εφαρμογή
+ Διακοπή εφαρμογής παρασκηνίου
+ Πέσε για ύπνο
+ Καθυστέρηση παρατεταμένου πατήματος διακοπής εφαρμογής
+ Αφορά την ενέργεια διακοπής εφαρμογής παρασκηνίου. Ορίζει τη διάρκεια πίεσης του πλήκτρου για να ενεργοποιήσει τη διακοπή
+ Ταχύτητα διπλού χτυπήματος
+ Αφορά την ενέργεια του διπλού χτυπήματος του πλήκτρου Menu. Ορίζει την ταχύτητα χτυπήματος του πλήκτρου για να ενεργοποιηθεί το διπλό χτύπημα
+ %s killed
+ Δεν υπάρχει κάτι για διακοπή
+ Δεν βρέθηκε προηγούμενη εφαρμογή
+
+
+ Βελτιώσεις τηλεφώνου
+ Περιλαμβάνει διάφορες τηλεφωνικές βελτιώσεις
+
+
+ Ενέργεια περιστροφής κατά το κουδούνισμα
+ Επιτρέπει τον ορισμό ποιας ενέργειας θα πραγματοποιηθεί όταν η συσκευή αναποδογυριστεί κατά το κουδούνισμα
+ Καμία ενέργεια
+ Σίγαση κουδουνίσματος
+ Ματαίωση κλήσης
+
+
+ Soft reboot
+
+
+ Μαύρο φόντο
+ Χρήση μαύρου φόντου ως προεπιλογή του Holo θέματος, αντί του μαυρο-γκρι (απαιτείται επανεκκίνηση)
+
+
+ Τμήματα ανά σειρά
+ Ορίζει το πόσα τμήματα γρήγορων ρυθμίσεων θα εμφανίζονται ανά σειρά. Τα τμήματα θα αλλάζουν μέγεθος αναλόγως. Αφορά το portrait mode.
+
+
+ Εμφάνιση ημέρας
+
+
+ Επεκτάσιμο πεδίο έντασης ήχου
+ Ενεργοποιεί το επεκτάσιμο πεδίο έντασης ήχου με τη δυνατότητα τον ορισμό εντάσεων για διαφορετικά streams
+
+
+ Link ειδοποίησης & εντάσεις ειδοποιήσεων
+ Όταν είναι απενεργοποιημένο, οι εντάσεις των ήχων κλήσης και ειδοποιήσεων μπορούν να οριστούν ανεξάρτητα
+
+
+ Αυτόματη εναλλαγή QuickSettings
+ Οι QuickSettings θα δείχνουν αυτόματα πότε τραβήχτηκε η γραμμή κατάστασης ενώ δεν υπάρχουν ειδοποιήσεις
+
+
+ Γρήγορο τράβηγμα
+ Η άκρη της γραμμής κατάστασης τραβάει κάτω τα QuickSettings
+ Κλειστό
+ Δεξιά
+ Αριστερά
+
+
+ Απενεργοποίηση ξύπνημα με τα πλήκτρα έντασης
+ Για συσκευές όπως τα Jiayu G3s,G4 όπου τα πλήκτρα έντασης ενεργοποιούν την οθόνη
+
+
+ χρώματα γραμμής κατάστασης
+
+
+ Ενεργοποίηση χρωμάτων εικονιδίων
+
+
+ χρώμα εικονιδίου γραμμής κατάστασης
+ Ορίζει το χρώμα των εικονιδίων της γραμμής κατάστασης και του ρολογιού
+
+
+ χρώμα κίνησης δεδομένων
+ Ορίζει το χρώμα των δεικτών κίνησης δεδομένων
+
+
+ διαχείρηση QuickSettings
+
+
+ Στυλ ειδοποιήσεων
+
+
+ Φόντο ειδοποιήσεων
+ Προεπιλεγμένο φόντο
+ γέμισμα χρώματος
+ Προσαρμοσμένη εικόνα
+ Ορισμός χρώματος φόντου
+ Ορισμός portrait εικόνας
+ Ορισμός landscape εικόνας
+ Διαφάνεια φόντου
+ Λειτουργία φόντου
+ Overlay
+ Underlay
+
+
+ Απενεργοποίηση δεικτών roaming
+ Όντας απενεργοποιημένος, ο δείκτης R δεν θα είναι ορατός κατά το roaming. Χρησιμοποιήστε με προσοχή.
+
+
+ Φορτίζει (%d%%)
+ Φορτισμένο
+ %d%% remaining
+
+
+ Δεν υπάρχει διαθέσιμη υπηρεσία
+ Airplane mode on
+ Κλήσεις έκτακτης ανάγκης μόνο
+
+
+ Pie χειρισμοί
+ Ενεργοποίηση pie χειρισμών
+ Εμφάνιση πλήκτρου αναζήτησης
+ Μέγεθος πλήκτρου πλοήγησης
+ Έναρξη θέσεων
+ Αριστερό όριο οθόνης
+ Κάτω όριο οθόνης
+ Δεξί όριο οθόνης
+ Πάνω όριο οθόνης
+
+
+ mode οπίσθιου φωτισμού πλήκτρου
+ Προεπιλεγμένο
+ Απενεργοποίηση οπίσθιου φωτισμού πλήκτρου
+ Πάντα on όταν η οθόνη είναι on
+ Ειδοποιήσεις οπίσθιου φωτισμού πλήκτρου
+ ΠΕΙΡΑΜΑΤΙΚΟ! Αναβοσβήνει τον οπίσθιο φωτισμό πλήκτρου όταν υπάρχει μία ειδοποίηση. Χρησιμοποιήστε σε περίπτωση που η συσκευή σας δεν έχει LED ειδοποιήσεων. Ενδέχεται να καταναλώνει μπαταρία.
+
+
+ Απόκρυψη μπάρας ειδοποιήσεων
+ Απόκρυψη μπάρας ειδοποιήσεων όταν οι χειρισμοί Pie είναι ενεργοποιημένοι (για συσκευές που έχουν μπάρα ειδοποιήσεων, απαιτείται επανεκκίνηση)
+
+
+ Αμφιταλάντευση Holo φόντου
+ Αντικαθιστά το βασικό Holo φόντο με κάποιο για να καταπιέσει το χρωματικό banding (απαιτείται επανεκκίνηση)
+
+
+ Απενεργοποίηση των hardware πλήκτρων
+ Απενεργοποιεί τα MENU, BACK, HOME όταν οι χειρισμοί Pie είναι ενεργοποιημένοι. Οι ενέργειες των πλήκτρων HW θα συνεχίσουν να λειτουργούν. (για συσκευές που έχουν πλήκτρα HW)
+
+
+ Χρήση θέματος Holo Dark
+ Αλλάζει από GB UI σε θέμα Holo Dark αντί για Holo Light
+
+
+ Off
+ Πάνω αριστερά
+ Πάνω δεξιά
+ Κάτω αριστερά
+ Κάτω δεξιά
+
+
+ Ρύθμιση πάνω margin
+
+
+ Απενεργοποίηση ειδοποιήσεων roaming
+ Απενεργοποιεί τις ειδοποιήσεις roaming κατά την αποστολή μηνυμάτων ή πραγματοποίηση τηλεφωνικών κλήσεων κατά τη διάρκεια roaming
+
+
+ Αναζήτηση
+ (τίποτα)
+
+
+ Quick App
+ Ρυθμίσεις κομματιού QuickApp
+ Κύρια εφαρμογή
+ εφαρμογή παρατεταμένου πατήματος slot 1
+ εφαρμογή παρατεταμένου πατήματος slot 2
+ εφαρμογή παρατεταμένου πατήματος slot 3
+ εφαρμογή παρατεταμένου πατήματος slot 4
+
+
+ GPS on
+ GPS off
+ GPS κλειδωμένο
+
+
+ Εμφάνιση πάντα του πλήκτρου μενού
+
+
+ Ringer mode
+
+
+ ρυθμίσεις ρολογιού
+
+
+ απόκρυψη AM/PM
+
+
+ απόκρυψη ρολογιού
+
+
+ μέγεθος Trigger
+
+
+ διαχείριση διαφάνειας
+ διαφάνεια Statusbar για τον launcher
+ διαφάνεια Statusbar για τη lockscreen
+ διαφάνεια Navbar για τον launcher
+ διαφάνεια Navbar για τη lockscreen
+
+
+ απόκρυψη εικονίδιο ξυπνητηριού
+
+
+ επίπεδο φωτισμού οθόνης
+ ποσότητα φωτεινότητας για κάθε επίπεδο φωτισμού - όταν η οθόνη πρόκειται να σβήσει (απαιτείται επανεκκίνηση)
+
+
+ τηλέφωνο
+ tablet
+
+
+ ρυθμίσεις φωτεινότητας
+ ενεργοποίηση ρυθμίσεων φωτεινότητας
+ Χρήση μόνο σε περίπτωση που η συσκευή σας υποστηρίζει τα βασικά χαρακτηριστικά φωτεινότητας Android. Κρατήστε απενεργοποιημένο αν παρατηρήσετε θέματα με τη φωτεινότητα. (απαιτείται επανεκκίνηση)
+
+
+ εμφάνιση πρόσφατων εφαρμογών
+
+
+ ενέργεια παρατεταμένου πατήματος του πλήκτρου Home
+
+
+ εκκίνηση custom εφαρμογής 1
+ ορισμός custom εφαρμογής 1
+ εκκίνηση custom εφαρμογής 2
+ ορισμός custom εφαρμογής 2
+ καμία custom εφαρμογή ορισμένη!
+ Custom εφαρμογή δεν βρέθηκε!
+
+
+ panel ειδοποιήσεων εφαρμογής ρολογιού
+ συνδέει το panel ειδοποιήσεων του ρολογιού με μία συγκεκριμένη εφαρμογή αντί για Date&Time ρυθμίσεις
+
+
+ αναμονή για απάντηση από GravityBox system framework…
+ GravityBox system framework δεν ανταποκρίνεται. έξοδος.
+
+
+ διεθνή δεδομένα roaming
+ σύνδεση σε υπηρεσίες δεδομένων όταν γίνεται διεθνές roaming
+
+
+ Διευρυμένο desktop mode
+ Απενεργοποιημένο
+ απόκρυψη statusbar
+ απόκρυψη navigation bar
+ απόκρυψη και των δύο
+ Διευρυμένο desktop
+ Διευρυμένο desktop ON
+ Διευρυμένο desktop OFF
+
+
+ Screenshot
+
+
+ εμφάνιση μενού
+
+
+ εναλλαγή διευρυμένου desktop
+ Διευρυμένο desktop mode είναι απενεργοποιημένο!
+
+
+ βελτιώσεις Navigation bar
+ περιλαμβάνει διάφορες βελτιώσεις της navigation bar
+ Παράκαμψη προεπιλεγμένων συστήματος
+ κύριος διακόπτης βελτιώσεων για τη navigation bar (απαιτείται επανεκκίνηση)
+ ενεργοποίηση navigation bar
+ απαιτείται επανεκκίνηση
+ Ύψος Navigation bar
+ εφαρμόζεται στον οριζόντιο και πορτραίτου προσανατολισμο της navigation bar
+ εφαρμόζεται στον οριζόντιο και landscape προσανατολισμο της navigation bar
+ Πλάτος Navigation bar
+ εφαρμόζεται σε κάθετη navigation bar
+ εμφάνιση πάντα του πλήκτρου μενού
+
+
+ Screenshot in power menu
+
+
+ ξεκλείδωμα των ρυθμίσεων του ring
+ ενεργοποίηση ξεκλειδώματος στόχων ring
+ κύριος διακόπτης για ξεκλείδωμα στόχων ring
+ Target εφαρμογή %s
+ ξεκλείδωμα κάθετου ring offset
+ ξεκλείδωμα οριζόντιου ring offset
+
+
+ ενεργοποίηση ελέγχου φωτεινότητας
+ ρυθμίζει τη φωτεινότητα γλιστρώντας πάνω στην statusbar (απαιτείται απενεργοποίηση της αυτόματης φωτεινότητας)
+
+
+ Κλήσεων
+ Μηνυμάτων
+ δεδομένων κινητής
+
+
+ Strip unicode
+ μετατρέπει τους χαρακτήρες unicode characters σε κανονικούς. Μειώνει το μέγεθος του μηνύματος.
+ Χαρακτήρες ανέπαφοι
+ Strip non-encodable χαρακτήρες
+ Strip όλους τους χαρακτήρες unicode
+
+
+ Απενεργοποίηση προειδοποίησης αργών 2G δεδομένων
+ Απενεργοποιεί την προειδοποίηση για αργή ταχύτητα δεδομένων όταν τα δεδομένα κινητής είναι ενεργοποιημένα από QuickSettings για τις SIM σε 2G λειτουργία
+
+
+ Follow προεπιλεγμένο χρώμα μπαταρίας
+ κάνει το ρολόι της statusbar, ποσοστό και κυκλική μπαταρία να χρησιμοποιεί το χρώμα του προεπιλεγμένου εικονίδιου μπαταρίας. Εφαρμόζεται όταν ο χρωματισμός του εικονιδίου είναι off.
+
+
+ Network mode tile mode
+ 2G/2G+3G/3G/(LTE)
+ 2G/2G+3G/(LTE)
+ 2G/3G/(LTE)
+
+
+ Επιτρέψτε όλες τις περιστροφές
+
+
+ Παράκαμψη προεπιλεγμένης συμπεριφοράς tile
+ Παρακάμπτει τη συμπεριφορά του πατήματος/παρατεταμένου πατήματος για τα επιλεγμένα tiles (απαιτείται επανεκκίνηση)
+
+
+ Network mode tile SIM slot
+ Ορίζει τη SIM slot σε ποιο δίκτυο mode tile applies (%s)
+ SIM slot 1
+ SIM slot 2
+
+
+ Ποτέ
+ Πάντα
+ Όταν είναι ενεργοποιημένο το διευρυμένο desktop
+ Όταν το διευρυμένο desktop αποκρύπτει τη navigation bar
+
+
+ Αφήνει το προεπιλεγμένο εικονίδιο μπαταρίας
+ Χρησιμοποιήστε σε περίπτωση που το προπιλεγμένο εικονίδιο μπαταρίας έχει αντικατασταθεί από εικονίδιο εφαρμογής
+
+
+ Αποσύνδεση ενεργοποιεί την οθόνη
+ Όταν είναι ενεργοποιημένο, η οθόνη θα ξυπνά όταν συνδέετε/αποσυνδέετε usb/φορτιστή/οτιδήποτε (απαιτείται επανεκκίνηση)
+
+
+ Ήχος ρύθμισης Mute έντασης
+ Απενεργοποιεί τον ήχο όταν ρυθμίζεται η ένταση με τα πλήκτρα έντασης
+
+
+ Δονήσεις κλήσεων
+ Κατά την έναρξη της κλήσης
+ Κατά τον τερματσμό της κλήσης
+ Κατά την αναμονή κλήσης
+ Κάθε 45 δευτερόλεπτα κατά τη διάρκεια εξερχόμενης κλήσης
+
+
+ Αναδιάταξη Tile
+ Επιτρέπει την αναδιάταξη των QuickSettings tiles
+
+
+ blocker συνεχόμενων ειδοποιήσεων
+ Επιτρέπει το μπλοκάρισμα επιλεγμένων συνεχόμενων ειδοποιήσεων
+ Η λίστα θα γεμίζει αυτόματα για κάθε συνεχόμενη ειδοποίηση που προκύπτει.
+ Μπορείτε μετά να αποφασίσετε αν θα μπλοκάρετε την συνεχόμενη ειδοποίηση ην επόμενη φορά που προκύψει. Χρησιμοποιήστε με προσοχή.
+ Ανανέωση λίστας
+ Είστε σίγουροι ότι θέλετε να ανανεώσετε τη λίστα?
+ This will clear current list and unblock all ongoing notifications previously blocked.
+ (list is empty)
+
+
+ Γρήγορο ξεκλείδωμα
+ Αυτόματο ξεκλείδωμα όταν εισαχθεί το σωστό PIN/password
+
+
+ Απενεργοποιημένο
+ Βασικό
+ Lowercase
+ Uppercase
+
+
+ Πολιτική κλειδώματος της γραμμής κατάστασης
+ Προεπιλογή
+ Ξεκλείδωτο αν το keyguard είναι ανασφαλές
+ Κλειδωμένο
+
+
+ monitor κίνησης δεδομένων
+ Ενεργοποίηση monitoring
+ Προβάλει το monitor κίνησης δεδομένων αυτομάτως μόλις ενεργοποιηθεί η κίνηση δεδομένων
+ Θέση
+ Αυτόματα (κεντρικά ή δεξιά αναλόγως τη θέση του ρολογιού)
+ Αριστερά
+ Δεξιά
+ Μέγεθος
+ Κανονικό
+ Μικρότερο
+ Το μικρότερο
+ B
+ KB
+ MB
+ s
+
+
+ Απενεργοποίηση ορίου widget
+ Επιτρέπει απεριόριστο αριθμό lockscreen widgets
+
+
+
+ %1$s free
+
+ %1$s used
+ μπάρα RAM πρόσφατων εργασιών
+ Off
+ Κορυφή
+ Στην κάτω πλευρά
+
+
+ Ενέργεια μονού χτυπήματος του πλήκτρου προσφάτων
+ Ενέργεια παρατεταμένου πατήματος του πλήκτρου προσφάτων
+
+
+ Προβολή καμπή μπαταρίας
+ Προβάλει την καμπή κατάστασης της μπαταρίας περιμετρικά του κύκλου ξεκλειδώματος της οθόνης
+
+
+ Αναβοσβήσιμο φακού
+
+
+ Φακός με παρατεταμένο πάτημα του πλήκτρου home
+ Ανάβει/Σβήνει τον φακό when device locked. Screen has to be turned on if device lacks native wake by home key support.
+
+
+ Ανάπτυξη αυτόματα
+
+
+ Πλήκτρο Μενού
+ Πλήκτρο Home
+ Πλήκτρο Πίσω
+ Πλήκτρο προσφάτων
+ Πλήκτρα έντασης
+ ʼλλες ρυθμίσεις
+ Ενέργεια παρατεταμένου πατήματος
+ Ενέργεια μονού χτυπήματος
+ Ενέργεια διπλού χτυπήματος
+
+
+ Απενεργοποίηση διπλού χτυπήματος
+
+
+ Signal color mode
+ Χρήση εικονίδια GravityBox (με υποστήριξη επιπέδου σινιάλου)
+ Χρήση εργοστασιακών εικονιδίων (χωρίς υποστήριξη επιπέδου σινιάλου)
+ Μη εφαρμογή χρώματος
+
+
\ No newline at end of file
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 42d104780c..f63955b7ff 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -125,8 +125,8 @@
Habilita las opciones avanzadas de desarrolador (requiere reinicio)
- Personalización de la barra de estado
- Personalizaciones varias de la barra de estado
+ Ajustes de la barra de estado
+ Contiene diversos ajustes relacionados a la barra de estado
Personalizaciones varias
Personalizaciones que no tienen cabida en otras categorias
Parches generales
@@ -158,8 +158,8 @@
Permite configurar el tono de llamada y de notificación para cada SIM por separado
- Configuración de la pantalla de bloqueo
- Configuraciones varias de la pantalla de bloqueo
+ Ajustes de la pantalla de bloqueo
+ Contiene diversos ajustes relacionados con la pantalla de bloqueo
Color de fondo de la pantalla de bloqueo
Color de fondo
Imagen de fondo por defecto
@@ -176,15 +176,15 @@
Cuando está habilitado, los Widgets de la pantalla de bloqueo serán maximizados por defecto
- Opciones de energía
- Contiene varias opciones relacionadas con el uso de la energía
+ Ajustes de energía
+ Contiene diversos ajustes relacionados con el uso de la energía
Deshabilitar el parpadeo del LED de notificaciones
Deshabilita el LED de notificaciones cuando queda poca carga en la batería y no se está cargando
- Mostrar ajustes
+ Ajustes de visualización
Contiene diversos ajustes de visualización
@@ -241,19 +241,19 @@
Acciones teclas de hardware
Permite configurar acciones personalizadas en las teclas de hardware
- Menú tecla larga pulsación
- Menú tecla de acción doble toque
- Acccion larga pulsación en tecla atras
+ Acción para pulsación larga en la tecla Menú
+ Acción para doble pulsación en la tecla Menú
+ Acción para pulsación larga en la tecla Atras
Por defecto
Buscar
Búsqueda por voz
Cambiar a la aplicación anterior
Matar aplicación en primer plano
Ir a dormir
- retraso en matar app con larga pulsación
+ Retraso en matar app con pulsación larga
Aplica para matar la acción aplicación en primer plano. Definido por cuánto retraso para matar la app
Velocidad de doble pulsación
- Se aplica a Menú tecla de acción doble toque. Define cómo debe ser aprovechado teclas de acceso rápido para activar la doble pulsación
+ Se aplica a la acción doble pulsación en la tecla Menú. Define cómo debe ser aprovechado teclas de acceso rápido para activar la doble pulsación
%s matada
"No hay nada para matar"
Aplicación previa no encontrada
@@ -307,8 +307,8 @@
Izquierda
- Desactivar despertar con teclas de volumen
- Para dispositivos como Jiayu G3, G4, donde las teclas de volumen encienden la pantalla
+ Desactivar despertar
+ Para dispositivos donde las teclas de volumen encienden la pantalla
Colores de la barra de estado
@@ -360,7 +360,6 @@
Controles Pie
Habilitar controles Pie
- Mostrar el botón de búsqueda
Tamaño de las teclas de navegación
Posiciones del disparador
Borde izquierdo de la pantalla
@@ -386,7 +385,7 @@
Deshabilitar teclas de hardware
- Deshabilitados botones MENU, BACK, HOME mientras que los controles PIE están habilitados. Acciones con los botones de hardware seguirán funcionando.
+ Deshabilitadas las teclas Menú, Atras, Home mientras que los controles PIE están habilitados. Acciones con las teclas de hardware seguirán funcionando.
Usar Dark theme Holo
@@ -469,7 +468,7 @@
Mostrar apps recientes
- Acción para pulsación larga boton HOME
+ Acción para pulsación larga en la tecla Home
Ejecutar app personalizada 1
@@ -512,8 +511,8 @@
El escritorio expandido está desactivado
- Ajustes barra de notificación
- Continene ajustes relacionados a la barra de notificación
+ Ajustes de la barra de notificación
+ Contiene diversos ajustes relacionados a la barra de notificación
Ignorar ajustes del sistema por defecto
Switch principal de ajustes de barra de notificación (requiere reiniciar)
Habilitar barra de navegación
@@ -583,5 +582,23 @@
Cuando el escritorio expandido este activado
Cuando el escritorio expandido oculte la barra de navegación
+
+ Acción para pulsación individual en la tecla Multitarea
+ Acción para pulsación larga en la tecla Multitarea
+
+
+ Tecla Menú
+ Tecla Home
+ Tecla atras
+ Tecla Multitarea
+ Teclas de volumen
+ Otros ajustes
+ Acción para pulsación larga
+ Acción para pulsación individual
+ Acción para doble pulsación
+
+
+ Deshabilitar doble pulsación
+
\ No newline at end of file
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 1e5cb35587..7aa93a63b6 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -22,6 +22,8 @@
Indicateur par défaut
Batterie circulaire
Batterie circulaire et pourcentage
+ Batterie KitKat
+ Batterie KitKat avec pourcentage
Batterie avec pourcentage
Aucun
@@ -96,7 +98,7 @@
Wi-Fi
Wi-Fi off
Non connecté
- Mise en route...
+ Mise en route…
Touches des paramètres rapides
@@ -134,7 +136,7 @@
Couleur barre d\'état
- Permet de choisir la couleur de fond de la barre d\'état et sa transparence
+ Permet de choisir la couleur de fond de la barre d\'état
Paramètres liés à la parole
@@ -158,7 +160,7 @@
Xposed framework
Encodé par rovo89@XDA. Touchez pour accéder au fil de discussion officiel
Donations
- Faîtes un don si vous pensez que cette application en vaut la peine ! Faîtes également un don à rovo89 pour son excellent Xposed framework
+ Touchez ce lien pour faire un don via Paypal et soutenir le développement
Votre %s va redémarrer
@@ -308,6 +310,10 @@
Panneau de volume extensible
Active le panneau de volume extensible avec la possibilité de régler les volumes pour différents flux sonores
+
+ Panneau de volume maximisé
+ Permet d\'utiliser tout l\'espace à l\'écran pour le panneau de volume
+
Volumes sonnerie & notifications liés
Si désactivé, les volumes de la sonnerie et des notifications peuvent être réglés indépendamment
@@ -377,7 +383,6 @@
Touches flottantes
Activer les touches flottantes
- Afficher le bouton de recherche
Taille des touches de navigation
Positions du déclencheur
À gauche
@@ -401,9 +406,9 @@
Arrière-plan Holo tramé
Remplace l\'arrière-plan Holo standard par un arrière-plan tramé pour supprimer les bandes de couleur (nécessite un redémarrage)
-
- Désactiver les touches matérielles
- Désactive les touches MENU, RETOUR, et HOME si les touches flottantes sont activées. Les actions des touches matérielles fonctionneront toujours (pour les appareils ayant des touches matérielles)
+
+ Désactiver les touches de navigation
+ Désactive l\'appui simple sur les touches de navigation lorsque les touches flottantes sont activées
Utiliser le thème Holo Dark
@@ -461,10 +466,11 @@
Gestion de la transparence
- Barre d\'état : lanceur
- Barre d\'état : écran de déverrouillage
- Barre de navigation : lanceur
- Barre de navigation : écran de déverrouillage
+ Gère la transparence de la barre d\'état et de la barre de navigation
+ Barre d\'état du lanceur
+ Barre d\'état de l\'écran de déverrouillage
+ Barre de navigation du lanceur
+ Barre de navigation de l\'écran de déverrouillage
Masquer l\'icône de l\'alarme
@@ -711,4 +717,101 @@
Action appui simple
Action appui double
+
+ Désactiver le double appui
+
+
+ Mode couleur pour le signal
+ Utiliser les icônes GravityBox (niveau du signal supporté)
+ Utiliser les icônes par défaut (niveau du signal non supporté)
+ Ne pas modifier les couleurs
+
+
+ Lanceur d\'applications
+ Boîte de dialogue qui permet de définir jusqu\'à 8 applications pouvant être assignées à une action sur touche matérielle ou utilisées comme touche supplémentaire dans la barre de navigation
+ Application de l\'emplacement %d
+ Aucune application assignée. Utiliser l\'item GravityBox / Lanceur d\'applications pour assigner des applications
+
+
+ Afficher la touche lanceur d\'appli
+
+
+ Afficher le lanceur d\'application
+
+
+ Afficher la touche personnalisée
+ Désactivé
+ Rechercher
+ Lanceur d\'applications
+
+
+ Couleurs touches flottantes
+ Couleur arrière-plan
+ Couleur premier plan
+ Couleur du contour
+ Couleur de la touche sélectionnée
+ Couleur du texte
+ Réinitialiser les couleurs
+
+
+ Activer la photo pour appelant non identifié
+ Définir la photo pour appelant non identifié
+ Photo changée
+ Photo non changée
+
+
+ Il se pourrait que votre écran ne supporte pas de valeurs inférieures à 20. Si votre écran ne s\'allume pas,
+ maintenez la touche Volume+ enfoncée au moins 7 secondes pour réinitialiser la luminosité, règlez-la ensuite à une valeur supérieure
+
+
+ Général
+ Touche de navigation
+ Couleurs
+ Dimensions
+
+
+ Activer les couleurs barre de navigation
+ Peut nécessiter un redémarrage après désactivation
+ Couleur touche de navigation
+ Couleur brillance touche de navigation
+ Couleur de fond barre de navigation
+
+
+ Désactiver le voile sur écran de déverrouillage
+ Supprime la tinte sombre de l\'écran de déverrouillage
+
+
+ Mode de gestion de la transparence
+ Nécessite un redémarrage
+ Désactivé
+ Barre d\'état
+ Barre de navigation
+ Les deux
+
+
+ Couleur signal secondaire
+ Remplace l\'icône orange par défaut du signal
+ Couleur activité de données secondaire
+ Définit la couleur des indicateurs d\'activité de données secondaire
+
+
+ Style icône d\'état
+ S\'applique aux icônes d\'état telles que silencieux, vibreur, alarme, etc
+ JellyBean
+ KitKat
+
+
+ Action double-appui touche retour
+
+
+ Aller à l\'écran Home
+ Retour
+
+
+ Style de touche
+ S\'applique uniquement aux touches induites par GravityBox (n\'affecte pas les touches par défaut)
+
+
+ Ajuster la marge inférieure
+
diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml
index 502b4222e3..0b7c1a03d8 100644
--- a/res/values-hu/strings.xml
+++ b/res/values-hu/strings.xml
@@ -96,7 +96,7 @@
Wi-Fi
Wi-Fi kikapcsolva
Nincs csatlakozva
- Bekapcsolás...
+ Bekapcsolás…
Állapotsáv Gyorsbeállítások csempéi
@@ -134,7 +134,7 @@
Állapotsáv háttérszín
- Lehetővé teszi, hogy beállíthassa az Állapotsáv háttérszínét és átlátszóságát
+ Lehetővé teszi az Állapotsáv háttérszínének a beállítását
Javítja a beszéd beállításokat
@@ -158,7 +158,7 @@
Xposed framework
Fejlesztette rovo89@XDA. Érintse meg a hivatalos fórum meglátogatásához.
Felajánlás
- Adományozzon a részemre, ha úgy gondolja, hogy ez a program megéri az árát! Valamint fontolja meg, hogy adományozzon rovo89-nek is a kitűnő Xposed framework-ért.
+ Érintse meg a program fejlesztésének PayPal-en keresztüli adományozással történő támogatásához
A telefon újra fog indulni.
@@ -308,6 +308,10 @@
Bővített hangerő panel
Engedélyezi a bővített hangerő panelt a különböző hangfolyamokhoz tartozó értékek külön beállítási lehetőségével
+
+ Teljes bővített hangerő panel
+ Lehetővé teszi, hogy a hangerő panel a teljes rendelkezésre álló helyet kitöltse
+
Csengőhang és figyelmeztető hangok értékei
Amikor ki van kapcsolva, a csengőhang és a figyelmeztető hangok értékei egymástól függetlenül állíthatóak
@@ -377,7 +381,6 @@
Pie Vezérlők
Pie Vezérlők engedélyezése
- Keresés gomb mutatása
Navigációs gomb méret
Kioldógomb pozíció
Bal oldali képernyőszél
@@ -401,9 +404,9 @@
Nagyobb színmélységű Holo háttér
Lecseréli a szabvány Holo hátteret nagyobb színmélységű típusra a színátmenetek folyamatosságának megtörése ellen (újraindítás szükséges)
-
- Hardver gombok letiltása
- Letiltja a MENU, BACK, HOME gombokat, ha a Pie Vezérlők engedélyezve vannak. A HW gombok műveletei működni fognak. (HW gombokkal ellátot eszközök esetén)
+
+ Navigációs hardver gombok letiltása
+ Letiltja a hardver gombok egyszeri érintését, ha a Pie Vezérlők engedélyezve vannak
Holo Sötét téma használata
@@ -461,10 +464,11 @@
Átlátszóság menedzsment
- Állapotsáv átlátszóság launcher-nél
- Állapotsáv átlátszóság zárképernyőnél
- Nav.sáv átlátszóság launcher-nél
- Nav.sáv átlátszóság zárképernyőnél
+ Állapotsáv és Navigációs sáv átlátszóságának kezelése
+ Állapotsáv Indítónál
+ Állapotsáv Zárképernyőnél
+ Navigációs sáv Indítónál
+ Navigációs sáv Zárképernyőnél
Ébresztő ikon elrejtése
@@ -486,7 +490,7 @@
Nemrég használt alkalmazások megjelenítése
- Home gomb hosszú érintés művelete
+ Kezdőlap gomb hosszú érintés művelete
Egyéni alkalmazás 1 indítása
@@ -658,6 +662,7 @@
Pozíció
Automatikus (középen vagy jobbra az óra pozíciójától függően)
Balra
+ Jobbra
Méret
Normál
Kisebb
@@ -681,4 +686,110 @@
Fent
Lent
+
+ Nemrég használt alkalmazások gomb egyszeri érintés művelete
+ Nemrég használt alkalmazások gomb hosszú érintés művelete
+
+
+ Akkumlátor körív mutatása
+ Mutatja az akkumlátor állapot körívet a feloldó kör körül.
+
+
+ Zseblámpa ki-bekapcsolása
+
+
+ Zseblámpa bekapcsolása a kezdőlap gomb hosszú érintésével
+ Be-kikapcsolja a zseblámpát zárolt eszköznél. A képernyőnek bekapcsolva kell lennie, ha az eszközből gyárilag hiányzik az ébresztés kezdőlap gomb segítségével funkció.
+
+
+ Automatikus bővített panel
+
+
+ Menü gomb
+ Kezdőlap gomb
+ Vissza gomb
+ Nemrég használt alkalmazások gomb
+ Hangerő gombok
+ Egyéb beállítások
+ Hosszú érintés művelete
+ Egyszeri érintés művelete
+ Dupla érintés művelete
+
+
+ Dupla érintés letiltása
+
+
+ Jelszint ikon színezés mód
+ Használja a GravityBox ikonokat (jelerősség szint támogatással)
+ Használja a gyári ikonokat (jelerősség szint támogatás nélkül)
+ Nem alkalmaz színezést
+
+
+ Alkalmazás Indító
+ Alkalmazás ablak 8 beállítható applikációval, melynek a megjelenítése hozzárendelhető hardver gomb művelethez vagy egy külön navigációs sáv gombhoz
+ Alkalmazás hely %d
+ Nincs beállítva alkalmazás. Applikációk hozzárendeléséhez használja a GravityBox / Alkalmazás Indító menüt.
+
+
+ Alkalmazás Indító gomb mutatása
+
+
+ Alkalmazás Indító megjelenítése
+
+
+ Egyéni gomb mutatása
+ Letiltva
+ Keresés
+ Alkalmazás Indító
+
+
+ Pie színek
+ Háttérszín
+ Előtérszín
+ Körvonal színe
+ Kiválasztott gomb színe
+ Szöveg színe
+ Színek visszaállítása
+
+
+ Ismeretlen hívó fotó engedélyezése
+ Ismeretlen hívó fotó beállítása
+ Fotó megváltoztatva
+ Fotó nincs megváltoztatva
+
+
+ Lehetséges, hogy a képernyő nem támogatja a 20 alatt beállított értéket. Ha a képernyő nem világít,
+ tartsa nyomva a hangerő + gombot legalább 7 másodpercig a fényerő beállítások alaphelyzetbe állításához, és utána állítsa be a fényerőt magasabb értékre.
+
+
+ Általános
+ Navigációs gombok
+ Szín
+ Méret
+
+
+ Navigációs bár színek engedélyezése
+ A funkció letiltása után újraindítást igényelhet
+ Navigációs gomb színe
+ Aktív navigációs gomb színe
+ Navigációs sáv háttérének színe
+
+
+ Zárképernyő árnyékolás letiltása
+ Eltávolítja a sötét árnyalatot a zárképernyőről
+
+
+ Átlátszóság menedzser mód
+ Újraindítás szükséges
+ Letiltva
+ Állapotsáv
+ Navigációs sáv
+ Mindkettő
+
+
+ Másodlagos SIM jelerősség színe
+ Felülírja a gyári sárga jelerősség ikonszínt
+ Másodlagos SIM adattevékenység színe
+ Beállítja a másodlagos adattevékenység jelzőikonok színét
+
diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml
index 799fb5aa7d..ab7c86dc8e 100644
--- a/res/values-in/strings.xml
+++ b/res/values-in/strings.xml
@@ -22,6 +22,8 @@
Indikator baterai bawaan
Baterai lingkar
Baterai lingkar dengan persentase
+ Baterai KitKat
+ Baterai KitKat dengan persentase
Teks persentase baterai
Tidak ada
@@ -105,6 +107,7 @@
Mode pesawat terbang
Status baterai
Wi-Fi
+ Wi-Fi (CM style)
Bluetooth
GPS
GPS (CM style)
@@ -133,7 +136,7 @@
Warna latar Statusbar
- Membolehkan untuk men-set warna latar dan transparansi statusbar
+ Membolehkan untuk men-set warna latar statusbar
Perbaiki setting Bicara
@@ -157,7 +160,7 @@
Xposed framework
Pembuatan kode oleh rovo89@XDA. Sentuh untuk mengunjungi topik resmi.
Donasi
- Donasilah kepada saya jika anda pikir aplikasi ini pantas! Dan juga pertimbangkan untuk donasi ke rovo89 untuk Xposed framework-nya yang hebat.
+ Sentuh untuk mendukung pengembangan melalui donasi lewat PayPal.
%s anda akan reboot
@@ -307,6 +310,10 @@
Panel volume yang bisa dibuka
Menghidupkan panel volume yang bisa dibuka dengan kemampuan untuk men-set volume-volume dengan alur yang berbeda
+
+ Panel volume yang bisa dibuka secara penuh
+ Membolehkan panel volume untuk menggunakan seluruh tempat yang disediakan
+
Gabungkan alur ringtone & notifikasi
Ketika dimatikan, alur volume untuk ringtone dan notifikasi bisa di set secara independen
@@ -376,7 +383,6 @@
Kontrol Pie
Hidupkan kontrol Pie
- Tampilkan tombol pencarian
Ukuran tombol navigasi
Posisi pemicu
Batas kiri layar
@@ -400,9 +406,9 @@
Latar belakang Holo dithered
Ganti latar belakang standar Holo dengan versi yang dithered untuk mengurangi pita warna (requires reboot)
-
- Matikan tombol fisik
- Matikan tombol MENU, BACK, HOME ketika kontrol Pie diaktifkan. Aksi tombol akan tetap bekerja. (untuk perangkat dengan tombol fisik)
+
+ Matikan tombol navigasi
+ Mematikan aksi tombol navigasi saat ditekan sekali ketika kontrol Pie diaktifkan.
Gunakan tema Holo Dark
@@ -460,10 +466,11 @@
Manajemen transparansi
- Transparansi statusbar untuk launcher
- Transparansi statusbar untuk lockscreen
- Transparansi Navbar untuk launcher
- Transparansi Navbar untuk lockscreen
+ Mengatur transparansi untuk statusbar dan navbar
+ Statusbar untuk launcher
+ Statusbar untuk lockscreen
+ Navbar untuk launcher
+ Navbar untuk lockscreen
Sembunyikan ikon alarm
@@ -657,6 +664,7 @@
Posisi
Otomatis (tengah atau kanan, bergantung posisi jam)
Kiri
+ Kanan
Ukuran
Normal
Lebih kecil
@@ -681,7 +689,109 @@
Bawah
- Aksi ketika tombol Recents ditekan
+ Aksi ketika tombol Recents ditekan sekali
Aksi ketika tombol Recents ditahan
+
+ Tunjukkan lengkungan baterai
+ Tunjukkan lengkungan status baterai di sekitar lingkaran pembuka kunci
+
+
+ Hidup/Matikan Senter
+
+
+ Hidupkan senter ketika tombol Home ditahan
+ Hidup/Matikan senter ketika perangkat terkunci. Layar harus dihidupkan terlebih dahulu jika perangkat tidak memiliki fitur untuk menghidupkan layar dengan tombol home.
+
+
+ Membesar secara otomatis
+
+
+ Tombol Menu
+ Tombol Home
+ Tombol Kembali
+ Tombol Recents
+ Tombol Volume
+ Pengaturan lain
+ Aksi ketika ditahan
+ Aksi ketika ditekan sekali
+ Aksi ketika ditekan dua kali
+
+
+ Matikan double-tap
+
+
+ Mode pewarnaan sinyal
+ Gunakan ikon GravityBox (dengan dukungan level sinyal)
+ Gunakan ikon bawaan (Tanpa dukungan level sinyal)
+ Jangan terapkan warna
+
+
+ Launcher aplikasi
+ Dialog yang memperbolehkan pengguna menetapkan sampai 8 aplikasi yang bisa ditetapkan sebagai aksi tombol fisik atau tombol tambahan di navbar.
+ Aplikasi slot %d
+ Tidak ada aplikasi yang ditetapkan. Gunakan GravityBox / menu Launcher Aplikasi untuk menetapkan aplikasi.
+
+
+ Tunjukkan tombol Launcher Aplikasi
+
+
+ Tunjukkan Launcher Aplikasi
+
+
+ Tunjukkan tombol kustom
+ Matikan
+ Pencarian
+ launcher Aplikasi
+
+
+ Warna Pie
+ Warna latar belakang
+ Warna latar depan
+ Warna garis
+ Warna tombol terpilih
+ Warna teks
+ Reset warna
+
+
+ Hidupkan foto pemanggil tak dikenal
+ Tetapkan foto pemanggil tak dikenal
+ Foto diganti
+ Foto tidak diganti
+
+
+ Layar anda mungkin tidak mendukung nilai kurang dari 20. Jika layar anda tidak hidup,
+ tahan tombol volume + setidaknya selama 7 detik untuk mereset kecerahan lalu atur nilai yang lebih tinggi.
+
+
+ Umum
+ Tombol navigasi
+ Warna
+ Ukuran
+
+
+ Hidupkan warna navbar
+ Mungkin membutuhkan restart setelah dimatikan
+ Warna tombol navigasi
+ Warna tombol navigasi ketika menyala
+ Warna latar Navbar
+
+
+ Matikan bayangan lockscreen
+ Menghapus warna gelap dari lockscreen
+
+
+ Mode pengelola transparansi
+ Membutuhkan restart
+ Dimatikan
+ Statusbar
+ Navbar
+ Keduanya
+
+
+ Warna sinyal kedua
+ Merubah warna sinyal oranye
+ Warna aktifitas data kedua
+ Men-set warna untuk indikator lalu-lintas data kedua
+
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 72acd94fc3..3cd16491eb 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -238,10 +238,10 @@
Cerca
Ricerca vocale
Passa alla app precedente
- Killa app corrente
+ Chiusura forzata app corrente
Vai in sleep
- Durata per Kill app su pressione lunga
- Si applica per il Kill della app corrente. Definisce quanto a lungo deve rimanere premuto il tasto per fare la kill
+ Durata per chiudura forzata app su pressione lunga
+ Si applica per la chiudura forzata dell\'app corrente. Definisce quanto a lungo deve rimanere premuto il tasto per fare la chiusura forzata
Velocità doppio-tap
Si applica per il doppio-tap del tasto MENU. Definisce quanto velocemente deve avvenire il secondo tap
%s terminata
@@ -350,7 +350,6 @@
Pie controls
Abilita pie controls
- Mostra bottone ricerca
Grandezza tasto navigazione
Posizione trigger
Bordo sinistro schermo
@@ -632,4 +631,131 @@
Disabilita limitazione widget
Consenti numero illimitato widget in lockscreen
+
+
+ %1$s liberi
+
+ %1$s usati
+ Memoria Applicazioni recenti
+ Spento
+ In alto
+ In basso
+
+
+ Azione pressione breve
+ Azione pressione lunga
+
+
+ Mostra Arco batteria
+ Mostra arco stato batteria disegnato nell\'anello di sblocco schermo
+
+
+ Torcia attiva/disattiva
+
+
+ Torcia su pressione lunga tasto home
+ Torcia on/off se telefono bloccato. Lo schermo deve essere acceso se il telefono non supporta nativamente lo sblocco usando il tasto home.
+
+
+ Espandi automaticamente
+
+
+ Tasto Menu
+ Tasto Home
+ Tasto Indietro
+ Tasto Recenti
+ Tasti volume
+ Altre impostazioni
+ Azione pressione lunga
+ Azione pressione corta
+ Azione doppio tap
+
+
+ Disabilita doppio tap
+
+
+ Colori icona segnale
+ Usa icone GravityBox (con supporto del segnale)
+ Usa icona stock (senza supporto del segnale)
+ Non applicare colore
+
+
+ Avvio applicazioni
+ Consente di definire fino a 8 app che possono essere assegnate a azioni tasti hardware or usate come barra di navigazione aggiuntiva
+ Application slot %d
+ Nessuna app assegnata. Usa GravityBox / Menu Launcher Applicazioni per assegnare le applicazioni.
+
+
+ Mostra Tasto Avvio Applicazioni
+
+
+ Mostra Launcher app
+
+
+ Mostra tasti personalizzati
+ Disabilitato
+ Cerca
+ Launcher app
+
+
+ Colori Pie
+ Colore sfondo
+ Colore primo piano
+ Colore sottolineatura
+ Colore tasto selezionato
+ Colore testo
+ Reset colori
+
+
+ Abilita foto per chiamante sconosciuto
+ Imposta foto chiamante sconosciuto
+ Foto cambiata
+ Foto non cambiata
+
+
+ Il tuo schermo potrebbe non supportare valori inferiori a 20. Se il tuo schermo non si accende,
+ tieni premuto il tasto Volume+ per almeno 7 secondi per resettare l\'impostazione luminosità e poi reimposta la luminosità con un valore superiore.
+
+
+ Generali
+ Tasti navigazione
+ Colore e trasparenze
+ Dimensioni
+
+
+ Colore tasto navigazione
+ Colore tasto navigazione evidenziato
+ Colore sfondo tasto navigazione
+
+
+ Disattiva ombreggiatura lockcreen
+ Rimuovi tinte scure nel lockscreen
+
+
+ Gestore trasparenze
+ Richiede riavvio
+ Disabilitato
+ Statusbar
+ Barra di navigazione
+ Entrambe
+
+
+ Colore segnale sim2
+ Sovrascrivi colore icona arancione standard
+ Colore icona dati sim2
+ Imposta colore icone dati sim2
+
+
+ Stile icona profilo audio
+ Si applica a Silenzioso, Vibrazione, Allarme, ecc
+ JellyBean
+ KitKat
+
+
+ Azione doppio tocco al tasto Indietro
+
+
+ Vai a schermata Home
+ Torna indietro
+
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index f389f8945b..a8b87242e6 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -7,6 +7,8 @@
標準バッテリーアイコン
サークルアイコン
サークル+パーセントアイコン
+ KitKatアイコン
+ KitKatアイコン+パーセント
バッテリーパーセントテキスト
なし
@@ -78,6 +80,10 @@
展開中
常時点灯オン
常時点灯オフ
+ Wi-Fi
+ Wi-Fiオフ
+ 未接続
+ オンにしています…
ステータスバークイック設定タイル
@@ -86,6 +92,7 @@
機内モード
バッテリー状態
Wi-Fi
+ Wi-Fi (CMスタイル)
Bluetooth
GPS
GPS (CMスタイル)
@@ -114,7 +121,7 @@
ステータスバー背景色
- ステータスバーの背景色と透過度を設定します。
+ ステータスバーの背景色を設定します。
スピーチ設定の表示
@@ -290,7 +297,11 @@
音量パネルを展開可能にする
- 様々な音量を調整できる音量パネルを展開できるようにします。
+ 音量パネルを展開して様々な音量を調整できるようにします。
+
+
+ 音量パネルを完全に展開する
+ 音量パネルを空きスペースいっぱいに展開するようにします。
着信音と通知音の音量をリンクする
@@ -361,7 +372,6 @@
パイ操作
パイ操作を有効化
- 検索キーを表示
ナビキーのサイズ
起動位置
画面左端
@@ -445,6 +455,7 @@
透過度管理
+ ステータスバーとナビバーの透過度を設定します。
ホームアプリでのステータスバーの透過度
ロック画面でのステータスバーの透過度
ホームアプリでのナビバーの透過度
@@ -642,11 +653,11 @@
位置
自動(時計の位置に従う)
左
+ 右
サイズ
中
小
極小
- 秒
ウィジェット制限の無効化
@@ -678,6 +689,112 @@
端末をロックしているときにトーチのオンオフをします。ホームキーで画面をオンにする機能がない場合は画面をオンにしないといけません。
- 自動的に拡張
+ 自動的に展開
+
+
+ メニューキー
+ ホームキー
+ バックキー
+ 最近のアプリキー
+ 音量キー
+ その他の設定
+ 長押しアクション
+ タップアクション
+ ダブルタップアクション
+
+
+ ダブルタップを無効化
+
+
+ 単色モード
+ GravityBoxアイコンを使用 (電波強度対応)
+ 標準アイコンを使用(信号強度非対応)
+ 色を適用しない
+
+
+ アプリランチャー
+ HWキーアクションやナビバーのボタンとして使える、アプリを8個まで登録できるダイアログです。
+ アプリスロット %d
+ アプリが登録されていません。GravityBox / アプリランチャーで登録してください。
+
+
+ アプリランチャーキー
+
+
+ アプリランチャーを表示
+
+
+ カスタムキーの表示
+ 無効
+ 検索
+ アプリランチャー
+
+
+ パイの色
+ 背景色
+ 前景色
+ アウトラインの色
+ 選択したキーの色
+ 文字色
+ 色の初期化
+
+
+ 不明な発信者画像を有効化
+ 不明な発信者用の画像をセット
+ 変更しました。
+ 変更しませんでした。
+
+
+ 20以下の明るさに対応していない画面です。 画面が点灯しなくなった場合、
+ 音量上キーを7秒以上押し続けると明るさを初期化できるので最低値を修正してください。
+
+
+ 基本
+ ナビキー
+ 色
+ サイズ
+
+
+ ナビバーの色を有効化
+ 無効化後は再起動してください。
+ ナビキーの色
+ ナビキーのグロー色
+ ナビバーの背景色
+
+
+ ロック画面シェードを無効化
+ ロック画面のシェードをなくします。
+
+
+ 透過処理モード
+ 変更後は再起動してください。
+ 無効
+ ステータスバー
+ ナビバー
+ 両方
+
+
+ セカンダリ電波アイコン色
+ オレンジの電波アイコンを上書きします。
+ セカンダリデータ通信色
+ セカンダリデータ通信アクティビティの色を設定します。
+
+
+ ステータスアイコンスタイル
+ マナーモードやアラーム等のアイコンのスタイルを変更します。
+
+
+ バックキーダブルタップ
+
+
+ ホーム
+ 戻る
+
+
+ タイルのスタイル
+ GravityBoxで追加したタイルにのみ適用されます。(標準タイルは変更されません)
+
+
+ ボタン下の余白を調整
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index 5d668b5286..ee01f3c6d2 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -376,7 +376,6 @@
Pie controls
Enable pie controls
- Show search button
Navigation key size
Trigger positions
Left screen border
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 4b44f0e4a6..50a3ee240c 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -26,7 +26,7 @@
Recovery
Bootloader
Kotroluj kursor przyciskiem głośności
- Pozwala przesuwać kursor przyciskami głośności w polach tekstowych
+ Pozwala przesuwać przyciskami głośności kursor w polach tekstowych
Wyłącz
Głośność góra/dół porusza w lewo/prawo
Głośność góra/dół porusza w prawo/lewo
@@ -209,6 +209,8 @@
Pokaż dzień tygodnia
Rozszerzony panel głośności
Uaktywnia rozszerzony panel głośności z możliwością ustawienia głośności dla różnych źródeł
+ W pełni rozszerzalny panel głośności
+ Pozwala by panel głośności zajął całe przewidziane miejsce
Połączone ust. głośności dzwonka i powiadomień
Po wyłączeniu głośność dzwonka i powiadomień można ustawiać niezależnie
Autom. Szybkie Ustawienia
@@ -249,7 +251,6 @@
Tylko połączenia alarmowe
Interfejs Kontroli Pie
Włącz interfejs kontroli Pie
- Pokaż przycisk wyszukiwania
Wielkość klawisza nawigacji
Pozycja aktywnej strefy
Lewy margines ekranu
@@ -297,10 +298,11 @@
Ukryj Zegar
Wielkość przełącznika Pie
Ustawienia przezroczystości
- Przezr. paska statusu startera
- Przezr. paska statusu ekranu blokady
- Przezr. paska nawigacji startera
- Przezr. paska nawi. ekranu blokady
+ Zarządza przezroczystością paska statusu i paska nawigacyjnego
+ Pasek statusu startera
+ Pasek statusu ekranu blokady
+ Pasek nawigacji startera
+ Pasek nawigacji ekranu blokady
Ukryj ikonę alarmu
Poziom przyciemnienia ekranu
Poziom niskiej jasności, zanim ekran zostanie całkiem wygaszony (wymagany restart)
@@ -309,7 +311,7 @@
Ustawienia jasności
Włącz ustawienia jasności
Należy używać tylko w przypadku, gdy urządzenie obsługuje standardowe funkcje jasności systemu Android. Pozostaw wyłączone w przypadku wystąpienia problemów związanych z jasnością. (wymagany restart)
- Pokaż najnowsze aplikacje
+ Pokaż ostatnie aplikacje
Akcja długiego naciśnięcia HOME
Uruchom własną aplikację 1
Ustaw własną aplikację 1
@@ -348,8 +350,8 @@
Dotyczy orientacji poziomej
Zawsze pokazuj klawisz menu
Zrzut ekranu w menu zasilania
- Cele Ekranu Blokady
- Włącz Cele Ekranu blokady
+ Ustawienia Pierścienia Odblokowania
+ Włącz Cele Ekranu Blokady
Główny wyłącznik Celów Ekranu Blokady
Aplikacja docelowa %s
Pionowe przesunięcie pierścienia
@@ -418,6 +420,7 @@
Pozycja
Automatycznie (centralnie lub po prawej w zależności od położenia zegara)
Po lewej
+ Po prawej
Rozmiar
Normalny
Mniejszy
@@ -436,4 +439,67 @@
Na dole
Akcja kliknięcia klawisza ostatnich aplikacji
Akcja przytrzymania klawisza ostatnich aplikacji
+ Pokaż wskaźnik stanu baterii
+ Pokazuje stan baterii w kształcie łuku wokół przycisku pierścienia odblokowania
+ Przełącz latarkę
+ Latarka przy długim nac. HOME
+ Umożliwia przełączanie latarki klawiszem HOME gdy urządzenie jest zablokowane. Ekran musi być włączony, jeśli urządzenie nie posiada natywnego wsparcia dla wybudzania klawiszem HOME.
+ Rozszerz automatycznie panel głośności
+ Klawisz MENU
+ Klawisz HOME
+ Klawisz BACK
+ Klawisz ostatnich aplikacji
+ Klawisze głośności
+ Inne ustawienia
+ Akcja długiego naciśnięcia
+ Akcja pojedynczego kliknięcia
+ Akcja podwójnego kliknięcia
+ Wyłącz podwójne kliknięcie
+ Tryb koloru wskaźnika sygnału
+ Użyj ikon GravityBox (z obsługą poziomu sygnału)
+ Użyj standardowych ikon (bez obsługi poziomu sygnału)
+ Nie stosuj koloru
+ Uruchamianie aplikacji
+ Dialog pozwala na zdefiniowanie do 8 aplikacji, które mogą być przypisane jako akcje klawiszy sprzętowych lub użyte jako dodatkowe przyciski paska nawigacyjnego
+ Slot aplikacji %d
+ Brak przypisanych aplikacji. Użyj GravityBox / menu Uruchamiania aplikacji aby przypisać aplikacje.
+ Pokaż przycisk uruchamiania aplikacji
+ Pokaż starter aplikacji
+ Pokaż opcjonalny przycisk
+ Wyłączone
+ Przycisk wyszukiwania
+ Starter aplikacji
+ Kolory Pie
+ Kolor tła
+ Kolor pierwszoplanowy
+ Kolor konturu
+ Kolor wybranego przycisku
+ Kolor tekstu
+ Resetuj kolory
+ Zdjęcie nieznanego dzwoniącego
+ Ustaw zdjęcie dla nieznanego dzwoniącego
+ Zdjęcie zostało zmienione
+ Zdjęcie nie zostało zmienione
+ Ekran może nie obsługiwać wartości niższych niż 20. Jeśli ekran nie zapala się, przytrzymaj przycisk VOLUME+ przez co najmniej 7 sekund aby zrestetować jasność, a następnie ustaw wyższą wartość minimalnej jasności.
+ Ogólne
+ Przyciski nawigacyjne
+ Kolory
+ Wymiary
+ Kolory paska nawigacyjnego
+ Może wymagać ponownego uruchomienia po wyłączeniu
+ Kolor klawisza nawigacyjnego
+ Poświata klawisza nawigacyjnego
+ Tło klawisza nawigacyjnego
+ Wyłącz przyciemnienie ekranu
+ Usuwa przyciemnienie ekranu blokady
+ Tryb przezroczystości
+ Wymaga ponownego uruchomienia
+ Wyłączony
+ Pasek statusu
+ Pasek nawigacyjny
+ Obydwa
+ Kolor drugiego wsk. sygnału
+ Zastępuje domyślny pomarańczowy wskaźnik sygnału
+ Kolor drugiego wskaźnika aktywności danych
+ Ustawia kolor dla drugiego wskaźnik aktywności transmisji danych
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index 82092bc0b3..c67b8ed1b5 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -7,6 +7,8 @@
Indicador de bateria padrão
Indicador de bateria circular
Indicador de bateria circular com percentagem
+ Indicador de bateria do KitKat
+ Indicador de bateria do KitKat com percentagem
Texto de percentagem de bateria
Nenhum
@@ -39,17 +41,17 @@
Teclas de volume +/- movem o cursor para a esquerda/direita
Teclas de volume +/- movem o cursor para a direita/esquerda
- Limpar todas as tarefas recentes
+ Limpar todas as aplicações recentes
Corrigir problema nas definições de data e hora
Selecionar caso tenha problemas ao aceder à configuração de data e hora nas definições do telefone (necessário reiniciar)
Corrigir problema na identificação de contatos na aplicação de telefone
- Selecionar caso um contacto não seja reconhecido quando recebe uma chamada (necessário reiniciar)
+ Selecionar caso um contato não seja reconhecido quando recebe uma chamada (necessário reiniciar)
Após reiniciar o telefone, deve limpar e readicionar os seus contatos para que a alteração possa ter efeito! Para isso, aceda a \"Definições / Aplicações / Todas\" para limpar os dados do Armazenamento de contatos.
Corrigir problema na aplicação de mensagens
- Selecionar caso obtenha conversações divididas em varios tópicos para o mesmo contacto (necessário reiniciar)
+ Selecionar caso obtenha conversações divididas em varios tópicos para o mesmo contato (necessário reiniciar)
Após reiniciar o telefone, deve limpar todas as conversações divididas para que a alteração possa ter efeito!
Corrigir problema na aplicação de calendário
@@ -57,8 +59,8 @@
Importante
- Imagem do contacto em ecrã completo
- Mostra a imagem do contacto em ecrã completo quando recebe uma chamada
+ Imagem do contato em ecrã completo
+ Mostra a imagem do contato em ecrã completo quando recebe uma chamada
Sinc. ativada
@@ -81,7 +83,7 @@
Wi-Fi
Wi-Fi desativado
Não ligado
- A ligar...
+ A ligar…
Definições rápidas na Barra de Status
@@ -94,7 +96,7 @@
Bluetooth
GPS
GPS (estilo CM)
- Dados 3G
+ Dados móveis
Modo de Rede
Utilização de dados
Perfis de áudio
@@ -127,7 +129,7 @@
Desbloquear opções de programador avançadas
- Desbloqueia as opções de programador avançadas nas definições do telefone (necessário reiniciar)
+ Desbloqueia as opções de programador avançadas nas definições (necessário reiniciar)
Ajustes da Barra de Status
@@ -142,8 +144,8 @@
Desenvolvido por C3C076@XDA. Carregue para visitar a página de suporte.
Xposed framework
Desenvolvido por rovo89@XDA. Carregue para visitar a página de suporte.
- Doação
- Envie-me uma doação se achar que esta aplicação vale a pena! Considere também a hipótese de enviar uma doação ao rovo89 pelo desenvolvimento do Xposed framework.
+ Contributo
+ Carregue para enviar um contributo através do PayPal por forma a suportar o desenvolvimento
O seu %s irá reiniciar.
@@ -233,8 +235,8 @@
Contém vários ajustes relacionados com multimédia
- Mais passos de volume
- Permite controlo mais fino do volume ao adicionar mais passos (necessário reiniciar)
+ Níveis de volume adicionais
+ Permite um controlo mais fino do volume ao adicionar mais níveis (necessário reiniciar)
Volume de segurança para mãos-livres
@@ -284,7 +286,7 @@
Painéis por linha
- Permite definir quantos painéis são mostrados por linha nas definições rápidas. O tamanho dos painéis é alterado de acordo com a escolha. Aplicável à orientação de ecrã vertical.
+ Permite definir quantos painéis são mostrados por linha nas definições rápidas, sendo o seu tamanho ajustado automaticamente de acordo com a escolha (aplicável à orientação de ecrã vertical)
Mostrar dia da semana
@@ -293,6 +295,10 @@
Painel de volume expandido
Ativa painel de volume expandido com possibilidade de controlar o volume de diferentes fontes
+
+ Painel totalmente expandido
+ Quando ativado, o painel de volume ocupa todo o espaço disponível no ecrã
+
Volumes de toque e notificações interligados
Quando desativado, os volumes de toque e notificações podem ser controlados de forma independente
@@ -346,8 +352,8 @@
Por trás
- Desativar indicadores de roaming
- Quando selecionado, o indicador R não será visível em roaming (usar com cautela)
+ Desativar indicadores de deslocamento
+ Quando selecionado, o indicador R não será visível quando em deslocamento (usar com cautela)
A carregar (%d%%)
@@ -362,7 +368,6 @@
Controlos Pie
Ativar controlos Pie
- Mostrar botão Pesquisa
Dimensão dos botões de navegação
Posições de ativação
Borda esquerda do ecrã
@@ -386,9 +391,9 @@
Fundo pontilhado
Substituir o fundo do tema padrão por um pontilhado por forma a evitar o efeito de bandas de cores (necessário reiniciar)
-
- Desativar teclas físicas
- Desativa as teclas de Menu, Atrás e Casa quando os controlos Pie estão ativados. As teclas físicas continuam a funcionar (para dispositivos com teclas físicas)
+
+ Desativar botões de navegação
+ Desativa as ações de toque nos botões da Barra de Navegação quando os controlos Pie estiverem ativados
Utilizar tema escuro
@@ -405,8 +410,8 @@
Ajustar margem superior
- Desativar avisos de roaming
- Desativa os avisos de roaming aquando do envio de mensagens ou realização de chamadas em roaming
+ Desativar avisos de deslocamento
+ Desativa os avisos aquando do envio de mensagens ou realização de chamadas em deslocamento
Pesquisa
@@ -446,6 +451,7 @@
Gestão de transparências
+ Permite definir a transparência da Barra de Status e da Barra de Navegação
Barra de Status no inicializador
Barra de Status no ecrã de bloqueio
Barra de Navegação no inicializador
@@ -490,8 +496,8 @@
Estrutura de sistema do GravityBox não responde. A sair.
- Roaming de dados nacionais
- Permite o estabelecimento de ligação de dados durante roaming em território nacional
+ Deslocamento de dados nacionais
+ Permite o estabelecimento de ligação de dados quando em deslocamento em território nacional
Modo ambiente de trabalho expandido
@@ -519,7 +525,7 @@
Ignorar predefinições de sistema
Ativação global dos ajustes da Barra de Navegação (necessário reiniciar)
Ativar Barra de Navegação
- Necessário reiniciar
+ Permite ativar Barra de Navegação (necessário reiniciar)
Altura da Barra de Navegação
Aplicável à barra horizontal e orientação de ecrã vertical
Aplicável à barra horizontal e orientação de ecrã horizontal
@@ -560,7 +566,7 @@
Associar cor padrão da bateria
- Força o uso da cor padrão para o indicador de bateria na fonte do relógio, percentagem e no indicador de bateria circular. Aplicável quando a coloração dos indicadores está desativada.
+ Permite forçar o uso da cor padrão para o indicador de bateria na fonte do relógio, percentagem e no indicador de bateria circular (aplicável quando a coloração dos indicadores está desativada)
Modo do painel Modo de Rede
@@ -627,8 +633,8 @@
Desativado
Padrão
- Maiúsculas
- Minúsculas
+ Minúsculas
+ Maiúsculas
Política de bloqueio da Barra de Status
@@ -662,14 +668,14 @@
%1$s livres
%1$s utiliz.
- Indicação RAM nas tarefas recentes
+ Indicação RAM nas aplicações recentes
Desativada
Topo superior
Topo inferior
- Ação após pressão da tecla Tarefas recentes
- Ação ao manter pressionada a tecla Tarefas recentes
+ Ação após pressão da tecla Aplicações recentes
+ Ação ao manter pressionada a tecla Aplicações recentes
Mostrar arco de bateria
@@ -689,11 +695,108 @@
Tecla Menu
Tecla Casa
Tecla Atrás
- Tecla Tarefas Recentes
+ Tecla Aplicações Recentes
Teclas de volume
Outras definições
Ação ao manter pressionada
Ação após pressão
Ação após dupla pressão
+
+ Desativar dupla pressão
+
+
+ Modo de coloração indicadores de sinal
+ Aplicar com indicadores do GravityBox (com indicação do nível de sinal)
+ Aplicar com indicadores padrão (sem indicação do nível de sinal)
+ Não aplicar coloração
+
+
+ Lançador de aplicações
+ Permite definir até 8 aplicações como ações para as teclas físicas ou para mostrar em botão adicional na Barra de Navegação
+ Aplicação posição %d
+ Nenhuma aplicação definida. Aceda a \"GravityBox / Lançador de aplicações\" para definir aplicações.
+
+
+ Mostrar botão Lançador aplicações
+
+
+ Mostrar lançador de aplicações
+
+
+ Mostrar botão personalizado
+ Desativado
+ Pesquisa
+ Lançador de aplicações
+
+
+ Coloração dos controlos Pie
+ Cor de segundo plano
+ Cor de primeiro plano
+ Cor do rebordo
+ Cor do botão quando pressionado
+ Cor do texto
+ Repor cores pré-definidas
+
+
+ Ativar imagem de contato desconhecido
+ Definir imagem de contato desconhecido
+ Imagem alterada
+ Imagem não alterada
+
+
+ O ecrã poderá não suportar valores de brilho inferiores a 20. Caso o ecrã não se ligue após a alteração,
+ mantenha a tecla de volume + pressionada durante pelo menos 7 segundos para repor o valor pré-definido e poder reajustar o nível de brilho mínimo para um valor superior.
+
+
+ Geral
+ Teclas de navegação
+ Cores
+ Dimensões
+
+
+ Ativar coloração
+ Pode ser necessário reiniciar após desativar
+ Cor das teclas
+ Cor das teclas ao pressionar
+ Cor de fundo da Barra de Navegação
+
+
+ Remover sombreado
+ Permite remover a tonalidade escura presente no ecrã de bloqueio
+
+
+ Modo de gestão de transparências
+ Permite definir o modo de gestão de transparências (necessário reiniciar)
+ Desativado
+ Barra de Status
+ Barra de Navegação
+ Ambas
+
+
+ Cor das barras de sinal secundárias
+ Permite substituir a cor laranja das barras de sinal secundárias
+ Cor da atividade de dados secundária
+ Permite definir a cor dos indicadores de atividade de dados secundários
+
+
+ Estilo dos indicadores
+ Aplicável aos indicadores de silêncio, vibração, alarme, etc.
+ JellyBean
+ KitKat
+
+
+ Ação após dupla pressão da tecla Atrás
+
+
+ Ir para início
+ Ir para trás
+
+
+ Estilo dos painéis
+ Aplicável apenas aos painéis adicionados pelo GravityBox (não altera os painéis padrão)
+
+
+ Ajustar margem inferior
+
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index 1149847149..88260b60e4 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -1,17 +1,17 @@
-
+
GravityBox
Estilo do indicador de bateria
Indicador de bateria padrão
- Indicador de bateria circular com porcentagem
- Texto da porcentagem grande
- Texto de porcentagem com icone padrão
+ Indicador de bateria circular
+ Indicador de bateria circular com porcentagem
+ Texto da porcentagem de bateria
Nenhum
- Teclas de Volume trocam de faixa
- Talcas de volume trocam de faixa após uma longa pressionada com a tela desligada
+ Teclas de volume trocam de faixa
+ Teclas de volume trocam de faixa após uma longa pressionada com a tela desligada
Aviso de baixa bateria
Sons e \"Pop-up\"
@@ -19,35 +19,34 @@
Somente sons
Desligado
- Mudanças serão aplicadas após reiniciar o celular.
+ Mudanças serão aplicadas após reiniciar o dispositivo.
Esconder automaticamente os icones de sinal
Esconder o icone de sinal para o slot SIM escolhido quando este não estiver inserido. Desabilita notificações de \"SIM não inserido\"
Esconder automaticamente SIM Slot 1
Esconder automaticamente SIM Slot 2
Desabilitar notificações
- Notificações \"SIM não inseirdo\" desabilitadas
+ Notificações \"SIM não inserido\" desabilitadas
Menu de Desligar avançado
Adiciona opções para reiniciar em modo de recuperação ao menu de desligar
Recuperação
Bootloader
- Tecla de volume controla cursor
+ Teclas de volume controlam cursor
As teclas de volume controlam o cursor em campos de texto
Desabilitado
- Teclas de Volume Cima/Baixo movem o cursor esquerda/direita
- Volume cima/baixo movem o cursor direita/esquerda
+ Teclas de volume +/- movem o cursor para a esquerda/direita
+ Teclas de volume +/- movem o cursor para a direita/esquerda
- Limpar todas as tarefas recentes
- Habilitar o botão de limpar tudas as tarefas recentes de uma vez na janela de tarefas recentes
+ Limpar todos os aplicativos recentes
- Ajustar erro de Data&Hora
- Habilitar esta opção caso esteja tendo problema ao acessar a opção de Data&Hora nas configurações (necessário reiniciar)
+ Corrigir erro de Data e Hora
+ Habilitar esta opção caso esteja tendo problema ao acessar a opção de Data e hora nas configurações (necessário reiniciar)
Corrigir contatos em ligação
Habilitar caso um contato não seja reconhecido quando recebendo uma ligação (necessário reiniciar)
- Após reiniciar, você deve limpar e readicionar seus contatos para ter efeito! Para tal, vá em Ajustes / Aplicações / Todos. Para limpar os dados do Provedor de Contatos.
+ Após reiniciar, você deve limpar e readicionar seus contatos para ter efeito! Para tal, vá em \"Ajustes / Aplicativos / Todos\" para limpar os dados do Armazenamento de contatos.
Corrigir contatos em mensagem
Habilitar caso tenha problemas de conversas divididas em varios tópicos do mesmo contato (necessário reiniciar)
@@ -62,42 +61,65 @@
Mostra a foto do contato em tela cheia quando recebe ligação
- Sync On
- Sync Off
- Wi-Fi AP On
- Wi-Fi AP Off
- Torch On
- Torch Off
+ Sinc. ativada
+ Sinc. desativada
+ PA Wi-Fi ativado
+ PA Wi-Fi desativado
+ Tocha ligada
+ Tocha desligada
Toque para desligar
+ Tocando…
+ Gravando…
+ Gravado
+ Longa pressionada para gravar
+ Toque para parar gravação
+ Desativado
+ Normal
+ Expandido
+ Manter ligado
+ Não manter ligado
+ Wi-Fi
+ Wi-Fi desativado
+ Não conectado
+ Ligando…
- Barra de Status Rápidas
+ Configurações rápidas na Barra de Status
Habilitar escolher quais configurações rápidas visualizar
Perfil do Usuário
Modo Avião
Status da Bateria
Wi-Fi
+ Wi-Fi (estilo CM)
Bluetooth
GPS
- Dados 3G
+ GPS (estilo CM)
+ Dados móveis
Modo de Rede
Uso de dados
- Perfils de Audio
+ Perfis de áudio
Brilho
- Tempo Limite de Tela
+ Tempo limite de tela
Auto rotação
Sincronização
- Wi-Fi Access Point
+ Ponto de Acesso Wi-Fi
Tocha
GravityBox
+ Dormir
+ Gravação rápida
+ Configurações
+ Volume
+ Ambiente de trabalho expandido
+ Manter ligado
+ Captura de tela
- Escolha a Cor
+ Escolha a cor
Pressione na cor para aplicar
Cor do fundo da Barra de Status
- Permite escolhe a cor e transparencia da cor do fundo
+ Permite escolhe a cor do fundo
Corrigir configurações de fala
@@ -108,12 +130,12 @@
Desbloqueia as configurações avançadas de desenvolvedor nas configurações (necessário reiniciar)
- Ajustes na Barra de Status
- Contém diversos ajustes para a barra de status
+ Ajustes da Barra de Status
+ Contém diversos ajustes relacionados com a Barra de status
Ajustes diversos
Contém todos os ajustes que não são classificados numa categoria específica
- Ajustes Gerais
- Contém correções gerais para MTK6589. Use somente se necessário!.
+ Ajustes gerais
+ Contém correções gerais para MTK6589. Use somente se necessário!
Sobre
@@ -134,20 +156,20 @@
Modo Engenharia
- Roda os aplicativos em modo engenharia
+ Roda o aplicativo Modo Engenharia
Toques para cada SIM
- Roda o aplicativo que permite que cada cartão SIM tenha sons de toque e notificações específicas para cada cartão
+ Roda o aplicativo que permite configurar sons de toque e notificações específicas para cada cartão SIM
- Ajustes na tela de bloqueio
- Contém diversos ajustes na tela de bloqueio
+ Ajustes da tela de bloqueio
+ Contém diversos ajustes relacionados com a tela de bloqueio
Fundo da tela de bloqueio
Estilo do fundo
- Papel de Parede padão
+ Papel de parede padrão
Cor
- Imagem Customizada
+ Imagem customizada
Escolha a cor
Permite escolher uma cor customizada para a tela de bloqueio
Escolha uma imagem
@@ -159,15 +181,564 @@
Quando habilitado, os widgets de tela de bloqueio serão maximizados por padrão
- Ajustes de Bateria
- Contém varios ajustes relacionados a bateria
+ Ajustes de energia
+ Contém diversos ajustes relacionados com a energia
Desabilitar LED piscante
Desabilitar o LED quando a bateria estiver baixa e não carregando
+
+ Ajustes da tela
+ Contém diversos ajustes relacionados com a tela
+
+
+ Nível de brilho mínimo
+ Permite definir o nível de brilho mínimo, aplicável apenas ao modo manual (necessário reiniciar)
+
+
+ Níveis de brilho automático
+ Permite ajustar os níveis de luz ambiente e os correspondentes valores para o brilho da tela
+ Nível
+ Lux máx.
+ Brilho (%d – 255)
+ Valor especificado inválido
+ Não é aconselhável um valor inferior a %d
+ O valor não pode ser superior a 255
+ O valor não pode ser negativo
+ O valor do patamar inferior não pode ser maior que o do patamar superior
+ O valor do patamar superior não pode ser menor que o do patamar inferior
+ Valores de %s definidos
+ Nova configuração de níveis de brilho automático gravada
+ Configuração de níveis de brilho automático não gravada
+ Definir
+
+
+ Enable lockscreen rotation
+ WARNING: can swap unlock ring targets on some devices in case AOSP lockscreen has been modified by vendor
+
+
+ Enable menu key
+ Allows menu key to be used for quick-unlocking the device while on lockscreen (requires reboot)
+
+
+ Fix messaging wakelock
+ Prevents screen from turning on when new message arrives (requires reboot)
+
+
+ Centrar relógio
+
+
+ Ajustes multimédia
+ Contém diversos ajustes relacionados com multimédia
+
+
+ More music volume steps
+ Adds more volume steps for music stream (requires reboot)
+
+
+ Safe headset media volume
+ Activates or deactivates safe headset media volume feature
+
+
+ Disable charging LED
+ Disables LED while charging
+
+
+ Hardware key actions
+ Allows to set custom actions on hardware keys
+ Menu key long-press action
+ Menu key double-tap action
+ Back key long-press action
+ Default
+ Search
+ Voice search
+ Switch to previous app
+ Kill foreground app
+ Go to sleep
+ Kill app long-press delay
+ Applies to Kill foreground app action. Defines for how long key must be pressed to trigger kill
+ Double-tap speed
+ Applies to Menu key double-tap action. Defines how fast key must be tapped to trigger double-tap
+ %s killed
+ There\'s nothing to kill
+ No previous app found
+
+
+ Ajustes de telefone
+ Contém diversos ajustes relacionados com o telefone
+
+
+ Flip action while ringing
+ Allows to define action to be performed when device is flipped face down while ringing
+ Do nothing
+ Mute ringer
+ Dismiss call
+
+
+ Soft reboot
+
+
+ Solid black background
+ Use solid black background for default Holo system theme instead of black-grey gradient (requires reboot)
+
+
+ Tiles per row
+ Defines how many QuickSettings tiles to display per one row. Tiles will be resized accordingly. Applies to portrait mode.
+
+
+ Exibir dia da semana
+
+
+ Expandable volume panel
+ Enables expandable volume panel with ability to set volumes for different streams
+
+
+ Link ringtone & notifications volumes
+ When disabled, volumes for ringtone and notifications can be set independently
+
+
+ Auto-switch QuickSettings
+ QuickSettings will show automatically when status bar is pulled down while there are no notifications
+
+
+ Quick pulldown
+ Edge of the status bar pulls down QuickSettings
+ Desabilitado
+ Direita
+ Esquerda
+
+
+ Desabilitar ligação de tela
+ Para dispositivos onde as teclas de volume ligam inadvertidamente a tela
+
+
+ Cores da Barra de Status
+
+
+ Enable icon colors
+
+
+ Statusbar icon color
+ Sets color for statusbar icons and clock
+
+
+ Data activity color
+ Sets color for data activity indicators
+
+
+ QuickSettings management
+
+
+ Notification drawer style
+
+
+ Notification drawer background
+ Default background
+ Color fill
+ Custom image
+ Set background color
+ Set portrait image
+ Set landscape image
+ Background transparency
+ Background mode
+ Overlay
+ Underlay
+
+
+ Disable roaming indicators
+ When disabled, R indicator will not be visible while roaming. Use with caution.
+
+
+ A carregar (%d%%)
+ Carregado
+ %d%% restante
+
+
+ Fora de serviço
+ Modo de avião ativado
+ Apenas chamadas de emergência
+
+
+ Controles Pie
+ Ativar controles Pie
+ Dimensão dos botões de navegação
+ Posições de ativação
+ Borda esquerda do ecrã
+ Borda inferior do ecrã
+ Borda direita do ecrã
+ Borda superior do ecrã
+
+
+ Button backlight mode
+ Default
+ Disable button backlight
+ Always on while screen is on
+ Button backlight notifications
+ EXPERIMENTAL! Blinks button backlight when there is a notification. Use in case your device lacks notification LED. May consume battery.
+
+
+ Hide navigation bar
+ Hides navigation bar while Pie Controls are enabled (for devices that have navigation bar, requires reboot)
+
+
+ Dithered Holo background
+ Replaces standard Holo background with dithered one to suppress color banding (requires reboot)
+
+
+ Disable navigation keys
+ Disables single-tap on keys while Pie Controls are enabled
+
+
+ Use Holo Dark theme
+ Switches GB UI to use Holo Dark theme instead of Holo Light
+
+
+ Desabilitado
+ Canto superior esquerdo
+ Canto superior direito
+ Canto inferior esquerdo
+ Canto inferior direito
+
+
+ Ajustar margem superior
+
+
+ Disable roaming warnings
+ Disables roaming warnings when sending messages or making phone calls while roaming
+
+
+ Pesquise
+ (Nenhum)
+
+
+ Aplicativo rápido
+ Configurações do painel Aplicativo rápido
+ Aplicativo principal
+ Longa pressionada aplicativo posição 1
+ Longa pressionada aplicativo posição 2
+ Longa pressionada aplicativo posição 3
+ Longa pressionada aplicativo posição 4
+
+
+ GPS ativado
+ GPS desativado
+ GPS fixado
+
+
+ Exibir sempre botão Menu
+
+
+ Ringer mode
+
+
+ Configurações do relógio
+
+
+ Esconder AM/PM
+
+
+ Esconder relógio
+
+
+ Trigger size
+
+
+ Gerenciamento de transparências
+ Barra de Status no inicializador
+ Barra de Status na tela de bloqueio
+ Barra de Navegação no inicializador
+ Barra de Navegação na tela de bloqueio
+
+
+ Esconder indicador de alarme
+
+
+ Screen dim level
+ Amount of brightness for dim state - when screen is about to be turned off (requires reboot)
+
telefone
tablet
+
+ Brightness settings
+ Enable brightness settings
+ Use only in case your device supports standard Android brightness features. Keep disabled if you experience brightness related issues. (requires reboot)
+
+
+ Exibir aplicativos recentes
+
+
+ Home key long-press action
+
+
+ Lançar aplicativo 1
+ Definir aplicativo 1
+ Lançar aplicativo 2
+ Definir aplicativo 2
+ Nenhum aplicativo definido!
+ Aplicativo não encontrado!
+
+
+ Notification panel clock app
+ Links notification panel clock to a specified app instead of Date&Time settings
+
+
+ Waiting for response from GravityBox system framework…
+ GravityBox system framework not responding. Exiting.
+
+
+ National data roaming
+ Connect to data services when nationally roaming
+
+
+ Expanded desktop mode
+ Disabled
+ Hide statusbar
+ Hide navigation bar
+ Hide both
+ Expanded desktop
+ Expanded desktop is ON
+ Expanded desktop is OFF
+
+
+ Captura de tela
+
+
+ Exibir menu
+
+
+ Toggle expanded desktop
+ Expanded desktop mode is disabled!
+
+
+ Ajustes da Barra de Navegação
+ Contém diversos ajustes relacionados com a Barra de Navegação
+ Override system defaults
+ Master switch for navigation bar tweaks (requires reboot)
+ Enable navigation bar
+ Requires reboot
+ Navigation bar height
+ Applies to horizontal navigation bar and portrait orientation
+ Applies to horizontal navigation bar and landscape orientation
+ Navigation bar width
+ Applies to vertical navigation bar
+ Always show menu key
+
+
+ Captura de tela no Menu de Desligar
+
+
+ Unlock ring settings
+ Enable unlock ring targets
+ Master switch for unlock ring targets
+ Target application %s
+ Unlock ring vertical offset
+ Unlock ring horizontal offset
+
+
+ Enable brightness control
+ Adjusts brightness by sliding over statusbar (requires automatic brightness to be disabled)
+
+
+ Celular
+ Mensagens
+ Dados móveis
+
+
+ Strip unicode
+ Converts unicode characters to normal characters. Decreases overall message size.
+ Leave characters intact
+ Strip non-encodable characters
+ Strip all unicode characters
+
+
+ Disable slow 2G data warning
+ Disables warning about slow data speed when turning on mobile data in QuickSettings for SIM in 2G mode
+
+
+ Follow stock battery color
+ Makes statusbar clock, percentage and circle battery use the color of stock battery icon. Applies when icon coloring is off.
+
+
+ Network mode tile mode
+ 2G/2G+3G/3G/(LTE)
+ 2G/2G+3G/(LTE)
+ 2G/3G/(LTE)
+
+
+ Permitir todas as rotações
+
+
+ Override default tile behaviour
+ Overrides touch/long-touch behaviour for selected tiles (requires reboot)
+
+
+ Network mode tile SIM slot
+ Defines SIM slot to which network mode tile applies (%s)
+ SIM slot 1
+ SIM slot 2
+
+
+ Never
+ Always
+ When expanded desktop on
+ When expanded desktop hides navigation bar
+
+
+ Leave stock battery icon intact
+ Use in case stock battery icon was replaced with 3rd party battery mod
+
+
+ Unplug turns on screen
+ If enabled, the screen will come on when you plug/unplug usb/power/whatever (requires reboot)
+
+
+ Mute volume adjust sound
+ Disables sound played when adjusting volume using volume keys
+
+
+ Call vibrations
+ On call connected
+ On call disconnected
+ On call waiting
+ Every 45th second during outgoing call
+
+
+ Tile reordering
+ Allows reordering of QuickSettings tiles
+
+
+ Ongoing notification blocker
+ Allows blocking of selected ongoing notifications
+ The list will get populated automatically for every ongoing notification that occurs.
+ You can then decide whether to block ongoing notification next time it occurs. Use with caution.
+ Reset list
+ Are you sure you want to reset list?
+ This will clear current list and unblock all ongoing notifications previously blocked.
+ (list is empty)
+
+
+ Quick unlock
+ Unlock automatically when the correct PIN/password is entered
+
+
+ Desabilitado
+ Padrão
+ Minúsculas
+ Maiúsculas
+
+
+ Statusbar lock policy
+ Default
+ Unlocked if keyguard insecured
+ Locked
+
+
+ Data traffic monitor
+ Enable monitoring
+ Shows data traffic monitor automatically whenever data connection is active
+ Position
+ Auto (center or right depending on clock position)
+ Esquerda
+ Direita
+ Size
+ Normal
+ Smaller
+ Smallest
+ B
+ KB
+ MB
+ s
+
+
+ Disable widget limit
+ Allows unlimited number of lockscreen widgets
+
+
+
+ %1$s livre
+
+ %1$s usada
+ Indicação RAM nos aplicativos recentes
+ Desabilitado
+ Topo superior
+ Topo inferior
+
+
+ Recents key single-tap action
+ Recents key long-press action
+
+
+ Show battery arc
+ Shows battery status arc drawn around unlock ring handle
+
+
+ Comutar tocha
+
+
+ Torch on home key long-press
+ Toggles torch on/off when device locked. Screen has to be turned on if device lacks native wake by home key support.
+
+
+ Expandir automaticamente
+
+
+ Menu key
+ Home key
+ Back key
+ Recents key
+ Volume keys
+ Other settings
+ Long-press action
+ Single-tap action
+ Double-tap action
+
+
+ Disable double-tap
+
+
+ Signal color mode
+ Use GravityBox icons (with signal level support)
+ Use stock icons (without signal level support)
+ Do not apply color
+
+
+ Application launcher
+ Dialog allowing to define up to 8 apps which can be assigned as HW Key Action or used as additional navigation bar key
+ Application slot %d
+ No apps assigned. Use GravityBox / Application launcher menu to assign apps.
+
+
+ Exibir botão Lançador aplicativos
+
+
+ Exibir lançador de aplicativos
+
+
+ Exibir botão customizado
+ Desabilitado
+ Pesquisa
+ Lançador de aplicativos
+
+
+ Pie colors
+ Background color
+ Foreground color
+ Outline color
+ Key selected color
+ Text color
+ Reset colors
+
+
+ Enable unknown caller photo
+ Set unknown caller photo
+ Photo changed
+ Photo not changed
+
+
+ Your screen might not support values lower than 20. If your screen doesn\'t light up,
+ hold Volume+ key for at least 7 seconds to reset brightness and then adjust minimum brightness to use higher values.
+
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 37fce461d5..2a8ea82c77 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -22,6 +22,8 @@
Стоковый индикатор
Круглый индикатор
Круглый индикатор с процентами
+ Батарея KitKat
+ Батарея KitKat с процентами
Индикатор с процентами
Не показывать
@@ -308,9 +310,13 @@
Расширяемая звуковая панель
Включает расширяемую звуковую панель, на которой можно менять звук для разных потоков
+
+ Полностью расширяемая панель громкости
+ Позволяет ползунку громкости занимать все доступное пространство
+
Связать громкость рингтона и уведомлений
- Когда отключено, громкость уведомлений и ренгтона можно задавать независимо
+ Когда отключено, громкость уведомлений и рингтона можно задавать независимо
Автовключение быстрых настроек
@@ -377,7 +383,6 @@
Веерное меню
Включить веерное меню
- Включить кнопку поиска
Размер навигационных кнопок
Позиция переключателей
Левая граница
@@ -461,6 +466,7 @@
Управление прозрачностью
+ Управляет прозрачностью статусбара и панели навигации
Статусбар для ланчера
Статусбара для экрана блокировки
Панель навиг. для ланчера
@@ -612,7 +618,7 @@
Откл. звук рег. громкости
- Отключает звук, проигрываемы при регулеровке громкости
+ Отключает звук, проигрываемы при регулировке громкости
Вибрация звонка
@@ -700,4 +706,105 @@
Расширять автоматически
+
+ Кнопка Меню
+ Кнопка Домой
+ Кнопка Назад
+ Кнопка Недавние
+ Кнопки громкости
+ Другие настройки
+ Действие по долгому нажатию
+ Дейтсвие по одному нажатию
+ Действие по двойному касанию
+
+
+ Отключить двойное касание
+
+
+ Режим цвета сигнала
+ Использовать иконки GB (с поддержкой уровня)
+ Использовать станд. иконки (без поддержки уровня)
+ Не применять цвет
+
+
+ Запуск приложений
+ Диалог, позволяющий выбрать до 8 приложений, которые можно назначить для действий кнопок или поместить на панель навигации
+ Слот приложения %d
+ Приложения не выбраны. Используйте GravityBox / Запуск приложений для выбора приложений.
+
+
+ Показывать кнопку запуска приложения
+
+
+ Запустить приложение
+
+
+ Показать пользовательскую кнопку
+ Отключено
+ Поиск
+ Запуск приложений
+
+
+ Цвет веерного меню
+ Цвет фона
+ Цвет переднего плана
+ Цвет контура
+ Цвет выбранной кнопки
+ Цвет текста
+ Сбросить цвета
+
+
+ Включить фото неизвестного звонящего
+ Задать фото
+ Фото изменено
+ Фото не изменено
+
+
+ Ваш экран может не поддерживать значения меньше 20. Если ваш экран не засветится,
+ зажмите кнопку Громкость+ как минимум на 7 секунд для сброса яркости и затем исправьте значение яркости на большее.
+
+
+ Общие
+ Кнопки навигации
+ Цвет и прозрачность
+ Размеры
+
+
+ Включить цвета панели навигации
+ Может потребоваться перезагрузка после отключения
+ Цвет кнопок навигации
+ Цвет тени кнопок навигации
+ Цвет фона панели навигации
+
+
+ Отключить тень экрана блокировки
+ Удаляет темный оттенок с экрана блокировки
+
+
+ Режим настройки прозрачности
+ Необходима перезагрузка
+ Отключено
+ Статусбар
+ Панель навигации
+ Оба
+
+
+ Цвет вторичного значка сигнала
+ Заменяет стандартный оранжевый цвет значка
+ Цвет активности данных
+ Задает увет для индикатора активности данных
+
+
+ Стиль значков статусбара
+ Применяется ко всем значкам статусбара беззвучный, вибрация и т.д.
+ JellyBean
+ KitKat
+
+
+ Двойное нажатие Назад
+
+
+ Домой
+ Назад
+
diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml
index 94dd8bc9aa..c93ffb165c 100644
--- a/res/values-sk/strings.xml
+++ b/res/values-sk/strings.xml
@@ -5,7 +5,10 @@
Štýl indikátora batérie
Základný
- Kruhový s percentami
+ Kruhový
+ Kruhový s percentami
+ KitKat
+ KitKat s percentami
Percentuálny text stavu batérie
Žiadny
@@ -140,8 +143,8 @@
Naprogramoval C3C076@XDA. Dotykom otvoríte oficiálnu stránku.
Xposed framework
Naprogramoval rovo89@XDA. Dotykom otvoríte oficiálnu stránku.
- Prispieť
- Prispejte cez PayPal ak si myslíte, že táto aplikácia za to stojí! Zvážte tiež príspevok pre rovo89 za jeho excelentný Xposed framework.
+ Podporiť vývoj
+ Dotykom podporíte vývoj aplikácie venovaním príspevku ľubovoľnej hodnoty cez PayPal
Váš %s bude reštartovaný.
@@ -356,7 +359,6 @@
Koláč
Zapnúť koláč
- Povoliť tlačidlo hľadania
Veľkosť koláča
Pozície koláča
Ľavý okraj obrazovky
@@ -380,9 +382,9 @@
Vyhladené Holo pozadie
Nahradí štandardné Holo pozadie vyhladeným obrázkom za účelom eliminácie pruhov farebného prechodu (vyžaduje reštart)
-
- Zablokovať HW tlačidlá
- Zablokuje MENU, SPÄŤ, DOMOV pokiaľ je zapnutý koláč. Akcie HW tlačidiel budú naďalej fungovať (pre zariadenia s HW tlačidlami)
+
+ Zablokovať navigačné tlačidlá
+ Zablokuje ťuknutie na tlačidlá pokiaľ je zapnutý koláč
Použiť tmavú tému
@@ -440,10 +442,11 @@
Nastavenia priehľadnosti
- Stavového riadku pre launcher
- Stavového riadku pre lockscreen
- Navigačnej lišty pre launcher
- Navigačnej lišty pre lockscreen
+ Umožňuje nastavenie úrovne priehľadnosti pre stavový riadok a navigačnú lištu
+ Stavový riadok pre launcher
+ Stavový riadok pre lockscreen
+ Navigačná lišta pre launcher
+ Navigačná lišta pre lockscreen
Skryť ikonu alarmu
@@ -682,4 +685,98 @@
Akcia na ťuknutie
Akcia na dvojité ťuknutie
+
+ Vypnúť dvojité ťuknutie
+
+
+ Režim vyfarbovania signálu
+ Použiť GravityBox ikony (s podporou úrovne signálu)
+ Použiť originál ikony (bez podpory úrovne signálu)
+ Nevyfarbovať
+
+
+ Spúšťač aplikácií
+ Dialóg s aplikáciami, ktorý môže byť aktivovaný na akciu tlačidla, alebo cez dodatočné tlačidlo navigačnej lišty, alebo z koláča
+ Aplikácia %d
+ Nie sú priradené žiadne aplikácie. Použite GravityBox / Spúšťač aplikácií pre priradenie aplikácií.
+
+
+ Tlačidlo spúštača aplikácií
+
+
+ Zobraziť spúšťač aplikácií
+
+
+ Voliteľné tlačidlo
+ Vypnuté
+ Hľadať
+ Spúšťač aplikácií
+
+
+ Farby koláča
+ Farba pozadia
+ Farba ikon
+ Farba okraja
+ Farba aktívneho tlačidla
+ Farba textu
+ Resetovať farby
+
+
+ Povoliť foto neznámeho čísla
+ Nastaviť foto neznámeho čísla
+ Foto nastavené
+ Foto nebolo nastavené
+
+
+ Vaša obrazovka nemusí podporovať hodnoty jasu nižšie ako 20. Ak sa obrazovka nerozsvieti,
+ držte tlačidlo Hlasitosť+ po dobu 7 sekúnd pre rozsvietenie obrazovky. Následne zmeňte nastavenie minimálneho jasu na vyššiu hodnotu.
+
+
+ Plná dĺžka posuvníkov
+ Umožní posuvníkom využiť celú dĺžku panelu nastavenia hlasitosti
+
+
+ Všeobecné
+ Navigačné tlačidlá
+ Farby
+ Rozmery
+
+
+ Povoliť farby
+ Môže vyžadovať reštart po deaktivácii
+ Farba tlačidiel
+ Efekt tlačidiel
+ Farba pozadia lišty
+
+
+ Vypnúť zatmavenie
+ Vypne zatmavenie obrazovky uzamknutia
+
+
+ Režim priehľadnosti
+ Vyžaduje reštart
+ Vypnutý
+ Stavový riadok
+ Navigačná lišta
+ Stavový riadok aj navigačná lišta
+
+
+ Farba sekundárneho signálu
+ Nahradí pôvodnú oranžovú verziu ikony signálu
+ Sekundárny indikátor dátovej aktivity
+ Nastaví farbu pre sekundárny indikátor dátovej aktivity
+
+
+ Štýl stavových ikon
+ Platí pre stavové ikony ako ikona vypnutého zvonenia, vibrovania, budíka, atď.
+ JellyBean
+ KitKat
+
+
+ Dvojité ťuknutie na Späť
+
+
+ Domov
+ Späť
+
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index f558621970..e66fd1c3cb 100755
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -376,7 +376,6 @@
Pasta dilimi kontrolleri
Pasta dilimi kontrollerini etkinleştir
- Arama düğmesini göster
Gezinme tuşu boyutu
Tetikleme konumu
Sol ekran kenarı
diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml
index 1e6dec05cb..03bec47e31 100644
--- a/res/values-uk/strings.xml
+++ b/res/values-uk/strings.xml
@@ -1,280 +1,492 @@
-
GravityBox
-
- Стиль індикатора батареї
- Стандартний індикатор
- Круговий з процентами
- Цифри процентів
- Ніякого
-
- Гортання треків гучністю
- Гортає музичні треки довгим натисканням гучності коли екран заблоковано
-
+ Вид індикатора заряду
+ Стоковий індикатор
+ Круглий індикатор
+ Круглий індикатор з відсотками
+ Індикатор з відсотками
+ Не показувати
+ Пропуск треку з допомогу клавіш гучності
+ Пропускати треки довгим натисканням клавіш гучності при вимкненому екрані
Попередження про низький заряд
- Спливаюче вікно та звук
- Тільки вікно
+ Повідомлення і звук
+ Тільки повідомлення
Тільки звук
- Вимкнене
-
+ Не попереджати
Зміни набудуть чинності після перезавантаження
-
- Приховування іконок сигналу
- Автоматично приховує іконки сигналу обраних SIM-слотів за відсутності карток, вимикає повідомлення \"SIM-картка відсутня\"
- Приховувати у 1-му SIM-слоті
- Приховувати у 2-му SIM-слоті
- Вимкнути повідомлення \"SIM-картка відсутня\"
- Вимкнути повідомлення \"SIM-картка відсутня\"
-
- Варіанти вимкнення
- Додає варіанти вимкнення пристрою з перезавантаженням та меню відновлення (рекавері)
- Меню відновлення (рекавері)
-
- Керування курсором гучністю
- Дозволяє рухати курсор клавішами гучності в текстових полях
- Вимкнено
- Збільш./зменш. гучності рухає курсор вліво/вправо
- Збільш./зменш. гучності рухає курсор вправо/вліво
-
- Завершення усіх завдань
- В меню поточних завдань створює кнопку для завершення одразу усіх завдань
-
- Виправлення дати та часу
- Увімкніть, якщо трапляються збої під час налаштування дати та часу (потрібне перезавантаження)
-
- Виправлення ID дзвінка
- Увімкніть, якщо трапляється неспівпадіння під час вхідного дзвінка (потрібне перезавантаження)
- Для набуття чинності після перезавантаження очистіть та знову додайте контакти! Налаштування / Програми / Усі - очистити дані Пам\'яті контактів.
-
- Виправлення ID повідомлень
- Увімкніть, якщо трапляються розрізнені ланцюжки повідомлень для одного контакту (потрібне перезавантаження)
- Для набуття чинності після перезавантаження видаліть всі розрізнені ланцюжки повідомлень!
-
- Виправлення календаря
- Увімкніть, якщо трапляються періодичні самовмикання екрану (потрібне перезавантаження)
-
+ Автоматично приховувати іконку антени
+ Автоматично приховує іконку антени для вибраного SIM-слота коли SIM-карта в цьому слоті відсутня, відключає повідомлення \"Відсутня SIM\"
+ Приховувати перший слот
+ Приховувати другий слот
+ Вимкнути сповіщення
+ Сповіщення \"Відсутня SIM\" відключені
+ Розширене меню перезавантаження
+ Включає розширене меню перезавантаження з можливістю перезавантаження у відновлення
+ Відновлення
+ Завантажувач
+ Управління курсором клавішами гучності
+ Дозволяє управляти курсором в текстових полях клавішами гучності
+ Відключено
+ Звук вгору/вниз для переміщення курсору вліво/вправо
+ Звук вгору/вниз для переміщення курсору вправо/вліво
+ Закрити всі поточні завдання
+ Падіння діалогу Дата і час
+ Включити, якщо при вході в налаштування Дати та часу відбувається падіння (Необхідна перезавантаження)
+ Визначення номера для дзвінка
+ Включити, якщо номер абонента не співпадає з контактом при вхідному дзвінку (Необхідна перезавантаження)
+ Після перезавантаження необхідно видалити і заново додати контакти, щоб зміни вступили в силу! Використовуйте Настройки - Додатки - Сховище контактів - Очистити дані.
+ Визначника номера для повідомлень
+ Включити, якщо спостерігається проблема кількох гілок повідомлень для одного контакту (Необхідна перезавантаження)
+ Після перезавантаження необхідно видалити всі роздільні гілки у Повідомленнях, щоб зміни вступили в силу!
+ Додаток Календар
+ Включити, якщо є проблема з періодично вмикаючимся екраном в сплячому режимі
Важливо
-
- Повноекранне фото
- Під час вхідного дзвінка показує фото контакту на повний екран
-
-
- Синхр. увімк.
- Синхр. вимк.
+ Фото того, хто телефонує на весь екран
+ Відображати фото того, хто телефонує на весь екран при вимк.иках
+ Синхрон. увімк.
+ Синхрон. вимк.
ТД Wi-Fi увімк.
ТД Wi-Fi вимк.
Ліхтарик увімк.
Ліхтарик вимк.
- Натисніть для вимк.
- Відтворення…
- Запис…
+ Натисніть для вимкнення
+ Відтворення...
+ Запис...
Записано
- Довг. натис. для запису
- Завершити запис
-
-
- Плитки швидких налаштувань
- Дозволяє показати або сховати плитки швидких налаштувань у панелі сповіщень
- Користувач
- Режим літака
- Стан батареї
+ Утримаєте для запису
+ Торкніться щоб зупинити запис
+ Відключено
+ Нормальний
+ Розширений
+ Не засинати увімк.
+ Не засинати вимк.
+ Wi-Fi
+ Wi-Fi вимк.
+ Чи не підключено
+ Включення...
+ Іконки швидких налаштувань статусбару
+ Дозволяє вмикати/вимикати іконки швидких налаштувань в статусбаре
+ Профіль користувача
+ Режим польоту
+ Заряд батареї
Wi-Fi
+ Wi-Fi (CM стиль)
Bluetooth
GPS
- Мобільні дані
- Режим мережі
- Використання даних
+ GPS (CM стиль)
+ Мобільний інтернет
+ Режим мережі (2G/3G)
+ Передача даних (статистика)
Профілі звуку
Яскравість
- Час гасіння екрану
- Автообертання екрану
+ Таймер відключення екрану
+ Автоповорот
Синхронізація
- Портативна точка доступу
+ Точка доступу Wi-Fi
Ліхтарик
GravityBox
- Блокування
- Швидкий запис
-
-
- Змішувач кольорів
- Натисніть для обрання кольору
-
-
- Тло панелі сповіщень
- Дозволяє призначати колір тла та прозорість панелі сповіщень
-
-
- Синтез мовлення
- Розблокує налаштування голосового пошуку та виводу синтезу мовлення з тексту в налаштуваннях мови та введення (потрібне перезавантаження)
-
-
- Параметри розробника
- Розблокує додаткові параметри розробника (потрібне перезавантаження)
-
-
- Твіки панелі сповіщень
- Різноманітні твіки панелі сповіщень
- Різне
- Решта твіків, що не підпадають під конкретну категорію
- Основні твіки
- Основні виправлення для MTK6589. Використовуйте лише в разі необхідності.
-
-
+ Сон
+ Швидка запис
+ Налаштування
+ Звук
+ Розширений робочий стіл
+ Не засинати
+ Знімок екрану
+ Вибір кольору
+ Натисніть на колір для застосування
+ Колір панелі повідомлень
+ Дозволяє задати колір і прозорість панелі повідомлень
+ Виправлення мовних налаштувань
+ Розблокує голосовий пошук і розпізнавання мови в налаштуваннях Мова і введення (Необхідна перезавантаження)
+ Розширені параметри Для розробника
+ Розблокує розширені параметри Для розробника (Необхідна перезавантаження)
+ Налаштування статусбара
+ Містить деякі налаштування статусбара
+ Різні налаштування
+ Містить налаштування, що не відносяться до інших категорій
+ Загальні налаштування
+ "Містить загальні налаштування, пов'язані з MTK6589. Використовувати тільки при необхідності."
Про програму
- Автор коду C3C076@XDA. Натисніть щоб зайти на офіційну сторінку обговорення.
- Xposed framework
- Автор коду rovo89@XDA. Натисніть щоб зайти на офіційну сторінку обговорення.
- Пожертва авторові
- Зробіть пожертву якщо вважаєте додаток вартим цього! Приділіть також увагу пожертві для rovo89 за його чудовий Xposed framework.
-
-
- %s буде перезавантажений.
- %s буде перезавантажений у меню відновлення (рекавері).
-
-
- Ефект старого кінескопу
- Вмикає анімацію, що імітуючє вимкнення старого кінескопу (або ж CRT, ЕПТ, ЭЛТ) під час вимкнення екрану
-
-
+ Кодується C3C076@XDA. Натисніть для переходу до офіційної темі.
+ Експоузд рамках
+ Кодується rovo89 @ XDA. Натисніть для переходу до офіційної темі.
+ Пожертвувати
+ Пожертвуйте, якщо вважаєте, що додаток варто того! Також задумайтеся про пожертву rovo89 за його чудовий Експоузд рамки.
+ %s буде перезавантажено.
+ %s буде перезавантажений у відновленні.
+ %s буде перезавантажений в завантажувач.
+ Ефект кіноскопу вимкнення екрану
+ Дозволяє включити анімацію, яка імітує вимикання старих ЕПТ-моніторів, при вимк.юченні екрану
Інженерне меню
- Запускає додаток інженерного меню
-
-
- Dual SIM Ringer
- Запускає додаток, що дозволяє призначити мелодії дзвінка та звуки сповіщень для кожної SIM-картки окремо
-
-
- Твіки екрану блокування
- Різноманітні твіки екрану блокування
- Тло екрану блокування
- Стиль тла
- Шпалери за умовчанням
- Заливка кольором
- Зображення на вибір
- Призначити колір
- Дозволяє на вибір призначати тло та колір екрану блокування
- Зображення на вибір
- Дозволяє на вибір призначати фонове зображення екрану блокування
- Тло змінене
- Тло не змінене
- Інше
- Максимізація віджетів
- Якщо увімкнено, то віджети екрану блокування будуть максимізовані за умовчанням
-
-
- Твіки живлення
- Різноманітні твіки стосовно живлення
-
-
- Мерехтіння світлодіода
- Вимикає докучливе мерехтіння світлодіода за низького рівня заряду та коли батарея не заряджається
-
-
- Твіки екрану
- Різноманітні твіки екрану
-
-
+ Дозволяє запустити Інженерне меню
+ Мелодія дзвінка для 2-х SIM
+ Запускає додаток, що дозволяє встановити мелодію дзвінка і повідомлень окремо для кожної SIM-карти
+ Налаштування екрану блокування
+ Містить різні налаштування екрану блокування
+ Фон екрану блокування
+ Стиль фону
+ Стандартні шпалери
+ Заповнення кольором
+ Користувацького зображення
+ Задати колір
+ Дозволяє задати колір фону для екрану блокування
+ Задати зображення
+ Дозволяє встановити користувацьке зображення для екрану блокування
+ Фон змінений
+ Фон не змінений
+ Інші
+ Розгорнути віджети
+ Коли включено, віджети будуть максимізувати за замовчуванням
+ Налаштування живлення
+ "Містить різні налаштування, пов'язані з зарядом"
+ Вимкнути спалах
+ Відключає спалах при малому заряді батареї і відключеному зарядному пристрої
+ Налаштування екрану
+ Містить різні настройки екрану
Мінімальний рівень яскравості
- Дозволяє призначити мінімальний рівень яскравості. Застосовується для ручного налаштування яскравості (потрібне перезавантаження)
-
-
- Автоматична яскравість
- Дозволяє призначати значення рівня зовнішнього освітлення та відповідні значення рівнів підсвітки екрану
+ Дозволяє встановити мінімальний рівень яскравості. Застосовується до ручному налаштуванні яскравості. (Необхідна перезавантаження)
+ Рівні автояскравості
+ Дозволяє налаштувати рівні яскравості підсвічування залежно від зовнішньої освітленості
Рівень
- Люкс макс.
- Яскравість (%d – 255)
- Невірне значення
- Не рекомендовано призначати яскравість нижче %d
- Яскравість не може бути більшою за 255
- Значення не можуть бути меншими нуля
- Значення для нижчих рівнів не можуть бути більшими значень для вищих
- Значення для вищих рівнів не можуть бути меншими значень для нижчих
- Значення для %s задано
- Нова конфігурація автоматичної яскравості збережена
- Конфігурація автоматичної яскравості НЕ збережена
-
-
- Автообертання е. б.
- УВАГА: на деяких пристроях можлива зміна мішеней кільця розблокування, якщо екран блокування AOSP був модифікований виробником
-
-
- Задіяти кнопку меню
- Дозволяє використовувати кнопку меню для швидкого розблокування пристрою в режимі екрану блокування (потрібне перезавантаження)
-
-
- Пробудження повідомленням
- Запобігає увімкненню екрану під час надходження повідомлення (потрібне перезавантаження)
-
-
- Центрування годинника
-
-
- Твіки медіа
- Різноманітні твіки для медіа та аудіосистеми
-
-
- Більше кроків гучності
- Додає більше кроків регулювання гучності для музики (потрібне перезавантаження)
-
-
- Безпечна гучність навушників
- Активує та деактивує установку безпечного рівня гучності медіа для навушників
-
-
- Світлодіод зарядження
- Вимикає світлодіод під час зарядження пристрою
-
-
- Дії апаратних кнопок
- Дозволяє призначати дії на апаратні кнопки
- Довге натискання кнопки меню
- Подвійний дотик кнопки меню
- Довге натискання кнопки назад
- За умовчанням
+ Максимальна освітленість
+ Яскравість ( %d - 255)
+ Некоректне значення
+ Не рекомендовано установлювати яскравість нижче %d
+ Яскравість не може бути вище 255
+ Значення не повинно бути менше 0
+ Значення на нижньому рівні не може бути вище значень на верхніх рівнях
+ Значення на верхньому рівні не може бути нижче значень на нижніх рівнях
+ Значення для %s встановлено
+ Нова конфігурація автояскравості збережена
+ Конфігурація автояскравості НЕ БУЛА збережена
+ Встановити
+ Включити поворот екрану блокування
+ УВАГА: може перемістити ярлики для кільця розблокування на деяких пристроях у разі, якщо екран блокування з AOSP був змінений виробником
+ Включити Меню
+ Дозволяє швидко розблокувати пристрій з екрану блокування клавішею Меню (Необхідна перезавантаження)
+ Виправлення прокидання бенкет вхідних повідомленнях
+ Запобігає включення екрану при вхідних повідомленнях (Необхідна перезавантаження)
+ Годинник в центрі
+ Налаштування мультимедіа
+ Містить різні налаштування для медіа-та аудіосистеми
+ Більше рівнів гучності для музики
+ Додає більше кроків для зміни гучності музики (Необхідна перезавантаження)
+ Безпечний звук у навушниках
+ Дозволяє включити або вимк.ючити функцію безпечного звуку в навушниках
+ Вимкнути діод зарядки
+ Дозволяє відключити діод під час заряду
+ Дії кнопок
+ Дозволяє задати свої дії для кнопок телефону
+ Довге натиснення Меню
+ Подвійне натискання Меню
+ Довге натиснення Назад
+ Дія за замовчуванням
Пошук
Голосовий пошук
- До попереднього додатку
- Завершити усі поточні
- Заблокувати
- Довге натискання завершення
- Застосовується до дії завершення усіх поточних завдань. Визначає тривалість натискання для спрацьовування
- Швидкість подвійного дотику
- Застосовується до дії подвійного дотику меню. Визначає швидкість подвійного дотику для спрацьовування
- Завдання %s завершене
- Нічого завершувати
- Немає попереднього додатку
-
-
- Твіки телефонії
- Різноманітні твіки телефонії
-
-
- Перегортання під час дзвінка
- Дозволяє призначити дію на перегортання пристрою лицем донизу під час вхідного дзвінка
+ Переключиться на попередній додаток
+ Закрити поточний додаток
+ Вимкнути екран
+ Затримка довгого натискання для закриття програми
+ Застосовується до кнопці Закрити поточний додаток. Визначає, як довго потрібно тримати кнопку щоб закрити програму
+ Швидкість подвійного натискання
+ Застосовується до подвійному натисненню Меню. Визначає, як швидко потрібно натиснути на кнопку Меню для спрацьовування подвійного натискання.
+ Додаток %s закрито
+ Нема чого закривати
+ Попереднє додаток не знайдено
+ Налаштування телефонії
+ Містить різні налаштування телефону
+ Переворот під час дзвінка
+ Дозволяє задати дію при перевертанні телефону під час вхідного дзвінка
Нічого не робити
- Заглушити дзвінок
- Покласти слухавку
-
-
- Вимкнення вібрації з\'єднання
- Вимикає вібрацію під час з\'єднання дзвінка
-
-
- М\'яке перезавантаження
-
-
- Суцільне чорне тло
- Призначає суцільне чорне тло замість чорно-сірого градієнту для системної теми за умовчанням Holo (потрібне перезавантаження)
-
-
- Плиток в рядку
- Призначає скільки плиток швидких налаштувань розміщувати в одному рядку. Розмір буде змінений належним чином. Застосовується до портретного режиму.
-
-
- Показувати день тижня
-
-
- Пристрій
-
+ Вимкнути звук
+ Скинути дзвінок
+ "М'які перезавантаження"
+ Чорний задній фон
+ Використовувати чорний фон для системної Holo-теми за замовчуванням замість темно-сірого градієнта (Необхідна перезавантаження)
+ Іконок в ряд
+ Визначає, як багато іконок швидких налаштувань буде показано в одному ряду. Розміри зміняться відповідно. Застосовується до портретному режиму.
+ Відображати день тижня
+ Повністю розширена панель гучності
+ Дозволяє панелі гучності займати весь простір
+ Розширювана звукова панель
+ Включає розширювану звукову панель, на якій можна міняти звук для різних потоків
+ "Зв'язати гучність рінгтона і повідомлень"
+ Коли відключено, гучність повідомлень і рінгтона можна задавати незалежно
+ Автоувімкнення швидких налаштувань
+ Швидкі налаштування будуть показані автоматично (якщо немає повідомлень) при витягуванні статусбара
+ Швидке витягування
+ За край статусбара можна витягнути швидкі налаштування
+ Вимкнено
+ Праворуч
+ Зліва
+ Відключення виходу зі сну клавішами гучності
+ Для пристроїв на зразок Jiayu G3s, G4 де зміна звуку будить пристрій
+ Кольори статусбара
+ Включити кольору іконок
+ Колір іконок статусбара
+ Задає кольори для іконок статусбара та годинника
+ Колір активності даних
+ Задає кольори для індикаторів активності даних
+ Управління Швидкими налаштуваннями
+ Стиль шторки повідомлень
+ Фон шторки повідомлень
+ Стандартний фон
+ Заповнення кольором
+ Користувацького зображення
+ Задати колір фону
+ Задати портретну картинку
+ Задати ландшафтну картинку
+ Прозорість фону
+ Режим фону
+ Передній план
+ Задній план
+ Відключити індикатор роумінгу
+ При відключенні R-індикатор не буде відображатися. Використовуйте з обережністю.
+ Зарядка ( %d%%)
+ Заряджений
+ %d%% залишилося
+ Немає мережі
+ Режим польоту
+ Тільки екстрені
+ Віялове меню
+ Включити віялове меню
+ Розмір навігаційних кнопок
+ Позиція перемикачів
+ Ліва межа
+ Нижня межа
+ Права межа
+ Верхня межа
+ Режим підсвічування клавіш
+ Стандартний
+ Відключити підсвічування
+ Включати завжди, коли включений екран
+ Сповіщення підсвічуванням клавіш
+ ЕКСПЕРИМЕНТАЛЬНО! Бликаюче підсвічування клавіш при повідомленнях. Використовувати тільки у разі відсутності світлодіодних індикатора. Може призвести до погіршення життя батареї.
+ Приховати панель навігації
+ Приховує панель навігації, коли включено віялове меню (для пристроїв з програмними кнопками навігації, необхідне перезавантаження)
+ Згладжений Holo фон
+ Замінює стандартний фон на згладжений для уникнення неплавного градієнта (необхідне перезавантаження)
+ Вимкнути залізні кнопки
+ Відключає кнопки НАЗАД, ДОДОМУ, МЕНЮ при включеному віяловому меню. Нестандартні дії цих кнопок по раніше будуть працювати. (Для пристроїв із залізними кнопками)
+ Використовувати тему Holo Dark
+ Перемикає тему інтерфейсу GravityBox зі світлою на темну
+ Вимкнено
+ Зверху зліва
+ Зверху справа
+ Знизу ліворуч
+ Знизу праворуч
+ Налаштувати відступ зверху
+ Вимкнути попередження про роумінг
+ Вимкнути попередження про роумінг при відправці повідомлень або здійснення дзвінків у роумінгу
+ Пошук
+ (Ні)
+ Швидкий запуск
+ Налаштування тайла Швидкого запуску
+ Основний додаток
+ Довгий тап, слот 1
+ Довгий тап, слот 2
+ Довгий тап, слот 3
+ Довгий тап, слот 4
+ GPS вкл
+ GPS вимк.
+ GPS блок
+ Завжди показувати Меню
+ Режим дзвінка
+ Налаштування годинника
+ Ховати AM/PM
+ Ховати годинник
+ Розмір перемикачів
+ Управління прозорістю
+ Статусбар для головного екрану
+ Статусбара для екрану блокування
+ Панель навігації для ланчера
+ Панель наві. для екрану блокування
+ Заховати значок будильника
+ Рівень загасання підсвічування
+ Яскравість для приглушеної підсвічування - коли екран майже вимк.ючився (необхідне перезавантаження)
+ Телефон
+ Планшет
+ Налаштування яскравості
+ Увімкнути налаштування яскравості
+ "Включити тільки у випадку, якщо пристрій використовує стандартний механізм Android для регулювання яскравості. Залиште вимкненим, якщо є проблеми, якось пов'язані з яскравістю. (Необхідна перезавантаження)"
+ Показати нещодавні додатки
+ Дія за довгому натисненню Головна
+ Запустити додаток 1
+ Вибрати додаток 1
+ Запустити програму 2
+ Вибрати додаток 2
+ Додаток не вибрано!
+ Додаток не знайдено!
+ Додаток-годинник для панелі повідомлень
+ "Пов'язує годинник на статусбаре з обраним додатком замість налаштувань Дати та часу"
+ Очікування відгуку від системного фреймворку GravityBox...
+ Системний фреймворк GravityBox не відповідає. Вихід.
+ Національний роумінг
+ Підключатися до служб передачі даних в національному роумінгу
+ Розширений робочий стіл
+ Відключено
+ Заховати статусбар
+ Заховати панель навігації
+ Ховати все
+ Розширений робочий стіл
+ Розширений робочий стіл ВКЛЮЧЕНИЙ
+ Расшренний робочий стіл ВИМКНЕНИЙ
+ Знімок екрану
+ Показати меню
+ Включити розширений робочий стіл
+ Розширений робочий стіл відключений!
+ Налаштування панелі навігації
+ Містить різні налаштування панелі навігації
+ Переписати налаштування за замовчуванням
+ Дозволяє включити всі твіки панелі навігації (Необхідна перезавантаження)
+ Включити панель навігації
+ Необхідне перезавантаження
+ Висота панелі навігації
+ Застосовується до портретної орієнтації
+ Застосовувати для горизонтальної та вертикальної орієнтацій
+ Ширина панелі навігації
+ Застосовується до ландшафтної орієнтації
+ Завжди показувати кнопку меню
+ Скріншот в меню вимкнення
+ ярлики екрану блокування
+ Включити ярлики екрану блокування
+ Загальний перемикач ярликів екрану блокування
+ Додаток %s
+ Вертикальний зсув кільця розблокування
+ Горизонтальне зміщення
+ Включити контроль яскравості
+ Міняти яскравість слайдом вздовж статусбара
+ Телефонія
+ Повідомлення
+ Передача даних
+ Змінювати Unicode
+ Конвертує Unicode символи в звичайні символи. Зменшує загальний розмір повідомлення.
+ Не скидати символи
+ Змінювати некодовані символи
+ Змінювати всі символи Unicode
+ Вимкнути 2G попередження
+ Відключає попередження про повільної швидкості передачі даних коли у швидких налаштуваннях включений режим 2G для SIM-карти
+ Слідувати кольором батареї
+ Дозволяє годинах в статусбаре, батареї і тексту з відсотками використовувати колір стокової батареї. Працює при вимкненому зміну кольорів іконок.
+ Режим тайла Режим мережі
+ 2G/2G+3G/3G/(LTE)
+ 2G/2G+3G/(LTE)
+ 2G/3G/(LTE)
+ Дозволити всі повороти
+ Замінити стандартну поведінку тайлів
+ Замінює поведінка торкання/довгого торкання для обраних тайлів (необхідне перезавантаження)
+ Слот SIM для тайла Режим мережі
+ Визначає слот, для якого працює тайл Режим мережі ( %s)
+ SIM-слот 1
+ SIM-слот 2
+ Ніколи
+ Завжди
+ При включеному розширеному дисплеї
+ Коли розширений дисплей без панелі навігації
+ Не чіпати значок батареї
+ Використовувати в випад заміни стокового значка батареї стороннім модом
+ Увімкнути. екран при підключенні
+ Якщо включено, екран буде включаться при підключенні/відключенні USB/навушників (необхідне перезавантаження)
+ Вимкнути. звук регулювання гучності
+ Відключає звук, біп при регулюваннні гучності
+ Вібрація дзвінка
+ На початку дзвінка
+ Наприкінці дзвінка
+ При очікуванні дзвінка
+ Кожні 45 секунд при вихідному
+ Сортування тайлів
+ Дозволяє сортувати тайли
+ Блокування повідомлень
+ Дозволяє блокувати вибрані повідомлення
+ Список формується автоматично при появі повідомлення. Ви можете вирішити пізніше, яке сповіщення блокувати. Використовуйте з обережністю.
+ Скинути список
+ Ви впевнені, що хочете скинути список? Це очистить список і розблокує всі поточні повідомлення.
+ (Список порожній)
+ Швидка розблокування
+ Розблокувати автоматично при введенні вірного PIN/пароля.
+ Відключено
+ Типово
+ рядковими
+ ВЕЛИКИМИ
+ Правила блокування статусбара
+ Типово
+ Розблоковано якщо блокування клавіатури ненадіне
+ Заблокований
+ Монітор трафіку
+ Включити моніторинг
+ Показує трафік завжди, коли включена передача даних
+ Позиція
+ Автоматично (у центрі або праворуч залежно від позиції годин)
+ Зліва
+ Праворуч
+ Розмір
+ Звичайний
+ Маленький
+ Дуже маленький
+ B
+ КБ
+ Мегабайт
+ з
+ Відключити обмеження віджетів
+ Дозволяє отримати необмежену кількість віджетів екрану блокування
+ %1$s вільно
+ %1$s використано
+ "Панель пам'яті поточних завдань"
+ вимкнено
+ зверху
+ знизу
+ Дія з одиночного торкання
+ Дія по довгому торкання
+ Статус батареї
+ Показувати арку батареї, намальовану навколо кільця розблокування
+ Включити ліхтарик
+ Ліхтарик по довгому натисненню Головна
+ Включити ліхтарик при заблокованому пристрої. Екран повинен бути включений, якщо пристрій не може зчитувати натискання кнопки у сні
+ Розширювати автоматично
+ Кнопка Меню
+ Кнопка Додому
+ Кнопка Назад
+ Кнопка Недавні
+ Кнопки гучності
+ Інші установки
+ Дія за довгому натисненню
+ Дейтсвіе за одним натисканням
+ Дія за подвійним торкання
+ Вимкнути подвійне торкання
+ Режим кольору сигналу
+ Використовувати іконки GB (з підтримкою рівня)
+ Використовувати стандартні іконки (без підтримки рівня)
+ Не застосовувати колір
+ Запуск додатків
+ Діалог, що дозволяє вибрати до 8 додатків, які можна призначити для дій кнопок або помістити на панель навігації
+ Слот додатки %d
+ Додатки не вибрані. Використовуйте GravityBox/Запуск додатків для вибору додатків.
+ Показувати кнопку запуску програми
+ Запустити програму
+ Показати призначену для користувача кнопку
+ Відключено
+ Пошук
+ Запуск додатків
+ Колір веєрного меню
+ Колір фону
+ Колір переднього плану
+ Колір контуру
+ Колір обраної кнопки
+ Колір тексту
+ Скинути кольору
+ Включити фото невідомого абонента
+ Задати фото
+ Фото змінено
+ Фото не змінено
+ Ваш екран може не підтримувати значення менше 20. Якщо ваш екран не засвітиться, затисніть кнопку Гучність+ як мінімум на 7 секунд для скидання яскравості і потім виправте значення яскравості на більше.
+ Загальне
+ Кнопки навігації
+ Колір та прозорість
+ Розміри
+ Колір кнопок навігації
+ Колір тіні кнопок навігації
+ Колір фону паненлі навігації
+ Вимкнути тінь екрану блокування
+ Видаляє темний відтінок
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index 83dc9c6c6c..8556b346b3 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -371,7 +371,6 @@
Điều khiển Pie
Cho phép
- Hiện nút bấm tìm kiếm
Kích thước khóa chuyển hướng
Vị trí kích hoạt
Viền màn hình trái
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index eda0bb1370..bbf5032d53 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -18,15 +18,17 @@
GravityBox
- 电量指示器风格
- 原厂电量指示器
- 圆形电量图案
- 圆形电量图案(包含百分比)
- 电量百分比文字
+ 电量图标风格
+ 原厂电量图标
+ 圆形电量图标
+ 圆形电量图标含百分比
+ KitKat电量图标
+ KitKat电量图标含百分比
+ 电量百分比
无
音量键跳过歌曲
- 当屏幕关闭时,长按音量键以跳过歌曲
+ 当屏幕关闭时长按音量键以跳过歌曲
低电量警告
弹出窗口以及音效
@@ -37,18 +39,18 @@
重新启动以后设置才会启用
自动隐藏信号强度图标
- 当 SIM 卡未插入时,自动隐藏指定 SIM 卡的信号强度图标,并停用“SIM 卡未插入”通知
- 自动隐藏 SIM 卡1
- 自动隐藏 SIM 卡2
+ 当SIM卡未插入时自动隐藏指定SIM卡的信号强度图标并停用“SIM卡未插入”通知
+ 自动隐藏SIM卡1
+ 自动隐藏SIM卡2
禁用通知
- “SIM 卡未插入”提醒已停用
+ “SIM卡未插入”提醒已停用
高级重新启动菜单
- 启用 重新启动 和 Recovery 选项高级菜单
+ 启用重新启动和Recovery选项高级菜单
Recovery
Bootloader
- 音量键光标控制
+ 音量键光标调整
在文字输入区域内,以音量键控制光标位置
禁用
音量键增/减按钮控制光标向左/向右
@@ -60,12 +62,12 @@
当您进入日期与时间设置发生错误时,启用这个选项(需要重新启动)
修正通话的来电显示
- 若您来电画面上显示的联系人与您的通讯录不合,启用这个选项(需要重新启动)
- 为了让更改生效,您应该在重新启动后清除并重新添加所有联系人!(使用 设置/应用程序/全部,找到“联系人存储”,清除数据)
+ 若您来电画面上显示的联系人与您的通讯录不符,启用这个选项(需要重新启动)
+ 为了让更改生效,您应该在重新启动后清除并重新添加所有联系人(使用 设置/应用程序/全部,找到“联系人存储”,清除数据)
修正短信的来电显示
如果来自同一个人的短信被分成不同的会话,启用这个选项(需要重新启动)
- 为了让更动生效,您应该在重新启动后,在“短信”应用程序内删除全部分散的会话!
+ 为了让更动生效,您应该在重新启动后,在“短信”应用程序内删除全部分散的会话
修正日历应用程序
若您周期性地遇到屏幕自动开启时,启用这个选项(需要重新启动)
@@ -78,8 +80,8 @@
同步开启
同步关闭
- Wi-Fi AP 开启
- Wi-Fi AP 关闭
+ Wi-Fi AP开启
+ Wi-Fi AP关闭
手电筒开启
手电筒关闭
按下以关闭
@@ -94,9 +96,9 @@
保持唤醒
唤醒关闭
Wi-Fi
- Wi-Fi 关闭
+ Wi-Fi关闭
未连接
- 正在打开…
+ 正在打开…
状态栏快速设置
@@ -105,10 +107,10 @@
飞行模式
电池状态
Wi-Fi
- Wi-Fi(CM 风格)
+ Wi-Fi(CM风格)
蓝牙
GPS
- GPS(CM 风格)
+ GPS(CM风格)
移动数据
网络模式
数据使用
@@ -117,7 +119,7 @@
屏幕超时
自动旋转
同步
- Wi-Fi 接入点
+ Wi-Fi接入点
手电筒
GravityBox
睡眠
@@ -150,20 +152,20 @@
杂项调整
包含所有不属于特定类别的调整选项
通用修正
- 包含 MTK6589 的通用修正。请只在有需要时使用。
+ 包含MTK6589的通用修正,请在有需要时使用
关于
- 由 C3C076@XDA 编写。点击此处以进入官方讨论链接。
+ 由C3C076@XDA编写,点击这里进入官方讨论链接
Xposed 框架
- 由 rovo89@XDA 编写。点击此处以进入官方讨论链接。
+ 由rovo89@XDA编写,点击这里进入官方讨论链接
捐助
- 若您觉得这个程序好用的话请捐助我!也请考虑捐助给rovo89编写出优秀的 Xposed 框架作者。
+ 支持开发,点击这里进入PayPal捐赠
您的%s将重新启动
- 您的%s将重新启动至 Recovery
- 您的%s将重新启动至 Bootloader
+ 您的%s将重新启动至Recovery
+ 您的%s将重新启动至Bootloader
CRT屏幕关闭特效
@@ -174,8 +176,8 @@
启动“工程模式”应用程序
- 双 SIM 卡铃声
- 启动可以设置各个 SIM 卡的铃声与通知音效的应用程序
+ 双SIM卡铃声
+ 开启可以设置各个SIM卡的铃声与通知音效
锁屏画面调整
@@ -184,7 +186,7 @@
背景风格
默认壁纸
纯色
- 自定义图案
+ 自定义图像
设置自定义颜色
可以为锁屏画面设置自定义的背景颜色
设置自定义图像
@@ -200,8 +202,8 @@
包含各种电源相关的调整选项
- 停用 LED 闪烁
- 停掉当低电量且未充电时会出现扰人的 LED 闪烁
+ 停用LED闪烁
+ 停掉当低电量且未充电时会出现扰人的LED闪烁
显示调整
@@ -209,35 +211,35 @@
最低亮度级别
- 可以设置最低的亮度级别。在手动设置亮度时适用。(需要重新启动)
+ 可以设置最低的亮度级别,在手动设置亮度时适用(需要重新启动)
自动亮度级别
- 可以设置环境的亮度级别与相对应的 LCD 背光值
+ 可以设置环境的亮度级别与相对应的LCD背光值
级别
最大照度(lux)
亮度(%d – 255)
指定值无效
- 不建议将亮度设为 %d 以下
- 亮度不可大于 255
- 值不可低于 0
+ 不建议将亮度设为%d以下
+ 亮度不可大于255
+ 值不可低于0
较低级别的值不可大于较高级别的值
较高级别的值不可小于较低级别的值
- 已设置 %s 的值
+ 已设置%s的值
自动亮度配置已保存
自动亮度配置未保存
设置
启用锁屏画面旋转
- 警告:若 AOSP 的锁定屏幕曾被厂商修改,某些装置的解锁环目标可能遭到互换
+ 警告:若AOSP的锁定屏幕曾被厂商修改,某些装置的解锁环目标可能遭到互换
启用菜单键
使菜单键在锁定画面时可以用来快速地解锁装置(需要重新启动)
- 修正短信的唤醒锁
+ 修正短信唤醒锁
避免在收到新短信时唤醒屏幕(需要重新启动)
@@ -248,20 +250,20 @@
包含各种媒体与声音系统的调整选项
- 更多音乐音量调整段数
- 为音乐流添加更多的音量调整段数(需要重新启动)
+ 更多音量段数
+ 添加更多的音量调整段数(需要重新启动)
- 安全的耳机媒体音量
- 启用或停用安全的耳机媒体音量功能
+ 安全耳机媒体音量
+ 启用或停用安全耳机媒体音量功能
- 禁用充电 LED 灯
- 禁用当充电时的 LED 灯
+ 禁用充电LED灯
+ 禁用当充电时的LED灯
实体按键调整
- 可在此为实体按键设置自定的动作
+ 可在此为实体按键设置自定动作
菜单键长按动作
菜单键双击动作
返回键长按动作
@@ -272,10 +274,10 @@
结束前台应用程序
使装置休眠
结束应用程序的长按延迟
- 适用于“结束正在使用的应用程序”动作。定义按键需要按下持续多久才会触发动作
+ 适用于“结束正在使用的应用程序”动作,定义按键需要按下持续多久才会触发动作
双击速度
- 适用于菜单键的双击动作。定义按键需要在多少时间内连续按两下才会触发动作
- %s 应用程序程序已结束
+ 适用于菜单键的双击动作,定义按键需要在多少时间内连续按两下才会触发动作
+ %s应用程序已结束
无应用程序可结束
找不到上一个应用程序
@@ -285,7 +287,7 @@
响铃时的手机翻转动作
- 可定义在响铃时,翻转使得屏幕向下时执行的动作
+ 可定义在响铃时,翻转使屏幕向下时执行的动作
无
铃声静音
拒接电话
@@ -295,18 +297,22 @@
纯黑色背景
- 在默认的 Holo 系统主题内使用纯黑色的背景,而不是黑-灰色的渐变(需要重新启动)
+ 在默认的Holo系统主题内使用纯黑色的背景而不是黑-灰色的渐变(需要重新启动)
每行方块数
- 定义快速设置内每行有几个方块。开关会根据您的设置自动缩放。适用于竖屏。
+ 定义快速设置内每行有几个方块,开关会根据您的设置自动缩放,适用于竖屏
- 显示星期
+ 显示周
可扩展音量面板
- 启用此选项使您可以调整不同流的音量
+ 启用此选项使你可以调整不同的媒体音量
+
+
+ 完整的可扩展音量面板
+ 允许音量面板占用所有提供的空间
合并铃声音量与通知音量
@@ -325,7 +331,7 @@
禁用音量键唤醒屏幕
- 佳域 G3s 和 G4 的实体音量键会唤醒屏幕
+ 佳域G3s和G4的实体音量键会唤醒屏幕
状态栏颜色
@@ -362,12 +368,12 @@
禁用漫游指示
- 禁用时,漫游指示器上(R)不可见。请小心使用
+ 禁用后漫游指示器上(R)不可见,请小心使用
- 充电中(%d%%)
- 已充满
- %d%% 剩余
+ 充电中:(%d%%)
+ 已充满!
+ 剩余:%d%%
无服务
@@ -375,9 +381,8 @@
仅限紧急呼叫
- 虚拟键控制
- 启用Pie Controls虚拟键控制
- 显示搜索键
+ Pie Controls虚拟键
+ 启用Pie Controls虚拟键
虚拟键大小
触发位置
屏幕左边缘
@@ -391,23 +396,23 @@
禁用按键背光
当屏幕亮起时常亮背光灯
背光灯通知
- 这个设置是实验性的!当收到通知时背光灯会闪烁提醒。建议当您的装置没有 LED 通知灯时才开启,此功能可能会消耗部分电量
+ 这个设置是实验性的!当收到通知时背光灯会闪烁提醒。建议当您的装置没有LED通知灯时才开启,此功能可能会消耗部分电量
隐藏虚拟键
当Pie Controls虚拟键启用时隐藏系统虚拟键(对于有虚拟键的设备,需要重新启动)
- 优化 Holo 背景
- 使用优化过的 Holo 背景以消除色带(需要重新启动)
+ 优化Holo背景
+ 使用优化过的Holo背景以消除色带(需要重新启动)
-
+
禁用实体按键
- 当虚拟键启用时将会禁用菜单键、返回键与主页键功能,但是实体按键功能仍可使用(对于实体按键的设备)
+ 当Pie Controls虚拟键启用时将会禁用实体按键功能(对于有实体按键的设备)
- 使用 Holo 黑色背景主题
- 切换 GravityBox 至黑色 Holo 主题,代替白色 Holo 主题
+ 使用Holo黑色背景主题
+ 切换GravityBox至黑色Holo主题代替白色Holo主题
关闭
@@ -437,9 +442,9 @@
长按应用槽 4
- 开启 GPS
- 关闭 GPS
- GPS 已定位
+ 开启GPS
+ 关闭GPS
+ GPS已定位
总是显示菜单键
@@ -451,7 +456,7 @@
时钟设置
- 隐藏 AM/PM
+ 隐藏 上午/下午
隐藏时钟
@@ -461,6 +466,7 @@
透明度调整
+ 管理状态栏和虚拟键透明度
启动器下的状态栏透明度
锁屏画面时的状态栏透明度
启动器下的虚拟键透明度
@@ -480,7 +486,7 @@
亮度设置
启用亮度设置
- 这个功能只能在您的设备支持标准的 Android 亮度调整功能才启用。如果遇到任何亮度问题请关闭此选项(需要重新启动)
+ 这个功能只能在您的设备支持标准的Android亮度调整功能才启用。如果遇到任何亮度问题请关闭此选项(需要重新启动)
显示最近使用的应用程序
@@ -501,8 +507,8 @@
启用后状态栏的时间将链接到指定应用,而不是日期与时间设置
- 等待 GravityBox 系统框架的响应…
- GravityBoy 系统框架未响应,退出中。。。
+ 等待GravityBox系统框架的响应…
+ GravityBoy系统框架未响应 退出中…
国内数据漫游
@@ -530,7 +536,7 @@
虚拟键调整
- 包含各种关于虚拟键的调整
+ 包含各种关于虚拟键的调整选项
覆盖系统默认值
虚拟键调整的总开关(需要重新启动)
启用虚拟键
@@ -555,7 +561,7 @@
启用亮度控制
- 启用状态栏调整亮度
+ 启用状态栏调整亮度(需要禁用自动亮度)
电话
@@ -563,19 +569,19 @@
移动数据
- 转换 Unicode
- 将 Unicode 字符转换为普通字符。减少整体信息大小。
+ 转换Unicode
+ 将Unicode字符转换为普通字符,减少整体信息大小
保留字符不变
转换不可编码字符
- 转换所有 Unicode 字符
+ 转换所有Unicode字符
禁用低速2G网络数据警告
- 当在快速设置中为 SIM 卡启用 2G 移动数据时,禁用低速数据警告
+ 当在快速设置中为SIM卡启用2G移动数据时,禁用低速数据警告
- 跟随原生电池颜色
- 使状态栏时钟、百分比和圆形电池使用原生电池图标的颜色。当图标颜色关闭时有效。
+ 保持原厂电池颜色
+ 使状态栏时钟、百分比和圆形电池使用原厂电池图标的颜色。当图标颜色关闭时有效
网络模式
@@ -603,16 +609,16 @@
当扩展桌面隐藏虚拟键时
- 保留原生电池图标
- 使用它以防止原生电池图标被替换第三方电池图标
+ 保持原厂电池图标
+ 使用它以防止原厂电池图标被替换为第三方电池图标
拔下电源线开启屏幕
- 如果启用,当你插入或拔出 USB 线/电源线时会亮起屏幕 (需要重新启动)
+ 如果启用,当你插入或拔出USB线/电源线时会亮起屏幕(需要重新启动)
静音音量调节音效
- 禁用调节音量时播放音效
+ 禁用调节音量时发出音效
通话振动
@@ -626,18 +632,18 @@
允许快速设置方块重新排序
- 进行中通知阻拦器
- 允许阻拦选定的进行中通知
- 在每个进行中通知发生时,此列表会被填充。
- 您可以决定在下次发生时是否阻拦进行中通知。小心使用。
+ 进行中通拦截器
+ 允许拦截选定进行中的通知
+ 在每个进行中通知发生时,此列表会被填充
+ 您可以决定在下次发生时是否拦截进行中的通知。请小心使用
重置列表
是否确实要重置列表?
- 这将清空当前列表,并且解除所有之前被阻拦的进行中通知。
- (列表为空)
+ 这将清空当前列表,并且解除所有之前被阻拦的进行中通知
+ (列表为空)
快速解锁
- 当输入正确的 PIN/密码时,自动解锁
+ 当输入正确的PIN/密码时,自动解锁
禁用
@@ -674,9 +680,9 @@
- %1$s 空闲
+ 空闲:%1$s
- %1$s 使用
+ 可用:%1$s
最近任务内存栏
关闭
置顶
@@ -695,7 +701,7 @@
长按主页键
- 设备锁定时长按切换开/关。如果屏幕已打开设备缺乏本地唤醒主页键的支持。
+ 设备锁定时长按切换开/关。如果屏幕已打开设备缺乏本地唤醒主页键的支持
自动展开
@@ -710,5 +716,102 @@
长按动作
单按动作
双击动作
+
+
+ 禁用双击
+
+
+ 信号色彩模式
+ 使用GravityBox图标(有信号等级)
+ 使用原厂图标(无信号等级)
+ 不使用颜色
+
+
+ 应用启动器
+ 对话框允许定义最多8个应用程序,可以分配硬件按键或作为额外的虚拟键
+ 应用程序槽 %d
+ 没有应用程序被分配,使用GravityBox/应用启动器来分配应用程序
+
+
+ 显示应用程序按键
+
+
+ 显示应用启动器
+
+
+ 显示自定义按键
+ 关闭
+ 搜索
+ 应用启动器
+
+
+ Pie 颜色
+ 背景颜色
+ 前景颜色
+ 边框颜色
+ 按键选中颜色
+ 文字颜色
+ 重设颜色
+
+
+ 开启未知来电者照片
+ 设置未知来电照片
+ 照片已更改
+ 照片未更改
+
+
+ 您的屏幕可能不支持低于20的值。如果您的屏幕亮不起来,
+ 按住 音量+ 键至少7秒钟将会还原亮度,调整亮度请使用更大的值
+
+
+ 普通
+ 虚拟按键
+ 颜色和透明度
+ 大小
+
+
+ 启用虚拟按键颜色
+ 停用后可能需要重启
+ 虚拟按键颜色
+ 虚拟按键发光颜色
+ 虚拟按键背景颜色
+
+
+ 禁用锁屏阴影
+ 锁屏后移除暗色调
+
+
+ 透明度管理模式
+ 需要重新启动
+ 禁用
+ 状态栏
+ 虚拟按键
+ 两者
+
+
+ 第二个信号颜色
+ 覆盖原厂橙色信号图标
+ 第二个数据活动颜色
+ 设置为辅助数据活动的指示颜色
+
+
+ 状态图标风格
+ 适用于无声,震动,闹钟等状态图标
+ JellyBean
+ KitKat
+
+
+ 返回键双击动作
+
+
+ 转到桌面
+ 返回
+
+
+ 标题风格
+ 仅适用于由GravityBox修改标题(不影响原厂标题)
+
+
+ 调整底部边距
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index 589bf07568..dcd0134bc6 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -7,6 +7,8 @@
預設電量指示器
圓形電量指示器
圓形電量指示器(包含電量百分比)
+ KitKat 電量指示器
+ KitKat 電量指示器(包含電量百分比)
電量百分比文字
無
@@ -144,7 +146,7 @@
Xposed 框架
由 rovo89@XDA 編寫。點選此處以拜訪官方的討論串。
捐助
- 若您覺得這個應用程式好用的話,請贊助我!也請考慮捐助給編寫出優秀的 Xposed 框架的 rovo89。
+ 如果您覺得這個程式寫得不錯,您可以按下這個按鈕利用 PayPal 來捐贈我
您的 %s 將重新啟動
@@ -194,21 +196,21 @@
包含各種顯示相關的校正選項
- 最低亮度層級
- 可以設定最低的亮度層級。在手動設定亮度時適用。(需要重新啟動)
+ 最低亮度等級
+ 可以設定最低的亮度等級。在手動設定亮度時適用。(需要重新啟動)
- 自動亮度層級
- 可以設定環境的亮度層級與相對應的 LCD 背光值
+ 自動亮度等級
+ 可以設定環境的亮度等級與相對應的 LCD 背光值
等級
最大照度(lux)
亮度(%d – 255)
- 指定的值不被接受
+ 指定的數值不被接受
不建議將亮度設為 %d 以下
亮度無法大於 255
- 值無法低於 0
- 較低層級的值無法大於較高層級的值
- 較高層級的值無法小於較低層級的值
+ 數值無法低於 0
+ 較低等級數值無法大於較高等級的數值
+ 較高等級數值無法小於較低等級的數值
已設定%s 的數值
已儲存新的自動亮度組態
"尚未"儲存新的自動亮度組態
@@ -297,6 +299,11 @@
可擴展音量面板
啟用此選項使您可以調整不同串流的音量
+
+
+
+ 完全擴展音量調節面板
+ 允許音量調節面板使用所有可提供的空間
將鈴聲音量與通知音量連結
@@ -367,7 +374,6 @@
Pie 控制
啟用 Pie 控制
- 顯示搜尋按鍵
導航鍵大小
觸發位置
螢幕左邊緣
@@ -450,10 +456,11 @@
透明度調整
- 桌面啟動器下的狀態列透明度
- 鎖定畫面時的狀態列透明度
- 桌面啟動器下的海苔條透明度
- 鎖定畫面時的海苔條透明度
+ 管理海苔條與狀態列透明度
+ 啟動器下的狀態列
+ 鎖定螢幕下的狀態列
+ 啟動器下的海苔條
+ 鎖定螢幕下的海苔條
隱藏時鐘圖示
@@ -491,7 +498,7 @@
正在等待 GravityBox 系統框架回應…
- GravityBox 系統框架沒有回應,正在退出中.
+ GravityBox 系統框架沒有回應,正在退出.
國內資料漫遊
@@ -621,7 +628,7 @@
可讓的 QuickSettings 瓷貼重新排序
- 運行中的程式通知封鎖器
+ 運行中的程式通知封鎖
允許封鎖已選擇的運行中的通知
該清單將為每個正在運行中的通知自動植入封鎖程序.
然後,您可以決定是否封鎖運行中的通知下一次出現。請謹慎使用.
@@ -637,8 +644,8 @@
停用
標準
- 小寫字符
- 大寫字符
+ 小寫字符(僅英文有效)
+ 大寫字符(僅英文有效)
鎖定螢幕時的狀態列鎖定政策
@@ -672,18 +679,18 @@
%1$s 空閒
%1$s 已使用
- 最近執行的任務 RAM 欄
+ RAM 使用狀況欄
關閉
頂部
按鍵
- 近期按鍵單擊操作
- 近期按鍵長按操作
+ 近期鍵單擊操作
+ 近期鍵長按操作
- 顯示電池狀態弧線
- 鎖定螢幕狀態下在解鎖環附近顯示當前電量狀態弧線
+ 顯示電池狀態圓弧
+ 鎖定螢幕狀態下在解鎖環附近顯示當前電量狀態圓弧
切換手電筒
@@ -694,5 +701,110 @@
自動展開音量面板
+
+
+ 選單鍵
+ Home 鍵
+ 返回鍵
+ 近期鍵
+ 音量鍵
+ 其他設定
+ 長按操作
+ 單擊操作
+ 雙擊操作
+
+
+ 停用雙擊操作
+
+
+ 訊號顏色模式
+ 使用 GravityBox 圖示 (有支援訊號等級)
+ 使用預設圖示 (沒有支援訊號等級)
+ 不要套用顏色
+
+
+ 應用程式啟動器
+ 對話框允許最多 8 個應用程式分配到硬體按鍵操作上或是做為額外的海苔條按鍵
+ 應用程式槽 %d
+ 沒有應用程式被分配. 使用 GravityBox / 程式啟動器選單來分配應用程式.
+
+
+ 顯示程式啟動器按鍵
+
+
+ 顯示應用程式啟動器
+
+
+ 顯示自訂按鍵
+ 停用
+ 搜尋
+ 應用程式啟動器
+
+
+ Pie 控制顏色
+ 背景顏色
+ 前景顏色
+ 邊框顏色
+ 按鍵選中顏色
+ 文字顏色
+ 重設顏色
+
+
+ 啟用未知來電撥號者照片
+ 設定未知來電撥號者
+ 照片已更改
+ 照片未更改
+
+
+ 您的裝置可能不支援低於 20 的數值,如果您的裝置螢幕亮不起來,您可以按住音量鍵 + 至少 7 秒,然後將會還原亮度,並請設定較高的數值.
+
+
+ 一般
+ 海苔條按鍵
+ 顏色
+ 尺寸
+
+
+
+ 啟用海苔條顏色
+ 停用後需要重新啟動
+ 海苔條顏色
+ 海苔條光暈顏色
+ 海苔條背景顏色
+
+
+ 停用鎖定螢幕的陰影
+ 移除螢幕鎖定畫面深色色調
+
+
+ 透明度管理器模式
+ 重新啟動裝置
+ 停用
+ 狀態列
+ 海苔條
+ 兩者
+
+
+ 輔助訊號顏色
+ 覆蓋預設橘色訊號圖示
+ 輔助資料連接活動顏色
+ 設定輔助資料連接指示符顏色
+
+
+ 狀態列圖示風格
+ 套用於無聲,震動,報警等狀態圖示.
+ JellyBean
+ KitKat
+
+
+ 返回鍵雙擊操作
+
+
+ 前往桌面
+ 返回
+
+ 瓷貼風格
+ 僅適用於 GravityBox 所推出的瓷貼 (不支援系統預設的瓷貼)
+
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index d2722004b7..b2b341719e 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -20,6 +20,8 @@
- @string/battery_style_stock
- @string/battery_style_circle
- @string/battery_style_circle_percent
+ - @string/battery_style_kitkat
+ - @string/battery_style_kitkat_percent
- @string/battery_style_none
@@ -27,6 +29,8 @@
- 1
- 2
- 3
+ - 4
+ - 5
- 0
@@ -182,6 +186,60 @@
- gravitybox_tileview
+
+ - @string/qs_tile_user_profile
+ - @string/qs_tile_brightness
+ - @string/qs_tile_settings
+ - @string/qs_tile_wifi
+ - @string/qs_tile_data_usage
+ - @string/qs_tile_autorotation
+ - @string/qs_tile_battery
+ - @string/qs_tile_airplane_mode
+ - @string/qs_tile_bluetooth
+ - @string/qs_tile_gps
+ - @string/qs_tile_gps_alt
+ - @string/qs_tile_ringer_mode
+ - @string/qs_tile_volume
+ - @string/qs_tile_network_mode
+ - @string/qs_tile_sync
+ - @string/qs_tile_wifi_ap
+ - @string/qs_tile_torch
+ - @string/qs_tile_sleep
+ - @string/qs_tile_stay_awake
+ - @string/qs_tile_quickrecord
+ - @string/qs_tile_quickapp
+ - @string/qs_tile_expanded_desktop
+ - @string/qs_tile_screenshot
+ - @string/qs_tile_gravitybox
+
+
+
+ - user_textview
+ - brightness_textview
+ - settings
+ - wifi_textview
+ - rssi_textview
+ - auto_rotate_textview
+ - battery_textview
+ - airplane_mode_textview
+ - bluetooth_textview
+ - gps_textview
+ - gps_tileview
+ - ringer_mode_tileview
+ - volume_tileview
+ - network_mode_tileview
+ - sync_tileview
+ - wifi_ap_tileview
+ - torch_tileview
+ - sleep_tileview
+ - stay_awake_tileview
+ - quickrecord_tileview
+ - quickapp_tileview
+ - expanded_tileview
+ - screenshot_tileview
+ - gravitybox_tileview
+
+
- @string/qs_tile_wifi
- @string/qs_tile_bluetooth
@@ -216,9 +274,12 @@
- @string/hwkey_action_kill
- @string/hwkey_action_sleep
- @string/hwkey_action_recent_apps
+ - @string/hwkey_action_app_launcher
- @string/hwkey_action_custom_app
- @string/hwkey_action_custom_app2
- @string/hwkey_action_menu
+ - @string/hwkey_action_home
+ - @string/hwkey_action_back
- @string/hwkey_action_expanded_desktop
- @string/hwkey_action_torch
@@ -231,9 +292,12 @@
- 4
- 5
- 6
+ - 12
- 7
- 8
- 9
+ - 13
+ - 14
- 10
- 11
@@ -580,4 +644,52 @@
- 80
+
+ - @string/signal_color_mode_gb
+ - @string/signal_color_mode_stock
+ - @string/signal_color_mode_disabled
+
+
+
+ - 0
+ - 1
+ - 2
+
+
+
+ - @string/pie_custom_key_off
+ - @string/pie_custom_key_search
+ - @string/pie_custom_key_app_launcher
+
+
+
+ - 0
+ - 1
+ - 2
+
+
+
+ - @string/tm_mode_disabled
+ - @string/tm_mode_statusbar
+ - @string/tm_mode_navbar
+ - @string/tm_mode_full
+
+
+
+ - 0
+ - 1
+ - 2
+ - 3
+
+
+
+ - @string/icon_style_jb
+ - @string/icon_style_kk
+
+
+
+ - 0
+ - 1
+
+
diff --git a/res/values/colors.xml b/res/values/colors.xml
index a283d875e3..4bc88aa7c9 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -29,4 +29,9 @@
@android:color/holo_blue_light
+
+ #e8ffffff
+ #40ffffff
+ #ff000000
+
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 50b9b4bbe0..ed05c7c3c8 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -46,4 +46,8 @@
128dip
+
+ 180dp
+ 320dp
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d4956643ad..3c2abedda6 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -22,6 +22,8 @@
Stock battery indicator
Circle battery
Circle battery with percentage
+ KitKat battery
+ KitKat battery with percentage
Battery percent text
None
@@ -96,7 +98,7 @@
Wi-Fi
Wi-Fi off
Not connected
- Turning on...
+ Turning on…
Statusbar QuickSettings tiles
@@ -134,7 +136,7 @@
Statusbar background color
- Allows to set statusbar background color and transparency
+ Allows to set statusbar background color
Fix speech settings
@@ -158,7 +160,7 @@
Xposed framework
Coded by rovo89@XDA. Touch to visit official thread.
Donate
- Donate to me if you think this app is worth it! Also consider donating to rovo89 for his excellent Xposed framework.
+ Touch to support development by donating via PayPal
Your %s will reboot.
@@ -308,6 +310,10 @@
Expandable volume panel
Enables expandable volume panel with ability to set volumes for different streams
+
+ Fully expandable volume panel
+ Allows the volume panel to take up all the space provided
+
Link ringtone & notifications volumes
When disabled, volumes for ringtone and notifications can be set independently
@@ -377,7 +383,6 @@
Pie controls
Enable pie controls
- Show search button
Navigation key size
Trigger positions
Left screen border
@@ -401,9 +406,9 @@
Dithered Holo background
Replaces standard Holo background with dithered one to suppress color banding (requires reboot)
-
- Disable hardware keys
- Disables MENU, BACK, HOME while Pie Controls are enabled. HW keys actions will still work. (for devices having HW keys)
+
+ Disable navigation keys
+ Disables single-tap on keys while Pie Controls are enabled
Use Holo Dark theme
@@ -461,10 +466,11 @@
Transparency management
- Statusbar transparency for launcher
- Statusbar transparency for lockscreen
- Navbar transparency for launcher
- Navbar transparency for lockscreen
+ Manages transparency for statusbar and navigation bar
+ Statusbar for launcher
+ Statusbar for lockscreen
+ Navbar for launcher
+ Navbar for lockscreen
Hide alarm icon
@@ -711,4 +717,101 @@
Single-tap action
Double-tap action
+
+ Disable double-tap
+
+
+ Signal color mode
+ Use GravityBox icons (with signal level support)
+ Use stock icons (without signal level support)
+ Do not apply color
+
+
+ Application launcher
+ Dialog allowing to define up to 8 apps which can be assigned as HW Key Action or used as additional navigation bar key
+ Application slot %d
+ No apps assigned. Use GravityBox / Application launcher menu to assign apps.
+
+
+ Show app launcher key
+
+
+ Show application launcher
+
+
+ Show custom key
+ Disabled
+ Search
+ Application launcher
+
+
+ Pie colors
+ Background color
+ Foreground color
+ Outline color
+ Key selected color
+ Text color
+ Reset colors
+
+
+ Enable unknown caller photo
+ Set unknown caller photo
+ Photo changed
+ Photo not changed
+
+
+ Your screen might not support values lower than 20. If your screen doesn\'t light up,
+ hold Volume+ key for at least 7 seconds to reset brightness and then adjust minimum brightness to use higher values.
+
+
+ General
+ Navigation keys
+ Colors
+ Dimensions
+
+
+ Enable navbar colors
+ May require reboot after disabling
+ Navigation key color
+ Navigation key glow color
+ Navigation bar background color
+
+
+ Disable lockscreen shade
+ Removes dark tint from lockscreen
+
+
+ Transparency manager mode
+ Requires reboot
+ Disabled
+ Statusbar
+ Navigation bar
+ Both
+
+
+ Secondary signal color
+ Overrides stock orange signal icon
+ Secondary data activity color
+ Sets color for secondary data activity indicators
+
+
+ Status icon style
+ Applies to status icons like silent, vibrate, alarm, etc.
+ JellyBean
+ KitKat
+
+
+ Back key double-tap action
+
+
+ Go home
+ Go back
+
+
+ Tile style
+ Applies only to tiles introduced by GravityBox (does not affect stock tiles)
+
+
+ Adjust bottom margin
+
diff --git a/res/xml/gravitybox.xml b/res/xml/gravitybox.xml
index 8b3576feba..d1f4b94d16 100644
--- a/res/xml/gravitybox.xml
+++ b/res/xml/gravitybox.xml
@@ -103,6 +103,12 @@
android:summary="@string/pref_lockscreen_bg_image_summary"
android:order="3" />
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
@@ -377,10 +395,12 @@
android:entryValues="@array/pie_controls_enable_values"
android:defaultValue="0" />
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ monitorBoxUnit="%"
+ android:defaultValue="100" />
+ monitorBoxUnit="%"
+ android:defaultValue="100" />
-
+
-
+
-
+
+
+
+
+
+ monitorBoxUnit="%" />
+ monitorBoxUnit="%" />
+ monitorBoxUnit="%" />
-
+
@@ -761,6 +905,15 @@
android:summary="@string/caller_fullscreen_photo_summary"
android:defaultValue="false" />
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mAppSlots;
+ private View mAppView;
+
+ private static void log(String message) {
+ XposedBridge.log(TAG + ": " + message);
+ }
+
+ private Runnable mDismissAppDialogRunnable = new Runnable() {
+ @Override
+ public void run() {
+ dismissDialog();
+ }
+ };
+
+ private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (DEBUG) log("Broadcast received: " + intent.toString());
+
+ if (intent.getAction().equals(GravityBoxSettings.ACTION_PREF_APP_LAUNCHER_CHANGED)) {
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_APP_LAUNCHER_SLOT) &&
+ intent.hasExtra(GravityBoxSettings.EXTRA_APP_LAUNCHER_APP)) {
+ int slot = intent.getIntExtra(GravityBoxSettings.EXTRA_APP_LAUNCHER_SLOT, -1);
+ String app = intent.getStringExtra(GravityBoxSettings.EXTRA_APP_LAUNCHER_APP);
+ if (DEBUG) log("appSlot=" + slot + "; app=" + app);
+ updateAppSlot(slot, app);
+ }
+ }
+ }
+ };
+
+ public AppLauncher(Context context, XSharedPreferences prefs) {
+ mContext = context;
+ mResources = mContext.getResources();
+ try {
+ mGbContext = mContext.createPackageContext(
+ GravityBox.PACKAGE_NAME, Context.CONTEXT_IGNORE_SECURITY);
+ } catch (NameNotFoundException e) {
+ log("Error creating GB context: " + e.getMessage());
+ }
+ mHandler = new Handler();
+ mPm = mContext.getPackageManager();
+
+ mAppSlots = new ArrayList();
+ mAppSlots.add(new AppInfo(R.id.quickapp1));
+ mAppSlots.add(new AppInfo(R.id.quickapp2));
+ mAppSlots.add(new AppInfo(R.id.quickapp3));
+ mAppSlots.add(new AppInfo(R.id.quickapp4));
+ mAppSlots.add(new AppInfo(R.id.quickapp5));
+ mAppSlots.add(new AppInfo(R.id.quickapp6));
+ mAppSlots.add(new AppInfo(R.id.quickapp7));
+ mAppSlots.add(new AppInfo(R.id.quickapp8));
+
+ for (int i = 0; i < GravityBoxSettings.PREF_KEY_APP_LAUNCHER_SLOT.size(); i++) {
+ updateAppSlot(i, prefs.getString(
+ GravityBoxSettings.PREF_KEY_APP_LAUNCHER_SLOT.get(i), null));
+ }
+
+ IntentFilter intentFilter = new IntentFilter();
+ intentFilter.addAction(GravityBoxSettings.ACTION_PREF_APP_LAUNCHER_CHANGED);
+ mContext.registerReceiver(mBroadcastReceiver, intentFilter);
+ }
+
+ public boolean dismissDialog() {
+ boolean dismissed = false;
+ mHandler.removeCallbacks(mDismissAppDialogRunnable);
+ if (mDialog != null && mDialog.isShowing()) {
+ mDialog.dismiss();
+ dismissed = true;
+ }
+ return dismissed;
+ }
+
+ public void showDialog() {
+ try {
+ if (dismissDialog()) {
+ return;
+ }
+
+ if (mDialog == null) {
+ LayoutInflater inflater = LayoutInflater.from(mGbContext);
+ mAppView = inflater.inflate(R.layout.navbar_app_dialog, null);
+ mDialog = new Dialog(mContext);
+ mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+ mDialog.setContentView(mAppView);
+ mDialog.setCanceledOnTouchOutside(true);
+ mDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL);
+ int pf = XposedHelpers.getIntField(mDialog.getWindow().getAttributes(), "privateFlags");
+ pf |= 0x00000010;
+ XposedHelpers.setIntField(mDialog.getWindow().getAttributes(), "privateFlags", pf);
+ mDialog.getWindow().getAttributes().gravity = Gravity.BOTTOM;
+ }
+
+ View appRow1 = mAppView.findViewById(R.id.appRow1);
+ View appRow2 = mAppView.findViewById(R.id.appRow2);
+ View separator = mAppView.findViewById(R.id.separator);
+ int appCount = 0;
+ boolean appRow1Visible = false;
+ boolean appRow2Visible = false;
+ TextView lastVisible = null;
+ for (AppInfo ai : mAppSlots) {
+ TextView tv = (TextView) mAppView.findViewById(ai.getResId());
+ if (ai.getValue() == null) {
+ tv.setVisibility(View.GONE);
+ continue;
+ }
+
+ tv.setText(ai.getAppName());
+ tv.setTextSize(1, 10);
+ tv.setMaxLines(2);
+ tv.setEllipsize(TruncateAt.END);
+ tv.setCompoundDrawablesWithIntrinsicBounds(null, ai.getAppIcon(), null, null);
+ tv.setClickable(true);
+ tv.setOnClickListener(mAppOnClick);
+ tv.setVisibility(View.VISIBLE);
+ lastVisible = tv;
+
+ appRow1Visible |= ai.getResId() == R.id.quickapp1 || ai.getResId() == R.id.quickapp2 ||
+ ai.getResId() == R.id.quickapp3 || ai.getResId() == R.id.quickapp4;
+ appRow2Visible |= ai.getResId() == R.id.quickapp5 || ai.getResId() == R.id.quickapp6 ||
+ ai.getResId() == R.id.quickapp7 || ai.getResId() == R.id.quickapp8;
+
+ appCount++;
+ }
+
+ if (appCount == 0) {
+ Toast.makeText(mContext, mGbContext.getString(R.string.app_launcher_no_apps),
+ Toast.LENGTH_LONG).show();
+ } else if (appCount == 1) {
+ mAppOnClick.onClick(lastVisible);
+ } else {
+ appRow1.setVisibility(appRow1Visible ? View.VISIBLE : View.GONE);
+ appRow2.setVisibility(appRow2Visible ? View.VISIBLE : View.GONE);
+ separator.setVisibility(appRow1Visible && appRow2Visible ?
+ View.VISIBLE : View.GONE);
+ mDialog.show();
+ mHandler.postDelayed(mDismissAppDialogRunnable, 4000);
+ }
+ } catch (Throwable t) {
+ log("Error opening app launcher dialog: " + t.getMessage());
+ }
+ }
+
+ private View.OnClickListener mAppOnClick = new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ dismissDialog();
+
+ AppInfo aiProcessing = null;
+ try {
+ for(AppInfo ai : mAppSlots) {
+ aiProcessing = ai;
+ if (v.getId() == ai.getResId()) {
+ startActivity(v.getContext(), ai.getIntent());
+ return;
+ }
+ }
+ aiProcessing = null;
+ } catch (Exception e) {
+ log("Unable to start activity: " + e.getMessage());
+ if (aiProcessing != null) {
+ aiProcessing.initAppInfo(null);
+ }
+ }
+ }
+ };
+
+ private void startActivity(Context context, Intent intent) {
+ intent.setAction(Intent.ACTION_MAIN);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ context.startActivity(intent);
+ }
+
+ private void updateAppSlot(int slot, String value) {
+ AppInfo ai = mAppSlots.get(slot);
+ if (ai.getValue() == null || !ai.getValue().equals(value)) {
+ ai.initAppInfo(value);
+ }
+ }
+
+ private final class AppInfo {
+ private String mPackageName;
+ private String mClassName;
+ private String mAppName;
+ private Drawable mAppIcon;
+ private String mValue;
+ private int mResId;
+
+ public AppInfo(int resId) {
+ mResId = resId;
+ }
+
+ public int getResId() {
+ return mResId;
+ }
+
+ public String getAppName() {
+ return mAppName;
+ }
+
+ public Drawable getAppIcon() {
+ return (mAppIcon == null ?
+ mResources.getDrawable(android.R.drawable.ic_menu_help) : mAppIcon);
+ }
+
+ public String getValue() {
+ return mValue;
+ }
+
+ public Intent getIntent() {
+ if (mPackageName == null || mClassName == null) return null;
+
+ Intent i = new Intent();
+ i.setClassName(mPackageName, mClassName);
+ return i;
+ }
+
+ private void reset() {
+ mValue = mPackageName = mClassName = mAppName = null;
+ mAppIcon = null;
+ }
+
+ public void initAppInfo(String value) {
+ mValue = value;
+ if (mValue == null) {
+ reset();
+ return;
+ }
+
+ try {
+ String[] splitValue = value.split(SEPARATOR);
+ mPackageName = splitValue[0];
+ mClassName = splitValue[1];
+ ComponentName cn = new ComponentName(mPackageName, mClassName);
+ ActivityInfo ai = mPm.getActivityInfo(cn, 0);
+ mAppName = ai.loadLabel(mPm).toString();
+ Bitmap appIcon = ((BitmapDrawable)ai.loadIcon(mPm)).getBitmap();
+ int sizePx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 40,
+ mResources.getDisplayMetrics());
+ Bitmap scaledIcon = Bitmap.createScaledBitmap(appIcon, sizePx, sizePx, true);
+ mAppIcon = new BitmapDrawable(mResources, scaledIcon);
+ if (DEBUG) log("AppInfo initialized for: " + getAppName());
+ } catch (NameNotFoundException e) {
+ log("App not found: " + ((mPackageName == null) ? "NULL" : mPackageName.toString()));
+ reset();
+ } catch (Exception e) {
+ log("Unexpected error: " + e.getMessage());
+ reset();
+ }
+ }
+ }
+}
diff --git a/src/com/ceco/gm2/gravitybox/BackgroundAlphaColorDrawable.java b/src/com/ceco/gm2/gravitybox/BackgroundAlphaColorDrawable.java
index 1d41eb090b..08a313f2f9 100644
--- a/src/com/ceco/gm2/gravitybox/BackgroundAlphaColorDrawable.java
+++ b/src/com/ceco/gm2/gravitybox/BackgroundAlphaColorDrawable.java
@@ -34,9 +34,6 @@ public BackgroundAlphaColorDrawable(int bgColor) {
}
public void setBgColor(int color) {
- if (color < 0) {
- color = Color.BLACK;
- }
mBgColor = color;
updateColor();
}
diff --git a/src/com/ceco/gm2/gravitybox/CmCircleBattery.java b/src/com/ceco/gm2/gravitybox/CmCircleBattery.java
index a37ad3bfd5..8031e46bfc 100644
--- a/src/com/ceco/gm2/gravitybox/CmCircleBattery.java
+++ b/src/com/ceco/gm2/gravitybox/CmCircleBattery.java
@@ -16,6 +16,10 @@
package com.ceco.gm2.gravitybox;
+import com.ceco.gm2.gravitybox.StatusBarIconManager.ColorInfo;
+import com.ceco.gm2.gravitybox.StatusBarIconManager.IconManagerListener;
+
+import de.robv.android.xposed.XposedBridge;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -30,12 +34,18 @@
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.BatteryManager;
+import android.os.Build;
import android.os.Handler;
import android.util.AttributeSet;
+import android.util.TypedValue;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
-public class CmCircleBattery extends ImageView {
+public class CmCircleBattery extends ImageView implements IconManagerListener {
+ private static final String TAG = "GB:CircleBattery";
+ private static final String PACKAGE_NAME = "com.android.systemui";
+ private static final boolean DEBUG = false;
+
private Handler mHandler;
private Context mContext;
private BatteryReceiver mBatteryReceiver = null;
@@ -66,6 +76,10 @@ public class CmCircleBattery extends ImageView {
private Paint mPaintSystem;
private Paint mPaintRed;
+ private static void log(String message) {
+ XposedBridge.log(TAG + ": " + message);
+ }
+
// runnable to invalidate view via mHandler.postDelayed() call
private final Runnable mInvalidate = new Runnable() {
public void run() {
@@ -158,8 +172,9 @@ public CmCircleBattery(Context context, AttributeSet attrs, int defStyle) {
mPaintSystem = new Paint(mPaintFont);
mPaintRed = new Paint(mPaintFont);
- mPaintFont.setColor(res.getColor(android.R.color.holo_blue_dark));
- mPaintSystem.setColor(res.getColor(android.R.color.holo_blue_dark));
+ mPaintFont.setColor(Build.VERSION.SDK_INT > 18 ? Color.WHITE :
+ res.getColor(android.R.color.holo_blue_dark));
+ mPaintSystem.setColor(mPaintFont.getColor());
// could not find the darker definition anywhere in resources
// do not want to use static 0x404040 color value. would break theming.
mPaintGray.setColor(res.getColor(android.R.color.darker_gray));
@@ -327,18 +342,29 @@ private void initSizeBasedStuff() {
* statusbar for all resolutions
*/
private void initSizeMeasureIconHeight() {
- int wifiIconId =
- getResources().getIdentifier("stat_sys_wifi_signal_4_fully", "drawable", "com.android.systemui");
- final Bitmap measure = BitmapFactory.decodeResource(getResources(), wifiIconId);
- final int x = measure.getWidth() / 2;
-
- mCircleSize = 2;
- for (int y = 0; y < measure.getHeight(); y++) {
- int alpha = Color.alpha(measure.getPixel(x, y));
- if (alpha > 5) {
- mCircleSize++;
+ final Resources res = getResources();
+ final int minSize = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ 15, res.getDisplayMetrics());
+ try {
+ final int batteryIconId =
+ res.getIdentifier("stat_sys_battery_100", "drawable", PACKAGE_NAME);
+ final Bitmap measure = BitmapFactory.decodeResource(res, batteryIconId);
+ final int x = measure.getWidth() / 2;
+ mCircleSize = 0;
+ for (int y = 0; y < measure.getHeight(); y++) {
+ int alpha = Color.alpha(measure.getPixel(x, y));
+ if (alpha > 5) {
+ mCircleSize++;
+ }
}
+ if (mCircleSize < minSize) {
+ mCircleSize = minSize;
+ }
+ } catch (Throwable t) {
+ log("Error determining Circle Battery size from battery icon: " + t.getMessage());
+ mCircleSize = minSize;
}
+ if (DEBUG) log("mCircleSize = " + mCircleSize + "px");
}
public void setColor(int color) {
@@ -355,4 +381,14 @@ public void setLowProfile(boolean lightsOut) {
mPaintRed.setAlpha(alpha);
invalidate();
}
+
+ @Override
+ public void onIconManagerStatusChanged(int flags, ColorInfo colorInfo) {
+ if ((flags & StatusBarIconManager.FLAG_ICON_COLOR_CHANGED) != 0) {
+ setColor(colorInfo.coloringEnabled ?
+ colorInfo.iconColor[0] : colorInfo.defaultIconColor);
+ } else if ((flags & StatusBarIconManager.FLAG_LOW_PROFILE_CHANGED) != 0) {
+ setLowProfile(colorInfo.lowProfile);
+ }
+ }
}
diff --git a/src/com/ceco/gm2/gravitybox/ConnectivityServiceWrapper.java b/src/com/ceco/gm2/gravitybox/ConnectivityServiceWrapper.java
index e14ca53442..31c7bafbcd 100644
--- a/src/com/ceco/gm2/gravitybox/ConnectivityServiceWrapper.java
+++ b/src/com/ceco/gm2/gravitybox/ConnectivityServiceWrapper.java
@@ -31,6 +31,8 @@ public class ConnectivityServiceWrapper {
public static final String ACTION_SET_MOBILE_DATA_ENABLED =
"gravitybox.intent.action.SET_MOBILE_DATA_ENABLED";
+ public static final String ACTION_XPERIA_MOBILE_DATA_TOGGLE =
+ "com.android.phone.intent.ACTION_DATA_TRAFFIC_SWITCH";
public static final String EXTRA_ENABLED = "enabled";
private static Object mConnectivityService;
@@ -64,9 +66,15 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
Context context = (Context) XposedHelpers.getObjectField(
param.thisObject, "mContext");
- IntentFilter intentFilter = new IntentFilter();
- intentFilter.addAction(ACTION_SET_MOBILE_DATA_ENABLED);
- context.registerReceiver(mBroadcastReceiver, intentFilter);
+ if (context == null && param.args.length != 0) {
+ context = (Context) param.args[0];
+ }
+
+ if (context != null) {
+ IntentFilter intentFilter = new IntentFilter();
+ intentFilter.addAction(ACTION_SET_MOBILE_DATA_ENABLED);
+ context.registerReceiver(mBroadcastReceiver, intentFilter);
+ }
}
});
} catch (Throwable t) {
diff --git a/src/com/ceco/gm2/gravitybox/GravityBox.java b/src/com/ceco/gm2/gravitybox/GravityBox.java
index 167f832006..d170ad41ed 100644
--- a/src/com/ceco/gm2/gravitybox/GravityBox.java
+++ b/src/com/ceco/gm2/gravitybox/GravityBox.java
@@ -42,6 +42,7 @@ public void initZygote(StartupParam startupParam) throws Throwable {
XposedBridge.log("GB:Device model: " + Build.MODEL);
XposedBridge.log("GB:Device type: " + (Utils.isTablet() ? "tablet" : "phone"));
XposedBridge.log("GB:Is MTK device: " + Utils.isMtkDevice());
+ XposedBridge.log("GB:Is Xperia device: " + Utils.isXperiaDevice());
XposedBridge.log("GB:Has telephony support: " + Utils.hasTelephonySupport());
XposedBridge.log("GB:Has Gemini support: " + Utils.hasGeminiSupport());
XposedBridge.log("GB:Android SDK: " + Build.VERSION.SDK_INT);
@@ -69,21 +70,25 @@ public void initZygote(StartupParam startupParam) throws Throwable {
if (Build.VERSION.SDK_INT > 16) {
FixTraceFlood.initZygote();
ModElectronBeam.initZygote(prefs);
- ModLockscreen.initZygote(prefs);
+ if (Build.VERSION.SDK_INT < 19) {
+ ModLockscreen.init(prefs, null);
+ }
}
// Common
ModVolumeKeySkipTrack.init(prefs);
ModVolKeyCursor.initZygote(prefs);
- ModCallCard.initZygote();
ModStatusbarColor.initZygote(prefs);
PhoneWrapper.initZygote(prefs);
ModLowBatteryWarning.initZygote(prefs);
ModDisplay.initZygote(prefs);
ModAudio.initZygote(prefs);
ModHwKeys.initZygote(prefs);
- PatchMasterKey.initZygote();
- ModPhone.initZygote(prefs);
+ if (Build.VERSION.SDK_INT < 19) {
+ PatchMasterKey.initZygote();
+ ModCallCard.initZygote();
+ ModPhone.initZygote(prefs);
+ }
ModExpandedDesktop.initZygote(prefs);
ConnectivityServiceWrapper.initZygote();
}
@@ -105,6 +110,13 @@ public void handleInitPackageResources(InitPackageResourcesParam resparam) throw
if (Build.VERSION.SDK_INT > 16 && resparam.packageName.equals(ModQuickSettings.PACKAGE_NAME)) {
ModQuickSettings.initResources(prefs, resparam);
}
+
+ // KitKat
+ if (Build.VERSION.SDK_INT > 18) {
+ if (resparam.packageName.equals(ModLockscreen.PACKAGE_NAME)) {
+ ModLockscreen.initPackageResources(prefs, resparam);
+ }
+ }
}
@Override
@@ -116,7 +128,7 @@ public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
// MTK Specific
if (Utils.isMtkDevice()) {
- if (Utils.hasGeminiSupport() &&
+ if (Utils.hasGeminiSupport() && !Utils.isMt6572Device() &&
lpparam.packageName.equals(ModSignalIconHide.PACKAGE_NAME)) {
ModSignalIconHide.init(prefs, lpparam.classLoader);
}
@@ -183,7 +195,7 @@ public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
ModPowerMenu.init(prefs, lpparam.classLoader);
}
- if (lpparam.packageName.equals(ModCallCard.PACKAGE_NAME)) {
+ if (Build.VERSION.SDK_INT < 19 && lpparam.packageName.equals(ModCallCard.PACKAGE_NAME)) {
ModCallCard.init(prefs, lpparam.classLoader);
}
@@ -199,7 +211,7 @@ public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
ModStatusBar.init(prefs, lpparam.classLoader);
}
- if (lpparam.packageName.equals(ModPhone.PACKAGE_NAME) &&
+ if (Build.VERSION.SDK_INT < 19 && lpparam.packageName.equals(ModPhone.PACKAGE_NAME) &&
Utils.hasTelephonySupport()) {
ModPhone.init(prefs, lpparam.classLoader);
}
@@ -221,8 +233,15 @@ public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
ModNavigationBar.init(prefs, lpparam.classLoader);
}
- if (lpparam.packageName.equals(ModMms.PACKAGE_NAME)) {
+ if (Build.VERSION.SDK_INT < 19 && lpparam.packageName.equals(ModMms.PACKAGE_NAME)) {
ModMms.init(prefs, lpparam.classLoader);
}
+
+ // KitKat
+ if (Build.VERSION.SDK_INT > 18) {
+ if (lpparam.packageName.equals(ModLockscreen.PACKAGE_NAME)) {
+ ModLockscreen.init(prefs, lpparam.classLoader);
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/com/ceco/gm2/gravitybox/GravityBoxSettings.java b/src/com/ceco/gm2/gravitybox/GravityBoxSettings.java
index c0b2ad4152..1250f079c7 100644
--- a/src/com/ceco/gm2/gravitybox/GravityBoxSettings.java
+++ b/src/com/ceco/gm2/gravitybox/GravityBoxSettings.java
@@ -60,6 +60,7 @@
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Rect;
@@ -69,6 +70,7 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String PREF_KEY_QUICK_SETTINGS = "pref_quick_settings2";
public static final String PREF_KEY_QUICK_SETTINGS_TILE_ORDER = "pref_qs_tile_order";
public static final String PREF_KEY_QUICK_SETTINGS_TILES_PER_ROW = "pref_qs_tiles_per_row";
+ public static final String PREF_KEY_QUICK_SETTINGS_TILE_STYLE = "pref_qs_tile_style";
public static final String PREF_KEY_QUICK_SETTINGS_AUTOSWITCH = "pref_auto_switch_qs";
public static final String PREF_KEY_QUICK_PULLDOWN = "pref_quick_pulldown";
public static final int QUICK_PULLDOWN_OFF = 0;
@@ -80,6 +82,8 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final int BATTERY_STYLE_STOCK = 1;
public static final int BATTERY_STYLE_CIRCLE = 2;
public static final int BATTERY_STYLE_CIRCLE_PERCENT = 3;
+ public static final int BATTERY_STYLE_KITKAT = 4;
+ public static final int BATTERY_STYLE_KITKAT_PERCENT = 5;
public static final int BATTERY_STYLE_NONE = 0;
public static final String PREF_KEY_LOW_BATTERY_WARNING_POLICY = "pref_low_battery_warning_policy";
@@ -101,6 +105,7 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String PREF_KEY_RECENTS_CLEAR_ALL = "pref_recents_clear_all2";
public static final String PREF_KEY_RAMBAR = "pref_rambar";
public static final String PREF_KEY_RECENTS_CLEAR_MARGIN_TOP = "pref_recent_clear_margin_top";
+ public static final String PREF_KEY_RECENTS_CLEAR_MARGIN_BOTTOM = "pref_recent_clear_margin_bottom";
public static final int RECENT_CLEAR_OFF = 0;
public static final int RECENT_CLEAR_TOP_LEFT = 51;
public static final int RECENT_CLEAR_TOP_RIGHT = 53;
@@ -109,6 +114,8 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String PREF_CAT_KEY_PHONE = "pref_cat_phone";
public static final String PREF_KEY_CALLER_FULLSCREEN_PHOTO = "pref_caller_fullscreen_photo";
+ public static final String PREF_KEY_CALLER_UNKNOWN_PHOTO_ENABLE = "pref_caller_unknown_photo_enable";
+ public static final String PREF_KEY_CALLER_UNKNOWN_PHOTO = "pref_caller_unknown_photo";
public static final String PREF_KEY_ROAMING_WARNING_DISABLE = "pref_roaming_warning_disable";
public static final String PREF_KEY_NATIONAL_ROAMING = "pref_national_roaming";
public static final String PREF_CAT_KEY_FIXES = "pref_cat_fixes";
@@ -119,12 +126,18 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String PREF_KEY_FIX_CALENDAR = "pref_fix_calendar";
public static final String PREF_CAT_KEY_STATUSBAR = "pref_cat_statusbar";
public static final String PREF_CAT_KEY_STATUSBAR_QS = "pref_cat_statusbar_qs";
+ public static final String PREF_CAT_KEY_STATUSBAR_COLORS = "pref_cat_statusbar_colors";
public static final String PREF_KEY_STATUSBAR_BGCOLOR = "pref_statusbar_bgcolor2";
public static final String PREF_KEY_STATUSBAR_COLOR_FOLLOW_STOCK_BATTERY = "pref_sbcolor_follow_stock_battery";
public static final String PREF_KEY_STATUSBAR_ICON_COLOR_ENABLE = "pref_statusbar_icon_color_enable";
public static final String PREF_KEY_STATUSBAR_ICON_COLOR = "pref_statusbar_icon_color";
+ public static final String PREF_KEY_STATUS_ICON_STYLE = "pref_status_icon_style";
+ public static final String PREF_KEY_STATUSBAR_ICON_COLOR_SECONDARY = "pref_statusbar_icon_color_secondary";
public static final String PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR = "pref_statusbar_data_activity_color";
+ public static final String PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR_SECONDARY =
+ "pref_statusbar_data_activity_color_secondary";
public static final String PREF_KEY_STATUSBAR_COLOR_SKIP_BATTERY = "pref_statusbar_color_skip_battery";
+ public static final String PREF_KEY_STATUSBAR_SIGNAL_COLOR_MODE = "pref_statusbar_signal_color_mode";
public static final String PREF_KEY_STATUSBAR_CENTER_CLOCK = "pref_statusbar_center_clock";
public static final String PREF_KEY_STATUSBAR_CLOCK_DOW = "pref_statusbar_clock_dow2";
public static final int DOW_DISABLED = 0;
@@ -135,6 +148,8 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String PREF_KEY_STATUSBAR_CLOCK_HIDE = "pref_clock_hide";
public static final String PREF_KEY_STATUSBAR_CLOCK_LINK = "pref_clock_link_app";
public static final String PREF_KEY_ALARM_ICON_HIDE = "pref_alarm_icon_hide";
+ public static final String PREF_CAT_KEY_TRANSPARENCY_MANAGER = "pref_cat_transparency_manager";
+ public static final String PREF_KEY_TM_MODE = "pref_tm_mode";
public static final String PREF_KEY_TM_STATUSBAR_LAUNCHER = "pref_tm_statusbar_launcher";
public static final String PREF_KEY_TM_STATUSBAR_LOCKSCREEN = "pref_tm_statusbar_lockscreen";
public static final String PREF_KEY_TM_NAVBAR_LAUNCHER = "pref_tm_navbar_launcher";
@@ -159,10 +174,10 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String PREF_KEY_LOCKSCREEN_BACKGROUND = "pref_lockscreen_background";
public static final String PREF_KEY_LOCKSCREEN_BACKGROUND_COLOR = "pref_lockscreen_bg_color";
public static final String PREF_KEY_LOCKSCREEN_BACKGROUND_IMAGE = "pref_lockscreen_bg_image";
+ public static final String PREF_KEY_LOCKSCREEN_SHADE_DISABLE = "pref_lockscreen_shade_disable";
public static final String LOCKSCREEN_BG_DEFAULT = "default";
public static final String LOCKSCREEN_BG_COLOR = "color";
public static final String LOCKSCREEN_BG_IMAGE = "image";
- private static final int LOCKSCREEN_BACKGROUND = 1024;
public static final String PREF_KEY_LOCKSCREEN_BATTERY_ARC = "pref_lockscreen_battery_arc";
public static final String PREF_KEY_LOCKSCREEN_MAXIMIZE_WIDGETS = "pref_lockscreen_maximize_widgets";
@@ -199,10 +214,12 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String PREF_KEY_MUSIC_VOLUME_STEPS = "pref_music_volume_steps";
public static final String PREF_KEY_SAFE_MEDIA_VOLUME = "pref_safe_media_volume";
public static final String PREF_KEY_VOLUME_PANEL_EXPANDABLE = "pref_volume_panel_expandable";
+ public static final String PREF_KEY_VOLUME_PANEL_FULLY_EXPANDABLE = "pref_volume_panel_expand_fully";
public static final String PREF_KEY_VOLUME_PANEL_AUTOEXPAND = "pref_volume_panel_autoexpand";
public static final String PREF_KEY_VOLUME_ADJUST_MUTE = "pref_volume_adjust_mute";
public static final String ACTION_PREF_VOLUME_PANEL_MODE_CHANGED = "gravitybox.intent.action.VOLUME_PANEL_MODE_CHANGED";
public static final String EXTRA_EXPANDABLE = "expandable";
+ public static final String EXTRA_EXPANDABLE_FULLY = "expandable_fully";
public static final String EXTRA_AUTOEXPAND = "autoExpand";
public static final String EXTRA_MUTED = "muted";
public static final String PREF_KEY_LINK_VOLUMES = "pref_link_volumes";
@@ -215,9 +232,11 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String PREF_KEY_HWKEY_MENU_DOUBLETAP = "pref_hwkey_menu_doubletap";
public static final String PREF_CAT_HWKEY_HOME = "pref_cat_hwkey_home";
public static final String PREF_KEY_HWKEY_HOME_LONGPRESS = "pref_hwkey_home_longpress";
+ public static final String PREF_KEY_HWKEY_HOME_DOUBLETAP_DISABLE = "pref_hwkey_home_doubletap_disable";
public static final String PREF_KEY_HWKEY_HOME_LONGPRESS_KEYGUARD = "pref_hwkey_home_longpress_keyguard";
public static final String PREF_CAT_HWKEY_BACK = "pref_cat_hwkey_back";
public static final String PREF_KEY_HWKEY_BACK_LONGPRESS = "pref_hwkey_back_longpress";
+ public static final String PREF_KEY_HWKEY_BACK_DOUBLETAP = "pref_hwkey_back_doubletap";
public static final String PREF_CAT_HWKEY_RECENTS = "pref_cat_hwkey_recents";
public static final String PREF_KEY_HWKEY_RECENTS_SINGLETAP = "pref_hwkey_recents_singletap";
public static final String PREF_KEY_HWKEY_RECENTS_LONGPRESS = "pref_hwkey_recents_longpress";
@@ -239,18 +258,24 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final int HWKEY_ACTION_MENU = 9;
public static final int HWKEY_ACTION_EXPANDED_DESKTOP = 10;
public static final int HWKEY_ACTION_TORCH = 11;
+ public static final int HWKEY_ACTION_APP_LAUNCHER = 12;
+ public static final int HWKEY_ACTION_HOME = 13;
+ public static final int HWKEY_ACTION_BACK = 14;
public static final int HWKEY_DOUBLETAP_SPEED_DEFAULT = 400;
public static final int HWKEY_KILL_DELAY_DEFAULT = 1000;
public static final String ACTION_PREF_HWKEY_MENU_LONGPRESS_CHANGED = "gravitybox.intent.action.HWKEY_MENU_LONGPRESS_CHANGED";
public static final String ACTION_PREF_HWKEY_MENU_DOUBLETAP_CHANGED = "gravitybox.intent.action.HWKEY_MENU_DOUBLETAP_CHANGED";
public static final String ACTION_PREF_HWKEY_HOME_LONGPRESS_CHANGED = "gravitybox.intent.action.HWKEY_HOME_LONGPRESS_CHANGED";
+ public static final String ACTION_PREF_HWKEY_HOME_DOUBLETAP_CHANGED = "gravitybox.intent.action.HWKEY_HOME_DOUBLETAP_CHANGED";
public static final String ACTION_PREF_HWKEY_BACK_LONGPRESS_CHANGED = "gravitybox.intent.action.HWKEY_BACK_LONGPRESS_CHANGED";
+ public static final String ACTION_PREF_HWKEY_BACK_DOUBLETAP_CHANGED = "gravitybox.intent.action.HWKEY_BACK_DOUBLETAP_CHANGED";
public static final String ACTION_PREF_HWKEY_RECENTS_SINGLETAP_CHANGED = "gravitybox.intent.action.HWKEY_RECENTS_SINGLETAP_CHANGED";
public static final String ACTION_PREF_HWKEY_RECENTS_LONGPRESS_CHANGED = "gravitybox.intent.action.HWKEY_RECENTS_LONGPRESS_CHANGED";
public static final String ACTION_PREF_HWKEY_DOUBLETAP_SPEED_CHANGED = "gravitybox.intent.action.HWKEY_DOUBLETAP_SPEED_CHANGED";
public static final String ACTION_PREF_HWKEY_KILL_DELAY_CHANGED = "gravitybox.intent.action.HWKEY_KILL_DELAY_CHANGED";
public static final String ACTION_PREF_VOLUME_ROCKER_WAKE_CHANGED = "gravitybox.intent.action.VOLUME_ROCKER_WAKE_CHANGED";
public static final String EXTRA_HWKEY_VALUE = "hwKeyValue";
+ public static final String EXTRA_HWKEY_HOME_DOUBLETAP_DISABLE = "hwKeyHomeDoubletapDisable";
public static final String EXTRA_HWKEY_HOME_LONGPRESS_KG = "hwKeyHomeLongpressKeyguard";
public static final String EXTRA_VOLUME_ROCKER_WAKE_DISABLE = "volumeRockerWakeDisable";
@@ -276,8 +301,6 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String NOTIF_BG_IMAGE = "image";
public static final String NOTIF_BG_COLOR_MODE_OVERLAY = "overlay";
public static final String NOTIF_BG_COLOR_MODE_UNDERLAY = "underlay";
- private static final int NOTIF_BG_IMAGE_PORTRAIT = 1025;
- private static final int NOTIF_BG_IMAGE_LANDSCAPE = 1026;
public static final String ACTION_NOTIF_BACKGROUND_CHANGED = "gravitybox.intent.action.NOTIF_BACKGROUND_CHANGED";
public static final String EXTRA_BG_TYPE = "bgType";
public static final String EXTRA_BG_COLOR = "bgColor";
@@ -285,20 +308,34 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String EXTRA_BG_ALPHA = "bgAlpha";
public static final String PREF_KEY_PIE_CONTROL_ENABLE = "pref_pie_control_enable2";
- public static final String PREF_KEY_PIE_CONTROL_SEARCH = "pref_pie_control_search";
+ public static final String PREF_KEY_PIE_CONTROL_CUSTOM_KEY = "pref_pie_control_custom_key";
public static final String PREF_KEY_PIE_CONTROL_MENU = "pref_pie_control_menu";
public static final String PREF_KEY_PIE_CONTROL_TRIGGERS = "pref_pie_control_trigger_positions";
public static final String PREF_KEY_PIE_CONTROL_TRIGGER_SIZE = "pref_pie_control_trigger_size";
public static final String PREF_KEY_PIE_CONTROL_SIZE = "pref_pie_control_size";
public static final String PREF_KEY_HWKEYS_DISABLE = "pref_hwkeys_disable";
+ public static final String PREF_KEY_PIE_COLOR_BG = "pref_pie_color_bg";
+ public static final String PREF_KEY_PIE_COLOR_FG = "pref_pie_color_fg";
+ public static final String PREF_KEY_PIE_COLOR_OUTLINE = "pref_pie_color_outline";
+ public static final String PREF_KEY_PIE_COLOR_SELECTED = "pref_pie_color_selected";
+ public static final String PREF_KEY_PIE_COLOR_TEXT = "pref_pie_color_text";
+ public static final String PREF_KEY_PIE_COLOR_RESET = "pref_pie_color_reset";
+ public static final int PIE_CUSTOM_KEY_OFF = 0;
+ public static final int PIE_CUSTOM_KEY_SEARCH = 1;
+ public static final int PIE_CUSTOM_KEY_APP_LAUNCHER = 2;
public static final String ACTION_PREF_PIE_CHANGED = "gravitybox.intent.action.PREF_PIE_CHANGED";
public static final String EXTRA_PIE_ENABLE = "pieEnable";
- public static final String EXTRA_PIE_SEARCH = "pieSearch";
+ public static final String EXTRA_PIE_CUSTOM_KEY_MODE = "pieCustomKeyMode";
public static final String EXTRA_PIE_MENU = "pieMenu";
public static final String EXTRA_PIE_TRIGGERS = "pieTriggers";
public static final String EXTRA_PIE_TRIGGER_SIZE = "pieTriggerSize";
public static final String EXTRA_PIE_SIZE = "pieSize";
public static final String EXTRA_PIE_HWKEYS_DISABLE = "hwKeysDisable";
+ public static final String EXTRA_PIE_COLOR_BG = "pieColorBg";
+ public static final String EXTRA_PIE_COLOR_FG = "pieColorFg";
+ public static final String EXTRA_PIE_COLOR_OUTLINE = "pieColorOutline";
+ public static final String EXTRA_PIE_COLOR_SELECTED = "pieColorSelected";
+ public static final String EXTRA_PIE_COLOR_TEXT = "pieColorText";
public static final String PREF_KEY_BUTTON_BACKLIGHT_MODE = "pref_button_backlight_mode";
public static final String PREF_KEY_BUTTON_BACKLIGHT_NOTIFICATIONS = "pref_button_backlight_notifications";
@@ -332,8 +369,12 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String EXTRA_SB_COLOR_FOLLOW = "sbColorFollow";
public static final String EXTRA_SB_ICON_COLOR_ENABLE = "iconColorEnable";
public static final String EXTRA_SB_ICON_COLOR = "iconColor";
+ public static final String EXTRA_SB_ICON_STYLE = "iconStyle";
+ public static final String EXTRA_SB_ICON_COLOR_SECONDARY = "iconColorSecondary";
public static final String EXTRA_SB_DATA_ACTIVITY_COLOR = "dataActivityColor";
+ public static final String EXTRA_SB_DATA_ACTIVITY_COLOR_SECONDARY = "dataActivityColorSecondary";
public static final String EXTRA_SB_COLOR_SKIP_BATTERY = "skipBattery";
+ public static final String EXTRA_SB_SIGNAL_COLOR_MODE = "signalColorMode";
public static final String EXTRA_TM_SB_LAUNCHER = "tmSbLauncher";
public static final String EXTRA_TM_SB_LOCKSCREEN = "tmSbLockscreen";
public static final String EXTRA_TM_NB_LAUNCHER = "tmNbLauncher";
@@ -344,6 +385,7 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String EXTRA_QS_COLS = "qsCols";
public static final String EXTRA_QS_AUTOSWITCH = "qsAutoSwitch";
public static final String EXTRA_QUICK_PULLDOWN = "quickPulldown";
+ public static final String EXTRA_QS_TILE_STYLE = "qsTileStyle";
public static final String ACTION_PREF_CLOCK_CHANGED = "gravitybox.intent.action.CENTER_CLOCK_CHANGED";
public static final String EXTRA_CENTER_CLOCK = "centerClock";
@@ -356,17 +398,30 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String ACTION_PREF_SAFE_MEDIA_VOLUME_CHANGED = "gravitybox.intent.action.SAFE_MEDIA_VOLUME_CHANGED";
public static final String EXTRA_SAFE_MEDIA_VOLUME_ENABLED = "enabled";
+ public static final String PREF_CAT_KEY_NAVBAR_KEYS = "pref_cat_navbar_keys";
+ public static final String PREF_CAT_KEY_NAVBAR_COLOR = "pref_cat_navbar_color";
+ public static final String PREF_CAT_KEY_NAVBAR_DIMEN = "pref_cat_navbar_dimen";
public static final String PREF_KEY_NAVBAR_OVERRIDE = "pref_navbar_override";
public static final String PREF_KEY_NAVBAR_ENABLE = "pref_navbar_enable";
public static final String PREF_KEY_NAVBAR_HEIGHT = "pref_navbar_height";
public static final String PREF_KEY_NAVBAR_HEIGHT_LANDSCAPE = "pref_navbar_height_landscape";
public static final String PREF_KEY_NAVBAR_WIDTH = "pref_navbar_width";
public static final String PREF_KEY_NAVBAR_MENUKEY = "pref_navbar_menukey";
+ public static final String PREF_KEY_NAVBAR_LAUNCHER_ENABLE = "pref_navbar_launcher_enable";
+ public static final String PREF_KEY_NAVBAR_COLOR_ENABLE = "pref_navbar_color_enable";
+ public static final String PREF_KEY_NAVBAR_KEY_COLOR = "pref_navbar_key_color";
+ public static final String PREF_KEY_NAVBAR_KEY_GLOW_COLOR = "pref_navbar_key_glow_color";
+ public static final String PREF_KEY_NAVBAR_BG_COLOR = "pref_navbar_bg_color";
public static final String ACTION_PREF_NAVBAR_CHANGED = "gravitybox.intent.action.ACTION_NAVBAR_CHANGED";
public static final String EXTRA_NAVBAR_HEIGHT = "navbarHeight";
public static final String EXTRA_NAVBAR_HEIGHT_LANDSCAPE = "navbarHeightLandscape";
public static final String EXTRA_NAVBAR_WIDTH = "navbarWidth";
public static final String EXTRA_NAVBAR_MENUKEY = "navbarMenukey";
+ public static final String EXTRA_NAVBAR_LAUNCHER_ENABLE = "navbarLauncherEnable";
+ public static final String EXTRA_NAVBAR_COLOR_ENABLE = "navbarColorEnable";
+ public static final String EXTRA_NAVBAR_KEY_COLOR = "navbarKeyColor";
+ public static final String EXTRA_NAVBAR_KEY_GLOW_COLOR = "navbarKeyGlowColor";
+ public static final String EXTRA_NAVBAR_BG_COLOR = "navbarBgColor";
public static final String PREF_KEY_LOCKSCREEN_TARGETS_ENABLE = "pref_lockscreen_ring_targets_enable";
public static final String PREF_KEY_LOCKSCREEN_TARGETS_APP[] = new String[] {
@@ -423,7 +478,20 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
public static final String EXTRA_DT_ENABLE = "dtEnable";
public static final String EXTRA_DT_POSITION = "dtPosition";
public static final String EXTRA_DT_SIZE = "dtSize";
-
+
+ public static final String PREF_CAT_KEY_APP_LAUNCHER = "pref_cat_app_launcher";
+ public static final List PREF_KEY_APP_LAUNCHER_SLOT = new ArrayList(Arrays.asList(
+ "pref_app_launcher_slot0", "pref_app_launcher_slot1", "pref_app_launcher_slot2",
+ "pref_app_launcher_slot3", "pref_app_launcher_slot4", "pref_app_launcher_slot5",
+ "pref_app_launcher_slot6", "pref_app_launcher_slot7"));
+ public static final String ACTION_PREF_APP_LAUNCHER_CHANGED = "gravitybox.intent.action.APP_LAUNCHER_CHANGED";
+ public static final String EXTRA_APP_LAUNCHER_SLOT = "appLauncherSlot";
+ public static final String EXTRA_APP_LAUNCHER_APP = "appLauncherApp";
+
+ private static final int REQ_LOCKSCREEN_BACKGROUND = 1024;
+ private static final int REQ_NOTIF_BG_IMAGE_PORTRAIT = 1025;
+ private static final int REQ_NOTIF_BG_IMAGE_LANDSCAPE = 1026;
+ private static final int REQ_CALLER_PHOTO = 1027;
private static final List rebootKeys = new ArrayList(Arrays.asList(
PREF_KEY_FIX_DATETIME_CRASH,
@@ -443,7 +511,8 @@ public class GravityBoxSettings extends Activity implements GravityBoxResultRece
PREF_KEY_NAVBAR_OVERRIDE,
PREF_KEY_NAVBAR_ENABLE,
PREF_KEY_QS_TILE_BEHAVIOUR_OVERRIDE,
- PREF_KEY_UNPLUG_TURNS_ON_SCREEN
+ PREF_KEY_UNPLUG_TURNS_ON_SCREEN,
+ PREF_KEY_TM_MODE
));
private static final class SystemProperties {
@@ -593,6 +662,7 @@ public static class PrefsFragment extends PreferenceFragment implements OnShared
private CheckBoxPreference mPrefHwKeyHomeLongpressKeyguard;
private PreferenceCategory mPrefCatHwKeyBack;
private ListPreference mPrefHwKeyBackLongpress;
+ private ListPreference mPrefHwKeyBackDoubletap;
private PreferenceCategory mPrefCatHwKeyRecents;
private ListPreference mPrefHwKeyRecentsSingletap;
private ListPreference mPrefHwKeyRecentsLongpress;
@@ -600,6 +670,7 @@ public static class PrefsFragment extends PreferenceFragment implements OnShared
private ListPreference mPrefHwKeyDoubletapSpeed;
private ListPreference mPrefHwKeyKillDelay;
private ListPreference mPrefPhoneFlip;
+ private CheckBoxPreference mPrefSbFollowStockBattery;
private CheckBoxPreference mPrefSbIconColorEnable;
private ColorPickerPreference mPrefSbIconColor;
private ColorPickerPreference mPrefSbDaColor;
@@ -623,8 +694,16 @@ public static class PrefsFragment extends PreferenceFragment implements OnShared
private ListPreference mPrefNotifColorMode;
private CheckBoxPreference mPrefDisableRoamingIndicators;
private ListPreference mPrefButtonBacklightMode;
+ private CheckBoxPreference mPrefButtonBacklightNotif;
private ListPreference mPrefPieEnabled;
+ private ListPreference mPrefPieCustomKey;
private CheckBoxPreference mPrefPieHwKeysDisabled;
+ private ColorPickerPreference mPrefPieColorBg;
+ private ColorPickerPreference mPrefPieColorFg;
+ private ColorPickerPreference mPrefPieColorOutline;
+ private ColorPickerPreference mPrefPieColorSelected;
+ private ColorPickerPreference mPrefPieColorText;
+ private Preference mPrefPieColorReset;
private CheckBoxPreference mPrefGbThemeDark;
private ListPreference mPrefRecentClear;
private ListPreference mPrefRambar;
@@ -641,11 +720,10 @@ public static class PrefsFragment extends PreferenceFragment implements OnShared
private PreferenceScreen mPrefCatMedia;
private CheckBoxPreference mPrefSafeMediaVolume;
private ListPreference mPrefExpandedDesktop;
+ private PreferenceCategory mPrefCatNavbarKeys;
+ private PreferenceCategory mPrefCatNavbarColor;
+ private PreferenceCategory mPrefCatNavbarDimen;
private CheckBoxPreference mPrefNavbarEnable;
- private SeekBarPreference mPrefNavbarHeight;
- private SeekBarPreference mPrefNavbarHeightLandscape;
- private SeekBarPreference mPrefNavbarWidth;
- private CheckBoxPreference mPrefNavbarMenukey;
private CheckBoxPreference mPrefMusicVolumeSteps;
private AppPickerPreference[] mPrefLockscreenTargetsApp;
private SeekBarPreference mPrefLockscreenTargetsVerticalOffset;
@@ -658,6 +736,7 @@ public static class PrefsFragment extends PreferenceFragment implements OnShared
private MultiSelectListPreference mPrefQsTileBehaviourOverride;
private ListPreference mPrefQsNetworkModeSimSlot;
private CheckBoxPreference mPrefSbColorSkipBattery;
+ private ListPreference mPrefSbSignalColorMode;
private CheckBoxPreference mPrefUnplugTurnsOnScreen;
private MultiSelectListPreference mPrefCallVibrations;
private Preference mPrefQsTileOrder;
@@ -667,7 +746,22 @@ public static class PrefsFragment extends PreferenceFragment implements OnShared
private ListPreference mPrefDataTrafficSize;
private CheckBoxPreference mPrefLinkVolumes;
private CheckBoxPreference mPrefVolumePanelExpandable;
+ private CheckBoxPreference mPrefVolumePanelFullyExpandable;
private CheckBoxPreference mPrefVolumePanelAutoexpand;
+ private CheckBoxPreference mPrefHomeDoubletapDisable;
+ private PreferenceScreen mPrefCatAppLauncher;
+ private AppPickerPreference[] mPrefAppLauncherSlot;
+ private File callerPhotoFile;
+ private CheckBoxPreference mPrefCallerUnknownPhotoEnable;
+ private Preference mPrefCallerUnknownPhoto;
+ private SeekBarPreference mPrefTmSbLauncher;
+ private SeekBarPreference mPrefTmSbLockscreen;
+ private SeekBarPreference mPrefTmNbLauncher;
+ private SeekBarPreference mPrefTmNbLockscreen;
+ private PreferenceScreen mPrefCatStatusbarColors;
+ private ColorPickerPreference mPrefSbIconColorSecondary;
+ private ColorPickerPreference mPrefSbDaColorSecondary;
+ private PreferenceScreen mPrefCatTransparencyManager;
@SuppressWarnings("deprecation")
@Override
@@ -725,6 +819,7 @@ public void onCreate(Bundle savedInstanceState) {
wallpaperTemporary = new File(getActivity().getCacheDir() + "/lockwallpaper.tmp");
notifBgImagePortrait = new File(getActivity().getFilesDir() + "/notifwallpaper");
notifBgImageLandscape = new File(getActivity().getFilesDir() + "/notifwallpaper_landscape");
+ callerPhotoFile = new File(getActivity().getFilesDir() + "/caller_photo");
mPrefCatHwKeyActions = (PreferenceScreen) findPreference(PREF_CAT_HWKEY_ACTIONS);
mPrefCatHwKeyMenu = (PreferenceCategory) findPreference(PREF_CAT_HWKEY_MENU);
@@ -735,19 +830,23 @@ public void onCreate(Bundle savedInstanceState) {
mPrefHwKeyHomeLongpressKeyguard = (CheckBoxPreference) findPreference(PREF_KEY_HWKEY_HOME_LONGPRESS_KEYGUARD);
mPrefCatHwKeyBack = (PreferenceCategory) findPreference(PREF_CAT_HWKEY_BACK);
mPrefHwKeyBackLongpress = (ListPreference) findPreference(PREF_KEY_HWKEY_BACK_LONGPRESS);
+ mPrefHwKeyBackDoubletap = (ListPreference) findPreference(PREF_KEY_HWKEY_BACK_DOUBLETAP);
mPrefCatHwKeyRecents = (PreferenceCategory) findPreference(PREF_CAT_HWKEY_RECENTS);
mPrefHwKeyRecentsSingletap = (ListPreference) findPreference(PREF_KEY_HWKEY_RECENTS_SINGLETAP);
mPrefHwKeyRecentsLongpress = (ListPreference) findPreference(PREF_KEY_HWKEY_RECENTS_LONGPRESS);
mPrefHwKeyDoubletapSpeed = (ListPreference) findPreference(PREF_KEY_HWKEY_DOUBLETAP_SPEED);
mPrefHwKeyKillDelay = (ListPreference) findPreference(PREF_KEY_HWKEY_KILL_DELAY);
mPrefCatHwKeyVolume = (PreferenceCategory) findPreference(PREF_CAT_HWKEY_VOLUME);
+ mPrefHomeDoubletapDisable = (CheckBoxPreference) findPreference(PREF_KEY_HWKEY_HOME_DOUBLETAP_DISABLE);
mPrefPhoneFlip = (ListPreference) findPreference(PREF_KEY_PHONE_FLIP);
+ mPrefSbFollowStockBattery = (CheckBoxPreference) findPreference(PREF_KEY_STATUSBAR_COLOR_FOLLOW_STOCK_BATTERY);
mPrefSbIconColorEnable = (CheckBoxPreference) findPreference(PREF_KEY_STATUSBAR_ICON_COLOR_ENABLE);
mPrefSbIconColor = (ColorPickerPreference) findPreference(PREF_KEY_STATUSBAR_ICON_COLOR);
mPrefSbDaColor = (ColorPickerPreference) findPreference(PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR);
mPrefSbColorSkipBattery = (CheckBoxPreference) findPreference(PREF_KEY_STATUSBAR_COLOR_SKIP_BATTERY);
+ mPrefSbSignalColorMode = (ListPreference) findPreference(PREF_KEY_STATUSBAR_SIGNAL_COLOR_MODE);
mPrefCatFixes = (PreferenceScreen) findPreference(PREF_CAT_KEY_FIXES);
mPrefFixDateTimeCrash = (CheckBoxPreference) findPreference(PREF_KEY_FIX_DATETIME_CRASH);
@@ -759,6 +858,7 @@ public void onCreate(Bundle savedInstanceState) {
mPrefFixDevOpts = (CheckBoxPreference) findPreference(PREF_KEY_FIX_DEV_OPTS);
mPrefCatStatusbar = (PreferenceScreen) findPreference(PREF_CAT_KEY_STATUSBAR);
mPrefCatStatusbarQs = (PreferenceScreen) findPreference(PREF_CAT_KEY_STATUSBAR_QS);
+ mPrefCatStatusbarColors = (PreferenceScreen) findPreference(PREF_CAT_KEY_STATUSBAR_COLORS);
mPrefAutoSwitchQs = (CheckBoxPreference) findPreference(PREF_KEY_QUICK_SETTINGS_AUTOSWITCH);
mPrefQuickPulldown = (ListPreference) findPreference(PREF_KEY_QUICK_PULLDOWN);
@@ -771,9 +871,17 @@ public void onCreate(Bundle savedInstanceState) {
mPrefDisableRoamingIndicators = (CheckBoxPreference) findPreference(PREF_KEY_DISABLE_ROAMING_INDICATORS);
mPrefButtonBacklightMode = (ListPreference) findPreference(PREF_KEY_BUTTON_BACKLIGHT_MODE);
+ mPrefButtonBacklightNotif = (CheckBoxPreference) findPreference(PREF_KEY_BUTTON_BACKLIGHT_NOTIFICATIONS);
mPrefPieEnabled = (ListPreference) findPreference(PREF_KEY_PIE_CONTROL_ENABLE);
mPrefPieHwKeysDisabled = (CheckBoxPreference) findPreference(PREF_KEY_HWKEYS_DISABLE);
+ mPrefPieCustomKey = (ListPreference) findPreference(PREF_KEY_PIE_CONTROL_CUSTOM_KEY);
+ mPrefPieColorBg = (ColorPickerPreference) findPreference(PREF_KEY_PIE_COLOR_BG);
+ mPrefPieColorFg = (ColorPickerPreference) findPreference(PREF_KEY_PIE_COLOR_FG);
+ mPrefPieColorOutline = (ColorPickerPreference) findPreference(PREF_KEY_PIE_COLOR_OUTLINE);
+ mPrefPieColorSelected = (ColorPickerPreference) findPreference(PREF_KEY_PIE_COLOR_SELECTED);
+ mPrefPieColorText = (ColorPickerPreference) findPreference(PREF_KEY_PIE_COLOR_TEXT);
+ mPrefPieColorReset = (Preference) findPreference(PREF_KEY_PIE_COLOR_RESET);
mPrefGbThemeDark = (CheckBoxPreference) findPreference(PREF_KEY_GB_THEME_DARK);
File file = new File(getActivity().getFilesDir() + "/" + FILE_THEME_DARK_FLAG);
@@ -802,15 +910,15 @@ public void onCreate(Bundle savedInstanceState) {
mPrefMusicVolumeSteps = (CheckBoxPreference) findPreference(PREF_KEY_MUSIC_VOLUME_STEPS);
mPrefLinkVolumes = (CheckBoxPreference) findPreference(PREF_KEY_LINK_VOLUMES);
mPrefVolumePanelExpandable = (CheckBoxPreference) findPreference(PREF_KEY_VOLUME_PANEL_EXPANDABLE);
+ mPrefVolumePanelFullyExpandable = (CheckBoxPreference) findPreference(PREF_KEY_VOLUME_PANEL_FULLY_EXPANDABLE);
mPrefVolumePanelAutoexpand = (CheckBoxPreference) findPreference(PREF_KEY_VOLUME_PANEL_AUTOEXPAND);
mPrefExpandedDesktop = (ListPreference) findPreference(PREF_KEY_EXPANDED_DESKTOP);
+ mPrefCatNavbarKeys = (PreferenceCategory) findPreference(PREF_CAT_KEY_NAVBAR_KEYS);
+ mPrefCatNavbarColor = (PreferenceCategory) findPreference(PREF_CAT_KEY_NAVBAR_COLOR);
+ mPrefCatNavbarDimen = (PreferenceCategory) findPreference(PREF_CAT_KEY_NAVBAR_DIMEN);
mPrefNavbarEnable = (CheckBoxPreference) findPreference(PREF_KEY_NAVBAR_ENABLE);
- mPrefNavbarHeight = (SeekBarPreference) findPreference(PREF_KEY_NAVBAR_HEIGHT);
- mPrefNavbarHeightLandscape = (SeekBarPreference) findPreference(PREF_KEY_NAVBAR_HEIGHT_LANDSCAPE);
- mPrefNavbarWidth = (SeekBarPreference) findPreference(PREF_KEY_NAVBAR_WIDTH);
- mPrefNavbarMenukey = (CheckBoxPreference) findPreference(PREF_KEY_NAVBAR_MENUKEY);
mPrefLockscreenTargetsApp = new AppPickerPreference[5];
for (int i=0; i<=4; i++) {
@@ -831,6 +939,8 @@ public void onCreate(Bundle savedInstanceState) {
mPrefCatPhoneMobileData = (PreferenceCategory) findPreference(PREF_CAT_KEY_PHONE_MOBILE_DATA);
mPrefMobileDataSlow2gDisable = (CheckBoxPreference) findPreference(PREF_KEY_MOBILE_DATA_SLOW2G_DISABLE);
mPrefCallVibrations = (MultiSelectListPreference) findPreference(PREF_KEY_CALL_VIBRATIONS);
+ mPrefCallerUnknownPhotoEnable = (CheckBoxPreference) findPreference(PREF_KEY_CALLER_UNKNOWN_PHOTO_ENABLE);
+ mPrefCallerUnknownPhoto = (Preference) findPreference(PREF_KEY_CALLER_UNKNOWN_PHOTO);
mPrefNetworkModeTileMode = (ListPreference) findPreference(PREF_KEY_NETWORK_MODE_TILE_MODE);
mPrefQsTileBehaviourOverride =
@@ -843,6 +953,29 @@ public void onCreate(Bundle savedInstanceState) {
mPrefDataTrafficPosition = (ListPreference) findPreference(PREF_KEY_DATA_TRAFFIC_POSITION);
mPrefDataTrafficSize = (ListPreference) findPreference(PREF_KEY_DATA_TRAFFIC_SIZE);
+ mPrefCatAppLauncher = (PreferenceScreen) findPreference(PREF_CAT_KEY_APP_LAUNCHER);
+ mPrefAppLauncherSlot = new AppPickerPreference[PREF_KEY_APP_LAUNCHER_SLOT.size()];
+ for (int i = 0; i < mPrefAppLauncherSlot.length; i++) {
+ AppPickerPreference appPref = new AppPickerPreference(getActivity(), null);
+ appPref.setKey(PREF_KEY_APP_LAUNCHER_SLOT.get(i));
+ appPref.setTitle(String.format(
+ getActivity().getString(R.string.pref_app_launcher_slot_title), i + 1));
+ appPref.setDialogTitle(appPref.getTitle());
+ appPref.setDefaultSummary(getActivity().getString(R.string.app_picker_none));
+ appPref.setSummary(getActivity().getString(R.string.app_picker_none));
+ mPrefAppLauncherSlot[i] = appPref;
+ mPrefCatAppLauncher.addPreference(mPrefAppLauncherSlot[i]);
+ }
+
+ mPrefCatTransparencyManager = (PreferenceScreen) findPreference(PREF_CAT_KEY_TRANSPARENCY_MANAGER);
+ mPrefTmSbLauncher = (SeekBarPreference) findPreference(PREF_KEY_TM_STATUSBAR_LAUNCHER);
+ mPrefTmSbLockscreen = (SeekBarPreference) findPreference(PREF_KEY_TM_STATUSBAR_LOCKSCREEN);
+ mPrefTmNbLauncher = (SeekBarPreference) findPreference(PREF_KEY_TM_NAVBAR_LAUNCHER);
+ mPrefTmNbLockscreen = (SeekBarPreference) findPreference(PREF_KEY_TM_NAVBAR_LOCKSCREEN);
+
+ mPrefSbIconColorSecondary = (ColorPickerPreference) findPreference(PREF_KEY_STATUSBAR_ICON_COLOR_SECONDARY);
+ mPrefSbDaColorSecondary = (ColorPickerPreference) findPreference(PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR_SECONDARY);
+
// Remove Phone specific preferences on Tablet devices
if (sSystemProperties.isTablet) {
mPrefCatStatusbarQs.removePreference(mPrefAutoSwitchQs);
@@ -884,8 +1017,10 @@ public void onCreate(Bundle savedInstanceState) {
getPreferenceScreen().removePreference(mPrefCatFixes);
mPrefCatStatusbar.removePreference(mSignalIconAutohide);
mPrefCatStatusbar.removePreference(mPrefDisableRoamingIndicators);
- mQuickSettings.setEntries(R.array.qs_tile_aosp_entries);
- mQuickSettings.setEntryValues(R.array.qs_tile_aosp_values);
+ mQuickSettings.setEntries(Build.VERSION.SDK_INT > 18 ?
+ R.array.qs_tile_aosp_entries_kk : R.array.qs_tile_aosp_entries);
+ mQuickSettings.setEntryValues(Build.VERSION.SDK_INT > 18 ?
+ R.array.qs_tile_aosp_values_kk : R.array.qs_tile_aosp_values);
mPrefCatPhoneTelephony.removePreference(mPrefRoamingWarningDisable);
mPrefCatStatusbarQs.removePreference(mPrefQsNetworkModeSimSlot);
} else {
@@ -895,6 +1030,13 @@ public void onCreate(Bundle savedInstanceState) {
mPrefCatStatusbar.removePreference(mPrefDisableRoamingIndicators);
mPrefCatPhoneMobileData.removePreference(mPrefMobileDataSlow2gDisable);
mPrefCatStatusbarQs.removePreference(mPrefQsNetworkModeSimSlot);
+ mPrefCatStatusbarColors.removePreference(mPrefSbIconColorSecondary);
+ mPrefCatStatusbarColors.removePreference(mPrefSbDaColorSecondary);
+ }
+
+ // Remove preferences not needed for MT6572
+ if (Utils.isMt6572Device()) {
+ mPrefCatStatusbar.removePreference(mSignalIconAutohide);
}
// Remove preferences not needed for ZTE V987
@@ -919,6 +1061,20 @@ public void onCreate(Bundle savedInstanceState) {
mPrefCatMedia.removePreference(mPrefSafeMediaVolume);
}
+ // Remove preferences not compatible with Android < 4.3+
+ if (Build.VERSION.SDK_INT < 18) {
+ mPrefCatHwKeyHome.removePreference(mPrefHomeDoubletapDisable);
+ }
+
+ // Remove preferences not compatible with KitKat
+ if (Build.VERSION.SDK_INT > 18) {
+ getPreferenceScreen().removePreference(mPrefCatTransparencyManager);
+ mPrefCatDisplay.removePreference(mPrefButtonBacklightNotif);
+ mPrefCatStatusbarColors.removePreference(mPrefSbFollowStockBattery);
+ mPrefCatStatusbarColors.removePreference(mStatusbarBgColor);
+ getPreferenceScreen().removePreference(mPrefCatPhone);
+ }
+
// Remove more music volume steps option if necessary
if (!Utils.shouldAllowMoreVolumeSteps()) {
mPrefs.edit().putBoolean(PREF_KEY_MUSIC_VOLUME_STEPS, false).commit();
@@ -987,6 +1143,8 @@ public void onCreate(Bundle savedInstanceState) {
mPrefHwKeyHomeLongpress.setEntryValues(actionEntryValues);
mPrefHwKeyBackLongpress.setEntries(actionEntries);
mPrefHwKeyBackLongpress.setEntryValues(actionEntryValues);
+ mPrefHwKeyBackDoubletap.setEntries(actionEntries);
+ mPrefHwKeyBackDoubletap.setEntryValues(actionEntryValues);
mPrefHwKeyRecentsSingletap.setEntries(actionEntries);
mPrefHwKeyRecentsSingletap.setEntryValues(actionEntryValues);
mPrefHwKeyRecentsLongpress.setEntries(actionEntries);
@@ -1016,13 +1174,17 @@ public void onPause() {
}
private void setDefaultValues() {
- if (mPrefs.getStringSet(PREF_KEY_QUICK_SETTINGS, null) == null) {
+ if (mPrefs.getStringSet(PREF_KEY_QUICK_SETTINGS, null) == null ||
+ (Build.VERSION.SDK_INT > 18 && !mPrefs.getBoolean("qs_tiles_kitkat_set", false))) {
Editor e = mPrefs.edit();
String[] values = getResources().getStringArray(
- Utils.isMtkDevice() ? R.array.qs_tile_values : R.array.qs_tile_aosp_values);
+ Utils.isMtkDevice() ? R.array.qs_tile_values :
+ Build.VERSION.SDK_INT > 18 ?
+ R.array.qs_tile_aosp_values_kk : R.array.qs_tile_aosp_values);
Set defVal = new HashSet(Arrays.asList(values));
e.putStringSet(PREF_KEY_QUICK_SETTINGS, defVal);
e.putString(TileOrderActivity.PREF_KEY_TILE_ORDER, Utils.join(values, ","));
+ e.putBoolean("qs_tiles_kitkat_set", true);
e.commit();
mQuickSettings.setValues(defVal);
}
@@ -1093,6 +1255,10 @@ private void updatePreferences(String key) {
mPrefHwKeyBackLongpress.setSummary(mPrefHwKeyBackLongpress.getEntry());
}
+ if (key == null || key.equals(PREF_KEY_HWKEY_BACK_DOUBLETAP)) {
+ mPrefHwKeyBackDoubletap.setSummary(mPrefHwKeyBackDoubletap.getEntry());
+ }
+
if (key == null || key.equals(PREF_KEY_HWKEY_RECENTS_SINGLETAP)) {
mPrefHwKeyRecentsSingletap.setSummary(mPrefHwKeyRecentsSingletap.getEntry());
}
@@ -1120,6 +1286,9 @@ private void updatePreferences(String key) {
mPrefSbIconColor.setEnabled(mPrefSbIconColorEnable.isChecked());
mPrefSbDaColor.setEnabled(mPrefSbIconColorEnable.isChecked());
mPrefSbColorSkipBattery.setEnabled(mPrefSbIconColorEnable.isChecked());
+ mPrefSbSignalColorMode.setEnabled(mPrefSbIconColorEnable.isChecked());
+ mPrefSbIconColorSecondary.setEnabled(mPrefSbIconColorEnable.isChecked());
+ mPrefSbDaColorSecondary.setEnabled(mPrefSbIconColorEnable.isChecked());
}
if (key == null || key.equals(PREF_KEY_NOTIF_BACKGROUND)) {
@@ -1187,10 +1356,9 @@ private void updatePreferences(String key) {
|| key.equals(PREF_KEY_NAVBAR_ENABLE)) {
final boolean override = mPrefs.getBoolean(PREF_KEY_NAVBAR_OVERRIDE, false);
mPrefNavbarEnable.setEnabled(override);
- mPrefNavbarHeight.setEnabled(override && mPrefNavbarEnable.isChecked());
- mPrefNavbarHeightLandscape.setEnabled(override && mPrefNavbarEnable.isChecked());
- mPrefNavbarWidth.setEnabled(override && mPrefNavbarEnable.isChecked());
- mPrefNavbarMenukey.setEnabled(override && mPrefNavbarEnable.isChecked());
+ mPrefCatNavbarKeys.setEnabled(override && mPrefNavbarEnable.isChecked());
+ mPrefCatNavbarColor.setEnabled(override && mPrefNavbarEnable.isChecked());
+ mPrefCatNavbarDimen.setEnabled(override && mPrefNavbarEnable.isChecked());
}
if (key == null || key.equals(PREF_KEY_LOCKSCREEN_TARGETS_ENABLE)) {
@@ -1244,6 +1412,27 @@ private void updatePreferences(String key) {
if (key == null || key.equals(PREF_KEY_VOLUME_PANEL_EXPANDABLE)) {
mPrefVolumePanelAutoexpand.setEnabled(mPrefVolumePanelExpandable.isChecked());
+ mPrefVolumePanelFullyExpandable.setEnabled(mPrefVolumePanelExpandable.isChecked());
+ }
+
+ if (key == null || key.equals(PREF_KEY_STATUSBAR_SIGNAL_COLOR_MODE)) {
+ mPrefSbSignalColorMode.setSummary(mPrefSbSignalColorMode.getEntry());
+ }
+
+ if (key == null || key.equals(PREF_KEY_PIE_CONTROL_CUSTOM_KEY)) {
+ mPrefPieCustomKey.setSummary(mPrefPieCustomKey.getEntry());
+ }
+
+ if (key == null || key.equals(PREF_KEY_CALLER_UNKNOWN_PHOTO_ENABLE)) {
+ mPrefCallerUnknownPhoto.setEnabled(mPrefCallerUnknownPhotoEnable.isChecked());
+ }
+
+ if (key == null || key.equals(PREF_KEY_TM_MODE)) {
+ final int tmMode = Integer.valueOf(mPrefs.getString(PREF_KEY_TM_MODE, "3"));
+ mPrefTmSbLauncher.setEnabled((tmMode & TransparencyManager.MODE_STATUSBAR) != 0);
+ mPrefTmSbLockscreen.setEnabled((tmMode & TransparencyManager.MODE_STATUSBAR) != 0);
+ mPrefTmNbLauncher.setEnabled((tmMode & TransparencyManager.MODE_NAVBAR) != 0);
+ mPrefTmNbLockscreen.setEnabled((tmMode & TransparencyManager.MODE_NAVBAR) != 0);
}
}
@@ -1278,6 +1467,10 @@ public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
intent.setAction(ACTION_PREF_QUICKSETTINGS_CHANGED);
intent.putExtra(EXTRA_QUICK_PULLDOWN, Integer.valueOf(
prefs.getString(PREF_KEY_QUICK_PULLDOWN, "0")));
+ } else if (key.equals(PREF_KEY_QUICK_SETTINGS_TILE_STYLE)) {
+ intent.setAction(ACTION_PREF_QUICKSETTINGS_CHANGED);
+ intent.putExtra(EXTRA_QS_TILE_STYLE, Integer.valueOf(
+ prefs.getString(PREF_KEY_QUICK_SETTINGS_TILE_STYLE, "0")));
} else if (key.equals(PREF_KEY_STATUSBAR_BGCOLOR)) {
intent.setAction(ACTION_PREF_STATUSBAR_COLOR_CHANGED);
intent.putExtra(EXTRA_SB_BG_COLOR, prefs.getInt(PREF_KEY_STATUSBAR_BGCOLOR, Color.BLACK));
@@ -1293,14 +1486,31 @@ public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
intent.setAction(ACTION_PREF_STATUSBAR_COLOR_CHANGED);
intent.putExtra(EXTRA_SB_ICON_COLOR, prefs.getInt(PREF_KEY_STATUSBAR_ICON_COLOR,
getResources().getInteger(R.integer.COLOR_HOLO_BLUE_LIGHT)));
+ } else if (key.equals(PREF_KEY_STATUS_ICON_STYLE)) {
+ intent.setAction(ACTION_PREF_STATUSBAR_COLOR_CHANGED);
+ intent.putExtra(EXTRA_SB_ICON_STYLE, Integer.valueOf(
+ prefs.getString(PREF_KEY_STATUS_ICON_STYLE, "0")));
+ } else if (key.equals(PREF_KEY_STATUSBAR_ICON_COLOR_SECONDARY)) {
+ intent.setAction(ACTION_PREF_STATUSBAR_COLOR_CHANGED);
+ intent.putExtra(EXTRA_SB_ICON_COLOR_SECONDARY,
+ prefs.getInt(PREF_KEY_STATUSBAR_ICON_COLOR_SECONDARY,
+ getResources().getInteger(R.integer.COLOR_HOLO_BLUE_LIGHT)));
} else if (key.equals(PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR)) {
intent.setAction(ACTION_PREF_STATUSBAR_COLOR_CHANGED);
intent.putExtra(EXTRA_SB_DATA_ACTIVITY_COLOR,
prefs.getInt(PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR, Color.WHITE));
+ } else if (key.equals(PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR_SECONDARY)) {
+ intent.setAction(ACTION_PREF_STATUSBAR_COLOR_CHANGED);
+ intent.putExtra(EXTRA_SB_DATA_ACTIVITY_COLOR_SECONDARY,
+ prefs.getInt(PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR_SECONDARY, Color.WHITE));
} else if (key.equals(PREF_KEY_STATUSBAR_COLOR_SKIP_BATTERY)) {
intent.setAction(ACTION_PREF_STATUSBAR_COLOR_CHANGED);
intent.putExtra(EXTRA_SB_COLOR_SKIP_BATTERY,
prefs.getBoolean(PREF_KEY_STATUSBAR_COLOR_SKIP_BATTERY, false));
+ } else if (key.equals(PREF_KEY_STATUSBAR_SIGNAL_COLOR_MODE)) {
+ intent.setAction(ACTION_PREF_STATUSBAR_COLOR_CHANGED);
+ intent.putExtra(EXTRA_SB_SIGNAL_COLOR_MODE,
+ Integer.valueOf(prefs.getString(PREF_KEY_STATUSBAR_SIGNAL_COLOR_MODE, "0")));
} else if (key.equals(PREF_KEY_TM_STATUSBAR_LAUNCHER)) {
intent.setAction(ACTION_PREF_STATUSBAR_COLOR_CHANGED);
intent.putExtra(EXTRA_TM_SB_LAUNCHER, prefs.getInt(PREF_KEY_TM_STATUSBAR_LAUNCHER, 0));
@@ -1354,10 +1564,18 @@ public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
intent.setAction(ACTION_PREF_HWKEY_HOME_LONGPRESS_CHANGED);
intent.putExtra(EXTRA_HWKEY_HOME_LONGPRESS_KG, prefs.getBoolean(
GravityBoxSettings.PREF_KEY_HWKEY_HOME_LONGPRESS_KEYGUARD, false));
+ } else if (key.equals(PREF_KEY_HWKEY_HOME_DOUBLETAP_DISABLE)) {
+ intent.setAction(ACTION_PREF_HWKEY_HOME_DOUBLETAP_CHANGED);
+ intent.putExtra(EXTRA_HWKEY_HOME_DOUBLETAP_DISABLE,
+ prefs.getBoolean(PREF_KEY_HWKEY_HOME_DOUBLETAP_DISABLE, false));
} else if (key.equals(PREF_KEY_HWKEY_BACK_LONGPRESS)) {
intent.setAction(ACTION_PREF_HWKEY_BACK_LONGPRESS_CHANGED);
intent.putExtra(EXTRA_HWKEY_VALUE, Integer.valueOf(
prefs.getString(PREF_KEY_HWKEY_BACK_LONGPRESS, "0")));
+ } else if (key.equals(PREF_KEY_HWKEY_BACK_DOUBLETAP)) {
+ intent.setAction(ACTION_PREF_HWKEY_BACK_DOUBLETAP_CHANGED);
+ intent.putExtra(EXTRA_HWKEY_VALUE, Integer.valueOf(
+ prefs.getString(PREF_KEY_HWKEY_BACK_DOUBLETAP, "0")));
} else if (key.equals(PREF_KEY_HWKEY_RECENTS_SINGLETAP)) {
intent.setAction(ACTION_PREF_HWKEY_RECENTS_SINGLETAP_CHANGED);
intent.putExtra(EXTRA_HWKEY_VALUE, Integer.valueOf(
@@ -1382,6 +1600,10 @@ public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
intent.setAction(ACTION_PREF_VOLUME_PANEL_MODE_CHANGED);
intent.putExtra(EXTRA_EXPANDABLE,
prefs.getBoolean(PREF_KEY_VOLUME_PANEL_EXPANDABLE, false));
+ } else if (key.equals(PREF_KEY_VOLUME_PANEL_FULLY_EXPANDABLE)) {
+ intent.setAction(ACTION_PREF_VOLUME_PANEL_MODE_CHANGED);
+ intent.putExtra(EXTRA_EXPANDABLE_FULLY,
+ prefs.getBoolean(PREF_KEY_VOLUME_PANEL_FULLY_EXPANDABLE, false));
} else if (key.equals(PREF_KEY_VOLUME_PANEL_AUTOEXPAND)) {
intent.setAction(ACTION_PREF_VOLUME_PANEL_MODE_CHANGED);
intent.putExtra(EXTRA_AUTOEXPAND,
@@ -1418,9 +1640,10 @@ public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if (mode == 0) {
intent.putExtra(EXTRA_PIE_HWKEYS_DISABLE, false);
}
- } else if (key.equals(PREF_KEY_PIE_CONTROL_SEARCH)) {
+ } else if (key.equals(PREF_KEY_PIE_CONTROL_CUSTOM_KEY)) {
intent.setAction(ACTION_PREF_PIE_CHANGED);
- intent.putExtra(EXTRA_PIE_SEARCH, prefs.getBoolean(PREF_KEY_PIE_CONTROL_SEARCH, false));
+ intent.putExtra(EXTRA_PIE_CUSTOM_KEY_MODE, Integer.valueOf(
+ prefs.getString(PREF_KEY_PIE_CONTROL_CUSTOM_KEY, "0")));
} else if (key.equals(PREF_KEY_PIE_CONTROL_MENU)) {
intent.setAction(ACTION_PREF_PIE_CHANGED);
intent.putExtra(EXTRA_PIE_MENU, prefs.getBoolean(PREF_KEY_PIE_CONTROL_MENU, false));
@@ -1439,6 +1662,26 @@ public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
} else if (key.equals(PREF_KEY_HWKEYS_DISABLE)) {
intent.setAction(ACTION_PREF_PIE_CHANGED);
intent.putExtra(EXTRA_PIE_HWKEYS_DISABLE, prefs.getBoolean(PREF_KEY_HWKEYS_DISABLE, false));
+ } else if (key.equals(PREF_KEY_PIE_COLOR_BG)) {
+ intent.setAction(ACTION_PREF_PIE_CHANGED);
+ intent.putExtra(EXTRA_PIE_COLOR_BG, prefs.getInt(PREF_KEY_PIE_COLOR_BG,
+ getResources().getColor(R.color.pie_background_color)));
+ } else if (key.equals(PREF_KEY_PIE_COLOR_FG)) {
+ intent.setAction(ACTION_PREF_PIE_CHANGED);
+ intent.putExtra(EXTRA_PIE_COLOR_FG, prefs.getInt(PREF_KEY_PIE_COLOR_FG,
+ getResources().getColor(R.color.pie_foreground_color)));
+ } else if (key.equals(PREF_KEY_PIE_COLOR_OUTLINE)) {
+ intent.setAction(ACTION_PREF_PIE_CHANGED);
+ intent.putExtra(EXTRA_PIE_COLOR_OUTLINE, prefs.getInt(PREF_KEY_PIE_COLOR_OUTLINE,
+ getResources().getColor(R.color.pie_outline_color)));
+ } else if (key.equals(PREF_KEY_PIE_COLOR_SELECTED)) {
+ intent.setAction(ACTION_PREF_PIE_CHANGED);
+ intent.putExtra(EXTRA_PIE_COLOR_SELECTED, prefs.getInt(PREF_KEY_PIE_COLOR_SELECTED,
+ getResources().getColor(R.color.pie_selected_color)));
+ } else if (key.equals(PREF_KEY_PIE_COLOR_TEXT)) {
+ intent.setAction(ACTION_PREF_PIE_CHANGED);
+ intent.putExtra(EXTRA_PIE_COLOR_TEXT, prefs.getInt(PREF_KEY_PIE_COLOR_TEXT,
+ getResources().getColor(R.color.pie_text_color)));
} else if (key.equals(PREF_KEY_BUTTON_BACKLIGHT_MODE)) {
intent.setAction(ACTION_PREF_BUTTON_BACKLIGHT_CHANGED);
intent.putExtra(EXTRA_BB_MODE, prefs.getString(
@@ -1479,6 +1722,34 @@ public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
} else if (key.equals(PREF_KEY_NAVBAR_MENUKEY)) {
intent.setAction(ACTION_PREF_NAVBAR_CHANGED);
intent.putExtra(EXTRA_NAVBAR_MENUKEY, prefs.getBoolean(PREF_KEY_NAVBAR_MENUKEY, false));
+ } else if (key.equals(PREF_KEY_NAVBAR_LAUNCHER_ENABLE)) {
+ intent.setAction(ACTION_PREF_NAVBAR_CHANGED);
+ intent.putExtra(EXTRA_NAVBAR_LAUNCHER_ENABLE,
+ prefs.getBoolean(PREF_KEY_NAVBAR_LAUNCHER_ENABLE, false));
+ } else if (key.equals(PREF_KEY_NAVBAR_COLOR_ENABLE)) {
+ intent.setAction(ACTION_PREF_NAVBAR_CHANGED);
+ intent.putExtra(EXTRA_NAVBAR_COLOR_ENABLE,
+ prefs.getBoolean(PREF_KEY_NAVBAR_COLOR_ENABLE, false));
+ } else if (key.equals(PREF_KEY_NAVBAR_KEY_COLOR)) {
+ intent.setAction(ACTION_PREF_NAVBAR_CHANGED);
+ intent.putExtra(EXTRA_NAVBAR_KEY_COLOR,
+ prefs.getInt(PREF_KEY_NAVBAR_KEY_COLOR,
+ getResources().getColor(R.color.navbar_key_color)));
+ } else if (key.equals(PREF_KEY_NAVBAR_KEY_GLOW_COLOR)) {
+ intent.setAction(ACTION_PREF_NAVBAR_CHANGED);
+ intent.putExtra(EXTRA_NAVBAR_KEY_GLOW_COLOR,
+ prefs.getInt(PREF_KEY_NAVBAR_KEY_GLOW_COLOR,
+ getResources().getColor(R.color.navbar_key_glow_color)));
+ } else if (key.equals(PREF_KEY_NAVBAR_BG_COLOR)) {
+ intent.setAction(ACTION_PREF_NAVBAR_CHANGED);
+ intent.putExtra(EXTRA_NAVBAR_BG_COLOR,
+ prefs.getInt(PREF_KEY_NAVBAR_BG_COLOR,
+ getResources().getColor(R.color.navbar_bg_color)));
+ } else if (PREF_KEY_APP_LAUNCHER_SLOT.contains(key)) {
+ intent.setAction(ACTION_PREF_APP_LAUNCHER_CHANGED);
+ intent.putExtra(EXTRA_APP_LAUNCHER_SLOT,
+ PREF_KEY_APP_LAUNCHER_SLOT.indexOf(key));
+ intent.putExtra(EXTRA_APP_LAUNCHER_APP, prefs.getString(key, null));
} else if (key.equals(PREF_KEY_STATUSBAR_BRIGHTNESS)) {
intent.setAction(ACTION_PREF_STATUSBAR_BRIGHTNESS_CHANGED);
intent.putExtra(EXTRA_SB_BRIGHTNESS, prefs.getBoolean(PREF_KEY_STATUSBAR_BRIGHTNESS, false));
@@ -1529,6 +1800,16 @@ public void onClick(DialogInterface dialog, int which) {
mDialog.show();
}
+ if (key.equals(PREF_KEY_BRIGHTNESS_MIN) &&
+ prefs.getInt(PREF_KEY_BRIGHTNESS_MIN, 20) < 20) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+ builder.setTitle(R.string.important);
+ builder.setMessage(R.string.screen_brightness_min_warning);
+ builder.setPositiveButton(android.R.string.ok, null);
+ mDialog = builder.create();
+ mDialog.show();
+ }
+
if (rebootKeys.contains(key))
Toast.makeText(getActivity(), getString(R.string.reboot_required), Toast.LENGTH_SHORT).show();
}
@@ -1576,8 +1857,30 @@ public boolean onPreferenceTreeClick(PreferenceScreen prefScreen, Preference pre
getActivity().recreate();
} else if (pref == mPrefQsTileOrder) {
intent = new Intent(getActivity(), TileOrderActivity.class);
+ } else if (pref == mPrefPieColorReset) {
+ final Resources res = getResources();
+ final int bgColor = res.getColor(R.color.pie_background_color);
+ final int fgColor = res.getColor(R.color.pie_foreground_color);
+ final int outlineColor = res.getColor(R.color.pie_outline_color);
+ final int selectedColor = res.getColor(R.color.pie_selected_color);
+ final int textColor = res.getColor(R.color.pie_text_color);
+ mPrefPieColorBg.setValue(bgColor);
+ mPrefPieColorFg.setValue(fgColor);
+ mPrefPieColorOutline.setValue(outlineColor);
+ mPrefPieColorSelected.setValue(selectedColor);
+ mPrefPieColorText.setValue(textColor);
+ Intent pieIntent = new Intent(ACTION_PREF_PIE_CHANGED);
+ pieIntent.putExtra(EXTRA_PIE_COLOR_BG, bgColor);
+ pieIntent.putExtra(EXTRA_PIE_COLOR_FG, fgColor);
+ pieIntent.putExtra(EXTRA_PIE_COLOR_OUTLINE, outlineColor);
+ pieIntent.putExtra(EXTRA_PIE_COLOR_SELECTED, selectedColor);
+ pieIntent.putExtra(EXTRA_PIE_COLOR_TEXT, textColor);
+ getActivity().sendBroadcast(pieIntent);
+ } else if (pref == mPrefCallerUnknownPhoto) {
+ setCustomCallerImage();
+ return true;
}
-
+
if (intent != null) {
try {
startActivity(intent);
@@ -1642,7 +1945,7 @@ private void setCustomLockscreenImage() {
wallpaperTemporary.setWritable(true, false);
intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(wallpaperTemporary));
intent.putExtra("return-data", false);
- getActivity().startActivityFromFragment(this, intent, LOCKSCREEN_BACKGROUND);
+ getActivity().startActivityFromFragment(this, intent, REQ_LOCKSCREEN_BACKGROUND);
} catch (Exception e) {
Toast.makeText(getActivity(), getString(
R.string.lockscreen_background_result_not_successful),
@@ -1678,7 +1981,7 @@ private void setCustomNotifBgPortrait() {
wallpaperTemporary.createNewFile();
wallpaperTemporary.setWritable(true, false);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(wallpaperTemporary));
- startActivityForResult(intent, NOTIF_BG_IMAGE_PORTRAIT);
+ startActivityForResult(intent, REQ_NOTIF_BG_IMAGE_PORTRAIT);
} catch (Exception e) {
Toast.makeText(getActivity(), getString(
R.string.lockscreen_background_result_not_successful),
@@ -1714,7 +2017,7 @@ private void setCustomNotifBgLandscape() {
wallpaperTemporary.createNewFile();
wallpaperTemporary.setWritable(true, false);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(wallpaperTemporary));
- startActivityForResult(intent, NOTIF_BG_IMAGE_LANDSCAPE);
+ startActivityForResult(intent, REQ_NOTIF_BG_IMAGE_LANDSCAPE);
} catch (Exception e) {
Toast.makeText(getActivity(), getString(
R.string.lockscreen_background_result_not_successful),
@@ -1723,9 +2026,38 @@ private void setCustomNotifBgLandscape() {
}
}
+ private void setCustomCallerImage() {
+ int width = getResources().getDimensionPixelSize(R.dimen.caller_id_photo_width);
+ int height = getResources().getDimensionPixelSize(R.dimen.caller_id_photo_height);
+ Intent intent = new Intent(Intent.ACTION_PICK,
+ android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
+ intent.setType("image/*");
+ intent.putExtra("crop", "true");
+ boolean isPortrait = getResources()
+ .getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
+ intent.putExtra("aspectX", isPortrait ? width : height);
+ intent.putExtra("aspectY", isPortrait ? height : width);
+ intent.putExtra("outputX", isPortrait ? width : height);
+ intent.putExtra("outputY", isPortrait ? height : width);
+ intent.putExtra("scale", true);
+ intent.putExtra("scaleUpIfNeeded", true);
+ intent.putExtra("outputFormat", Bitmap.CompressFormat.PNG.toString());
+ try {
+ wallpaperTemporary.createNewFile();
+ wallpaperTemporary.setWritable(true, false);
+ intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(wallpaperTemporary));
+ startActivityForResult(intent, REQ_CALLER_PHOTO);
+ } catch (Exception e) {
+ Toast.makeText(getActivity(), getString(
+ R.string.caller_unkown_photo_result_not_successful),
+ Toast.LENGTH_SHORT).show();
+ e.printStackTrace();
+ }
+ }
+
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (requestCode == LOCKSCREEN_BACKGROUND) {
+ if (requestCode == REQ_LOCKSCREEN_BACKGROUND) {
if (resultCode == Activity.RESULT_OK) {
if (wallpaperTemporary.exists()) {
wallpaperTemporary.renameTo(wallpaperImage);
@@ -1742,7 +2074,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
R.string.lockscreen_background_result_not_successful),
Toast.LENGTH_SHORT).show();
}
- } else if (requestCode == NOTIF_BG_IMAGE_PORTRAIT) {
+ } else if (requestCode == REQ_NOTIF_BG_IMAGE_PORTRAIT) {
if (resultCode == Activity.RESULT_OK) {
if (wallpaperTemporary.exists()) {
wallpaperTemporary.renameTo(notifBgImagePortrait);
@@ -1761,7 +2093,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
}
Intent intent = new Intent(ACTION_NOTIF_BACKGROUND_CHANGED);
getActivity().sendBroadcast(intent);
- } else if (requestCode == NOTIF_BG_IMAGE_LANDSCAPE) {
+ } else if (requestCode == REQ_NOTIF_BG_IMAGE_LANDSCAPE) {
if (resultCode == Activity.RESULT_OK) {
if (wallpaperTemporary.exists()) {
wallpaperTemporary.renameTo(notifBgImageLandscape);
@@ -1780,6 +2112,23 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
}
Intent intent = new Intent(ACTION_NOTIF_BACKGROUND_CHANGED);
getActivity().sendBroadcast(intent);
+ } else if (requestCode == REQ_CALLER_PHOTO) {
+ if (resultCode == Activity.RESULT_OK) {
+ if (wallpaperTemporary.exists()) {
+ wallpaperTemporary.renameTo(callerPhotoFile);
+ }
+ callerPhotoFile.setReadable(true, false);
+ Toast.makeText(getActivity(), getString(
+ R.string.caller_unknown_photo_result_successful),
+ Toast.LENGTH_SHORT).show();
+ } else {
+ if (wallpaperTemporary.exists()) {
+ wallpaperTemporary.delete();
+ }
+ Toast.makeText(getActivity(), getString(
+ R.string.caller_unkown_photo_result_not_successful),
+ Toast.LENGTH_SHORT).show();
+ }
}
}
}
diff --git a/src/com/ceco/gm2/gravitybox/KeyButtonView.java b/src/com/ceco/gm2/gravitybox/KeyButtonView.java
new file mode 100644
index 0000000000..30489bf6e5
--- /dev/null
+++ b/src/com/ceco/gm2/gravitybox/KeyButtonView.java
@@ -0,0 +1,242 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * Copyright (C) 2013 Peter Gregus for GravityBox Project (C3C076@xda)
+ *
+ * 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.
+ */
+
+package com.ceco.gm2.gravitybox;
+
+import de.robv.android.xposed.XposedBridge;
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.graphics.Canvas;
+import android.graphics.PorterDuff;
+import android.graphics.RectF;
+import android.os.SystemClock;
+import android.view.HapticFeedbackConstants;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewConfiguration;
+import android.widget.ImageView;
+
+public class KeyButtonView extends ImageView {
+ private static final String PACKAGE_NAME = "com.android.systemui";
+ private static final String TAG = "GB:KeyButtonView";
+
+ final float GLOW_MAX_SCALE_FACTOR = 1.8f;
+ final float BUTTON_QUIESCENT_ALPHA = 0.70f;
+
+ long mDownTime;
+ int mTouchSlop;
+ Drawable mGlowBG;
+ int mGlowWidth, mGlowHeight;
+ float mGlowAlpha = 0f, mGlowScale = 1f, mDrawingAlpha = 1f;
+ RectF mRect = new RectF(0f,0f,0f,0f);
+ AnimatorSet mPressedAnim;
+ Resources mResources;
+ boolean mLongPressConsumed;
+
+ Runnable mCheckLongPress = new Runnable() {
+ public void run() {
+ if (isPressed()) {
+ mLongPressConsumed = performLongClick();
+ }
+ }
+ };
+
+ public KeyButtonView(Context context) {
+ super(context);
+
+ mResources = context.getResources();
+
+ mGlowBG = mResources.getDrawable(mResources.getIdentifier(
+ "ic_sysbar_highlight", "drawable", PACKAGE_NAME));
+ if (mGlowBG != null) {
+ setDrawingAlpha(BUTTON_QUIESCENT_ALPHA);
+ mGlowWidth = mGlowBG.getIntrinsicWidth();
+ mGlowHeight = mGlowBG.getIntrinsicHeight();
+ }
+
+ setClickable(true);
+ mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ if (mGlowBG != null) {
+ canvas.save();
+ final int w = getWidth();
+ final int h = getHeight();
+ final float aspect = (float)mGlowWidth / mGlowHeight;
+ final int drawW = (int)(h*aspect);
+ final int drawH = h;
+ final int margin = (drawW-w)/2;
+ canvas.scale(mGlowScale, mGlowScale, w*0.5f, h*0.5f);
+ mGlowBG.setBounds(-margin, 0, drawW-margin, drawH);
+ mGlowBG.setAlpha((int)(mDrawingAlpha * mGlowAlpha * 255));
+ mGlowBG.draw(canvas);
+ canvas.restore();
+ mRect.right = w;
+ mRect.bottom = h;
+ }
+ super.onDraw(canvas);
+ }
+
+ public float getDrawingAlpha() {
+ if (mGlowBG == null) return 0;
+ return mDrawingAlpha;
+ }
+
+ @SuppressWarnings("deprecation")
+ public void setDrawingAlpha(float x) {
+ if (mGlowBG == null) return;
+ // Calling setAlpha(int), which is an ImageView-specific
+ // method that's different from setAlpha(float). This sets
+ // the alpha on this ImageView's drawable directly
+ setAlpha((int) (x * 255));
+ mDrawingAlpha = x;
+ }
+
+ public float getGlowAlpha() {
+ if (mGlowBG == null) return 0;
+ return mGlowAlpha;
+ }
+
+ public void setGlowAlpha(float x) {
+ if (mGlowBG == null) return;
+ mGlowAlpha = x;
+ invalidate();
+ }
+
+ public float getGlowScale() {
+ if (mGlowBG == null) return 0;
+ return mGlowScale;
+ }
+
+ @SuppressWarnings("unused")
+ public void setGlowScale(float x) {
+ if (mGlowBG == null) return;
+ mGlowScale = x;
+ final float w = getWidth();
+ final float h = getHeight();
+ if (GLOW_MAX_SCALE_FACTOR <= 1.0f) {
+ // this only works if we know the glow will never leave our bounds
+ invalidate();
+ } else {
+ final float rx = (w * (GLOW_MAX_SCALE_FACTOR - 1.0f)) / 2.0f + 1.0f;
+ final float ry = (h * (GLOW_MAX_SCALE_FACTOR - 1.0f)) / 2.0f + 1.0f;
+ invalidateGlobalRegion(
+ this,
+ new RectF(getLeft() - rx,
+ getTop() - ry,
+ getRight() + rx,
+ getBottom() + ry));
+
+ // also invalidate our immediate parent to help avoid situations where nearby glows
+ // interfere
+ ((View)getParent()).invalidate();
+ }
+ }
+
+ public void setPressed(boolean pressed) {
+ if (mGlowBG != null) {
+ if (pressed != isPressed()) {
+ if (mPressedAnim != null && mPressedAnim.isRunning()) {
+ mPressedAnim.cancel();
+ }
+ final AnimatorSet as = mPressedAnim = new AnimatorSet();
+ if (pressed) {
+ if (mGlowScale < GLOW_MAX_SCALE_FACTOR)
+ mGlowScale = GLOW_MAX_SCALE_FACTOR;
+ if (mGlowAlpha < BUTTON_QUIESCENT_ALPHA)
+ mGlowAlpha = BUTTON_QUIESCENT_ALPHA;
+ setDrawingAlpha(1f);
+ as.playTogether(
+ ObjectAnimator.ofFloat(this, "glowAlpha", 1f),
+ ObjectAnimator.ofFloat(this, "glowScale", GLOW_MAX_SCALE_FACTOR)
+ );
+ as.setDuration(50);
+ } else {
+ as.playTogether(
+ ObjectAnimator.ofFloat(this, "glowAlpha", 0f),
+ ObjectAnimator.ofFloat(this, "glowScale", 1f),
+ ObjectAnimator.ofFloat(this, "drawingAlpha", BUTTON_QUIESCENT_ALPHA)
+ );
+ as.setDuration(500);
+ }
+ as.start();
+ }
+ }
+ super.setPressed(pressed);
+ }
+
+ public boolean onTouchEvent(MotionEvent ev) {
+ final int action = ev.getAction();
+ int x, y;
+
+ switch (action) {
+ case MotionEvent.ACTION_DOWN:
+ //Slog.d("KeyButtonView", "press");
+ mDownTime = SystemClock.uptimeMillis();
+ setPressed(true);
+ performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
+ removeCallbacks(mCheckLongPress);
+ mLongPressConsumed = false;
+ postDelayed(mCheckLongPress, ViewConfiguration.getLongPressTimeout());
+ break;
+ case MotionEvent.ACTION_MOVE:
+ x = (int)ev.getX();
+ y = (int)ev.getY();
+ setPressed(x >= -mTouchSlop
+ && x < getWidth() + mTouchSlop
+ && y >= -mTouchSlop
+ && y < getHeight() + mTouchSlop);
+ break;
+ case MotionEvent.ACTION_CANCEL:
+ setPressed(false);
+ removeCallbacks(mCheckLongPress);
+ break;
+ case MotionEvent.ACTION_UP:
+ final boolean doIt = isPressed() && !mLongPressConsumed;
+ setPressed(false);
+ if (doIt) {
+ performClick();
+ }
+ removeCallbacks(mCheckLongPress);
+ break;
+ }
+
+ return true;
+ }
+
+ private static void invalidateGlobalRegion(View view, RectF childBounds) {
+ while (view.getParent() != null && view.getParent() instanceof View) {
+ view = (View) view.getParent();
+ view.getMatrix().mapRect(childBounds);
+ view.invalidate((int) Math.floor(childBounds.left),
+ (int) Math.floor(childBounds.top),
+ (int) Math.ceil(childBounds.right),
+ (int) Math.ceil(childBounds.bottom));
+ }
+ }
+
+ public void setGlowColor(int color) {
+ if (mGlowBG != null) {
+ mGlowBG.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
+ }
+ }
+}
diff --git a/src/com/ceco/gm2/gravitybox/KitKatBattery.java b/src/com/ceco/gm2/gravitybox/KitKatBattery.java
new file mode 100644
index 0000000000..a79bbf37af
--- /dev/null
+++ b/src/com/ceco/gm2/gravitybox/KitKatBattery.java
@@ -0,0 +1,330 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * Copyright (C) 2013 Peter Gregus for GravityBox Project (C3C076@xda)
+ *
+ * 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.
+ */
+
+package com.ceco.gm2.gravitybox;
+
+import com.ceco.gm2.gravitybox.StatusBarIconManager.ColorInfo;
+import com.ceco.gm2.gravitybox.StatusBarIconManager.IconManagerListener;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.Path;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffXfermode;
+import android.graphics.Rect;
+import android.graphics.RectF;
+import android.graphics.Typeface;
+import android.os.BatteryManager;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.view.View;
+
+public class KitKatBattery extends View implements IconManagerListener {
+ public static final String TAG = "GB:KitKatBattery";
+
+ public static final boolean SINGLE_DIGIT_PERCENT = false;
+ public static final boolean SHOW_100_PERCENT = false;
+
+ public static final int[] LEVELS = new int[] { 4, 15, 100 };
+ public static final int[] COLORS = new int[] { 0xFFFF3300, 0xFFFF3300, 0xFFFFFFFF };
+ public static final int BOLT_COLOR = 0xB2000000;
+ public static final int FULL = 96;
+ public static final int EMPTY = 4;
+
+ public static final float SUBPIXEL = 0.4f; // inset rects for softer edges
+
+ private int[] mColors;
+
+ private boolean mShowPercent = true;
+ private Paint mFramePaint, mBatteryPaint, mWarningTextPaint, mTextPaint, mBoltPaint;
+ private int mButtonHeight;
+ private float mTextHeight, mWarningTextHeight;
+
+ private int mHeight;
+ private int mWidth;
+ private String mWarningString;
+ private int mChargeColor;
+ private final float[] mBoltPoints;
+ private final Path mBoltPath = new Path();
+
+ private final RectF mFrame = new RectF();
+ private final RectF mButtonFrame = new RectF();
+ private final RectF mClipFrame = new RectF();
+ private final Rect mBoltFrame = new Rect();
+
+ private class BatteryTracker extends BroadcastReceiver {
+ public static final int UNKNOWN_LEVEL = -1;
+
+ // current battery status
+ int level = UNKNOWN_LEVEL;
+ int plugType;
+ boolean plugged;
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ final String action = intent.getAction();
+ if (action.equals(Intent.ACTION_BATTERY_CHANGED)) {
+ level = (int)(100f
+ * intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0)
+ / intent.getIntExtra(BatteryManager.EXTRA_SCALE, 100));
+
+ plugType = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0);
+ plugged = plugType != 0;
+
+ postInvalidate();
+ }
+ }
+ }
+
+ BatteryTracker mTracker = new BatteryTracker();
+
+ @Override
+ public void onAttachedToWindow() {
+ super.onAttachedToWindow();
+
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(Intent.ACTION_BATTERY_CHANGED);
+ final Intent sticky = getContext().registerReceiver(mTracker, filter);
+ if (sticky != null) {
+ // preload the battery level
+ mTracker.onReceive(getContext(), sticky);
+ }
+ }
+
+ @Override
+ public void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+
+ getContext().unregisterReceiver(mTracker);
+ }
+
+ public KitKatBattery(Context context) {
+ this(context, null, 0);
+ }
+
+ public KitKatBattery(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public KitKatBattery(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+
+ mWarningString = "!";
+
+ mFramePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ mFramePaint.setDither(true);
+ mFramePaint.setStrokeWidth(0);
+ mFramePaint.setStyle(Paint.Style.FILL_AND_STROKE);
+ mFramePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_ATOP));
+
+ mBatteryPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ mBatteryPaint.setDither(true);
+ mBatteryPaint.setStrokeWidth(0);
+ mBatteryPaint.setStyle(Paint.Style.FILL_AND_STROKE);
+
+ mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ Typeface font = Typeface.create("sans-serif-condensed", Typeface.NORMAL);
+ mTextPaint.setTypeface(font);
+ mTextPaint.setTextAlign(Paint.Align.CENTER);
+
+ mWarningTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ font = Typeface.create("sans-serif", Typeface.BOLD);
+ mWarningTextPaint.setTypeface(font);
+ mWarningTextPaint.setTextAlign(Paint.Align.CENTER);
+
+ mBoltPaint = new Paint();
+ mBoltPaint.setAntiAlias(true);
+ mBoltPoints = loadBoltPoints();
+ setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+
+ setColor(Build.VERSION.SDK_INT > 18 ? Color.WHITE :
+ context.getResources().getColor(android.R.color.holo_blue_dark));
+ }
+
+ public void setColor(int mainColor) {
+ COLORS[COLORS.length-1] = mainColor;
+
+ final int N = LEVELS.length;
+ mColors = new int[2*N];
+ for (int i=0; i= FULL) {
+ drawFrac = 1f;
+ } else if (level <= EMPTY) {
+ drawFrac = 0f;
+ }
+
+ c.drawRect(mButtonFrame, drawFrac == 1f ? mBatteryPaint : mFramePaint);
+
+ mClipFrame.set(mFrame);
+ mClipFrame.top += (mFrame.height() * (1f - drawFrac));
+
+ c.save(Canvas.CLIP_SAVE_FLAG);
+ c.clipRect(mClipFrame);
+ c.drawRect(mFrame, mBatteryPaint);
+ c.restore();
+
+ if (tracker.plugged) {
+ // draw the bolt
+ final int bl = (int)(mFrame.left + mFrame.width() / 4.5f);
+ final int bt = (int)(mFrame.top + mFrame.height() / 6f);
+ final int br = (int)(mFrame.right - mFrame.width() / 7f);
+ final int bb = (int)(mFrame.bottom - mFrame.height() / 10f);
+ if (mBoltFrame.left != bl || mBoltFrame.top != bt
+ || mBoltFrame.right != br || mBoltFrame.bottom != bb) {
+ mBoltFrame.set(bl, bt, br, bb);
+ mBoltPath.reset();
+ mBoltPath.moveTo(
+ mBoltFrame.left + mBoltPoints[0] * mBoltFrame.width(),
+ mBoltFrame.top + mBoltPoints[1] * mBoltFrame.height());
+ for (int i = 2; i < mBoltPoints.length; i += 2) {
+ mBoltPath.lineTo(
+ mBoltFrame.left + mBoltPoints[i] * mBoltFrame.width(),
+ mBoltFrame.top + mBoltPoints[i + 1] * mBoltFrame.height());
+ }
+ mBoltPath.lineTo(
+ mBoltFrame.left + mBoltPoints[0] * mBoltFrame.width(),
+ mBoltFrame.top + mBoltPoints[1] * mBoltFrame.height());
+ }
+ c.drawPath(mBoltPath, mBoltPaint);
+ } else if (level <= EMPTY) {
+ final float x = mWidth * 0.5f;
+ final float y = (mHeight + mWarningTextHeight) * 0.48f;
+ c.drawText(mWarningString, x, y, mWarningTextPaint);
+ } else if (mShowPercent && !(tracker.level == 100 && !SHOW_100_PERCENT)) {
+ mTextPaint.setTextSize(height *
+ (SINGLE_DIGIT_PERCENT ? 0.75f
+ : (tracker.level == 100 ? 0.38f : 0.5f)));
+ mTextPaint.setColor(level < 33 ? Color.WHITE : Color.BLACK);
+ mTextHeight = -mTextPaint.getFontMetrics().ascent;
+
+ final String str = String.valueOf(SINGLE_DIGIT_PERCENT ? (level/10) : level);
+ final float x = mWidth * 0.5f;
+ final float y = (mHeight + mTextHeight) * 0.47f;
+ c.drawText(str,
+ x,
+ y,
+ mTextPaint);
+ }
+ }
+
+ @Override
+ public void onIconManagerStatusChanged(int flags, ColorInfo colorInfo) {
+ if ((flags & StatusBarIconManager.FLAG_ICON_COLOR_CHANGED) != 0) {
+ setColor(colorInfo.coloringEnabled ?
+ colorInfo.iconColor[0] : colorInfo.defaultIconColor);
+ }
+ }
+}
diff --git a/src/com/ceco/gm2/gravitybox/ModBatteryStyle.java b/src/com/ceco/gm2/gravitybox/ModBatteryStyle.java
index 48c9bcc2c2..95f1aacd7b 100644
--- a/src/com/ceco/gm2/gravitybox/ModBatteryStyle.java
+++ b/src/com/ceco/gm2/gravitybox/ModBatteryStyle.java
@@ -15,17 +15,16 @@
package com.ceco.gm2.gravitybox;
-import static de.robv.android.xposed.XposedHelpers.findClass;
-import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
-
-import java.util.ArrayList;
-
+import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.Context;
import android.content.IntentFilter;
+import android.graphics.Color;
+import android.os.BatteryManager;
import android.os.Build;
import android.provider.Settings;
+import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
@@ -38,23 +37,27 @@
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_InitPackageResources.InitPackageResourcesParam;
import de.robv.android.xposed.callbacks.XC_LayoutInflated;
-import de.robv.android.xposed.callbacks.XCallback;
public class ModBatteryStyle {
private static final String TAG = "GB:ModBatteryStyle";
public static final String PACKAGE_NAME = "com.android.systemui";
public static final String CLASS_PHONE_STATUSBAR = "com.android.systemui.statusbar.phone.PhoneStatusBar";
- public static final String CLASS_BATTERY_CONTROLLER = "com.android.systemui.statusbar.policy.BatteryController";
+ public static final String CLASS_BATTERY_CONTROLLER =
+ "com.android.systemui.statusbar.policy.BatteryController";
private static final boolean DEBUG = false;
- private static final String ACTION_MTK_BATTERY_PERCENTAGE_SWITCH = "mediatek.intent.action.BATTERY_PERCENTAGE_SWITCH";
+ private static final String ACTION_MTK_BATTERY_PERCENTAGE_SWITCH =
+ "mediatek.intent.action.BATTERY_PERCENTAGE_SWITCH";
public static final String EXTRA_MTK_BATTERY_PERCENTAGE_STATE = "state";
public static final String SETTING_MTK_BATTERY_PERCENTAGE = "battery_percentage";
private static int mBatteryStyle;
- private static boolean mBatteryPercentText;
- private static boolean mMtkPercentText;
- private static Object mBatteryController;
+ private static boolean mBatteryPercentTextEnabled;
+ private static boolean mMtkPercentTextEnabled;
+ private static StatusbarBatteryPercentage mPercentText;
+ private static CmCircleBattery mCircleBattery;
+ private static View mStockBattery;
+ private static KitKatBattery mKitKatBattery;
private static void log(String message) {
XposedBridge.log(TAG + ": " + message);
@@ -70,23 +73,41 @@ public void onReceive(Context context, Intent intent) {
if (DEBUG) log("mBatteryStyle changed to: " + mBatteryStyle);
}
if (intent.hasExtra("batteryPercent")) {
- mBatteryPercentText = intent.getBooleanExtra("batteryPercent", false);
- if (DEBUG) log("mBatteryPercentText changed to: " + mBatteryPercentText);
+ mBatteryPercentTextEnabled = intent.getBooleanExtra("batteryPercent", false);
+ if (DEBUG) log("mBatteryPercentText changed to: " + mBatteryPercentTextEnabled);
}
- updateBatteryStyle();
+ updateBatteryStyle(null);
} else if (intent.getAction().equals(ACTION_MTK_BATTERY_PERCENTAGE_SWITCH)) {
- mMtkPercentText = intent.getIntExtra(EXTRA_MTK_BATTERY_PERCENTAGE_STATE, 0) == 1;
- if (DEBUG) log("mMtkPercentText changed to: " + mMtkPercentText);
- updateBatteryStyle();
+ mMtkPercentTextEnabled = intent.getIntExtra(EXTRA_MTK_BATTERY_PERCENTAGE_STATE, 0) == 1;
+ if (DEBUG) log("mMtkPercentText changed to: " + mMtkPercentTextEnabled);
+ updateBatteryStyle(null);
}
}
};
public static void initResources(XSharedPreferences prefs, InitPackageResourcesParam resparam) {
try {
- String layout = Utils.hasGeminiSupport() ? "gemini_super_status_bar" : "super_status_bar";
+ // Before anything else, let's make sure we're not dealing with a Lenovo device
+ // Lenovo is known for doing some deep customizations into UI, so let's just check
+ // if is possible to hook a specific layout and work with it in that case
+ String layout = "lenovo_gemini_super_status_bar";
+ try{
+ resparam.res.hookLayout(PACKAGE_NAME, "layout", layout, new XC_LayoutInflated() {
+
+ @Override
+ public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
+ if (DEBUG) log("Lenovo custom layout found");
+ }
+ });
+ } catch (Throwable t) {
+ // Specific layout not found, so let's work with standard layout
+ layout = Utils.hasGeminiSupport() ? "gemini_super_status_bar" : "super_status_bar";
+ }
+ final String[] batteryPercentTextIds = new String[] { "percentage", "battery_text" };
+
resparam.res.hookLayout(PACKAGE_NAME, "layout", layout, new XC_LayoutInflated() {
+ @SuppressLint("NewApi")
@Override
public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
@@ -94,25 +115,35 @@ public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
liparam.res.getIdentifier("signal_battery_cluster", "id", PACKAGE_NAME));
// inject percent text if it doesn't exist
- TextView percText = (TextView) vg.findViewById(liparam.res.getIdentifier(
- "percentage", "id", PACKAGE_NAME));
- if (percText == null) {
- percText = new TextView(vg.getContext());
- percText.setTag("percentage");
+ for (String bptId : batteryPercentTextIds) {
+ final int bptResId = liparam.res.getIdentifier(
+ bptId, "id", PACKAGE_NAME);
+ if (bptResId != 0) {
+ View v = vg.findViewById(bptResId);
+ if (v != null && v instanceof TextView) {
+ mPercentText = new StatusbarBatteryPercentage((TextView) v);
+ mPercentText.getView().setTag("percentage");
+ if (DEBUG) log("Battery percent text found as: " + bptId);
+ break;
+ }
+ }
+ }
+ if (mPercentText == null) {
+ TextView percentTextView = new TextView(vg.getContext());
+ percentTextView.setTag("percentage");
LinearLayout.LayoutParams lParams = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
- percText.setLayoutParams(lParams);
- percText.setPadding(4, 0, 0, 0);
- percText.setTextSize(1, 16);
- percText.setTextColor(vg.getContext().getResources().getColor(
- android.R.color.holo_blue_dark));
- percText.setVisibility(View.GONE);
- vg.addView(percText);
+ percentTextView.setLayoutParams(lParams);
+ percentTextView.setPadding(6, 0, 0, 0);
+ percentTextView.setTextSize(1, 16);
+ percentTextView.setTextColor(Build.VERSION.SDK_INT > 18 ? Color.WHITE :
+ vg.getContext().getResources().getColor(android.R.color.holo_blue_dark));
+ percentTextView.setVisibility(View.GONE);
+ mPercentText = new StatusbarBatteryPercentage(percentTextView);
+ vg.addView(mPercentText.getView());
if (DEBUG) log("Battery percent text injected");
- } else {
- percText.setTag("percentage");
}
- ModStatusbarColor.setPercentage(percText);
+ ModStatusbarColor.registerIconManagerListener(mPercentText);
// GM2 specific - if there's already view with id "circle_battery", remove it
if (Build.DISPLAY.toLowerCase().contains("gravitymod")) {
@@ -125,23 +156,43 @@ public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
}
// inject circle battery view
- CmCircleBattery circleBattery = new CmCircleBattery(vg.getContext());
- circleBattery.setTag("circle_battery");
+ mCircleBattery = new CmCircleBattery(vg.getContext());
+ mCircleBattery.setTag("circle_battery");
LinearLayout.LayoutParams lParams = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
- circleBattery.setLayoutParams(lParams);
- circleBattery.setPadding(4, 0, 0, 0);
- circleBattery.setVisibility(View.GONE);
- ModStatusbarColor.setCircleBattery(circleBattery);
- vg.addView(circleBattery);
+ lParams.gravity = Gravity.CENTER_VERTICAL;
+ mCircleBattery.setLayoutParams(lParams);
+ mCircleBattery.setPadding(4, 0, 0, 0);
+ mCircleBattery.setVisibility(View.GONE);
+ ModStatusbarColor.registerIconManagerListener(mCircleBattery);
+ vg.addView(mCircleBattery);
if (DEBUG) log("CmCircleBattery injected");
+ // inject KitKat battery view
+ mKitKatBattery = new KitKatBattery(vg.getContext());
+ mKitKatBattery.setTag("kitkat_battery");
+ final float density = liparam.res.getDisplayMetrics().density;
+ lParams = new LinearLayout.LayoutParams((int)(density * 10.5f),
+ (int)(density * 16));
+ if (Build.VERSION.SDK_INT > 16) {
+ lParams.setMarginStart((int)(density * 4));
+ } else {
+ lParams.leftMargin = Math.round(density * 4);
+ }
+ if (Utils.hasGeminiSupport()) {
+ lParams.bottomMargin = 2;
+ }
+ mKitKatBattery.setLayoutParams(lParams);
+ mKitKatBattery.setVisibility(View.GONE);
+ ModStatusbarColor.registerIconManagerListener(mKitKatBattery);
+ vg.addView(mKitKatBattery);
+
// find battery
- ImageView battery = (ImageView) vg.findViewById(
+ mStockBattery = vg.findViewById(
liparam.res.getIdentifier("battery", "id", PACKAGE_NAME));
- if (battery != null) {
- battery.setTag("stock_battery");
- ModStatusbarColor.setBattery(battery);
+ if (mStockBattery != null) {
+ mStockBattery.setTag("stock_battery");
+ ModStatusbarColor.setBattery(mStockBattery);
}
}
@@ -152,65 +203,23 @@ public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
}
public static void init(final XSharedPreferences prefs, ClassLoader classLoader) {
-
if (DEBUG) log("init");
try {
-
- Class> phoneStatusBarClass = findClass(CLASS_PHONE_STATUSBAR, classLoader);
- Class> batteryControllerClass = findClass(CLASS_BATTERY_CONTROLLER, classLoader);
-
- findAndHookMethod(phoneStatusBarClass, "makeStatusBarView", new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
-
- @Override
- protected void afterHookedMethod(MethodHookParam param) throws Throwable {
-
- Object mBatteryController = XposedHelpers.getObjectField(param.thisObject, "mBatteryController");
- View mStatusBarView = (View) XposedHelpers.getObjectField(param.thisObject, "mStatusBarView");
-
- ImageView circleBattery = (ImageView) mStatusBarView.findViewWithTag("circle_battery");
- if (circleBattery != null) {
- XposedHelpers.callMethod(mBatteryController, "addIconView", circleBattery);
- if (DEBUG) log("BatteryController.addIconView(circleBattery)");
- }
-
- TextView percText = (TextView) mStatusBarView.findViewWithTag("percentage");
- if (percText != null) {
- // add percent text only in case there is no label with "percentage" tag present
- @SuppressWarnings("unchecked")
- ArrayList mLabelViews =
- (ArrayList) XposedHelpers.getObjectField(mBatteryController, "mLabelViews");
- boolean percentTextExists = false;
- for (TextView tv : mLabelViews) {
- if ("percentage".equals(tv.getTag())) {
- percentTextExists = true;
- break;
- }
- }
- if (!percentTextExists) {
- XposedHelpers.callMethod(mBatteryController, "addLabelView", percText);
- if (DEBUG) log("BatteryController.addLabelView(percText)");
- }
- }
- }
- });
+ Class> batteryControllerClass = XposedHelpers.findClass(CLASS_BATTERY_CONTROLLER, classLoader);
XposedBridge.hookAllConstructors(batteryControllerClass, new XC_MethodHook() {
@Override
protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
- mBatteryController = param.thisObject;
-
prefs.reload();
- mBatteryStyle = Integer.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_BATTERY_STYLE, "1"));
- mBatteryPercentText = prefs.getBoolean(GravityBoxSettings.PREF_KEY_BATTERY_PERCENT_TEXT, false);
- // handle obsolete settings
- if (mBatteryStyle == 4) {
- mBatteryStyle = GravityBoxSettings.BATTERY_STYLE_STOCK;
- }
+ mBatteryStyle = Integer.valueOf(prefs.getString(
+ GravityBoxSettings.PREF_KEY_BATTERY_STYLE, "1"));
+ mBatteryPercentTextEnabled = prefs.getBoolean(
+ GravityBoxSettings.PREF_KEY_BATTERY_PERCENT_TEXT, false);
- Context context = (Context) XposedHelpers.getObjectField(mBatteryController, "mContext");
- mMtkPercentText = Utils.isMtkDevice() ?
+ Context context = (Context) param.args[0];
+ mMtkPercentTextEnabled = Utils.isMtkDevice() ?
Settings.Secure.getInt(context.getContentResolver(),
SETTING_MTK_BATTERY_PERCENTAGE, 0) == 1 : false;
@@ -221,15 +230,21 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
}
context.registerReceiver(mBroadcastReceiver, intentFilter);
+ updateBatteryStyle(null);
if (DEBUG) log("BatteryController constructed");
}
});
- findAndHookMethod(batteryControllerClass, "onReceive", Context.class, Intent.class, new XC_MethodHook() {
-
+ XposedHelpers.findAndHookMethod(batteryControllerClass, "onReceive",
+ Context.class, Intent.class, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
- updateBatteryStyle();
+ Integer level = null;
+ Intent intent = (Intent) param.args[1];
+ if (intent != null) {
+ level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
+ }
+ updateBatteryStyle(level);
}
});
}
@@ -238,38 +253,39 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
}
}
- private static void updateBatteryStyle() {
- if (mBatteryController == null) return;
-
+ private static void updateBatteryStyle(Integer level) {
try {
- @SuppressWarnings("unchecked")
- ArrayList mIconViews =
- (ArrayList) XposedHelpers.getObjectField(mBatteryController, "mIconViews");
- @SuppressWarnings("unchecked")
- ArrayList mLabelViews =
- (ArrayList) XposedHelpers.getObjectField(mBatteryController, "mLabelViews");
-
- for (ImageView iv : mIconViews) {
- if ("stock_battery".equals(iv.getTag())) {
- iv.setVisibility((mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_STOCK) ?
- View.VISIBLE : View.GONE);
- } else if ("circle_battery".equals(iv.getTag())) {
- iv.setVisibility((mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_CIRCLE ||
- mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_CIRCLE_PERCENT) ?
- View.VISIBLE : View.GONE);
- ((CmCircleBattery)iv).setPercentage(
- mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_CIRCLE_PERCENT);
- }
+ if (mStockBattery != null) {
+ mStockBattery.setVisibility((mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_STOCK) ?
+ View.VISIBLE : View.GONE);
}
-
- for (TextView tv : mLabelViews) {
- if ("percentage".equals(tv.getTag())) {
- tv.setVisibility(
- ((mBatteryPercentText || mMtkPercentText) ? View.VISIBLE : View.GONE));
+
+ if (mCircleBattery != null) {
+ mCircleBattery.setVisibility((mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_CIRCLE ||
+ mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_CIRCLE_PERCENT) ?
+ View.VISIBLE : View.GONE);
+ mCircleBattery.setPercentage(
+ mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_CIRCLE_PERCENT);
+ }
+
+ if (mKitKatBattery != null) {
+ mKitKatBattery.setVisibility((mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_KITKAT ||
+ mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_KITKAT_PERCENT) ?
+ View.VISIBLE : View.GONE);
+ mKitKatBattery.setShowPercent(
+ mBatteryStyle == GravityBoxSettings.BATTERY_STYLE_KITKAT_PERCENT);
+ }
+
+ if (mPercentText != null) {
+ if (level != null) {
+ mPercentText.getView().setText(level + "%");
}
+ mPercentText.getView().setVisibility(
+ (mBatteryPercentTextEnabled || mMtkPercentTextEnabled) ?
+ View.VISIBLE : View.GONE);
}
} catch (Throwable t) {
XposedBridge.log(t);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/com/ceco/gm2/gravitybox/ModCallCard.java b/src/com/ceco/gm2/gravitybox/ModCallCard.java
index 4650bda9a5..5466bdcb20 100644
--- a/src/com/ceco/gm2/gravitybox/ModCallCard.java
+++ b/src/com/ceco/gm2/gravitybox/ModCallCard.java
@@ -15,10 +15,17 @@
package com.ceco.gm2.gravitybox;
+import java.io.File;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import de.robv.android.xposed.XC_MethodHook;
@@ -54,8 +61,8 @@ public static void init(final XSharedPreferences prefs, ClassLoader classLoader)
if (DEBUG) XposedBridge.log(TAG + ": init");
try {
- Class> callCardClass = XposedHelpers.findClass(CLASS_CALLCARD, classLoader);
- Class> inCallTouchUiClass = XposedHelpers.findClass(CLASS_IN_CALL_TOUCH_UI, classLoader);
+ final Class> callCardClass = XposedHelpers.findClass(CLASS_CALLCARD, classLoader);
+ final Class> inCallTouchUiClass = XposedHelpers.findClass(CLASS_IN_CALL_TOUCH_UI, classLoader);
XposedHelpers.findAndHookMethod(callCardClass, "updateCallInfoLayout", phoneConstStateClass,
new XC_MethodHook() {
@@ -126,6 +133,35 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
}
}
});
+
+ XposedHelpers.findAndHookMethod(callCardClass, "showImage",
+ ImageView.class, int.class, new XC_MethodHook() {
+ @Override
+ protected void beforeHookedMethod(final MethodHookParam param) throws Throwable {
+ if (!prefs.getBoolean(
+ GravityBoxSettings.PREF_KEY_CALLER_UNKNOWN_PHOTO_ENABLE, false) ||
+ param.args[0] == null) return;
+
+ final ImageView iv = (ImageView) param.args[0];
+ final Context context = iv.getContext();
+ final int resId = context.getResources().getIdentifier(
+ "picture_unknown", "drawable", PACKAGE_NAME);
+
+ if (resId == (Integer) param.args[1]) {
+ Context gbContext = context.createPackageContext(GravityBox.PACKAGE_NAME, 0);
+ final String path = gbContext.getFilesDir() + "/caller_photo";
+ File f = new File(path);
+ if (f.exists()) {
+ Bitmap b = BitmapFactory.decodeFile(path);
+ if (b != null) {
+ XposedHelpers.callStaticMethod(callCardClass, "showImage", iv, b);
+ param.setResult(null);
+ return;
+ }
+ }
+ }
+ }
+ });
} catch (Throwable t) {
XposedBridge.log(t);
}
diff --git a/src/com/ceco/gm2/gravitybox/ModClearAllRecents.java b/src/com/ceco/gm2/gravitybox/ModClearAllRecents.java
index 08267d2164..d218a682d9 100644
--- a/src/com/ceco/gm2/gravitybox/ModClearAllRecents.java
+++ b/src/com/ceco/gm2/gravitybox/ModClearAllRecents.java
@@ -245,14 +245,18 @@ private static void updateButtonLayout(View container) {
FrameLayout.LayoutParams lparams =
(FrameLayout.LayoutParams) mRecentsClearButton.getLayoutParams();
lparams.gravity = gravity;
- if ((gravity & Gravity.TOP) != 0) {
+ if (gravity == 51 || gravity == 53) {
int marginTop = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP,
mPrefs.getInt(GravityBoxSettings.PREF_KEY_RECENTS_CLEAR_MARGIN_TOP, 0),
mRecentsClearButton.getResources().getDisplayMetrics());
lparams.setMargins(0, marginTop, 0, 0);
} else {
- lparams.setMargins(0, 0, 0, 0);
+ int marginBottom = (int) TypedValue.applyDimension(
+ TypedValue.COMPLEX_UNIT_DIP,
+ mPrefs.getInt(GravityBoxSettings.PREF_KEY_RECENTS_CLEAR_MARGIN_BOTTOM, 0),
+ mRecentsClearButton.getResources().getDisplayMetrics());
+ lparams.setMargins(0, 0, 0, marginBottom);
}
mRecentsClearButton.setLayoutParams(lparams);
mRecentsClearButton.setVisibility(View.VISIBLE);
@@ -316,6 +320,9 @@ private static void updateRamBarLayout() {
final int marginTop = rbOnTop ? (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
mPrefs.getInt(GravityBoxSettings.PREF_KEY_RECENTS_CLEAR_MARGIN_TOP, 0),
mRamUsageBar.getResources().getDisplayMetrics()) : 0;
+ final int marginBottom = !rbOnTop ? (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ mPrefs.getInt(GravityBoxSettings.PREF_KEY_RECENTS_CLEAR_MARGIN_BOTTOM, 0),
+ mRamUsageBar.getResources().getDisplayMetrics()) : 0;
FrameLayout.LayoutParams flp = (FrameLayout.LayoutParams) mRamUsageBar.getLayoutParams();
flp.gravity = rbGravity;
@@ -323,7 +330,7 @@ private static void updateRamBarLayout() {
sibling && caOnLeft ? mClearAllRecentsSizePx : mRamUsageBarHorizontalMargin,
rbOnTop ? (mRamUsageBarVerticalMargin + marginTop) : 0,
sibling && !caOnLeft ? mClearAllRecentsSizePx : mRamUsageBarHorizontalMargin,
- rbOnTop ? 0 : mRamUsageBarVerticalMargin
+ rbOnTop ? 0 : (mRamUsageBarVerticalMargin + marginBottom)
);
mRamUsageBar.setLayoutParams(flp);
mRamUsageBar.setVisibility(View.VISIBLE);
diff --git a/src/com/ceco/gm2/gravitybox/ModDisplay.java b/src/com/ceco/gm2/gravitybox/ModDisplay.java
index 7e1e91df1f..24a532eb42 100644
--- a/src/com/ceco/gm2/gravitybox/ModDisplay.java
+++ b/src/com/ceco/gm2/gravitybox/ModDisplay.java
@@ -87,7 +87,7 @@ public void onReceive(Context context, Intent intent) {
mButtonBacklightMode = intent.getStringExtra(GravityBoxSettings.EXTRA_BB_MODE);
updateButtonBacklight();
}
- if (intent.hasExtra(GravityBoxSettings.EXTRA_BB_NOTIF)) {
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_BB_NOTIF) && Build.VERSION.SDK_INT < 19) {
mButtonBacklightNotif = intent.getBooleanExtra(GravityBoxSettings.EXTRA_BB_NOTIF, false);
if (!mButtonBacklightNotif) {
mPendingNotif = false;
@@ -108,20 +108,24 @@ private static void updateButtonBacklight() {
private static void updateButtonBacklight(boolean isScreenOn) {
if (mLight == null || mPendingNotif) return;
- Integer color = null;
- if (mButtonBacklightMode.equals(GravityBoxSettings.BB_MODE_ALWAYS_ON)) {
- color = isScreenOn ? 0xff6e6e6e : 0;
- } else if (mButtonBacklightMode.equals(GravityBoxSettings.BB_MODE_DISABLE)) {
- color = 0;
- } else if (!isScreenOn) {
- color = 0;
- }
-
- if (color != null) {
- Object ls = XposedHelpers.getSurroundingThis(mLight);
- int np = XposedHelpers.getIntField(ls, "mNativePointer");
- XposedHelpers.callMethod(ls, "setLight_native",
- np, LIGHT_ID_BUTTONS, color, 0, 0, 0, 0);
+ try {
+ Integer color = null;
+ if (mButtonBacklightMode.equals(GravityBoxSettings.BB_MODE_ALWAYS_ON)) {
+ color = isScreenOn ? 0xff6e6e6e : 0;
+ } else if (mButtonBacklightMode.equals(GravityBoxSettings.BB_MODE_DISABLE)) {
+ color = 0;
+ } else if (!isScreenOn) {
+ color = 0;
+ }
+
+ if (color != null) {
+ Object ls = XposedHelpers.getSurroundingThis(mLight);
+ int np = XposedHelpers.getIntField(ls, "mNativePointer");
+ XposedHelpers.callMethod(ls, "setLight_native",
+ np, LIGHT_ID_BUTTONS, color, 0, 0, 0, 0);
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
}
}
@@ -176,7 +180,8 @@ public static void initZygote(final XSharedPreferences prefs) {
mButtonBacklightMode = prefs.getString(
GravityBoxSettings.PREF_KEY_BUTTON_BACKLIGHT_MODE, GravityBoxSettings.BB_MODE_DEFAULT);
mButtonBacklightNotif = prefs.getBoolean(
- GravityBoxSettings.PREF_KEY_BUTTON_BACKLIGHT_NOTIFICATIONS, false);
+ GravityBoxSettings.PREF_KEY_BUTTON_BACKLIGHT_NOTIFICATIONS, false) &&
+ Build.VERSION.SDK_INT < 19;
if (brightnessSettingsEnabled && classDisplayPowerController != null) {
int brightnessMin = prefs.getInt(GravityBoxSettings.PREF_KEY_BRIGHTNESS_MIN, 20);
@@ -270,7 +275,6 @@ int.class, int.class, int.class, int.class, int.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(final MethodHookParam param) throws Throwable {
- if (mHandler == null) mHandler = new Handler();
if (mLight == null) mLight = param.thisObject;
int id = XposedHelpers.getIntField(param.thisObject, "mId");
if (DEBUG) log("lightId=" + id + "; color=" + param.args[0] +
@@ -299,6 +303,7 @@ protected void beforeHookedMethod(final MethodHookParam param) throws Throwable
}
if (mButtonBacklightNotif) {
+ if (mHandler == null) mHandler = new Handler();
if (id == LIGHT_ID_NOTIFICATIONS || id == LIGHT_ID_ATTENTION) {
if ((Integer)param.args[0] != 0) {
if (!mPendingNotif) {
diff --git a/src/com/ceco/gm2/gravitybox/ModExpandedDesktop.java b/src/com/ceco/gm2/gravitybox/ModExpandedDesktop.java
index 42846bd5b0..4a74ba02d5 100644
--- a/src/com/ceco/gm2/gravitybox/ModExpandedDesktop.java
+++ b/src/com/ceco/gm2/gravitybox/ModExpandedDesktop.java
@@ -628,7 +628,8 @@ private static class ApplicationDisplayMetrics {
}
private static void updateDisplayMetrics(Object windowManager) {
- if (windowManager == null || Build.VERSION.SDK_INT < 17) return;
+ if (windowManager == null || Build.VERSION.SDK_INT < 17
+ || Build.VERSION.SDK_INT > 18) return;
final long origId = Binder.clearCallingIdentity();
boolean changed = false;
diff --git a/src/com/ceco/gm2/gravitybox/ModHwKeys.java b/src/com/ceco/gm2/gravitybox/ModHwKeys.java
index abc3527f17..41e00406b8 100644
--- a/src/com/ceco/gm2/gravitybox/ModHwKeys.java
+++ b/src/com/ceco/gm2/gravitybox/ModHwKeys.java
@@ -34,6 +34,7 @@
import android.hardware.input.InputManager;
import android.os.Build;
import android.os.Handler;
+import android.os.IBinder;
import android.os.PowerManager;
import android.os.Process;
import android.os.SystemClock;
@@ -79,13 +80,18 @@ public class ModHwKeys {
private static boolean mIsMenuLongPressed = false;
private static boolean mIsMenuDoubleTap = false;
private static boolean mIsBackLongPressed = false;
+ private static boolean mIsBackDoubleTap = false;
+ private static boolean mWasBackDoubleTap = false;
private static boolean mIsRecentsLongPressed = false;
private static boolean mIsHomeLongPressed = false;
private static int mMenuLongpressAction = 0;
private static int mMenuDoubletapAction = 0;
private static int mHomeLongpressAction = 0;
private static int mHomeLongpressActionKeyguard = 0;
+ private static boolean mHomeDoubletapDisabled;
+ private static int mHomeDoubletapDefaultAction;
private static int mBackLongpressAction = 0;
+ private static int mBackDoubletapAction = 0;
private static int mRecentsSingletapAction = 0;
private static int mRecentsLongpressAction = 0;
private static int mDoubletapSpeed = GravityBoxSettings.HWKEY_DOUBLETAP_SPEED_DEFAULT;
@@ -93,12 +99,18 @@ public class ModHwKeys {
private static boolean mVolumeRockerWakeDisabled = false;
private static boolean mHwKeysEnabled = true;
private static XSharedPreferences mPrefs;
+ private static AppLauncher mAppLauncher;
+ private static int mPieMode;
+ private static int mExpandedDesktopMode;
+ private static boolean mMenuKeyPressed;
+ private static boolean mBackKeyPressed;
private static List mKillIgnoreList = new ArrayList(Arrays.asList(
"com.android.systemui",
"com.mediatek.bluetooth",
"android.process.acore",
- "com.google.process.gapps"
+ "com.google.process.gapps",
+ "com.android.smspush"
));
private static void log(String message) {
@@ -118,6 +130,7 @@ private static enum HwKeyTrigger {
HOME_LONGPRESS,
HOME_LONGPRESS_KEYGUARD,
BACK_LONGPRESS,
+ BACK_DOUBLETAP,
RECENTS_SINGLETAP,
RECENTS_LONGPRESS
}
@@ -153,9 +166,26 @@ public void onReceive(Context context, Intent intent) {
if (DEBUG) log("Home long-press action while keyguard on set to: " +
mHomeLongpressActionKeyguard);
}
+ } else if (action.equals(GravityBoxSettings.ACTION_PREF_HWKEY_HOME_DOUBLETAP_CHANGED)) {
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_HWKEY_HOME_DOUBLETAP_DISABLE)) {
+ mHomeDoubletapDisabled = intent.getBooleanExtra(
+ GravityBoxSettings.EXTRA_HWKEY_HOME_DOUBLETAP_DISABLE, false);
+ if (Build.VERSION.SDK_INT > 17 && mPhoneWindowManager != null) {
+ try {
+ XposedHelpers.setIntField(mPhoneWindowManager, "mDoubleTapOnHomeBehavior",
+ mHomeDoubletapDisabled ? 0 : mHomeDoubletapDefaultAction);
+ } catch (Throwable t) {
+ log("PhoneWindowManager: Error settings mDoubleTapOnHomeBehavior: " +
+ t.getMessage());
+ }
+ }
+ }
} else if (action.equals(GravityBoxSettings.ACTION_PREF_HWKEY_BACK_LONGPRESS_CHANGED)) {
mBackLongpressAction = value;
if (DEBUG) log("Back long-press action set to: " + value);
+ } else if (action.equals(GravityBoxSettings.ACTION_PREF_HWKEY_BACK_DOUBLETAP_CHANGED)) {
+ mBackDoubletapAction = value;
+ if (DEBUG) log("Back double-tap action set to: " + value);
} else if (action.equals(GravityBoxSettings.ACTION_PREF_HWKEY_RECENTS_SINGLETAP_CHANGED)) {
mRecentsSingletapAction = value;
if (DEBUG) log("Recents single-tap action set to: " + value);
@@ -172,20 +202,37 @@ public void onReceive(Context context, Intent intent) {
mVolumeRockerWakeDisabled = intent.getBooleanExtra(
GravityBoxSettings.EXTRA_VOLUME_ROCKER_WAKE_DISABLE, false);
if (DEBUG) log("mVolumeRockerWakeDisabled set to: " + mVolumeRockerWakeDisabled);
- } else if (action.equals(GravityBoxSettings.ACTION_PREF_PIE_CHANGED) &&
- intent.hasExtra(GravityBoxSettings.EXTRA_PIE_HWKEYS_DISABLE)) {
- mHwKeysEnabled = !intent.getBooleanExtra(GravityBoxSettings.EXTRA_PIE_HWKEYS_DISABLE, false);
+ } else if (action.equals(GravityBoxSettings.ACTION_PREF_PIE_CHANGED)) {
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_HWKEYS_DISABLE)) {
+ mHwKeysEnabled = !intent.getBooleanExtra(GravityBoxSettings.EXTRA_PIE_HWKEYS_DISABLE, false);
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_ENABLE)) {
+ mPieMode = intent.getIntExtra(GravityBoxSettings.EXTRA_PIE_ENABLE, 0);
+ }
} else if (action.equals(ACTION_SCREENSHOT) && mPhoneWindowManager != null) {
- XposedHelpers.callMethod(mPhoneWindowManager, "takeScreenshot");
+ try {
+ XposedHelpers.callMethod(mPhoneWindowManager, "takeScreenshot");
+ } catch (Throwable t) {
+ log("Error executing PhoneWindowManager.takeScreenshot(): " + t.getMessage());
+ }
} else if (action.equals(GravityBoxSettings.ACTION_PREF_DISPLAY_ALLOW_ALL_ROTATIONS_CHANGED)) {
final boolean allowAllRotations = intent.getBooleanExtra(
GravityBoxSettings.EXTRA_ALLOW_ALL_ROTATIONS, false);
- if (mPhoneWindowManager != null) {
+ try {
XposedHelpers.setIntField(mPhoneWindowManager, "mAllowAllRotations",
allowAllRotations ? 1 : 0);
+ } catch (Throwable t) {
+ log("Error settings PhoneWindowManager.mAllowAllRotations: " + t.getMessage());
}
} else if (action.equals(ACTION_SHOW_POWER_MENU) && mPhoneWindowManager != null) {
- XposedHelpers.callMethod(mPhoneWindowManager, "showGlobalActionsDialog");
+ try {
+ XposedHelpers.callMethod(mPhoneWindowManager, "showGlobalActionsDialog");
+ } catch (Throwable t) {
+ log("Error executing PhoneWindowManager.showGlobalActionsDialog(): " + t.getMessage());
+ }
+ } else if (action.equals(GravityBoxSettings.ACTION_PREF_EXPANDED_DESKTOP_MODE_CHANGED)) {
+ mExpandedDesktopMode = intent.getIntExtra(
+ GravityBoxSettings.EXTRA_ED_MODE, GravityBoxSettings.ED_DISABLED);
}
}
};
@@ -202,6 +249,8 @@ public static void initZygote(final XSharedPreferences prefs) {
prefs.getString(GravityBoxSettings.PREF_KEY_HWKEY_HOME_LONGPRESS, "0"));
mBackLongpressAction = Integer.valueOf(
prefs.getString(GravityBoxSettings.PREF_KEY_HWKEY_BACK_LONGPRESS, "0"));
+ mBackDoubletapAction = Integer.valueOf(
+ prefs.getString(GravityBoxSettings.PREF_KEY_HWKEY_BACK_DOUBLETAP, "0"));
mRecentsSingletapAction = Integer.valueOf(
prefs.getString(GravityBoxSettings.PREF_KEY_HWKEY_RECENTS_SINGLETAP, "0"));
mRecentsLongpressAction = Integer.valueOf(
@@ -217,10 +266,27 @@ public static void initZygote(final XSharedPreferences prefs) {
mHomeLongpressActionKeyguard = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_HWKEY_HOME_LONGPRESS_KEYGUARD, false) ?
GravityBoxSettings.HWKEY_ACTION_TORCH : GravityBoxSettings.HWKEY_ACTION_DEFAULT;
+ mHomeDoubletapDisabled = prefs.getBoolean(
+ GravityBoxSettings.PREF_KEY_HWKEY_HOME_DOUBLETAP_DISABLE, false);
mVolumeRockerWakeDisabled = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_VOLUME_ROCKER_WAKE_DISABLE, false);
mHwKeysEnabled = !prefs.getBoolean(GravityBoxSettings.PREF_KEY_HWKEYS_DISABLE, false);
+ mPieMode = ModPieControls.PIE_DISABLED;
+ try {
+ mPieMode = Integer.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_PIE_CONTROL_ENABLE, "0"));
+ } catch (NumberFormatException nfe) {
+ log("Invalid preference value for Pie Mode");
+ }
+
+ mExpandedDesktopMode = GravityBoxSettings.ED_DISABLED;
+ try {
+ mExpandedDesktopMode = Integer.valueOf(prefs.getString(
+ GravityBoxSettings.PREF_KEY_EXPANDED_DESKTOP, "0"));
+ } catch (NumberFormatException nfe) {
+ log("Invalid value for PREF_KEY_EXPANDED_DESKTOP preference");
+ }
+
final Class> classPhoneWindowManager = XposedHelpers.findClass(CLASS_PHONE_WINDOW_MANAGER, null);
classActivityManagerNative = XposedHelpers.findClass(CLASS_ACTIVITY_MANAGER_NATIVE, null);
@@ -242,6 +308,18 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
boolean keyguardOn = (Boolean) XposedHelpers.callMethod(mPhoneWindowManager, "keyguardOn");
Handler handler = (Handler) XposedHelpers.getObjectField(param.thisObject, "mHandler");
+ if (DEBUG) log("interceptKeyBeforeQueueing: keyCode=" + keyCode +
+ "; action=" + event.getAction());
+
+ if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
+ if (!down) {
+ handler.removeCallbacks(mResetBrightnessRunnable);
+ } else {
+ if (event.getRepeatCount() == 0) {
+ handler.postDelayed(mResetBrightnessRunnable, 7000);
+ }
+ }
+ }
if (mVolumeRockerWakeDisabled &&
(keyCode == KeyEvent.KEYCODE_VOLUME_UP ||
@@ -261,7 +339,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
param.setResult(0);
return;
}
- if (!mHwKeysEnabled &&
+ if (!areHwKeysEnabled() &&
event.getRepeatCount() == 0 &&
(event.getFlags() & KeyEvent.FLAG_FROM_SYSTEM) != 0) {
if (DEBUG) log("HOME KeyEvent coming from HW key and keys disabled. Ignoring.");
@@ -296,27 +374,38 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
KeyEvent event = (KeyEvent) param.args[1];
int keyCode = event.getKeyCode();
boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
+ boolean isFromSystem = (event.getFlags() & KeyEvent.FLAG_FROM_SYSTEM) != 0;
Handler mHandler = (Handler) XposedHelpers.getObjectField(param.thisObject, "mHandler");
- if (DEBUG) log("keyCode=" + keyCode);
+ if (DEBUG) log("interceptKeyBeforeDispatching: keyCode=" + keyCode +
+ "; isInjected=" + (((Integer)param.args[2] & 0x01000000) != 0) +
+ "; fromSystem=" + isFromSystem);
- if (keyCode == KeyEvent.KEYCODE_MENU) {
- if (!hasAction(HwKey.MENU) && mHwKeysEnabled) return;
+ if (keyCode == KeyEvent.KEYCODE_MENU && isFromSystem &&
+ (hasAction(HwKey.MENU) || !areHwKeysEnabled())) {
if (!down) {
+ mMenuKeyPressed = false;
mHandler.removeCallbacks(mMenuLongPress);
if (mIsMenuLongPressed) {
+ mIsMenuLongPressed = false;
param.setResult(-1);
return;
}
- if (!mHwKeysEnabled &&
- event.getRepeatCount() == 0 &&
- ((event.getFlags() & KeyEvent.FLAG_FROM_SYSTEM) != 0)) {
- if (DEBUG) log("MENU KeyEvent coming from HW key and keys disabled. Ignoring.");
- param.setResult(-1);
- return;
+ if (event.getRepeatCount() == 0) {
+ if (!areHwKeysEnabled()) {
+ if (DEBUG) log("MENU KeyEvent coming from HW key and keys disabled. Ignoring.");
+ param.setResult(-1);
+ return;
+ } else if (mIsMenuDoubleTap) {
+ // we are still waiting for double-tap
+ if (DEBUG) log("MENU doubletap pending. Ignoring.");
+ param.setResult(-1);
+ return;
+ }
}
} else {
if (event.getRepeatCount() == 0) {
+ mMenuKeyPressed = true;
if (mIsMenuDoubleTap) {
performAction(HwKeyTrigger.MENU_DOUBLETAP);
mHandler.removeCallbacks(mMenuDoubleTapReset);
@@ -329,6 +418,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if (mMenuDoubletapAction != GravityBoxSettings.HWKEY_ACTION_DEFAULT) {
mIsMenuDoubleTap = true;
mHandler.postDelayed(mMenuDoubleTapReset, mDoubletapSpeed);
+ param.setResult(-1);
}
if (mMenuLongpressAction != GravityBoxSettings.HWKEY_ACTION_DEFAULT) {
mHandler.postDelayed(mMenuLongPress,
@@ -344,48 +434,70 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
}
- if (keyCode == KeyEvent.KEYCODE_BACK) {
- if (!hasAction(HwKey.BACK) && mHwKeysEnabled) return;
+ if (keyCode == KeyEvent.KEYCODE_BACK && isFromSystem &&
+ (hasAction(HwKey.BACK) || !areHwKeysEnabled())) {
if (!down) {
+ mBackKeyPressed = false;
mHandler.removeCallbacks(mBackLongPress);
if (mIsBackLongPressed) {
- param.setResult(-1);
- return;
- }
- if (!mHwKeysEnabled &&
- event.getRepeatCount() == 0 &&
- ((event.getFlags() & KeyEvent.FLAG_FROM_SYSTEM) != 0)) {
- if (DEBUG) log("BACK KeyEvent coming from HW key and keys disabled. Ignoring.");
- param.setResult(-1);
- return;
+ mIsBackLongPressed = false;
+ } else if (areHwKeysEnabled() && !mIsBackDoubleTap && !mWasBackDoubleTap) {
+ // inject BACK key event as it was previously eaten by us
+ if (DEBUG) log("Triggering original DOWN/UP events for BACK key");
+ injectKey(KeyEvent.KEYCODE_BACK);
+ } else {
+ if (DEBUG) log("BACK KeyEvent coming from HW key and keys disabled; " +
+ "or pending double-tap. Ignoring.");
}
} else {
if (event.getRepeatCount() == 0) {
- mIsBackLongPressed = false;
- if (mBackLongpressAction != GravityBoxSettings.HWKEY_ACTION_DEFAULT) {
- mHandler.postDelayed(mBackLongPress,
- getLongpressTimeoutForAction(mBackLongpressAction));
+ mBackKeyPressed = true;
+ mWasBackDoubleTap = mIsBackDoubleTap;
+ if (mIsBackDoubleTap) {
+ performAction(HwKeyTrigger.BACK_DOUBLETAP);
+ mHandler.removeCallbacks(mBackDoubleTapReset);
+ mIsBackDoubleTap = false;
+ param.setResult(-1);
+ return;
+ } else {
+ mIsBackLongPressed = false;
+ mIsBackDoubleTap = false;
+ if (mBackDoubletapAction != GravityBoxSettings.HWKEY_ACTION_DEFAULT) {
+ mIsBackDoubleTap = true;
+ mHandler.postDelayed(mBackDoubleTapReset, mDoubletapSpeed);
+ }
+ if (mBackLongpressAction != GravityBoxSettings.HWKEY_ACTION_DEFAULT) {
+ mHandler.postDelayed(mBackLongPress,
+ getLongpressTimeoutForAction(mBackLongpressAction));
+ }
}
- } else {
- param.setResult(-1);
- return;
}
}
+ param.setResult(-1);
+ return;
}
if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
- if (!hasAction(HwKey.RECENTS)) return;
+ if (!hasAction(HwKey.RECENTS) && areHwKeysEnabled()) return;
if (!down) {
mHandler.removeCallbacks(mRecentsLongPress);
if (!mIsRecentsLongPressed) {
+ if (!areHwKeysEnabled() &&
+ event.getRepeatCount() == 0 &&
+ ((event.getFlags() & KeyEvent.FLAG_FROM_SYSTEM) != 0)) {
+ if (DEBUG) log("APP_SWITCH KeyEvent coming from HW key and keys disabled. Ignoring.");
+ param.setResult(-1);
+ return;
+ }
if (mRecentsSingletapAction != GravityBoxSettings.HWKEY_ACTION_DEFAULT) {
performAction(HwKeyTrigger.RECENTS_SINGLETAP);
} else {
toggleRecentApps();
}
}
+ mIsRecentsLongPressed = false;
} else {
if (event.getRepeatCount() == 0) {
mIsRecentsLongPressed = false;
@@ -436,6 +548,20 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
});
}
+
+ if (Build.VERSION.SDK_INT > 17) {
+ XposedHelpers.findAndHookMethod(classPhoneWindowManager,
+ "readConfigurationDependentBehaviors", new XC_MethodHook() {
+ @Override
+ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
+ mHomeDoubletapDefaultAction = XposedHelpers.getIntField(
+ param.thisObject, "mDoubleTapOnHomeBehavior");
+ if (mHomeDoubletapDisabled) {
+ XposedHelpers.setIntField(param.thisObject, "mDoubleTapOnHomeBehavior", 0);
+ }
+ }
+ });
+ }
} catch (Throwable t) {
XposedBridge.log(t);
}
@@ -457,12 +583,16 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
mStrCustomAppNone = res.getString(R.string.hwkey_action_custom_app_none);
mStrCustomAppMissing = res.getString(R.string.hwkey_action_custom_app_missing);
mStrExpandedDesktopDisabled = res.getString(R.string.hwkey_action_expanded_desktop_disabled);
-
+
+ mAppLauncher = new AppLauncher(mContext, mPrefs);
+
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_MENU_LONGPRESS_CHANGED);
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_MENU_DOUBLETAP_CHANGED);
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_HOME_LONGPRESS_CHANGED);
+ intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_HOME_DOUBLETAP_CHANGED);
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_BACK_LONGPRESS_CHANGED);
+ intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_BACK_DOUBLETAP_CHANGED);
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_RECENTS_SINGLETAP_CHANGED);
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_RECENTS_LONGPRESS_CHANGED);
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_DOUBLETAP_SPEED_CHANGED);
@@ -472,12 +602,18 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
intentFilter.addAction(ACTION_SCREENSHOT);
intentFilter.addAction(ACTION_SHOW_POWER_MENU);
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_DISPLAY_ALLOW_ALL_ROTATIONS_CHANGED);
+ intentFilter.addAction(GravityBoxSettings.ACTION_PREF_EXPANDED_DESKTOP_MODE_CHANGED);
mContext.registerReceiver(mBroadcastReceiver, intentFilter);
if (DEBUG) log("Phone window manager initialized");
}
};
+ private static boolean areHwKeysEnabled() {
+ return (mHwKeysEnabled ||
+ !ModPieControls.isPieEnabled(mContext, mPieMode, mExpandedDesktopMode));
+ }
+
private static Runnable mMenuLongPress = new Runnable() {
@Override
@@ -492,8 +628,14 @@ public void run() {
@Override
public void run() {
- if (DEBUG) log("menu key double tap timed out");
mIsMenuDoubleTap = false;
+ // doubletap timed out and since we blocked default MENU key action while waiting for doubletap
+ // let's inject it now additionally, but only in case it's not still pressed as we might still be waiting
+ // for long-press action
+ if (!mMenuKeyPressed && areHwKeysEnabled()) {
+ if (DEBUG) log("MENU key double tap timed out and key not pressed; injecting MENU key");
+ injectKey(KeyEvent.KEYCODE_MENU);
+ }
}
};
@@ -507,6 +649,21 @@ public void run() {
}
};
+ private static Runnable mBackDoubleTapReset = new Runnable() {
+
+ @Override
+ public void run() {
+ mIsBackDoubleTap = false;
+ // doubletap timed out and since we blocked default BACK key action while waiting for doubletap
+ // let's inject it now additionally, but only in case it's not still pressed as we might still be waiting
+ // for long-press action
+ if (!mBackKeyPressed && areHwKeysEnabled()) {
+ if (DEBUG) log("BACK key double tap timed out and key not pressed; injecting BACK key");
+ injectKey(KeyEvent.KEYCODE_BACK);
+ }
+ }
+ };
+
private static Runnable mRecentsLongPress = new Runnable() {
@Override
@@ -527,6 +684,32 @@ public void run() {
}
};
+ private static Runnable mResetBrightnessRunnable = new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ Class> classSm = XposedHelpers.findClass("android.os.ServiceManager", null);
+ Class> classIpm = XposedHelpers.findClass("android.os.IPowerManager.Stub", null);
+ IBinder b = (IBinder) XposedHelpers.callStaticMethod(
+ classSm, "getService", Context.POWER_SERVICE);
+ Object power = XposedHelpers.callStaticMethod(classIpm, "asInterface", b);
+ if (power != null) {
+ Settings.System.putInt(mContext.getContentResolver(),
+ Settings.System.SCREEN_BRIGHTNESS_MODE, 0);
+ final String bcMethod = Build.VERSION.SDK_INT > 16 ?
+ "setTemporaryScreenBrightnessSettingOverride" : "setBacklightBrightness";
+ XposedHelpers.callMethod(power, bcMethod, 100);
+ Settings.System.putInt(mContext.getContentResolver(),
+ Settings.System.SCREEN_BRIGHTNESS, 100);
+ if (DEBUG) log("Screen brightness reset to manual with level set to 100");
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+ };
+
private static int getActionForHwKeyTrigger(HwKeyTrigger keyTrigger) {
int action = GravityBoxSettings.HWKEY_ACTION_DEFAULT;
@@ -540,6 +723,8 @@ private static int getActionForHwKeyTrigger(HwKeyTrigger keyTrigger) {
action = mHomeLongpressActionKeyguard;
} else if (keyTrigger == HwKeyTrigger.BACK_LONGPRESS) {
action = mBackLongpressAction;
+ } else if (keyTrigger == HwKeyTrigger.BACK_DOUBLETAP) {
+ action = mBackDoubletapAction;
} else if (keyTrigger == HwKeyTrigger.RECENTS_SINGLETAP) {
action = mRecentsSingletapAction;
} else if (keyTrigger == HwKeyTrigger.RECENTS_LONGPRESS) {
@@ -559,6 +744,7 @@ private static boolean hasAction(HwKey key) {
retVal |= getActionForHwKeyTrigger(HwKeyTrigger.HOME_LONGPRESS) != GravityBoxSettings.HWKEY_ACTION_DEFAULT;
} else if (key == HwKey.BACK) {
retVal |= getActionForHwKeyTrigger(HwKeyTrigger.BACK_LONGPRESS) != GravityBoxSettings.HWKEY_ACTION_DEFAULT;
+ retVal |= getActionForHwKeyTrigger(HwKeyTrigger.BACK_DOUBLETAP) != GravityBoxSettings.HWKEY_ACTION_DEFAULT;
} else if (key == HwKey.RECENTS) {
retVal |= getActionForHwKeyTrigger(HwKeyTrigger.RECENTS_SINGLETAP) != GravityBoxSettings.HWKEY_ACTION_DEFAULT;
retVal |= getActionForHwKeyTrigger(HwKeyTrigger.RECENTS_LONGPRESS) != GravityBoxSettings.HWKEY_ACTION_DEFAULT;
@@ -595,11 +781,17 @@ private static void performAction(HwKeyTrigger keyTrigger) {
|| action == GravityBoxSettings.HWKEY_ACTION_CUSTOM_APP2) {
launchCustomApp(action);
} else if (action == GravityBoxSettings.HWKEY_ACTION_MENU) {
- injectMenuKey();
+ injectKey(KeyEvent.KEYCODE_MENU);
} else if (action == GravityBoxSettings.HWKEY_ACTION_EXPANDED_DESKTOP) {
toggleExpandedDesktop();
} else if (action == GravityBoxSettings.HWKEY_ACTION_TORCH) {
toggleTorch();
+ } else if (action == GravityBoxSettings.HWKEY_ACTION_APP_LAUNCHER) {
+ showAppLauncher();
+ } else if (action == GravityBoxSettings.HWKEY_ACTION_HOME) {
+ injectKey(KeyEvent.KEYCODE_HOME);
+ } else if (action == GravityBoxSettings.HWKEY_ACTION_BACK) {
+ injectKey(KeyEvent.KEYCODE_BACK);
}
}
@@ -784,7 +976,7 @@ public void run() {
);
}
- private static void injectMenuKey() {
+ private static void injectKey(final int keyCode) {
Handler handler = (Handler) XposedHelpers.getObjectField(mPhoneWindowManager, "mHandler");
if (handler == null) return;
@@ -797,10 +989,10 @@ public void run() {
mContext.getSystemService(Context.INPUT_SERVICE);
XposedHelpers.callMethod(inputManager, "injectInputEvent",
new KeyEvent(eventTime - 50, eventTime - 50, KeyEvent.ACTION_DOWN,
- KeyEvent.KEYCODE_MENU, 0), 0);
+ keyCode, 0), 0);
XposedHelpers.callMethod(inputManager, "injectInputEvent",
new KeyEvent(eventTime - 50, eventTime - 25, KeyEvent.ACTION_UP,
- KeyEvent.KEYCODE_MENU, 0), 0);
+ keyCode, 0), 0);
} catch (Throwable t) {
XposedBridge.log(t);
}
@@ -844,4 +1036,16 @@ private static void toggleTorch() {
log("Error toggling Torch: " + t.getMessage());
}
}
-}
\ No newline at end of file
+
+ private static void showAppLauncher() {
+ Handler handler = (Handler) XposedHelpers.getObjectField(mPhoneWindowManager, "mHandler");
+ if (handler == null || mAppLauncher == null) return;
+
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ mAppLauncher.showDialog();
+ }
+ });
+ }
+}
diff --git a/src/com/ceco/gm2/gravitybox/ModLockscreen.java b/src/com/ceco/gm2/gravitybox/ModLockscreen.java
index 78a2563789..da68145282 100644
--- a/src/com/ceco/gm2/gravitybox/ModLockscreen.java
+++ b/src/com/ceco/gm2/gravitybox/ModLockscreen.java
@@ -18,11 +18,15 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Hashtable;
+import java.util.List;
import com.ceco.gm2.gravitybox.preference.AppPickerPreference;
import android.app.Activity;
+import android.appwidget.AppWidgetHostView;
+import android.appwidget.AppWidgetProviderInfo;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -39,6 +43,7 @@
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
@@ -60,24 +65,29 @@
import de.robv.android.xposed.XSharedPreferences;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
+import de.robv.android.xposed.callbacks.XC_InitPackageResources.InitPackageResourcesParam;
public class ModLockscreen {
+ private static final String CLASS_PATH = Build.VERSION.SDK_INT > 18 ?
+ "com.android.keyguard" : "com.android.internal.policy.impl.keyguard";
private static final String TAG = "GB:ModLockscreen";
- private static final String CLASS_KGVIEW_MANAGER = "com.android.internal.policy.impl.keyguard.KeyguardViewManager";
- private static final String CLASS_KG_HOSTVIEW = "com.android.internal.policy.impl.keyguard.KeyguardHostView";
- private static final String CLASS_KG_SELECTOR_VIEW = "com.android.internal.policy.impl.keyguard.KeyguardSelectorView";
+ public static final String PACKAGE_NAME = Build.VERSION.SDK_INT > 18 ? "com.android.keyguard" : "android";
+
+ private static final String CLASS_KGVIEW_MANAGER = CLASS_PATH + ".KeyguardViewManager";
+ private static final String CLASS_KG_HOSTVIEW = CLASS_PATH + ".KeyguardHostView";
+ private static final String CLASS_KG_SELECTOR_VIEW = CLASS_PATH + ".KeyguardSelectorView";
private static final String CLASS_TARGET_DRAWABLE = Utils.isMtkDevice() ?
"com.android.internal.policy.impl.keyguard.TargetDrawable" :
"com.android.internal.widget.multiwaveview.TargetDrawable";
- private static final String CLASS_TRIGGER_LISTENER = "com.android.internal.policy.impl.keyguard.KeyguardSelectorView$1";
- private static final String CLASS_KG_ABS_KEY_INPUT_VIEW =
- "com.android.internal.policy.impl.keyguard.KeyguardAbsKeyInputView";
- private static final String CLASS_KGVIEW_MEDIATOR = "com.android.internal.policy.impl.keyguard.KeyguardViewMediator";
- private static final String CLASS_KG_UPDATE_MONITOR = "com.android.internal.policy.impl.keyguard.KeyguardUpdateMonitor";
- private static final String CLASS_KG_UPDATE_MONITOR_CB =
- "com.android.internal.policy.impl.keyguard.KeyguardUpdateMonitorCallback";
- private static final String CLASS_KG_UPDATE_MONITOR_BATTERY_STATUS =
- "com.android.internal.policy.impl.keyguard.KeyguardUpdateMonitor.BatteryStatus";
+ private static final String CLASS_TRIGGER_LISTENER = CLASS_PATH + ".KeyguardSelectorView$1";
+ private static final String CLASS_KG_ABS_KEY_INPUT_VIEW = CLASS_PATH + ".KeyguardAbsKeyInputView";
+ private static final String CLASS_KGVIEW_MEDIATOR = CLASS_PATH + ".KeyguardViewMediator";
+ private static final String CLASS_KG_UPDATE_MONITOR = CLASS_PATH + ".KeyguardUpdateMonitor";
+ private static final String CLASS_KG_UPDATE_MONITOR_CB = CLASS_PATH + ".KeyguardUpdateMonitorCallback";
+ private static final String CLASS_KG_UPDATE_MONITOR_BATTERY_STATUS =
+ CLASS_PATH + ".KeyguardUpdateMonitor.BatteryStatus";
+ private static final String CLASS_KG_VIEW_BASE = CLASS_PATH + ".KeyguardViewBase";
+ private static final String CLASS_KG_WIDGET_PAGER = CLASS_PATH + ".KeyguardWidgetPager";
private static final boolean DEBUG = false;
private static final boolean DEBUG_ARC = false;
@@ -85,6 +95,14 @@ public class ModLockscreen {
private static final int STATUSBAR_DISABLE_NOTIFICATION_TICKER = 0x00080000;
private static final int STATUSBAR_DISABLE_EXPAND = 0x00010000;
private static final int STATUSBAR_DISABLE_SEARCH = 0x02000000;
+ private static final int STATUSBAR_DISABLE_CLOCK = 0x00800000;
+
+ private static final List CLOCK_WIDGETS = new ArrayList(Arrays.asList(
+ "com.android.deskclock",
+ "com.dvtonder.chronus",
+ "net.nurik.roman.dashclock",
+ "com.roymam.android.notificationswidget"
+ ));
private static XSharedPreferences mPrefs;
private static Hashtable mAppInfoCache = new Hashtable();
@@ -108,21 +126,36 @@ private static void log(String message) {
XposedBridge.log(TAG + ": " + message);
}
- public static void initZygote(final XSharedPreferences prefs) {
+ public static void initPackageResources(final XSharedPreferences prefs, final InitPackageResourcesParam resparam) {
+ try {
+ boolean enableMenuKey = prefs.getBoolean(
+ GravityBoxSettings.PREF_KEY_LOCKSCREEN_MENU_KEY, false);
+ resparam.res.setReplacement(PACKAGE_NAME, "bool", "config_disableMenuKeyInLockScreen", !enableMenuKey);
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+
+ public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) {
try {
mPrefs = prefs;
- final Class> kgViewManagerClass = XposedHelpers.findClass(CLASS_KGVIEW_MANAGER, null);
- final Class> kgHostViewClass = XposedHelpers.findClass(CLASS_KG_HOSTVIEW, null);
- final Class> kgSelectorViewClass = XposedHelpers.findClass(CLASS_KG_SELECTOR_VIEW, null);
- final Class> triggerListenerClass = XposedHelpers.findClass(CLASS_TRIGGER_LISTENER, null);
- final Class> kgAbsKeyInputViewClass = XposedHelpers.findClass(CLASS_KG_ABS_KEY_INPUT_VIEW, null);
- final Class> kgViewMediatorClass = XposedHelpers.findClass(CLASS_KGVIEW_MEDIATOR, null);
- final Class> kgUpdateMonitorClass = XposedHelpers.findClass(CLASS_KG_UPDATE_MONITOR, null);
- final Class> kgUpdateMonitorCbClass = XposedHelpers.findClass(CLASS_KG_UPDATE_MONITOR_CB, null);
+ final Class> kgViewManagerClass = XposedHelpers.findClass(CLASS_KGVIEW_MANAGER, classLoader);
+ final Class> kgHostViewClass = XposedHelpers.findClass(CLASS_KG_HOSTVIEW, classLoader);
+ final Class> kgSelectorViewClass = XposedHelpers.findClass(CLASS_KG_SELECTOR_VIEW, classLoader);
+ final Class> triggerListenerClass = XposedHelpers.findClass(CLASS_TRIGGER_LISTENER, classLoader);
+ final Class> kgAbsKeyInputViewClass = XposedHelpers.findClass(CLASS_KG_ABS_KEY_INPUT_VIEW, classLoader);
+ final Class> kgViewMediatorClass = XposedHelpers.findClass(CLASS_KGVIEW_MEDIATOR, classLoader);
+ final Class> kgUpdateMonitorClass = XposedHelpers.findClass(CLASS_KG_UPDATE_MONITOR, classLoader);
+ final Class> kgUpdateMonitorCbClass = XposedHelpers.findClass(CLASS_KG_UPDATE_MONITOR_CB, classLoader);
+ final Class> kgViewBaseClass = XposedHelpers.findClass(CLASS_KG_VIEW_BASE, classLoader);
+ final Class> kgWidgetPagerClass = XposedHelpers.findClass(CLASS_KG_WIDGET_PAGER, classLoader);
boolean enableMenuKey = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_LOCKSCREEN_MENU_KEY, false);
- XResources.setSystemWideReplacement("android", "bool", "config_disableMenuKeyInLockScreen", !enableMenuKey);
+
+ if (Build.VERSION.SDK_INT < 19) {
+ XResources.setSystemWideReplacement(PACKAGE_NAME, "bool", "config_disableMenuKeyInLockScreen", !enableMenuKey);
+ }
XposedHelpers.findAndHookMethod(kgViewManagerClass, "maybeCreateKeyguardLocked",
boolean.class, boolean.class, Bundle.class, new XC_MethodHook() {
@@ -309,17 +342,20 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
final ArrayList newDirections = new ArrayList();
final ArrayList appInfoList = new ArrayList(5);
final int unlockDescResId = res.getIdentifier("description_target_unlock",
- "string", "android");
+ "string", PACKAGE_NAME);
final int unlockDirecResId = res.getIdentifier("description_direction_right",
- "string", "android");
+ "string", PACKAGE_NAME);
// fill appInfoList helper with apps from preferences
for (int i=0; i<=4; i++) {
String app = prefs.getString(
GravityBoxSettings.PREF_KEY_LOCKSCREEN_TARGETS_APP[i], null);
if (app != null) {
- appInfoList.add(getAppInfo(context, app));
- if (DEBUG) log("appInfoList.add: " + app);
+ AppInfo appInfo = getAppInfo(context, app);
+ if (appInfo != null) {
+ appInfoList.add(appInfo);
+ if (DEBUG) log("appInfoList.add: " + app);
+ }
}
}
@@ -536,6 +572,39 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
}
}
});
+
+ // TODO: KitKat
+ if (Build.VERSION.SDK_INT < 19) {
+ XposedHelpers.findAndHookMethod(kgViewBaseClass, "resetBackground", new XC_MethodHook() {
+ @Override
+ protected void beforeHookedMethod(final MethodHookParam param) throws Throwable {
+ if (mPrefs.getBoolean(GravityBoxSettings.PREF_KEY_LOCKSCREEN_SHADE_DISABLE, false)) {
+ ((View) param.thisObject).setBackground(null);
+ param.setResult(null);
+ }
+ }
+ });
+ }
+
+ XposedHelpers.findAndHookMethod(kgWidgetPagerClass, "onPageSwitched",
+ View.class, int.class, new XC_MethodHook() {
+ @Override
+ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
+ if (param.args[0] instanceof ViewGroup) {
+ final ViewGroup vg = (ViewGroup) param.args[0];
+ if (vg.getChildAt(0) instanceof AppWidgetHostView) {
+ final AppWidgetProviderInfo info =
+ ((AppWidgetHostView) vg.getChildAt(0)).getAppWidgetInfo();
+ final String widgetPackage = info.provider.getPackageName();
+ if (DEBUG) log("onPageSwitched: widget package = " + widgetPackage);
+ if (CLOCK_WIDGETS.contains(widgetPackage)) {
+ final View v = (View) param.thisObject;
+ v.setSystemUiVisibility(v.getSystemUiVisibility() | STATUSBAR_DISABLE_CLOCK);
+ }
+ }
+ }
+ }
+ });
} catch (Throwable t) {
XposedBridge.log(t);
}
@@ -622,7 +691,7 @@ private static AppInfo getAppInfo(Context context, String app) {
String[] splitValue = app.split(AppPickerPreference.SEPARATOR);
ComponentName cn = new ComponentName(splitValue[0], splitValue[1]);
- Intent i = new Intent();
+ Intent i = new Intent(Intent.ACTION_MAIN);
i.setComponent(cn);
appInfo.intent = i;
@@ -640,7 +709,7 @@ private static AppInfo getAppInfo(Context context, String app) {
if (DEBUG) log("AppInfo: storing to cache for " + app);
return appInfo;
} catch (Throwable t) {
- XposedBridge.log(t);
+ log("Error getting app info for " + app + "! Error: " + t.getMessage());
return null;
}
}
diff --git a/src/com/ceco/gm2/gravitybox/ModNavigationBar.java b/src/com/ceco/gm2/gravitybox/ModNavigationBar.java
index a4b9e617ac..4359176b9c 100644
--- a/src/com/ceco/gm2/gravitybox/ModNavigationBar.java
+++ b/src/com/ceco/gm2/gravitybox/ModNavigationBar.java
@@ -20,9 +20,15 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
+import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.ImageView.ScaleType;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XSharedPreferences;
@@ -36,14 +42,33 @@ public class ModNavigationBar {
private static final String CLASS_NAVBAR_VIEW = "com.android.systemui.statusbar.phone.NavigationBarView";
private static final String CLASS_PHONE_STATUSBAR = "com.android.systemui.statusbar.phone.PhoneStatusBar";
+ private static final String CLASS_KEY_BUTTON_VIEW = "com.android.systemui.statusbar.policy.KeyButtonView";
private static boolean mAlwaysShowMenukey;
- private static Object mNavigationBarView;
+ private static View mNavigationBarView;
private static Object[] mRecentsKeys;
private static HomeKeyInfo[] mHomeKeys;
private static int mRecentsSingletapAction = 0;
private static int mRecentsLongpressAction = 0;
private static int mHomeLongpressAction = 0;
+ private static boolean mHwKeysEnabled;
+
+ // Application launcher key
+ private static boolean mAppLauncherEnabled;
+ private static Resources mResources;
+ private static Context mGbContext;
+ private static AppLauncher mAppLauncher;
+ private static NavbarViewInfo[] mNavbarViewInfo = new NavbarViewInfo[2];
+
+ // Colors
+ private static boolean mNavbarColorsEnabled;
+ private static int mKeyDefaultColor = 0xe8ffffff;
+ private static int mKeyDefaultGlowColor = 0x40ffffff;
+ private static int mNavbarDefaultBgColor = 0xff000000;
+ private static int mKeyColor;
+ private static int mKeyGlowColor;
+ private static int mNavbarBgColor;
+ private static Integer mNavbarBgColorOriginal;
private static void log(String message) {
XposedBridge.log(TAG + ": " + message);
@@ -54,6 +79,14 @@ static class HomeKeyInfo {
public boolean supportsLongPressDefault;
}
+ static class NavbarViewInfo {
+ ViewGroup navButtons;
+ View originalView;
+ KeyButtonView appLauncherView;
+ int position;
+ boolean visible;
+ }
+
private static BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
@@ -74,6 +107,32 @@ public void onReceive(Context context, Intent intent) {
}
}
}
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_NAVBAR_LAUNCHER_ENABLE)) {
+ mAppLauncherEnabled = intent.getBooleanExtra(
+ GravityBoxSettings.EXTRA_NAVBAR_LAUNCHER_ENABLE, false);
+ setAppKeyVisibility(mAppLauncherEnabled);
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_NAVBAR_KEY_COLOR)) {
+ mKeyColor = intent.getIntExtra(
+ GravityBoxSettings.EXTRA_NAVBAR_KEY_COLOR, mKeyDefaultColor);
+ setKeyColor();
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_NAVBAR_KEY_GLOW_COLOR)) {
+ mKeyGlowColor = intent.getIntExtra(
+ GravityBoxSettings.EXTRA_NAVBAR_KEY_GLOW_COLOR, mKeyDefaultGlowColor);
+ setKeyColor();
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_NAVBAR_BG_COLOR)) {
+ mNavbarBgColor = intent.getIntExtra(
+ GravityBoxSettings.EXTRA_NAVBAR_BG_COLOR, mNavbarDefaultBgColor);
+ setNavbarBgColor();
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_NAVBAR_COLOR_ENABLE)) {
+ mNavbarColorsEnabled = intent.getBooleanExtra(
+ GravityBoxSettings.EXTRA_NAVBAR_COLOR_ENABLE, false);
+ setNavbarBgColor();
+ setKeyColor();
+ }
} else if (intent.getAction().equals(
GravityBoxSettings.ACTION_PREF_HWKEY_RECENTS_SINGLETAP_CHANGED)) {
mRecentsSingletapAction = intent.getIntExtra(GravityBoxSettings.EXTRA_HWKEY_VALUE, 0);
@@ -86,6 +145,10 @@ public void onReceive(Context context, Intent intent) {
GravityBoxSettings.ACTION_PREF_HWKEY_HOME_LONGPRESS_CHANGED)) {
mHomeLongpressAction = intent.getIntExtra(GravityBoxSettings.EXTRA_HWKEY_VALUE, 0);
updateHomeKeyLongpressSupport();
+ } else if (intent.getAction().equals(GravityBoxSettings.ACTION_PREF_PIE_CHANGED) &&
+ intent.hasExtra(GravityBoxSettings.EXTRA_PIE_HWKEYS_DISABLE)) {
+ mHwKeysEnabled = !intent.getBooleanExtra(GravityBoxSettings.EXTRA_PIE_HWKEYS_DISABLE, false);
+ updateRecentsKeyCode();
}
}
};
@@ -108,18 +171,40 @@ public static void init(final XSharedPreferences prefs, final ClassLoader classL
XposedBridge.log(nfe);
}
+ mAppLauncherEnabled = prefs.getBoolean(
+ GravityBoxSettings.PREF_KEY_NAVBAR_LAUNCHER_ENABLE, false);
+ mHwKeysEnabled = !prefs.getBoolean(GravityBoxSettings.PREF_KEY_HWKEYS_DISABLE, false);
+
XposedBridge.hookAllConstructors(navbarViewClass, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Context context = (Context) param.args[0];
if (context == null) return;
- mNavigationBarView = param.thisObject;
+ mResources = context.getResources();
+
+ mGbContext = context.createPackageContext(
+ GravityBox.PACKAGE_NAME, Context.CONTEXT_IGNORE_SECURITY);
+ final Resources res = mGbContext.getResources();
+ mNavbarColorsEnabled = prefs.getBoolean(GravityBoxSettings.PREF_KEY_NAVBAR_COLOR_ENABLE, false);
+ mKeyDefaultColor = res.getColor(R.color.navbar_key_color);
+ mKeyColor = prefs.getInt(GravityBoxSettings.PREF_KEY_NAVBAR_KEY_COLOR, mKeyDefaultColor);
+ mKeyDefaultGlowColor = res.getColor(R.color.navbar_key_glow_color);
+ mKeyGlowColor = prefs.getInt(
+ GravityBoxSettings.PREF_KEY_NAVBAR_KEY_GLOW_COLOR, mKeyDefaultGlowColor);
+ mNavbarDefaultBgColor = res.getColor(R.color.navbar_bg_color);
+ mNavbarBgColor = prefs.getInt(
+ GravityBoxSettings.PREF_KEY_NAVBAR_BG_COLOR, mNavbarDefaultBgColor);
+
+ mAppLauncher = new AppLauncher(context, prefs);
+
+ mNavigationBarView = (View) param.thisObject;
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_NAVBAR_CHANGED);
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_RECENTS_SINGLETAP_CHANGED);
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_RECENTS_LONGPRESS_CHANGED);
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_HWKEY_HOME_LONGPRESS_CHANGED);
+ intentFilter.addAction(GravityBoxSettings.ACTION_PREF_PIE_CHANGED);
context.registerReceiver(mBroadcastReceiver, intentFilter);
if (DEBUG) log("NavigationBarView constructed; Broadcast receiver registered");
}
@@ -136,10 +221,11 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
XposedHelpers.findAndHookMethod(navbarViewClass, "onFinishInflate", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
- final Resources res = ((View) param.thisObject).getContext().getResources();
- final int backButtonResId = res.getIdentifier("back", "id", PACKAGE_NAME);
- final int recentAppsResId = res.getIdentifier("recent_apps", "id", PACKAGE_NAME);
- final int homeButtonResId = res.getIdentifier("home", "id", PACKAGE_NAME);
+ final Context context = ((View) param.thisObject).getContext();
+ final Resources gbRes = mGbContext.getResources();
+ final int backButtonResId = mResources.getIdentifier("back", "id", PACKAGE_NAME);
+ final int recentAppsResId = mResources.getIdentifier("recent_apps", "id", PACKAGE_NAME);
+ final int homeButtonResId = mResources.getIdentifier("home", "id", PACKAGE_NAME);
final View[] rotatedViews =
(View[]) XposedHelpers.getObjectField(param.thisObject, "mRotatedViews");
@@ -170,8 +256,41 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
index++;
}
}
+
+ // insert app key
+ ViewGroup vRot, navButtons;
+
+ // insert app key in rot0 view
+ vRot = (ViewGroup) ((ViewGroup) param.thisObject).findViewById(
+ mResources.getIdentifier("rot0", "id", PACKAGE_NAME));
+ if (vRot != null) {
+ KeyButtonView appKey = new KeyButtonView(context);
+ appKey.setScaleType(ScaleType.FIT_CENTER);
+ appKey.setClickable(true);
+ appKey.setImageDrawable(gbRes.getDrawable(R.drawable.ic_sysbar_apps));
+ appKey.setOnClickListener(mAppKeyOnClickListener);
+ navButtons = (ViewGroup) vRot.findViewById(
+ mResources.getIdentifier("nav_buttons", "id", PACKAGE_NAME));
+ prepareNavbarViewInfo(navButtons, 0, appKey);
+ }
+
+ // insert app key in rot90 view
+ vRot = (ViewGroup) ((ViewGroup) param.thisObject).findViewById(
+ mResources.getIdentifier("rot90", "id", PACKAGE_NAME));
+ if (vRot != null) {
+ KeyButtonView appKey = new KeyButtonView(context);
+ appKey.setClickable(true);
+ appKey.setImageDrawable(gbRes.getDrawable(R.drawable.ic_sysbar_apps));
+ appKey.setOnClickListener(mAppKeyOnClickListener);
+ navButtons = (ViewGroup) vRot.findViewById(
+ mResources.getIdentifier("nav_buttons", "id", PACKAGE_NAME));
+ prepareNavbarViewInfo(navButtons, 1, appKey);
+ }
+
+ setAppKeyVisibility(mAppLauncherEnabled);
updateRecentsKeyCode();
updateHomeKeyLongpressSupport();
+ setNavbarBgColor();
}
});
@@ -185,11 +304,133 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
}
});
+
+ XposedHelpers.findAndHookMethod(navbarViewClass, "setDisabledFlags",
+ int.class, boolean.class, new XC_MethodHook() {
+ @Override
+ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
+ boolean visible = mAppLauncherEnabled;
+ View v = (View) XposedHelpers.callMethod(param.thisObject, "getRecentsButton");
+ if (v != null) {
+ visible &= v.getVisibility() == View.VISIBLE;
+ }
+ setAppKeyVisibility(visible);
+ }
+ });
+
+ XposedHelpers.findAndHookMethod(navbarViewClass, "setNavigationIconHints",
+ int.class, boolean.class, new XC_MethodHook() {
+ @Override
+ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
+ if (mNavbarColorsEnabled) {
+ final int navigationIconHints = XposedHelpers.getIntField(
+ param.thisObject, "mNavigationIconHints");
+ if ((Integer) param.args[0] != navigationIconHints || (Boolean)param.args[1]) {
+ setKeyColor();
+ }
+ }
+ }
+ });
} catch(Throwable t) {
XposedBridge.log(t);
}
}
+ private static void prepareNavbarViewInfo(ViewGroup navButtons, int index, KeyButtonView appView) {
+ try {
+ final int size = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ 40, navButtons.getResources().getDisplayMetrics());
+ if (DEBUG) log("App key view minimum size=" + size);
+
+ mNavbarViewInfo[index] = new NavbarViewInfo();
+ mNavbarViewInfo[index].navButtons = navButtons;
+ mNavbarViewInfo[index].appLauncherView = appView;
+
+ int searchPosition = index == 0 ? 0 : navButtons.getChildCount()-1;
+ View v = navButtons.getChildAt(searchPosition);
+ if (v.getId() == -1 && !v.getClass().getName().equals(CLASS_KEY_BUTTON_VIEW)) {
+ mNavbarViewInfo[index].originalView = v;
+ } else {
+ searchPosition = searchPosition == 0 ? navButtons.getChildCount()-1 : 0;
+ v = navButtons.getChildAt(searchPosition);
+ if (v.getId() == -1 && !v.getClass().getName().equals(CLASS_KEY_BUTTON_VIEW)) {
+ mNavbarViewInfo[index].originalView = v;
+ }
+ }
+ mNavbarViewInfo[index].position = searchPosition;
+
+ // determine app key layout
+ LinearLayout.LayoutParams lp = null;
+ if (mNavbarViewInfo[index].originalView != null) {
+ // determine layout from layout of placeholder view we found
+ ViewGroup.LayoutParams ovlp = mNavbarViewInfo[index].originalView.getLayoutParams();
+ if (DEBUG) log("originalView: lpWidth=" + ovlp.width + "; lpHeight=" + ovlp.height);
+ if (ovlp.width >= 0) {
+ lp = new LinearLayout.LayoutParams(size, LinearLayout.LayoutParams.MATCH_PARENT, 0);
+ } else if (ovlp.height >= 0) {
+ lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, size, 0);
+ } else {
+ log("Weird layout of placeholder view detected");
+ }
+ } else {
+ // determine layout from Back key
+ final int resId = navButtons.getResources().getIdentifier("back", "id", PACKAGE_NAME);
+ if (resId != 0) {
+ View back = navButtons.findViewById(resId);
+ if (back != null) {
+ ViewGroup.LayoutParams blp = back.getLayoutParams();
+ if (blp.width >= 0) {
+ lp = new LinearLayout.LayoutParams(size, LinearLayout.LayoutParams.MATCH_PARENT, 0);
+ } else if (blp.height >= 0) {
+ lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, size, 0);
+ } else {
+ log("Weird layout of back button view detected");
+ }
+ } else {
+ log("Could not find back button view");
+ }
+ } else {
+ log("Could not find back button resource ID");
+ }
+ }
+ // worst case scenario (should never happen, but just to make sure)
+ if (lp == null) {
+ lp = new LinearLayout.LayoutParams(size, size, 0);
+ }
+ if (DEBUG) log("appView: lpWidth=" + lp.width + "; lpHeight=" + lp.height);
+ mNavbarViewInfo[index].appLauncherView.setLayoutParams(lp);
+ } catch (Throwable t) {
+ log("Error preparing NavbarViewInfo: " + t.getMessage());
+ }
+ }
+
+ private static void setAppKeyVisibility(boolean visible) {
+ try {
+ for (int i = 0; i <= 1; i++) {
+ if (mNavbarViewInfo[i].visible == visible) continue;
+
+ if (mNavbarViewInfo[i].originalView != null) {
+ mNavbarViewInfo[i].navButtons.removeViewAt(mNavbarViewInfo[i].position);
+ mNavbarViewInfo[i].navButtons.addView(visible ?
+ mNavbarViewInfo[i].appLauncherView : mNavbarViewInfo[i].originalView,
+ mNavbarViewInfo[i].position);
+ } else {
+ if (visible) {
+ mNavbarViewInfo[i].navButtons.addView(mNavbarViewInfo[i].appLauncherView,
+ mNavbarViewInfo[i].position);
+ } else {
+ mNavbarViewInfo[i].navButtons.removeView(mNavbarViewInfo[i].appLauncherView);
+ }
+ }
+ mNavbarViewInfo[i].visible = visible;
+ mNavbarViewInfo[i].navButtons.requestLayout();
+ if (DEBUG) log("setAppKeyVisibility: visible=" + visible);
+ }
+ } catch (Throwable t) {
+ log("Error setting app key visibility: " + t.getMessage());
+ }
+ }
+
private static void updateRecentsKeyCode() {
if (mRecentsKeys == null) return;
@@ -206,7 +447,9 @@ private static void updateRecentsKeyCode() {
}
private static boolean recentsKeyHasAction() {
- return (mRecentsSingletapAction != 0 || mRecentsLongpressAction != 0);
+ return (mRecentsSingletapAction != 0 ||
+ mRecentsLongpressAction != 0 ||
+ !mHwKeysEnabled);
}
private static void updateHomeKeyLongpressSupport() {
@@ -223,4 +466,82 @@ private static void updateHomeKeyLongpressSupport() {
XposedBridge.log(t);
}
}
+
+ private static View.OnClickListener mAppKeyOnClickListener = new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mAppLauncher != null && mHwKeysEnabled) {
+ mAppLauncher.showDialog();
+ }
+ }
+ };
+
+ private static void setKeyColor() {
+ try {
+ View v = (View) XposedHelpers.getObjectField(mNavigationBarView, "mCurrentView");
+ ViewGroup navButtons = (ViewGroup) v.findViewById(
+ mResources.getIdentifier("nav_buttons", "id", PACKAGE_NAME));
+ final int childCount = navButtons.getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ if (navButtons.getChildAt(i) instanceof ImageView) {
+ ImageView imgv = (ImageView)navButtons.getChildAt(i);
+ if (mNavbarColorsEnabled) {
+ imgv.setColorFilter(mKeyColor, PorterDuff.Mode.SRC_ATOP);
+ } else {
+ imgv.clearColorFilter();
+ }
+ if (imgv.getClass().getName().equals(CLASS_KEY_BUTTON_VIEW)) {
+ Drawable d = (Drawable) XposedHelpers.getObjectField(imgv, "mGlowBG");
+ if (d != null) {
+ if (mNavbarColorsEnabled) {
+ d.setColorFilter(mKeyGlowColor, PorterDuff.Mode.SRC_ATOP);
+ } else {
+ d.clearColorFilter();
+ }
+ }
+ } else if (imgv instanceof KeyButtonView) {
+ ((KeyButtonView) imgv).setGlowColor(mKeyGlowColor);
+ }
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+
+ private static void setNavbarBgColor() {
+ try {
+ if (!mNavbarColorsEnabled) {
+ if (mNavbarBgColorOriginal != null) {
+ ColorDrawable cd = new ColorDrawable(mNavbarBgColorOriginal);
+ mNavigationBarView.setBackground(cd);
+ if (DEBUG) log("Restored navbar background original color");
+ }
+ } else {
+ if (mNavbarBgColorOriginal == null &&
+ (mNavigationBarView.getBackground() instanceof ColorDrawable)) {
+ mNavbarBgColorOriginal =
+ ((ColorDrawable) mNavigationBarView.getBackground()).getColor();
+ if (DEBUG) log("Saved navbar background original color");
+ }
+ if (Utils.isXperiaDevice()) {
+ if (!(mNavigationBarView.getBackground() instanceof ColorDrawable)) {
+ ColorDrawable colorDrawable = new ColorDrawable(mNavbarBgColor);
+ mNavigationBarView.setBackground(colorDrawable);
+ } else {
+ ((ColorDrawable) mNavigationBarView.getBackground()).setColor(mNavbarBgColor);
+ }
+ } else {
+ if (!(mNavigationBarView.getBackground() instanceof BackgroundAlphaColorDrawable)) {
+ BackgroundAlphaColorDrawable colorDrawable = new BackgroundAlphaColorDrawable(mNavbarBgColor);
+ mNavigationBarView.setBackground(colorDrawable);
+ } else {
+ ((BackgroundAlphaColorDrawable) mNavigationBarView.getBackground()).setBgColor(mNavbarBgColor);
+ }
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
}
diff --git a/src/com/ceco/gm2/gravitybox/ModPieControls.java b/src/com/ceco/gm2/gravitybox/ModPieControls.java
index 090d23ec26..1a430e673f 100644
--- a/src/com/ceco/gm2/gravitybox/ModPieControls.java
+++ b/src/com/ceco/gm2/gravitybox/ModPieControls.java
@@ -97,16 +97,18 @@ public void onReceive(Context context, Intent intent) {
mPieMode = intent.getIntExtra(GravityBoxSettings.EXTRA_PIE_ENABLE, 0);
attachPie();
}
- if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_SEARCH)) {
- mPieController.setSearchVisibility(intent.getBooleanExtra(
- GravityBoxSettings.EXTRA_PIE_SEARCH, false));
- attachPie();
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_CUSTOM_KEY_MODE)) {
+ mPieController.setCustomKeyMode(intent.getIntExtra(
+ GravityBoxSettings.EXTRA_PIE_CUSTOM_KEY_MODE,
+ GravityBoxSettings.PIE_CUSTOM_KEY_OFF));
}
if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_TRIGGERS)) {
String[] triggers = intent.getStringArrayExtra(
GravityBoxSettings.EXTRA_PIE_TRIGGERS);
mPieTriggerSlots = getTriggerSlotsFromArray(triggers);
- mPieContainer.setTriggerSlots(mPieTriggerSlots);
+ if (mPieContainer != null) {
+ mPieContainer.setTriggerSlots(mPieTriggerSlots);
+ }
attachPie();
}
if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_TRIGGER_SIZE)) {
@@ -115,7 +117,9 @@ public void onReceive(Context context, Intent intent) {
}
if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_SIZE)) {
mPieSize = intent.getIntExtra(GravityBoxSettings.EXTRA_PIE_SIZE, 1000);
- mPieContainer.setPieSize(mPieSize);
+ if (mPieContainer != null) {
+ mPieContainer.setPieSize(mPieSize);
+ }
attachPie();
}
if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_HWKEYS_DISABLE)) {
@@ -128,6 +132,26 @@ public void onReceive(Context context, Intent intent) {
GravityBoxSettings.EXTRA_PIE_MENU, false);
mPieController.setMenuVisibility(mShowMenuItem | mAlwaysShowMenuItem);
}
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_COLOR_BG)) {
+ mPieController.setBackgroundColor(intent.getIntExtra(GravityBoxSettings.EXTRA_PIE_COLOR_BG,
+ mGbContext.getResources().getColor(R.color.pie_background_color)));
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_COLOR_FG)) {
+ mPieController.setForegroundColor(intent.getIntExtra(GravityBoxSettings.EXTRA_PIE_COLOR_FG,
+ mGbContext.getResources().getColor(R.color.pie_foreground_color)));
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_COLOR_OUTLINE)) {
+ mPieController.setOutlineColor(intent.getIntExtra(GravityBoxSettings.EXTRA_PIE_COLOR_OUTLINE,
+ mGbContext.getResources().getColor(R.color.pie_outline_color)));
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_COLOR_SELECTED)) {
+ mPieController.setSelectedColor(intent.getIntExtra(GravityBoxSettings.EXTRA_PIE_COLOR_SELECTED,
+ mGbContext.getResources().getColor(R.color.pie_selected_color)));
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_PIE_COLOR_TEXT)) {
+ mPieController.setTextColor(intent.getIntExtra(GravityBoxSettings.EXTRA_PIE_COLOR_TEXT,
+ mGbContext.getResources().getColor(R.color.pie_text_color)));
+ }
} else if (intent.getAction().equals(GravityBoxSettings.ACTION_PREF_EXPANDED_DESKTOP_MODE_CHANGED)) {
mExpandedDesktopMode = intent.getIntExtra(
GravityBoxSettings.EXTRA_ED_MODE, GravityBoxSettings.ED_DISABLED);
@@ -254,9 +278,17 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
mContext = (Context) XposedHelpers.getObjectField(param.thisObject, "mContext");
mGbContext = mContext.createPackageContext(GravityBox.PACKAGE_NAME, Context.CONTEXT_IGNORE_SECURITY);
mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
- mPieController = new PieController(mContext, mGbContext);
- mPieController.setSearchVisibility(prefs.getBoolean(
- GravityBoxSettings.PREF_KEY_PIE_CONTROL_SEARCH, false));
+ mPieController = new PieController(mContext, mGbContext, prefs);
+
+ int customKeyMode = GravityBoxSettings.PIE_CUSTOM_KEY_OFF;
+ try {
+ customKeyMode = Integer.valueOf(prefs.getString(
+ GravityBoxSettings.PREF_KEY_PIE_CONTROL_CUSTOM_KEY, "0"));
+ } catch (NumberFormatException nfe) {
+ log("Invalid value for PREF_KEY_PIE_CONTROL_CUSTOM_KEY preference");
+ }
+ mPieController.setCustomKeyMode(customKeyMode);
+
mPieController.attachTo(param.thisObject);
IntentFilter intentFilter = new IntentFilter();
@@ -344,29 +376,31 @@ public void onChange(boolean selfChange) {
}
}
- private static boolean isPieEnabled() {
- final ContentResolver cr = mContext.getContentResolver();
- if (DEBUG) log("isPieEnabled: mPieMode = " + mPieMode);
+ public static boolean isPieEnabled(Context context, int pieMode, int expandedDesktopMode) {
+ if (context == null) return false;
+
+ final ContentResolver cr = context.getContentResolver();
+ if (DEBUG) log("isPieEnabled: mPieMode = " + pieMode);
- switch(mPieMode) {
+ switch(pieMode) {
case PIE_DISABLED: return false;
case PIE_ENABLED_ALWAYS: return true;
case PIE_ENABLED_ED:
case PIE_ENABLED_ED_NAVBAR_HIDDEN:
- if (DEBUG) log("isPieEnabled: SETTING_EXPANDED_DESKTOP_MODE = " + mExpandedDesktopMode);
+ if (DEBUG) log("isPieEnabled: SETTING_EXPANDED_DESKTOP_MODE = " + expandedDesktopMode);
final boolean edEnabled = Settings.System.getInt(
cr, ModExpandedDesktop.SETTING_EXPANDED_DESKTOP_STATE, 0) == 1;
if (DEBUG) log("isPieEnabled: SETTING_EXPANDED_DESKTOP_STATE = " + edEnabled);
- return edEnabled && (mPieMode == PIE_ENABLED_ED ||
- (mPieMode == PIE_ENABLED_ED_NAVBAR_HIDDEN
- && (mExpandedDesktopMode == GravityBoxSettings.ED_NAVBAR ||
- mExpandedDesktopMode == GravityBoxSettings.ED_BOTH)));
+ return edEnabled && (pieMode == PIE_ENABLED_ED ||
+ (pieMode == PIE_ENABLED_ED_NAVBAR_HIDDEN
+ && (expandedDesktopMode == GravityBoxSettings.ED_NAVBAR ||
+ expandedDesktopMode == GravityBoxSettings.ED_BOTH)));
default: return false;
}
}
private static void attachPie() {
- if (isPieEnabled()) {
+ if (isPieEnabled(mContext, mPieMode, mExpandedDesktopMode)) {
// Create our container, if it does not exist already
if (mPieContainer == null) {
diff --git a/src/com/ceco/gm2/gravitybox/ModQuickSettings.java b/src/com/ceco/gm2/gravitybox/ModQuickSettings.java
index 62aa70878f..a60648192b 100644
--- a/src/com/ceco/gm2/gravitybox/ModQuickSettings.java
+++ b/src/com/ceco/gm2/gravitybox/ModQuickSettings.java
@@ -59,6 +59,7 @@
import android.os.Build;
import android.os.IBinder;
import android.provider.Settings;
+import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@@ -66,6 +67,7 @@
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.TextView;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XC_MethodReplacement;
@@ -86,6 +88,8 @@ public class ModQuickSettings {
private static final String CLASS_QS_MODEL = "com.android.systemui.statusbar.phone.QuickSettingsModel";
private static final String CLASS_QS_MODEL_RCB = "com.android.systemui.statusbar.phone.QuickSettingsModel$RefreshCallback";
private static final String CLASS_QS_MODEL_STATE = "com.android.systemui.statusbar.phone.QuickSettingsModel.State";
+ private static final String CLASS_ROTATION_LOCK_CTRL = "com.android.systemui.statusbar.policy.RotationLockController";
+ private static final String CLASS_ROTATION_POLICY = "com.android.internal.view.RotationPolicy";
private static final boolean DEBUG = false;
private static final float STATUS_BAR_SETTINGS_FLIP_PERCENTAGE_RIGHT = 0.15f;
@@ -164,6 +168,7 @@ public class ModQuickSettings {
tmpMap.put("battery_textview", 7);
tmpMap.put("airplane_mode_textview", 8);
tmpMap.put("bluetooth_textview", 9);
+ tmpMap.put("gps_textview", 10);
mAospTileTags = Collections.unmodifiableMap(tmpMap);
mAllTileViews = new HashMap();
@@ -235,81 +240,153 @@ private static void updateTileOrderAndVisibility() {
return;
}
- final List dynamicTiles = new ArrayList();
-
- final int tileCount = mContainerView.getChildCount();
- for(int i = tileCount - 1; i >= 0; i--) {
- View view = mContainerView.getChildAt(i);
- final String key = getTileKey(view);
- if (key != null) {
- if (!mAllTileViews.containsKey(key)) {
- mAllTileViews.put(key, view);
+ try {
+ final List dynamicTiles = new ArrayList();
+
+ final int tileCount = mContainerView.getChildCount();
+ for(int i = tileCount - 1; i >= 0; i--) {
+ View view = mContainerView.getChildAt(i);
+ final String key = getTileKey(view);
+ if (key != null) {
+ if (!mAllTileViews.containsKey(key)) {
+ mAllTileViews.put(key, view);
+ }
+ mContainerView.removeView(view);
+ } else if (view != null) {
+ // found tile that's not in our custom list
+ // might be dynamic tile (e.g. alarm) or some ROM specific tile?
+ // remove it and store it so it could be added in the end
+ dynamicTiles.add(view);
+ mContainerView.removeView(view);
}
- mContainerView.removeView(view);
- } else if (view != null) {
- // found tile that's not in our custom list
- // might be dynamic tile (e.g. alarm) or some ROM specific tile?
- // remove it and store it so it could be added in the end
- dynamicTiles.add(view);
- mContainerView.removeView(view);
}
- }
-
- for (String key : mActiveTileKeys) {
- if (mAllTileViews.containsKey(key)) {
- mContainerView.addView(mAllTileViews.get(key));
+
+ for (String key : mActiveTileKeys) {
+ if (mAllTileViews.containsKey(key)) {
+ mContainerView.addView(mAllTileViews.get(key));
+ }
+ }
+
+ // add tiles from dynamic list as last (e.g. alarm tile we previously removed)
+ for (View v : dynamicTiles) {
+ mContainerView.addView(v);
}
+
+ // trigger layout refresh
+ XposedHelpers.callMethod(mContainerView, "updateResources");
+ } catch (Throwable t) {
+ XposedBridge.log(t);
}
+ }
- // add tiles from dynamic list as last (e.g. alarm tile we previously removed)
- for (View v : dynamicTiles) {
- mContainerView.addView(v);
+ private static TextView findTileTextView(ViewGroup viewGroup) {
+ if (viewGroup == null) return null;
+
+ TextView textView = null;
+ final int childCount = viewGroup.getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ View childView = viewGroup.getChildAt(i);
+ if (childView instanceof ViewGroup) {
+ textView = findTileTextView((ViewGroup) childView);
+ } else if (childView instanceof TextView) {
+ textView = (TextView) childView;
+ }
+ if (textView != null) {
+ break;
+ }
}
- // trigger layout refresh
- XposedHelpers.callMethod(mContainerView, "updateResources");
+ return textView;
}
private static void updateTileLayout(FrameLayout container, int orientation) {
if (container == null) return;
- int tileCount = container.getChildCount();
- int textSize = 12;
+ try {
+ int textSize = 12;
+ final Resources res = container.getResources();
- if (orientation == Configuration.ORIENTATION_PORTRAIT) {
- switch (mNumColumns) {
- case 4: textSize = 10; break;
- case 5: textSize = 8; break;
- case 3:
- default: textSize = 12;
+ int imgMarginTop = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ 27, res.getDisplayMetrics());
+ int imgMarginBottom = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ 17, res.getDisplayMetrics());
+ try {
+ imgMarginTop = res.getDimensionPixelSize(
+ res.getIdentifier("qs_tile_margin_above_icon", "dimen", PACKAGE_NAME));
+ imgMarginBottom = res.getDimensionPixelSize(
+ res.getIdentifier("qs_tile_margin_below_icon", "dimen", PACKAGE_NAME));
+ } catch (Resources.NotFoundException rnfe) {
+ //
+ }
+
+ final int imgResId = res.getIdentifier("image", "id", PACKAGE_NAME);
+ final int rssiImgResId = res.getIdentifier("rssi_image", "id", PACKAGE_NAME);
+
+ if (orientation == Configuration.ORIENTATION_PORTRAIT) {
+ switch (mNumColumns) {
+ case 4:
+ textSize = 10;
+ imgMarginTop = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ 17, res.getDisplayMetrics());
+ imgMarginBottom = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ 11, res.getDisplayMetrics());
+ break;
+ case 5:
+ imgMarginTop = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ 10, res.getDisplayMetrics());
+ imgMarginBottom = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ 5, res.getDisplayMetrics());
+ textSize = 8;
+ break;
+ case 3:
+ default:
+ textSize = 12;
+ break;
+ }
}
- }
- for(int i = 0; i < tileCount; i++) {
- ViewGroup viewGroup = (ViewGroup) mContainerView.getChildAt(i);
- if (viewGroup != null) {
- int childCount = viewGroup.getChildCount();
- for(int j = 0; j < childCount; j++) {
- View childView = viewGroup.getChildAt(j);
- TextView targetView = null;
- if (childView instanceof ViewGroup) {
- int innerChildCount = ((ViewGroup) childView).getChildCount();
- for (int k = 0; k < innerChildCount; k++) {
- View innerChildView = ((ViewGroup) childView).getChildAt(k);
- if (innerChildView instanceof TextView) {
- targetView = (TextView) innerChildView;
+ final int tileCount = container.getChildCount();
+ for(int i = 0; i < tileCount; i++) {
+ ViewGroup viewGroup = (ViewGroup) mContainerView.getChildAt(i);
+ if (viewGroup != null) {
+ TextView textView = findTileTextView(viewGroup);
+ if (textView != null) {
+ textView.setTextSize(1, textSize);
+ textView.setSingleLine(false);
+ textView.setAllCaps(true);
+ }
+
+ // adjust layout in case it's AOSP 4.3+ tile
+ if (Build.VERSION.SDK_INT > 17 && imgResId != 0 && rssiImgResId != 0) {
+ View img = viewGroup.findViewById(imgResId);
+ if (img != null) {
+ // basic tile
+ if (img.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {
+ ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) img.getLayoutParams();
+ lp.topMargin = imgMarginTop;
+ lp.bottomMargin = imgMarginBottom;
+ img.setLayoutParams(lp);
+ img.requestLayout();
+ }
+ } else {
+ // RSSI special tile
+ img = viewGroup.findViewById(rssiImgResId);
+ if (img != null && img.getParent() instanceof FrameLayout) {
+ FrameLayout fl = (FrameLayout) img.getParent();
+ if (fl.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {
+ ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) fl.getLayoutParams();
+ lp.topMargin = imgMarginTop;
+ lp.bottomMargin = imgMarginBottom;
+ fl.setLayoutParams(lp);
+ fl.requestLayout();
+ }
}
}
- } else if (childView instanceof TextView) {
- targetView = (TextView) childView;
- }
- if (targetView != null) {
- targetView.setTextSize(1, textSize);
- targetView.setSingleLine(false);
- targetView.setAllCaps(true);
}
}
}
+ } catch (Throwable t) {
+ XposedBridge.log(t);
}
}
@@ -392,6 +469,32 @@ public static void init(final XSharedPreferences prefs, final ClassLoader classL
tagAospTileViews(classLoader);
}
+ if (Build.VERSION.SDK_INT > 18) {
+ final Class> rlControllerClass = XposedHelpers.findClass(CLASS_ROTATION_LOCK_CTRL, classLoader);
+ XposedHelpers.findAndHookMethod(rlControllerClass, "isRotationLockAffordanceVisible",
+ new XC_MethodReplacement() {
+ @Override
+ protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
+ return mActiveTileKeys != null ?
+ mActiveTileKeys.contains("auto_rotate_textview") :
+ XposedBridge.invokeOriginalMethod(param.method, param.thisObject, param.args);
+ }
+ });
+ final Class> rlPolicyClass = XposedHelpers.findClass(CLASS_ROTATION_POLICY, null);
+ XposedHelpers.findAndHookMethod(rlPolicyClass, "isRotationLockToggleSupported",
+ Context.class, new XC_MethodReplacement() {
+ @Override
+ protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
+ try {
+ return XposedHelpers.callStaticMethod(rlPolicyClass, "isRotationSupported", param.args[0]);
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ return XposedBridge.invokeOriginalMethod(param.method, param.thisObject, param.args);
+ }
+ }
+ });
+ }
+
XposedHelpers.findAndHookMethod(phoneStatusBarClass, "removeNotification", IBinder.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(final MethodHookParam param) throws Throwable {
@@ -424,7 +527,7 @@ protected void beforeHookedMethod(final MethodHookParam param) throws Throwable
// let the original method finish its work
} else {
if (DEBUG) log("animateCollapsePanels: all notifications removed " +
- "but showing QuickSettings - do nothing");
+ "but showing QuickSettings - do nothing");
param.setResult(null);
}
}
@@ -479,79 +582,80 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
LayoutInflater inflater = (LayoutInflater) param.args[1];
mTiles = new ArrayList();
- mBroadcastSubReceivers = new ArrayList();
if (Utils.isMtkDevice()) {
WifiTile wt = new WifiTile(mContext, mGbContext, mStatusBar, mPanelBar, mWifiManager);
- wt.setupQuickSettingsTile(mContainerView, inflater);
+ wt.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(wt);
}
if (Utils.hasGPS(mContext)) {
GpsTile gpsTile = new GpsTile(mContext, mGbContext, mStatusBar, mPanelBar);
- gpsTile.setupQuickSettingsTile(mContainerView, inflater);
+ gpsTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(gpsTile);
}
RingerModeTile rmTile = new RingerModeTile(mContext, mGbContext, mStatusBar, mPanelBar);
- rmTile.setupQuickSettingsTile(mContainerView, inflater);
+ rmTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(rmTile);
VolumeTile volTile = new VolumeTile(mContext, mGbContext, mStatusBar, mPanelBar);
- volTile.setupQuickSettingsTile(mContainerView, inflater);
+ volTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(volTile);
if (!Utils.isWifiOnly(mContext)) {
NetworkModeTile nmTile = new NetworkModeTile(mContext, mGbContext, mStatusBar, mPanelBar);
nmTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(nmTile);
- mBroadcastSubReceivers.add(nmTile);
}
SyncTile syncTile = new SyncTile(mContext, mGbContext, mStatusBar, mPanelBar);
- syncTile.setupQuickSettingsTile(mContainerView, inflater);
+ syncTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(syncTile);
WifiApTile wifiApTile = new WifiApTile(mContext, mGbContext, mStatusBar, mPanelBar, mWifiManager);
- wifiApTile.setupQuickSettingsTile(mContainerView, inflater);
+ wifiApTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(wifiApTile);
if (Utils.hasFlash(mContext)) {
TorchTile torchTile = new TorchTile(mContext, mGbContext, mStatusBar, mPanelBar);
- torchTile.setupQuickSettingsTile(mContainerView, inflater);
+ torchTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(torchTile);
}
SleepTile sleepTile = new SleepTile(mContext, mGbContext, mStatusBar, mPanelBar);
- sleepTile.setupQuickSettingsTile(mContainerView, inflater);
+ sleepTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(sleepTile);
StayAwakeTile swTile = new StayAwakeTile(mContext, mGbContext, mStatusBar, mPanelBar);
- swTile.setupQuickSettingsTile(mContainerView, inflater);
+ swTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(swTile);
QuickRecordTile qrTile = new QuickRecordTile(mContext, mGbContext, mStatusBar, mPanelBar);
- qrTile.setupQuickSettingsTile(mContainerView, inflater);
+ qrTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(qrTile);
QuickAppTile qAppTile = new QuickAppTile(mContext, mGbContext, mStatusBar, mPanelBar);
qAppTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(qAppTile);
- mBroadcastSubReceivers.add(qAppTile);
ExpandedDesktopTile edTile = new ExpandedDesktopTile(mContext, mGbContext, mStatusBar, mPanelBar);
edTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(edTile);
- mBroadcastSubReceivers.add(edTile);
ScreenshotTile ssTile = new ScreenshotTile(mContext, mGbContext, mStatusBar, mPanelBar);
- ssTile.setupQuickSettingsTile(mContainerView, inflater);
+ ssTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(ssTile);
GravityBoxTile gbTile = new GravityBoxTile(mContext, mGbContext, mStatusBar, mPanelBar);
- gbTile.setupQuickSettingsTile(mContainerView, inflater);
+ gbTile.setupQuickSettingsTile(mContainerView, inflater, mPrefs);
mTiles.add(gbTile);
+ mBroadcastSubReceivers = new ArrayList();
+ for (AQuickSettingsTile t : mTiles) {
+ mBroadcastSubReceivers.add(t);
+ }
+
updateTileOrderAndVisibility();
} catch (Throwable t) {
XposedBridge.log(t);
@@ -845,6 +949,17 @@ public void onClick(View v) {
(ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
final boolean mobileDataEnabled =
(Boolean) XposedHelpers.callMethod(cm, "getMobileDataEnabled");
+
+ if (Utils.isXperiaDevice()) {
+ if (!mobileDataEnabled && mStatusBar != null) {
+ XposedHelpers.callMethod(mStatusBar, "animateCollapsePanels");
+ }
+
+ Intent i = new Intent(ConnectivityServiceWrapper.ACTION_XPERIA_MOBILE_DATA_TOGGLE);
+ mContext.sendBroadcast(i);
+ return;
+ }
+
Intent intent = new Intent(ConnectivityServiceWrapper.ACTION_SET_MOBILE_DATA_ENABLED);
intent.putExtra(ConnectivityServiceWrapper.EXTRA_ENABLED, !mobileDataEnabled);
mContext.sendBroadcast(intent);
@@ -887,13 +1002,19 @@ protected void afterHookedMethod(final MethodHookParam param2) throws Throwable
}
try {
- XposedHelpers.findAndHookMethod(classQsModel, "addRotationLockTile",
- CLASS_QS_TILEVIEW, CLASS_QS_MODEL_RCB, new XC_MethodHook() {
+ final XC_MethodHook addRotationLockTileHook = new XC_MethodHook() {
@Override
protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
((View)param.args[0]).setTag(mAospTileTags.get("auto_rotate_textview"));
}
- });
+ };
+ if (Build.VERSION.SDK_INT > 18) {
+ XposedHelpers.findAndHookMethod(classQsModel, "addRotationLockTile",
+ CLASS_QS_TILEVIEW, CLASS_ROTATION_LOCK_CTRL, CLASS_QS_MODEL_RCB, addRotationLockTileHook);
+ } else {
+ XposedHelpers.findAndHookMethod(classQsModel, "addRotationLockTile",
+ CLASS_QS_TILEVIEW, CLASS_QS_MODEL_RCB, addRotationLockTileHook);
+ }
} catch (Throwable t) {
XposedBridge.log(t);
}
@@ -973,5 +1094,19 @@ public boolean onLongClick(View v) {
} catch (Throwable t) {
XposedBridge.log(t);
}
+
+ if (Build.VERSION.SDK_INT > 18) {
+ try {
+ XposedHelpers.findAndHookMethod(classQsModel, "addLocationTile",
+ CLASS_QS_TILEVIEW, CLASS_QS_MODEL_RCB, new XC_MethodHook() {
+ @Override
+ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
+ ((View)param.args[0]).setTag(mAospTileTags.get("gps_textview"));
+ }
+ });
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/com/ceco/gm2/gravitybox/ModStatusBar.java b/src/com/ceco/gm2/gravitybox/ModStatusBar.java
index dec944302f..950460f8fb 100644
--- a/src/com/ceco/gm2/gravitybox/ModStatusBar.java
+++ b/src/com/ceco/gm2/gravitybox/ModStatusBar.java
@@ -27,6 +27,7 @@
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LayoutInflated;
import de.robv.android.xposed.callbacks.XC_InitPackageResources.InitPackageResourcesParam;
+import de.robv.android.xposed.callbacks.XC_LayoutInflated.LayoutInflatedParam;
import android.app.Notification;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
@@ -78,7 +79,7 @@ public class ModStatusBar {
private static ViewGroup mIconArea;
private static ViewGroup mRootView;
private static LinearLayout mLayoutClock;
- private static TextView mClock;
+ private static StatusbarClock mClock;
private static TextView mClockExpanded;
private static Object mPhoneStatusBar;
private static Object mStatusBarView;
@@ -87,7 +88,6 @@ public class ModStatusBar {
private static int mAnimPushDownIn;
private static int mAnimFadeIn;
private static boolean mClockCentered = false;
- private static int mClockOriginalPaddingLeft;
private static int mClockShowDow = GravityBoxSettings.DOW_DISABLED;
private static boolean mAmPmHide = false;
private static boolean mClockHide = false;
@@ -129,13 +129,13 @@ public void onReceive(Context context, Intent intent) {
mClockShowDow = intent.getIntExtra(GravityBoxSettings.EXTRA_CLOCK_DOW,
GravityBoxSettings.DOW_DISABLED);
if (mClock != null) {
- XposedHelpers.callMethod(mClock, "updateClock");
+ XposedHelpers.callMethod(mClock.getView(), "updateClock");
}
}
if (intent.hasExtra(GravityBoxSettings.EXTRA_AMPM_HIDE)) {
mAmPmHide = intent.getBooleanExtra(GravityBoxSettings.EXTRA_AMPM_HIDE, false);
if (mClock != null) {
- XposedHelpers.callMethod(mClock, "updateClock");
+ XposedHelpers.callMethod(mClock.getView(), "updateClock");
}
if (mClockExpanded != null) {
XposedHelpers.callMethod(mClockExpanded, "updateClock");
@@ -144,7 +144,7 @@ public void onReceive(Context context, Intent intent) {
if (intent.hasExtra(GravityBoxSettings.EXTRA_CLOCK_HIDE)) {
mClockHide = intent.getBooleanExtra(GravityBoxSettings.EXTRA_CLOCK_HIDE, false);
if (mClock != null) {
- mClock.setVisibility(mClockHide ? View.GONE : View.VISIBLE);
+ mClock.getView().setVisibility(mClockHide ? View.GONE : View.VISIBLE);
}
}
if (intent.hasExtra(GravityBoxSettings.EXTRA_CLOCK_LINK)) {
@@ -225,7 +225,23 @@ public void update() {
public static void initResources(final XSharedPreferences prefs, final InitPackageResourcesParam resparam) {
try {
- String layout = Utils.hasGeminiSupport() ? "gemini_super_status_bar" : "super_status_bar";
+ // Before anything else, let's make sure we're not dealing with a Lenovo device
+ // Lenovo is known for doing some deep customizations into UI, so let's just check
+ // if is possible to hook a specific layout and work with it in that case
+ String layout = "lenovo_gemini_super_status_bar";
+ try{
+ resparam.res.hookLayout(PACKAGE_NAME, "layout", layout, new XC_LayoutInflated() {
+
+ @Override
+ public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
+ if (DEBUG) log("Lenovo custom layout found");
+ }
+ });
+ } catch (Throwable t) {
+ // Specific layout not found, so let's work with standard layout
+ layout = Utils.hasGeminiSupport() ? "gemini_super_status_bar" : "super_status_bar";
+ }
+
resparam.res.hookLayout(PACKAGE_NAME, "layout", layout, new XC_LayoutInflated() {
@Override
@@ -253,21 +269,21 @@ public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
"status_bar_contents", "id", PACKAGE_NAME)) : mIconArea;
// find statusbar clock
- mClock = (TextView) mIconArea.findViewById(
+ TextView clock = (TextView) mIconArea.findViewById(
liparam.res.getIdentifier("clock", "id", PACKAGE_NAME));
// the second attempt
- if (mClock == null) {
- mClock = (TextView) mSbContents.findViewById(
+ if (clock == null) {
+ clock = (TextView) mSbContents.findViewById(
liparam.res.getIdentifier("clock", "id", PACKAGE_NAME));
- mClockInSbContents = mClock != null;
+ mClockInSbContents = clock != null;
}
- if (mClock != null) {
- ModStatusbarColor.setClock(mClock);
+ if (clock != null) {
+ mClock = new StatusbarClock(clock);
+ ModStatusbarColor.registerIconManagerListener(mClock);
// use this additional field to identify the instance of Clock that resides in status bar
- XposedHelpers.setAdditionalInstanceField(mClock, "sbClock", true);
- mClockOriginalPaddingLeft = mClock.getPaddingLeft();
+ XposedHelpers.setAdditionalInstanceField(mClock.getView(), "sbClock", true);
if (mClockHide) {
- mClock.setVisibility(View.GONE);
+ mClock.getView().setVisibility(View.GONE);
}
}
@@ -299,7 +315,7 @@ public void onClick(View v) {
if (DEBUG) log("mLayoutClock injected");
if (mClock != null) {
- XposedHelpers.findAndHookMethod(mClock.getClass(), "getSmallTime", new XC_MethodHook() {
+ XposedHelpers.findAndHookMethod(mClock.getView().getClass(), "getSmallTime", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
// is this a status bar Clock instance?
@@ -320,7 +336,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (DEBUG) log("AM/PM removed. New clockText: '" + clockText + "'");
amPmIndex = -1;
} else if (!mAmPmHide
- && !DateFormat.is24HourFormat(mClock.getContext())
+ && !DateFormat.is24HourFormat(mClock.getView().getContext())
&& amPmIndex == -1) {
// insert AM/PM if missing
clockText += " " + amPm;
@@ -378,10 +394,28 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
log("Invalid preference value for PREF_KEY_DATA_TRAFFIC_SIZE");
}
mTrafficMeter.setTextSize(1, size);
- ModStatusbarColor.setTrafficMeter(mTrafficMeter);
+ ModStatusbarColor.registerIconManagerListener(mTrafficMeter);
updateTrafficMeterPosition();
mTrafficMeter.setTrafficMeterEnabled(prefs.getBoolean(
GravityBoxSettings.PREF_KEY_DATA_TRAFFIC_ENABLE, false));
+
+ // MTK Dual SIMs: reduce space between wifi and signal icons
+ if (Utils.hasGeminiSupport()) {
+ final int scvResId = liparam.res.getIdentifier("signal_cluster", "id", PACKAGE_NAME);
+ if (scvResId != 0) {
+ final View scView = liparam.view.findViewById(scvResId);
+ if (scView != null) {
+ final int spacerResId = liparam.res.getIdentifier("spacer", "id", PACKAGE_NAME);
+ final View spacer = scView.findViewById(spacerResId);
+ if (spacer != null &&
+ (spacer.getLayoutParams() instanceof LinearLayout.LayoutParams)) {
+ final int spacerSize = (int) spacer.getContext()
+ .getResources().getDisplayMetrics().density * 6;
+ spacer.setLayoutParams(new LinearLayout.LayoutParams(spacerSize, spacerSize));
+ }
+ }
+ }
+ }
}
});
} catch (Throwable t) {
@@ -474,7 +508,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (mClock == null) return;
boolean visible = (Boolean) param.args[0] && !mClockHide;
- mClock.setVisibility(visible ? View.VISIBLE : View.GONE);
+ mClock.getView().setVisibility(visible ? View.VISIBLE : View.GONE);
}
});
@@ -600,27 +634,27 @@ private static void setClockPosition(boolean center) {
}
if (center) {
- mClock.setGravity(Gravity.CENTER);
- mClock.setLayoutParams(new LinearLayout.LayoutParams(
+ mClock.getView().setGravity(Gravity.CENTER);
+ mClock.getView().setLayoutParams(new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
- mClock.setPadding(0, 0, 0, 0);
+ mClock.getView().setPadding(0, 0, 0, 0);
if (mClockInSbContents) {
- mSbContents.removeView(mClock);
+ mSbContents.removeView(mClock.getView());
} else {
- mIconArea.removeView(mClock);
+ mIconArea.removeView(mClock.getView());
}
- mLayoutClock.addView(mClock);
+ mLayoutClock.addView(mClock.getView());
if (DEBUG) log("Clock set to center position");
} else {
- mClock.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
- mClock.setLayoutParams(new LinearLayout.LayoutParams(
+ mClock.getView().setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
+ mClock.getView().setLayoutParams(new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
- mClock.setPadding(mClockOriginalPaddingLeft, 0, 0, 0);
- mLayoutClock.removeView(mClock);
+ mClock.resetOriginalPaddingLeft();
+ mLayoutClock.removeView(mClock.getView());
if (mClockInSbContents) {
- mSbContents.addView(mClock);
+ mSbContents.addView(mClock.getView());
} else {
- mIconArea.addView(mClock);
+ mIconArea.addView(mClock.getView());
}
if (DEBUG) log("Clock set to normal position");
}
diff --git a/src/com/ceco/gm2/gravitybox/ModStatusbarColor.java b/src/com/ceco/gm2/gravitybox/ModStatusbarColor.java
index d85f31406c..2af10af915 100644
--- a/src/com/ceco/gm2/gravitybox/ModStatusbarColor.java
+++ b/src/com/ceco/gm2/gravitybox/ModStatusbarColor.java
@@ -18,12 +18,13 @@
import java.util.ArrayList;
import java.util.List;
+import com.ceco.gm2.gravitybox.StatusBarIconManager.ColorInfo;
+import com.ceco.gm2.gravitybox.StatusBarIconManager.IconManagerListener;
+
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.res.Resources;
-import android.content.res.XModuleResources;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.Rect;
@@ -32,12 +33,13 @@
import android.os.BatteryManager;
import android.os.Build;
import android.view.View;
+import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
-import android.widget.TextView;
import de.robv.android.xposed.XC_MethodHook;
+import de.robv.android.xposed.XC_MethodHook.Unhook;
import de.robv.android.xposed.XC_MethodReplacement;
import de.robv.android.xposed.XSharedPreferences;
import de.robv.android.xposed.XposedBridge;
@@ -55,62 +57,48 @@ public class ModStatusbarColor {
"com.android.systemui.statusbar.SignalClusterView";
private static final String CLASS_BATTERY_CONTROLLER = "com.android.systemui.statusbar.policy.BatteryController";
private static final String CLASS_NOTIF_PANEL_VIEW = "com.android.systemui.statusbar.phone.NotificationPanelView";
+ private static final String CLASS_POLICY_WINDOW_STATE = "android.view.WindowManagerPolicy$WindowState";
+ private static final String CLASS_WINDOW_STATE = "com.android.server.wm.WindowState";
+ private static final String CLASS_WINDOW_MANAGER_SERVICE = "com.android.server.wm.WindowManagerService";
+ private static final String CLASS_STATUSBAR_ICON_VIEW = "com.android.systemui.statusbar.StatusBarIconView";
+ private static final String CLASS_STATUSBAR_ICON = "com.android.internal.statusbar.StatusBarIcon";
private static final boolean DEBUG = false;
public static final String ACTION_PHONE_STATUSBAR_VIEW_MADE = "gravitybox.intent.action.PHONE_STATUSBAR_VIEW_MADE";
private static View mPanelBar;
private static StatusBarIconManager mIconManager;
- private static Object mSignalClusterView;
- private static boolean mIconColorEnabled;
- private static boolean mSkipBatteryIcon;
- private static TextView mClock;
- private static CmCircleBattery mCircleBattery;
- private static TextView mPercentage;
- private static ImageView mBattery;
+ private static View mBattery;
private static int mBatteryLevel;
private static boolean mBatteryPlugged;
private static Object mBatteryController;
- private static FrameLayout mNotificationPanelView;
- private static NotificationWallpaper mNotificationWallpaper;
- private static boolean mRoamingIndicatorsDisabled;
private static TransparencyManager mTransparencyManager;
- private static TrafficMeter mTrafficMeter;
private static Context mContextPwm;
- private static int[] mTransparencyValuesPwm = new int[4];
+ private static int[] mTransparencyValuesPwm = new int[] { 0, 0, 0, 0};
+ private static int mTransparencyModePwm = TransparencyManager.MODE_FULL;
private static List mBroadcastSubReceivers;
+ private static Unhook mDisplayContentHook;
+ private static Object mPhoneWindowManager;
+ private static Object mPhoneStatusBar;
+ private static StatusbarSignalCluster mSignalCluster;
static {
- mIconManager = new StatusBarIconManager(XModuleResources.createInstance(GravityBox.MODULE_PATH, null));
- mIconColorEnabled = false;
- mSkipBatteryIcon = false;
mBatteryLevel = 0;
mBatteryPlugged = false;
- mRoamingIndicatorsDisabled = false;
}
private static void log(String message) {
XposedBridge.log(TAG + ": " + message);
}
- public static void setClock(TextView clock) {
- mClock = clock;
- }
-
- public static void setCircleBattery(CmCircleBattery circleBattery) {
- mCircleBattery = circleBattery;
- }
-
- public static void setPercentage(TextView percentage) {
- mPercentage = percentage;
- }
-
- public static void setBattery(ImageView battery) {
+ public static void setBattery(View battery) {
mBattery = battery;
}
- public static void setTrafficMeter(TrafficMeter trafficMeter) {
- mTrafficMeter = trafficMeter;
+ public static void registerIconManagerListener(IconManagerListener listener) {
+ if (mIconManager != null) {
+ mIconManager.registerListener(listener);
+ }
}
private static BroadcastReceiver mBroadcastReceiverPwm = new BroadcastReceiver() {
@@ -143,58 +131,7 @@ public void onReceive(Context context, Intent intent) {
if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_BG_COLOR)) {
int bgColor = intent.getIntExtra(GravityBoxSettings.EXTRA_SB_BG_COLOR, Color.BLACK);
setStatusbarBgColor(bgColor);
- } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_ICON_COLOR)) {
- int iconColor = intent.getIntExtra(
- GravityBoxSettings.EXTRA_SB_ICON_COLOR, mIconManager.getDefaultIconColor());
- mIconManager.setIconColor(iconColor);
- applyIconColors();
- } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_DATA_ACTIVITY_COLOR)) {
- int daColor = intent.getIntExtra(
- GravityBoxSettings.EXTRA_SB_DATA_ACTIVITY_COLOR,
- StatusBarIconManager.DEFAULT_DATA_ACTIVITY_COLOR);
- mIconManager.setDataActivityColor(daColor);
- applyIconColors();
- } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_ICON_COLOR_ENABLE)) {
- mIconColorEnabled = intent.getBooleanExtra(
- GravityBoxSettings.EXTRA_SB_ICON_COLOR_ENABLE, false);
- if (DEBUG) log("Icon colors master switch set to: " + mIconColorEnabled);
- if (!mIconColorEnabled) mIconManager.clearCache();
- applyIconColors();
- } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_COLOR_FOLLOW)) {
- boolean follow = intent.getBooleanExtra(GravityBoxSettings.EXTRA_SB_COLOR_FOLLOW, false);
- mIconManager.setFollowStockBatteryColor(follow);
- applyIconColors();
- } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_COLOR_SKIP_BATTERY)) {
- mSkipBatteryIcon = intent.getBooleanExtra(
- GravityBoxSettings.EXTRA_SB_COLOR_SKIP_BATTERY, false);
- applyIconColors();
- }
- }
-
- if (intent.getAction().equals(GravityBoxSettings.ACTION_NOTIF_BACKGROUND_CHANGED) &&
- mNotificationWallpaper != null) {
- if (intent.hasExtra(GravityBoxSettings.EXTRA_BG_TYPE)) {
- mNotificationWallpaper.setType(
- intent.getStringExtra(GravityBoxSettings.EXTRA_BG_TYPE));
- }
- if (intent.hasExtra(GravityBoxSettings.EXTRA_BG_COLOR)) {
- mNotificationWallpaper.setColor(
- intent.getIntExtra(GravityBoxSettings.EXTRA_BG_COLOR, Color.BLACK));
- }
- if (intent.hasExtra(GravityBoxSettings.EXTRA_BG_ALPHA)) {
- mNotificationWallpaper.setAlpha(
- intent.getIntExtra(GravityBoxSettings.EXTRA_BG_ALPHA, 60));
}
- if (intent.hasExtra(GravityBoxSettings.EXTRA_BG_COLOR_MODE)) {
- mNotificationWallpaper.setColorMode(
- intent.getStringExtra(GravityBoxSettings.EXTRA_BG_COLOR_MODE));
- }
- updateNotificationPanelBackground();
- }
-
- if (intent.getAction().equals(GravityBoxSettings.ACTION_DISABLE_ROAMING_INDICATORS_CHANGED)) {
- mRoamingIndicatorsDisabled = intent.getBooleanExtra(
- GravityBoxSettings.EXTRA_INDICATORS_DISABLED, false);
}
for (BroadcastSubReceiver bsr : mBroadcastSubReceivers) {
@@ -203,52 +140,242 @@ public void onReceive(Context context, Intent intent) {
}
};
+ // in Zygote hooks
public static void initZygote(final XSharedPreferences prefs) {
try {
final Class> phoneWindowManagerClass = XposedHelpers.findClass(CLASS_PHONE_WINDOW_MANAGER, null);
+ final Class> windowStateClass = XposedHelpers.findClass(CLASS_WINDOW_STATE, null);
+ final Class> windowManagerServiceClass = XposedHelpers.findClass(CLASS_WINDOW_MANAGER_SERVICE, null);
- if (DEBUG) log("replacing getSystemDecorRectLw method");
- XposedHelpers.findAndHookMethod(phoneWindowManagerClass,
- "getSystemDecorRectLw", Rect.class, new XC_MethodReplacement() {
+ try {
+ mTransparencyModePwm = Integer.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_TM_MODE, "3"));
+ } catch (NumberFormatException nfe) {
+ //
+ }
- @Override
- protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
- if (mContextPwm == null) {
- if (DEBUG) log("getSystemDecorRectLw: registering transparency settings receiver");
- mTransparencyValuesPwm[0] = prefs.getInt(GravityBoxSettings.PREF_KEY_TM_STATUSBAR_LAUNCHER, 0);
- mTransparencyValuesPwm[1] = prefs.getInt(GravityBoxSettings.PREF_KEY_TM_STATUSBAR_LOCKSCREEN, 0);
- mTransparencyValuesPwm[2] = prefs.getInt(GravityBoxSettings.PREF_KEY_TM_NAVBAR_LAUNCHER, 0);
- mTransparencyValuesPwm[3] = prefs.getInt(GravityBoxSettings.PREF_KEY_TM_NAVBAR_LOCKSCREEN, 0);
- mContextPwm = (Context) XposedHelpers.getObjectField(param.thisObject, "mContext");
- IntentFilter intentFilter = new IntentFilter();
- intentFilter.addAction(GravityBoxSettings.ACTION_PREF_STATUSBAR_COLOR_CHANGED);
- mContextPwm.registerReceiver(mBroadcastReceiverPwm, intentFilter);
+ if (mTransparencyModePwm != TransparencyManager.MODE_DISABLED && Build.VERSION.SDK_INT < 19) {
+ if (DEBUG) log("replacing getSystemDecorRectLw method");
+ XposedHelpers.findAndHookMethod(phoneWindowManagerClass,
+ "getSystemDecorRectLw", Rect.class, new XC_MethodReplacement() {
+
+ @Override
+ protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
+ if (mContextPwm == null) {
+ if (DEBUG) log("getSystemDecorRectLw: registering transparency settings receiver");
+ mTransparencyValuesPwm[0] = prefs.getInt(GravityBoxSettings.PREF_KEY_TM_STATUSBAR_LAUNCHER, 0);
+ mTransparencyValuesPwm[1] = prefs.getInt(GravityBoxSettings.PREF_KEY_TM_STATUSBAR_LOCKSCREEN, 0);
+ mTransparencyValuesPwm[2] = prefs.getInt(GravityBoxSettings.PREF_KEY_TM_NAVBAR_LAUNCHER, 0);
+ mTransparencyValuesPwm[3] = prefs.getInt(GravityBoxSettings.PREF_KEY_TM_NAVBAR_LOCKSCREEN, 0);
+ mPhoneWindowManager = param.thisObject;
+ mContextPwm = (Context) XposedHelpers.getObjectField(param.thisObject, "mContext");
+ IntentFilter intentFilter = new IntentFilter();
+ intentFilter.addAction(GravityBoxSettings.ACTION_PREF_STATUSBAR_COLOR_CHANGED);
+ mContextPwm.registerReceiver(mBroadcastReceiverPwm, intentFilter);
+ }
+
+ if (!isTransparencyEnabled()) {
+ if (DEBUG) log("getSystemDecorRectLw: calling original method");
+ return XposedBridge.invokeOriginalMethod(param.method, param.thisObject, param.args);
+ } else {
+ if (DEBUG) log("getSystemDecorRectLw: overriding original method");
+ Rect rect = (Rect) param.args[0];
+ rect.left = XposedHelpers.getIntField(param.thisObject, "mSystemLeft");
+ rect.top = XposedHelpers.getIntField(param.thisObject, "mSystemTop");
+ rect.right = XposedHelpers.getIntField(param.thisObject, "mSystemRight");
+ rect.bottom = XposedHelpers.getIntField(param.thisObject, "mSystemBottom");
+ return 0;
+ }
}
+ });
+
+ XposedHelpers.findAndHookMethod(phoneWindowManagerClass, "layoutWindowLw",
+ CLASS_POLICY_WINDOW_STATE, WindowManager.LayoutParams.class,
+ CLASS_POLICY_WINDOW_STATE, new XC_MethodHook(XC_MethodHook.PRIORITY_LOWEST) {
+ @Override
+ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
+ final boolean isDefaultDisplay = Build.VERSION.SDK_INT > 16 ?
+ (Boolean) XposedHelpers.callMethod(param.args[0], "isDefaultDisplay") : true;
+ if (!isNavbarTransparencyEnabled() || !isDefaultDisplay) return;
+
+ final WindowManager.LayoutParams attrs = (WindowManager.LayoutParams) param.args[1];
+ if (attrs.type == WindowManager.LayoutParams.TYPE_WALLPAPER) {
+ final int fl = attrs.flags;
+ final int sysUiFl = (Integer) XposedHelpers.callMethod(param.args[0], "getSystemUiVisibility");
+ final Rect pf = (Rect) XposedHelpers.getObjectField(param.thisObject, "mTmpParentFrame");
+ final Rect df = (Rect) XposedHelpers.getObjectField(param.thisObject, "mTmpDisplayFrame");
+ final Rect cf = (Rect) XposedHelpers.getObjectField(param.thisObject, "mTmpContentFrame");
+ final Rect vf = (Rect) XposedHelpers.getObjectField(param.thisObject, "mTmpVisibleFrame");
+ final Rect of = Build.VERSION.SDK_INT > 17 ?
+ (Rect) XposedHelpers.getObjectField(param.thisObject, "mTmpOverscanFrame") : null;
+
+ pf.top = df.top = cf.top = vf.top =
+ XposedHelpers.getIntField(param.thisObject, "mUnrestrictedScreenTop");
+ pf.bottom = df.bottom = cf.bottom = vf.bottom = pf.top +
+ XposedHelpers.getIntField(param.thisObject, "mUnrestrictedScreenHeight");
+
+ if (Build.VERSION.SDK_INT > 17) {
+ of.set(pf);
+ }
- boolean override = false;
- for (int i = 0; i < 4; i++) {
- override |= mTransparencyValuesPwm[i] != 0;
- }
+ XposedHelpers.callMethod(param.thisObject, "applyStableConstraints",
+ sysUiFl, fl, cf);
+ if (Build.VERSION.SDK_INT > 17) {
+ XposedHelpers.callMethod(param.args[0], "computeFrameLw", pf, df, of, cf, vf);
+ } else {
+ XposedHelpers.callMethod(param.args[0], "computeFrameLw", pf, df, cf, vf);
+ }
- if (!override) {
- if (DEBUG) log("getSystemDecorRectLw: calling original method");
- return XposedBridge.invokeOriginalMethod(param.method, param.thisObject, param.args);
- } else {
- if (DEBUG) log("getSystemDecorRectLw: overriding original method");
- Rect rect = (Rect) param.args[0];
- rect.left = XposedHelpers.getIntField(param.thisObject, "mSystemLeft");
- rect.top = XposedHelpers.getIntField(param.thisObject, "mSystemTop");
- rect.right = XposedHelpers.getIntField(param.thisObject, "mSystemRight");
- rect.bottom = XposedHelpers.getIntField(param.thisObject, "mSystemBottom");
- return 0;
+ if (DEBUG) log("layoutWindowLw recomputing frame");
+ }
}
+ });
+
+ if (Build.VERSION.SDK_INT > 17) {
+ XposedHelpers.findAndHookMethod(windowStateClass, "computeFrameLw",
+ Rect.class, Rect.class, Rect.class, Rect.class, Rect.class, windowStateComputeFrameLw);
+ } else {
+ XposedHelpers.findAndHookMethod(windowStateClass, "computeFrameLw",
+ Rect.class, Rect.class, Rect.class, Rect.class, windowStateComputeFrameLw);
}
- });
+
+ XposedHelpers.findAndHookMethod(windowManagerServiceClass, "adjustWallpaperWindowsLocked",
+ adjustWallpaperHook);
+
+ XposedHelpers.findAndHookMethod(windowManagerServiceClass, "updateWallpaperOffsetLocked",
+ CLASS_WINDOW_STATE, boolean.class, adjustWallpaperHook);
+ }
+
} catch (Throwable t) {
XposedBridge.log(t);
}
}
+ private static XC_MethodHook windowStateComputeFrameLw = new XC_MethodHook() {
+ @Override
+ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
+ if (isNavbarTransparencyEnabled() &&
+ XposedHelpers.getBooleanField(param.thisObject, "mIsWallpaper")) {
+ try {
+ final int width = getWallpaperWidth();
+ final int height = getWallpaperHeight();
+ if (width > 0 && height > 0) {
+ XposedHelpers.callMethod(
+ XposedHelpers.getObjectField(param.thisObject, "mService"),
+ "updateWallpaperOffsetLocked",
+ param.thisObject, width, height, false);
+ if (DEBUG) log("updateWallpaperOffsetLocked: width=" + width +
+ "; height=" + height);
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+ }
+ };
+
+ private static XC_MethodHook adjustWallpaperHook = new XC_MethodHook() {
+ @Override
+ protected void beforeHookedMethod(final MethodHookParam param) throws Throwable {
+ if (!isNavbarTransparencyEnabled()) return;
+
+ try {
+ if (Build.VERSION.SDK_INT > 16) {
+ final Class> displayContentClass =
+ XposedHelpers.findClass("com.android.server.wm.DisplayContent", null);
+ if (DEBUG) log ("adjustWallpaperWindowsLocked: hooking getDisplayInfo");
+ mDisplayContentHook = XposedHelpers.findAndHookMethod(displayContentClass, "getDisplayInfo",
+ new XC_MethodHook() {
+ @Override
+ protected void beforeHookedMethod(final MethodHookParam param2) throws Throwable {
+ Object di = XposedHelpers.getObjectField(param2.thisObject, "mDisplayInfo");
+ final int width = getWallpaperWidth();
+ final int height = getWallpaperHeight();
+ if (width > 0 && height > 0) {
+ XposedHelpers.setIntField(di, "appWidth", width);
+ XposedHelpers.setIntField(di, "appHeight", height);
+ param.setResult(di);
+ if (DEBUG) log("adjustWallpaperWindowsLocked: getDisplayInfo appWidth=" + width
+ + "; appHeight=" + height);
+ }
+ }
+ });
+ } else {
+ final int width = getWallpaperWidth();
+ final int height = getWallpaperHeight();
+ if (width > 0 && height > 0) {
+ int appWidth = XposedHelpers.getIntField(param.thisObject, "mAppDisplayWidth");
+ int appHeight = XposedHelpers.getIntField(param.thisObject, "mAppDisplayHeight");
+ XposedHelpers.setAdditionalInstanceField(param.thisObject, "mAppDisplayWidthOrig", appWidth);
+ XposedHelpers.setAdditionalInstanceField(param.thisObject, "mAppDisplayHeightOrig", appHeight);
+ XposedHelpers.setIntField(param.thisObject, "mAppDisplayWidth", width);
+ XposedHelpers.setIntField(param.thisObject, "mAppDisplayHeight", height);
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+ @Override
+ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
+ if (!isNavbarTransparencyEnabled()) return;
+
+ try {
+ if (Build.VERSION.SDK_INT > 16) {
+ if (mDisplayContentHook != null) {
+ mDisplayContentHook.unhook();
+ mDisplayContentHook = null;
+ if (DEBUG) log ("adjustWallpaperWindowsLocked: unhooking getDisplayInfo");
+ }
+ } else {
+ Integer appWidth = (Integer) XposedHelpers.getAdditionalInstanceField(
+ param.thisObject, "mAppDisplayWidthOrig");
+ Integer appHeight = (Integer) XposedHelpers.getAdditionalInstanceField(
+ param.thisObject, "mAppDisplayHeightOrig");
+ if (appWidth != null && appHeight != null) {
+ XposedHelpers.setIntField(param.thisObject, "mAppDisplayWidth", (int)appWidth);
+ XposedHelpers.setIntField(param.thisObject, "mAppDisplayHeight", (int)appHeight);
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+ };
+
+ private static boolean isTransparencyEnabled() {
+ return (isStatusbarTransparencyEnabled() ||
+ isNavbarTransparencyEnabled());
+ }
+
+ private static boolean isStatusbarTransparencyEnabled() {
+ return (TransparencyManager.isStatusbarEnabled(mTransparencyModePwm) &&
+ (mTransparencyValuesPwm[0] != 0 || mTransparencyValuesPwm[1] != 0));
+ }
+
+ private static boolean isNavbarTransparencyEnabled() {
+ return (TransparencyManager.isNavbarEnabled(mTransparencyModePwm) &&
+ (mTransparencyValuesPwm[2] != 0 || mTransparencyValuesPwm[3] != 0));
+ }
+
+ private static int getWallpaperWidth() {
+ if (mPhoneWindowManager != null) {
+ final int left = XposedHelpers.getIntField(mPhoneWindowManager, "mUnrestrictedScreenLeft");
+ final int width = XposedHelpers.getIntField(mPhoneWindowManager, "mUnrestrictedScreenWidth");
+ return left + (left + width);
+ }
+ return 0;
+ }
+
+ private static int getWallpaperHeight() {
+ if (mPhoneWindowManager != null) {
+ final int top = XposedHelpers.getIntField(mPhoneWindowManager, "mUnrestrictedScreenTop");
+ final int height = XposedHelpers.getIntField(mPhoneWindowManager, "mUnrestrictedScreenHeight");
+ return top + (top + height);
+ }
+ return 0;
+ }
+
+ // in process hooks
public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) {
try {
final Class> phoneStatusbarViewClass = XposedHelpers.findClass(CLASS_PHONE_STATUSBAR_VIEW, classLoader);
@@ -257,22 +384,10 @@ public static void init(final XSharedPreferences prefs, final ClassLoader classL
final Class> batteryControllerClass = XposedHelpers.findClass(CLASS_BATTERY_CONTROLLER, classLoader);
final Class> notifPanelViewClass = Build.VERSION.SDK_INT > 16 ?
XposedHelpers.findClass(CLASS_NOTIF_PANEL_VIEW, classLoader) : null;
+ final Class> statusbarIconViewClass = XposedHelpers.findClass(CLASS_STATUSBAR_ICON_VIEW, classLoader);
mBroadcastSubReceivers = new ArrayList();
- mIconColorEnabled = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_ICON_COLOR_ENABLE, false);
- mSkipBatteryIcon = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_COLOR_SKIP_BATTERY, false);
- mIconManager.setIconColor(
- prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_ICON_COLOR,
- mIconManager.getDefaultIconColor()));
- mIconManager.setDataActivityColor(
- prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR,
- StatusBarIconManager.DEFAULT_DATA_ACTIVITY_COLOR));
- mIconManager.setFollowStockBatteryColor(prefs.getBoolean(
- GravityBoxSettings.PREF_KEY_STATUSBAR_COLOR_FOLLOW_STOCK_BATTERY, false));
- mRoamingIndicatorsDisabled = prefs.getBoolean(
- GravityBoxSettings.PREF_KEY_DISABLE_ROAMING_INDICATORS, false);
-
XposedBridge.hookAllConstructors(phoneStatusbarViewClass, new XC_MethodHook() {
@Override
@@ -285,7 +400,42 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
intentFilter.addAction(GravityBoxSettings.ACTION_DISABLE_ROAMING_INDICATORS_CHANGED);
mPanelBar.getContext().registerReceiver(mBroadcastReceiver, intentFilter);
- mIconManager.initStockBatteryColor(mPanelBar.getContext());
+ Context gbContext = mPanelBar.getContext().createPackageContext(GravityBox.PACKAGE_NAME,
+ Context.CONTEXT_IGNORE_SECURITY);
+ mIconManager = new StatusBarIconManager(mPanelBar.getContext(), gbContext);
+ mIconManager.setIconColor(
+ prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_ICON_COLOR,
+ mIconManager.getDefaultIconColor()));
+ try {
+ int iconStyle = Integer.valueOf(
+ prefs.getString(GravityBoxSettings.PREF_KEY_STATUS_ICON_STYLE, "0"));
+ mIconManager.setIconStyle(iconStyle);
+ } catch(NumberFormatException nfe) {
+ log("Invalid value for PREF_KEY_STATUS_ICON_STYLE preference");
+ }
+ mIconManager.setIconColor(1,
+ prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_ICON_COLOR_SECONDARY,
+ mIconManager.getDefaultIconColor()));
+ mIconManager.setDataActivityColor(
+ prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR,
+ StatusBarIconManager.DEFAULT_DATA_ACTIVITY_COLOR));
+ mIconManager.setDataActivityColor(1,
+ prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_DATA_ACTIVITY_COLOR_SECONDARY,
+ StatusBarIconManager.DEFAULT_DATA_ACTIVITY_COLOR));
+ mIconManager.setFollowStockBatteryColor(prefs.getBoolean(
+ GravityBoxSettings.PREF_KEY_STATUSBAR_COLOR_FOLLOW_STOCK_BATTERY, false));
+ try {
+ int signalIconMode = Integer.valueOf(prefs.getString(
+ GravityBoxSettings.PREF_KEY_STATUSBAR_SIGNAL_COLOR_MODE, "0"));
+ mIconManager.setSignalIconMode(signalIconMode);
+ } catch (NumberFormatException nfe) {
+ log("Invalid value for PREF_KEY_STATUSBAR_SIGNAL_COLOR_MODE preference");
+ }
+ mIconManager.setSkipBatteryIcon(prefs.getBoolean(
+ GravityBoxSettings.PREF_KEY_STATUSBAR_COLOR_SKIP_BATTERY, false));
+ mIconManager.setColoringEnabled(prefs.getBoolean(
+ GravityBoxSettings.PREF_KEY_STATUSBAR_ICON_COLOR_ENABLE, false));
+ mBroadcastSubReceivers.add(mIconManager);
}
});
@@ -293,7 +443,10 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
@Override
protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
- mSignalClusterView = param.thisObject;
+ LinearLayout view = (LinearLayout) param.thisObject;
+ mSignalCluster = StatusbarSignalCluster.create(view, mIconManager);
+ mSignalCluster.initPreferences(prefs);
+ mBroadcastSubReceivers.add(mSignalCluster);
if (DEBUG) log("SignalClusterView constructed - mSignalClusterView set");
}
});
@@ -303,19 +456,31 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
@Override
protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
+ prefs.reload();
+ mPhoneStatusBar = param.thisObject;
Context context = (Context) XposedHelpers.getObjectField(param.thisObject, "mContext");
- mTransparencyManager = new TransparencyManager(context);
- mTransparencyManager.setStatusbar(XposedHelpers.getObjectField(param.thisObject, "mStatusBarView"));
- mTransparencyManager.setNavbar(XposedHelpers.getObjectField(
- param.thisObject, "mNavigationBarView"));
- mTransparencyManager.initPreferences(prefs);
- mBroadcastSubReceivers.add(mTransparencyManager);
+
+ int tmMode = TransparencyManager.MODE_FULL;
+ try {
+ tmMode = Integer.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_TM_MODE, "3"));
+ } catch (NumberFormatException nfe) {
+ log("Invalid value for PREF_KEY_TM_MODE preference");
+ }
+ if (tmMode != TransparencyManager.MODE_DISABLED && Build.VERSION.SDK_INT < 19) {
+ mTransparencyManager = new TransparencyManager(context, tmMode);
+ mTransparencyManager.setStatusbar(XposedHelpers.getObjectField(param.thisObject, "mStatusBarView"));
+ mTransparencyManager.setNavbar(XposedHelpers.getObjectField(param.thisObject, "mNavigationBarView"));
+ mTransparencyManager.initPreferences(prefs);
+ mBroadcastSubReceivers.add(mTransparencyManager);
+ }
mBatteryController = XposedHelpers.getObjectField(param.thisObject, "mBatteryController");
- prefs.reload();
int bgColor = prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_BGCOLOR, Color.BLACK);
setStatusbarBgColor(bgColor);
- applyIconColors();
+ if (mIconManager != null) {
+ mIconManager.registerListener(mIconManagerListener);
+ mIconManager.refreshState();
+ }
Intent i = new Intent(ACTION_PHONE_STATUSBAR_VIEW_MADE);
context.sendBroadcast(i);
@@ -352,22 +517,18 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
}
});
- XposedHelpers.findAndHookMethod(phoneStatusbarClass, "setStatusBarLowProfile",
- boolean.class, new XC_MethodHook() {
- @Override
- protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
- final boolean lightsOut = (Boolean) param.args[0];
- if (mCircleBattery != null) {
- mCircleBattery.setLowProfile(lightsOut);
- }
- if (mPercentage != null) {
- mPercentage.setAlpha(lightsOut ? 0.5f : 1);
- }
- if (mTrafficMeter != null) {
- mTrafficMeter.setAlpha(lightsOut ? 0 : 1);
+ if (Build.VERSION.SDK_INT < 19) {
+ XposedHelpers.findAndHookMethod(phoneStatusbarClass, "setStatusBarLowProfile",
+ boolean.class, new XC_MethodHook() {
+ @Override
+ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
+ final boolean lightsOut = (Boolean) param.args[0];
+ if (mIconManager != null) {
+ mIconManager.setLowProfile(lightsOut);
+ }
}
- }
- });
+ });
+ }
XposedHelpers.findAndHookMethod(batteryControllerClass, "onReceive",
Context.class, Intent.class, new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
@@ -377,191 +538,23 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
Intent intent = (Intent) param.args[1];
if (Intent.ACTION_BATTERY_CHANGED.equals(intent.getAction())) {
mBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
- mBatteryPlugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0;
- if (mIconColorEnabled && !mSkipBatteryIcon && mBattery != null) {
- Drawable d = mIconManager.getBatteryIcon(mBatteryLevel, mBatteryPlugged);
- if (d != null) mBattery.setImageDrawable(d);
+ if (Build.VERSION.SDK_INT > 17) {
+ int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS,
+ BatteryManager.BATTERY_STATUS_UNKNOWN);
+ mBatteryPlugged = (status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL);
+ } else {
+ mBatteryPlugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0;
}
- }
- }
- });
-
- XposedHelpers.findAndHookMethod(signalClusterViewClass, "apply", new XC_MethodHook() {
-
- @Override
- protected void afterHookedMethod(MethodHookParam param) throws Throwable {
- if (XposedHelpers.getObjectField(param.thisObject, "mWifiGroup") == null) return;
-
- Resources res = ((LinearLayout) param.thisObject).getContext().getResources();
-
- if (mIconColorEnabled) {
- Object mobileIconId = null;
- Object[] mobileIconIds = null, mobileIconIdsGemini = null;
- Object mobileActivityId = null, mobileActivityIdGemini = null;
- Object mobileTypeId = null, mobileTypeIdGemini = null;
- if (Utils.isMtkDevice()) {
- if (Utils.hasGeminiSupport()) {
- mobileIconIds = (Object[]) XposedHelpers.getObjectField(param.thisObject, "mMobileStrengthId");
- mobileIconIdsGemini = (Object[]) XposedHelpers.getObjectField(param.thisObject, "mMobileStrengthIdGemini");
- mobileActivityIdGemini = XposedHelpers.getObjectField(param.thisObject, "mMobileActivityIdGemini");
- mobileTypeIdGemini = XposedHelpers.getObjectField(param.thisObject, "mMobileTypeIdGemini");
- } else {
- mobileIconId = (Object) XposedHelpers.getObjectField(param.thisObject, "mMobileStrengthId");
- }
- mobileActivityId = XposedHelpers.getObjectField(param.thisObject, "mMobileActivityId");
- mobileTypeId = XposedHelpers.getObjectField(param.thisObject, "mMobileTypeId");
- }
-
- if (XposedHelpers.getBooleanField(param.thisObject, "mWifiVisible")) {
- ImageView wifiIcon = (ImageView) XposedHelpers.getObjectField(param.thisObject, "mWifi");
- if (wifiIcon != null) {
- try {
- int resId = XposedHelpers.getIntField(param.thisObject, "mWifiStrengthId");
- String resName = res.getResourceEntryName(resId);
- Drawable d = mIconManager.getWifiIcon(resName);
- if (d != null) wifiIcon.setImageDrawable(d);
- } catch (Resources.NotFoundException e) { }
- }
- ImageView wifiActivity = (ImageView) XposedHelpers.getObjectField(param.thisObject, "mWifiActivity");
- if (wifiActivity != null) {
- try {
- int resId = XposedHelpers.getIntField(param.thisObject, "mWifiActivityId");
- Drawable d = res.getDrawable(resId).mutate();
- d = mIconManager.applyDataActivityColorFilter(d);
- wifiActivity.setImageDrawable(d);
- } catch (Resources.NotFoundException e) {
- wifiActivity.setImageDrawable(null);
- }
- }
- }
-
- if (!XposedHelpers.getBooleanField(param.thisObject, "mIsAirplaneMode")) {
- // for SIM Slot 1
- if (XposedHelpers.getBooleanField(param.thisObject, "mMobileVisible")) {
- boolean allowChange = false;
- ImageView mobile = (ImageView) XposedHelpers.getObjectField(param.thisObject, "mMobile");
- if (mobile != null) {
- try {
- int resId = Utils.isMtkDevice() ?
- (Integer) XposedHelpers.callMethod(Utils.hasGeminiSupport() ?
- mobileIconIds[0] : mobileIconId, "getIconId") :
- XposedHelpers.getIntField(param.thisObject, "mMobileStrengthId");
- String resName = res.getResourceEntryName(resId);
- allowChange = resName.contains("blue") | !Utils.isMtkDevice();
- Drawable d = mIconManager.getMobileIcon(resName);
- if (d != null) mobile.setImageDrawable(d);
- } catch (Resources.NotFoundException e) { }
- }
- if (allowChange) {
- ImageView mobileActivity =
- (ImageView) XposedHelpers.getObjectField(param.thisObject, "mMobileActivity");
- if (mobileActivity != null) {
- try {
- int resId = Utils.isMtkDevice() ?
- (Integer) XposedHelpers.callMethod(mobileActivityId, "getIconId") :
- XposedHelpers.getIntField(param.thisObject, "mMobileActivityId");
- Drawable d = res.getDrawable(resId).mutate();
- d = mIconManager.applyDataActivityColorFilter(d);
- mobileActivity.setImageDrawable(d);
- } catch (Resources.NotFoundException e) {
- mobileActivity.setImageDrawable(null);
- }
- }
- ImageView mobileType = (ImageView) XposedHelpers.getObjectField(param.thisObject, "mMobileType");
- if (mobileType != null) {
- try {
- int resId = Utils.hasGeminiSupport() ?
- (Integer) XposedHelpers.callMethod(mobileTypeId, "getIconId") :
- XposedHelpers.getIntField(param.thisObject, "mMobileTypeId");
- Drawable d = res.getDrawable(resId).mutate();
- d = mIconManager.applyColorFilter(d);
- mobileType.setImageDrawable(d);
- } catch (Resources.NotFoundException e) {
- mobileType.setImageDrawable(null);
- }
- }
- if (Utils.isMtkDevice() &&
- XposedHelpers.getBooleanField(param.thisObject, "mRoaming")) {
- ImageView mobileRoam = (ImageView) XposedHelpers.getObjectField(param.thisObject, "mMobileRoam");
- if (mobileRoam != null) {
- try {
- int resId = XposedHelpers.getIntField(param.thisObject, "mRoamingId");
- Drawable d = res.getDrawable(resId).mutate();
- d = mIconManager.applyColorFilter(d);
- mobileRoam.setImageDrawable(d);
- } catch (Resources.NotFoundException e) {
- mobileRoam.setImageDrawable(null);
- }
- }
- }
- }
- }
-
- // for SIM Slot 2
- if (Utils.hasGeminiSupport() &&
- XposedHelpers.getBooleanField(param.thisObject, "mMobileVisibleGemini")) {
- boolean allowChange = false;
- ImageView mobile = (ImageView) XposedHelpers.getObjectField(param.thisObject, "mMobileGemini");
- if (mobile != null) {
- try {
- int resId = (Integer) XposedHelpers.callMethod(mobileIconIdsGemini[0], "getIconId");
- String resName = res.getResourceEntryName(resId);
- allowChange = resName.contains("blue");
- Drawable d = mIconManager.getMobileIcon(resName);
- if (d != null) mobile.setImageDrawable(d);
- } catch (Resources.NotFoundException e) { }
- }
- if (allowChange) {
- ImageView mobileActivity =
- (ImageView) XposedHelpers.getObjectField(param.thisObject, "mMobileActivityGemini");
- if (mobileActivity != null) {
- try {
- int resId = (Integer) XposedHelpers.callMethod(mobileActivityIdGemini, "getIconId");
- Drawable d = res.getDrawable(resId).mutate();
- d = mIconManager.applyDataActivityColorFilter(d);
- mobileActivity.setImageDrawable(d);
- } catch (Resources.NotFoundException e) {
- mobileActivity.setImageDrawable(null);
- }
- }
- ImageView mobileType = (ImageView) XposedHelpers.getObjectField(param.thisObject, "mMobileTypeGemini");
- if (mobileType != null) {
- try {
- int resId = (Integer) XposedHelpers.callMethod(mobileTypeIdGemini, "getIconId");
- Drawable d = res.getDrawable(resId).mutate();
- d = mIconManager.applyColorFilter(d);
- mobileType.setImageDrawable(d);
- } catch (Resources.NotFoundException e) {
- mobileType.setImageDrawable(null);
- }
- }
- if (XposedHelpers.getBooleanField(param.thisObject, "mRoamingGemini")) {
- ImageView mobileRoam = (ImageView) XposedHelpers.getObjectField(param.thisObject, "mMobileRoamGemini");
- if (mobileRoam != null) {
- try {
- int resId = XposedHelpers.getIntField(param.thisObject, "mRoamingGeminiId");
- Drawable d = res.getDrawable(resId).mutate();
- d = mIconManager.applyColorFilter(d);
- mobileRoam.setImageDrawable(d);
- } catch (Resources.NotFoundException e) {
- mobileRoam.setImageDrawable(null);
- }
- }
- }
- }
+ if (mIconManager != null && mIconManager.isColoringEnabled() &&
+ !mIconManager.shouldSkipBatteryIcon() && mBattery != null &&
+ (mBattery instanceof ImageView)) {
+ Drawable d = mIconManager.getBatteryIcon(mBatteryLevel, mBatteryPlugged);
+ if (d != null) {
+ ((ImageView)mBattery).setImageDrawable(d);
}
}
}
-
- if (Utils.isMtkDevice() && mRoamingIndicatorsDisabled) {
- ImageView mobileRoam;
- mobileRoam = (ImageView) XposedHelpers.getObjectField(param.thisObject, "mMobileRoam");
- if (mobileRoam != null) mobileRoam.setVisibility(View.GONE);
- if (Utils.hasGeminiSupport()) {
- mobileRoam = (ImageView) XposedHelpers.getObjectField(param.thisObject, "mMobileRoamGemini");
- if (mobileRoam != null) mobileRoam.setVisibility(View.GONE);
- }
- }
}
});
@@ -570,78 +563,90 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
- mNotificationPanelView = (FrameLayout) param.thisObject;
-
- mNotificationWallpaper = new NotificationWallpaper(mNotificationPanelView.getContext());
- FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.MATCH_PARENT);
- mNotificationWallpaper.setLayoutParams(lp);
- mNotificationWallpaper.setType(prefs.getString(
- GravityBoxSettings.PREF_KEY_NOTIF_BACKGROUND,
- GravityBoxSettings.NOTIF_BG_DEFAULT));
- mNotificationWallpaper.setColor(prefs.getInt(
- GravityBoxSettings.PREF_KEY_NOTIF_COLOR, Color.BLACK));
- mNotificationWallpaper.setColorMode(prefs.getString(
- GravityBoxSettings.PREF_KEY_NOTIF_COLOR_MODE,
- GravityBoxSettings.NOTIF_BG_COLOR_MODE_OVERLAY));
- mNotificationWallpaper.setAlpha(prefs.getInt(
- GravityBoxSettings.PREF_KEY_NOTIF_BACKGROUND_ALPHA, 60));
- mNotificationPanelView.addView(mNotificationWallpaper);
- updateNotificationPanelBackground();
+ NotificationWallpaper nw =
+ new NotificationWallpaper((FrameLayout) param.thisObject, prefs);
+ mBroadcastSubReceivers.add(nw);
}
});
}
+ XposedHelpers.findAndHookMethod(statusbarIconViewClass, "getIcon",
+ CLASS_STATUSBAR_ICON, new XC_MethodHook() {
+ @Override
+ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
+ if (mIconManager != null && mIconManager.isColoringEnabled()) {
+ final String iconPackage =
+ (String) XposedHelpers.getObjectField(param.args[0], "iconPackage");
+ if (DEBUG) log("statusbarIconView.getIcon: iconPackage=" + iconPackage);
+ if (iconPackage == null || iconPackage.equals(PACKAGE_NAME)) {
+ final int iconId = XposedHelpers.getIntField(param.args[0], "iconId");
+ Drawable d = mIconManager.getBasicIcon(iconId);
+ if (d != null) {
+ param.setResult(d);
+ return;
+ }
+ }
+ }
+ }
+ });
+
} catch (Throwable t) {
XposedBridge.log(t);
}
}
private static void setStatusbarBgColor(int color) {
- if (mPanelBar == null) return;
-
- ColorDrawable colorDrawable = new ColorDrawable();
- colorDrawable.setColor(color);
- mPanelBar.setBackground(colorDrawable);
- if (DEBUG) log("statusbar background color set to: " + color);
- }
-
- private static void applyIconColors() {
- if (mSignalClusterView != null) {
- XposedHelpers.callMethod(mSignalClusterView, "apply");
- }
-
- if (mClock != null) {
- if (mIconManager.getDefaultClockColor() == null) {
- mIconManager.setDefaultClockColor(mClock.getCurrentTextColor());
+ if (Build.VERSION.SDK_INT < 19 && mPanelBar != null) {
+ if (Utils.isXperiaDevice()) {
+ if (!(mPanelBar.getBackground() instanceof ColorDrawable)) {
+ ColorDrawable colorDrawable = new ColorDrawable(color);
+ mPanelBar.setBackground(colorDrawable);
+ if (DEBUG) log("statusbar view backround replaced with ColorDrawable");
+ } else {
+ ((ColorDrawable) mPanelBar.getBackground()).setColor(color);
+ }
+ } else {
+ if (!(mPanelBar.getBackground() instanceof BackgroundAlphaColorDrawable)) {
+ BackgroundAlphaColorDrawable colorDrawable = new BackgroundAlphaColorDrawable(color);
+ mPanelBar.setBackground(colorDrawable);
+ if (DEBUG) log("statusbar view backround replaced with BackgroundAlphaColorDrawable");
+ } else {
+ ((BackgroundAlphaColorDrawable) mPanelBar.getBackground()).setBgColor(color);
+ }
}
- mClock.setTextColor(mIconColorEnabled ?
- mIconManager.getIconColor() : mIconManager.getClockColor());
- }
-
- if (mCircleBattery != null) {
- mCircleBattery.setColor(mIconColorEnabled ?
- mIconManager.getIconColor() : mIconManager.getDefaultIconColor());
- }
-
- if (mTrafficMeter != null) {
- mTrafficMeter.setTextColor(mIconColorEnabled ?
- mIconManager.getIconColor() : mIconManager.getDefaultIconColor());
+ if (DEBUG) log("statusbar background color set to: " + color);
}
+ }
- if (mPercentage != null) {
- if (mIconManager.getDefaultBatteryPercentageColor() == null) {
- mIconManager.setDefaultBatteryPercentageColor(mPercentage.getCurrentTextColor());
+ private static IconManagerListener mIconManagerListener = new IconManagerListener() {
+ @Override
+ public void onIconManagerStatusChanged(int flags, ColorInfo colorInfo) {
+ final boolean updateBattery = (flags &
+ (StatusBarIconManager.FLAG_ICON_COLOR_CHANGED |
+ StatusBarIconManager.FLAG_SKIP_BATTERY_ICON_CHANGED)) != 0;
+ final boolean updateStatusIcons = (flags &
+ (StatusBarIconManager.FLAG_ICON_COLOR_CHANGED |
+ StatusBarIconManager.FLAG_ICON_STYLE_CHANGED)) != 0;
+ if (updateBattery) {
+ updateBattery();
+ }
+ if (updateStatusIcons) {
+ updateStatusIcons();
}
- mPercentage.setTextColor(mIconColorEnabled ?
- mIconManager.getIconColor() : mIconManager.getBatteryPercentageColor());
}
+ };
+ private static void updateBattery() {
if (mBatteryController != null && mBattery != null) {
Intent intent = new Intent(Intent.ACTION_BATTERY_CHANGED);
intent.putExtra(BatteryManager.EXTRA_LEVEL, mBatteryLevel);
- intent.putExtra(BatteryManager.EXTRA_PLUGGED, mBatteryPlugged);
+ if (Build.VERSION.SDK_INT > 17) {
+ intent.putExtra(BatteryManager.EXTRA_STATUS, mBatteryPlugged ?
+ BatteryManager.BATTERY_STATUS_CHARGING :
+ BatteryManager.BATTERY_STATUS_UNKNOWN);
+ } else {
+ intent.putExtra(BatteryManager.EXTRA_PLUGGED, mBatteryPlugged ? 1 : 0);
+ }
try {
XposedHelpers.callMethod(mBatteryController, "onReceive", mBattery.getContext(), intent);
} catch (Throwable t) {
@@ -650,18 +655,31 @@ private static void applyIconColors() {
}
}
- private static void updateNotificationPanelBackground() {
- if (mNotificationPanelView == null || mNotificationWallpaper == null) return;
-
- mNotificationPanelView.setBackgroundResource(0);
- mNotificationPanelView.setBackgroundResource(
- mNotificationPanelView.getResources().getIdentifier(
- "notification_panel_bg", "drawable", PACKAGE_NAME));
- Drawable background = mNotificationPanelView.getBackground();
- float alpha = mNotificationWallpaper.getAlpha();
- background.setAlpha(alpha == 0 ? 255 :
- (int)(1-alpha * 255));
-
- mNotificationWallpaper.updateNotificationWallpaper();
+ private static void updateStatusIcons() {
+ if (mPhoneStatusBar == null) return;
+ try {
+ ViewGroup vg = (ViewGroup) XposedHelpers.getObjectField(mPhoneStatusBar, "mStatusIcons");
+ final int childCount = vg.getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ if (!vg.getChildAt(i).getClass().getName().equals(CLASS_STATUSBAR_ICON_VIEW)) {
+ continue;
+ }
+ ImageView v = (ImageView) vg.getChildAt(i);
+ final Object sbIcon = XposedHelpers.getObjectField(v, "mIcon");
+ if (sbIcon != null) {
+ final String iconPackage =
+ (String) XposedHelpers.getObjectField(sbIcon, "iconPackage");
+ if (iconPackage == null || iconPackage.equals(PACKAGE_NAME)) {
+ final int resId = XposedHelpers.getIntField(sbIcon, "iconId");
+ Drawable d = mIconManager.getBasicIcon(resId);
+ if (d != null) {
+ v.setImageDrawable(d);
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
}
-}
\ No newline at end of file
+}
diff --git a/src/com/ceco/gm2/gravitybox/ModVolumePanel.java b/src/com/ceco/gm2/gravitybox/ModVolumePanel.java
index fd99a109f0..9d2f6ac0fb 100644
--- a/src/com/ceco/gm2/gravitybox/ModVolumePanel.java
+++ b/src/com/ceco/gm2/gravitybox/ModVolumePanel.java
@@ -52,6 +52,7 @@ public class ModVolumePanel {
private static boolean mVolumeAdjustMuted;
private static boolean mVoiceCapable;
private static boolean mExpandable;
+ private static boolean mExpandFully;
private static boolean mAutoExpand;
private static void log(String message) {
@@ -68,6 +69,10 @@ public void onReceive(Context context, Intent intent) {
GravityBoxSettings.EXTRA_EXPANDABLE, false);
updateVolumePanelMode();
}
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_EXPANDABLE_FULLY)) {
+ mExpandFully = intent.getBooleanExtra(
+ GravityBoxSettings.EXTRA_EXPANDABLE_FULLY, false);
+ }
if (intent.hasExtra(GravityBoxSettings.EXTRA_AUTOEXPAND)) {
mAutoExpand = intent.getBooleanExtra(GravityBoxSettings.EXTRA_AUTOEXPAND, false);
}
@@ -103,6 +108,9 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
mExpandable = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_VOLUME_PANEL_EXPANDABLE, false);
+ mExpandFully = prefs.getBoolean(
+ GravityBoxSettings.PREF_KEY_VOLUME_PANEL_FULLY_EXPANDABLE, false);
+
updateVolumePanelMode();
mAutoExpand = prefs.getBoolean(GravityBoxSettings.PREF_KEY_VOLUME_PANEL_AUTOEXPAND, false);
@@ -119,6 +127,20 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
context.registerReceiver(mBrodcastReceiver, intentFilter);
}
});
+
+ if (Utils.isXperiaDevice()) {
+ try {
+ XposedHelpers.findAndHookMethod(classVolumePanel, "inflateUi", new XC_MethodHook() {
+ @Override
+ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
+ mVoiceCapable = XposedHelpers.getBooleanField(param.thisObject, "mVoiceCapable");
+ updateVolumePanelMode();
+ }
+ });
+ } catch (Throwable t) {
+ if (DEBUG) log("We might want to fix our Xperia detection...");
+ }
+ }
XposedHelpers.findAndHookMethod(classVolumePanel, "createSliders", new XC_MethodHook() {
@Override
@@ -143,6 +165,19 @@ protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
@Override
protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
hideNotificationSliderIfLinked();
+
+ if (!mExpandFully)
+ return;
+ View mMoreButton = (View) XposedHelpers.getObjectField(mVolumePanel, "mMoreButton");
+ View mDivider = (View) XposedHelpers.getObjectField(mVolumePanel, "mDivider");
+
+ if (mMoreButton != null) {
+ mMoreButton.setVisibility(View.GONE);
+ }
+
+ if (mDivider != null) {
+ mDivider.setVisibility(View.GONE);
+ }
}
});
@@ -241,11 +276,16 @@ private static void updateVolumePanelMode() {
View mMoreButton = (View) XposedHelpers.getObjectField(mVolumePanel, "mMoreButton");
View mDivider = (View) XposedHelpers.getObjectField(mVolumePanel, "mDivider");
- mMoreButton.setVisibility(mExpandable ? View.VISIBLE : View.GONE);
- if (!mMoreButton.hasOnClickListeners()) {
- mMoreButton.setOnClickListener((OnClickListener) mVolumePanel);
+ if (mMoreButton != null) {
+ mMoreButton.setVisibility(mExpandable ? View.VISIBLE : View.GONE);
+ if (!mMoreButton.hasOnClickListeners()) {
+ mMoreButton.setOnClickListener((OnClickListener) mVolumePanel);
+ }
+ }
+
+ if (mDivider != null) {
+ mDivider.setVisibility(mExpandable ? View.VISIBLE : View.GONE);
}
- mDivider.setVisibility(mExpandable ? View.VISIBLE : View.GONE);
XposedHelpers.setBooleanField(mVolumePanel, "mShowCombinedVolumes", mExpandable);
XposedHelpers.setObjectField(mVolumePanel, "mStreamControls", null);
diff --git a/src/com/ceco/gm2/gravitybox/NotificationWallpaper.java b/src/com/ceco/gm2/gravitybox/NotificationWallpaper.java
index 136ff2c9ba..8eb4ea386f 100644
--- a/src/com/ceco/gm2/gravitybox/NotificationWallpaper.java
+++ b/src/com/ceco/gm2/gravitybox/NotificationWallpaper.java
@@ -18,13 +18,16 @@
import java.io.File;
+import de.robv.android.xposed.XSharedPreferences;
import de.robv.android.xposed.XposedBridge;
import android.content.Context;
+import android.content.Intent;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
+import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
@@ -36,10 +39,11 @@
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
-class NotificationWallpaper extends FrameLayout {
-
+class NotificationWallpaper extends FrameLayout implements BroadcastSubReceiver {
+ private static final String PACKAGE_NAME = "com.android.systemui";
private static final String TAG = "GB:NotificationWallpaper";
+ private FrameLayout mNotificationPanelView;
private ImageView mNotificationWallpaperImage;
private String mNotifBgImagePathPortrait;
private String mNotifBgImagePathLandscape;
@@ -50,9 +54,10 @@ class NotificationWallpaper extends FrameLayout {
private Context mContext;
Bitmap mBitmapWallpaper = null;
- public NotificationWallpaper(Context context) {
- super(context);
- mContext = context;
+ public NotificationWallpaper(FrameLayout container, XSharedPreferences prefs) {
+ super(container.getContext());
+ mNotificationPanelView = container;
+ mContext = mNotificationPanelView.getContext();
try {
Context gbContext = mContext.createPackageContext(GravityBox.PACKAGE_NAME, 0);
@@ -67,6 +72,23 @@ public NotificationWallpaper(Context context) {
mBgType = GravityBoxSettings.NOTIF_BG_DEFAULT;
mColorMode = GravityBoxSettings.NOTIF_BG_COLOR_MODE_OVERLAY;
mAlpha = 0.6f;
+
+ FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
+ FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.MATCH_PARENT);
+ setLayoutParams(lp);
+ setType(prefs.getString(
+ GravityBoxSettings.PREF_KEY_NOTIF_BACKGROUND,
+ GravityBoxSettings.NOTIF_BG_DEFAULT));
+ setColor(prefs.getInt(
+ GravityBoxSettings.PREF_KEY_NOTIF_COLOR, Color.BLACK));
+ setColorMode(prefs.getString(
+ GravityBoxSettings.PREF_KEY_NOTIF_COLOR_MODE,
+ GravityBoxSettings.NOTIF_BG_COLOR_MODE_OVERLAY));
+ setAlpha(prefs.getInt(
+ GravityBoxSettings.PREF_KEY_NOTIF_BACKGROUND_ALPHA, 60));
+ mNotificationPanelView.addView(this);
+ updateNotificationPanelBackground();
}
public String getType() {
@@ -109,7 +131,19 @@ public void setAlpha(int alpha) {
mAlpha = (float)alpha / (float)100;
}
- public void updateNotificationWallpaper() {
+ public void updateNotificationPanelBackground() {
+ mNotificationPanelView.setBackgroundResource(0);
+ mNotificationPanelView.setBackgroundResource(
+ mNotificationPanelView.getResources().getIdentifier(
+ "notification_panel_bg", "drawable", PACKAGE_NAME));
+ Drawable background = mNotificationPanelView.getBackground();
+ background.setAlpha(mAlpha == 0 ? 255 :
+ (int)(1-mAlpha * 255));
+
+ updateNotificationWallpaper();
+ }
+
+ private void updateNotificationWallpaper() {
if (mNotificationWallpaperImage != null) {
removeView(mNotificationWallpaperImage);
mNotificationWallpaperImage = null;
@@ -184,5 +218,23 @@ public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
updateNotificationWallpaper();
}
-}
+ @Override
+ public void onBroadcastReceived(Context context, Intent intent) {
+ if (intent.getAction().equals(GravityBoxSettings.ACTION_NOTIF_BACKGROUND_CHANGED)) {
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_BG_TYPE)) {
+ setType(intent.getStringExtra(GravityBoxSettings.EXTRA_BG_TYPE));
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_BG_COLOR)) {
+ setColor(intent.getIntExtra(GravityBoxSettings.EXTRA_BG_COLOR, Color.BLACK));
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_BG_ALPHA)) {
+ setAlpha(intent.getIntExtra(GravityBoxSettings.EXTRA_BG_ALPHA, 60));
+ }
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_BG_COLOR_MODE)) {
+ setColorMode(intent.getStringExtra(GravityBoxSettings.EXTRA_BG_COLOR_MODE));
+ }
+ updateNotificationPanelBackground();
+ }
+ }
+}
diff --git a/src/com/ceco/gm2/gravitybox/PatchMasterKey.java b/src/com/ceco/gm2/gravitybox/PatchMasterKey.java
index 6009bea89a..6fbd31ca7e 100644
--- a/src/com/ceco/gm2/gravitybox/PatchMasterKey.java
+++ b/src/com/ceco/gm2/gravitybox/PatchMasterKey.java
@@ -17,15 +17,23 @@
package com.ceco.gm2.gravitybox;
import static de.robv.android.xposed.XposedHelpers.findField;
+import static de.robv.android.xposed.XposedHelpers.findClass;
+import static de.robv.android.xposed.XposedHelpers.findConstructorExact;
import java.io.BufferedInputStream;
+import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
+import java.util.Arrays;
import java.util.Map;
+import java.util.zip.Inflater;
+import java.util.zip.InflaterInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
@@ -38,12 +46,16 @@
import libcore.io.HeapBufferIterator;
import libcore.io.Streams;
+@SuppressWarnings("unchecked")
+
public class PatchMasterKey {
private static final String TAG = "GB:PatchMasterKey";
private static final long CENSIG = 0x2014b50;
private static final int GPBF_ENCRYPTED_FLAG = 1 << 0;
private static final int GPBF_UNSUPPORTED_MASK = GPBF_ENCRYPTED_FLAG;
+ private static final long LOCSIG = 0x04034b50;
+ private static final long ENDSIG = 0x06054b50;
private static final int ENDHDR = 22;
private static final int CENHDR = 46;
@@ -56,7 +68,13 @@ public class PatchMasterKey {
private static Field fldLocalHeaderRelOffset;
private static Field fldName;
private static Field fldRaf;
+ private static Field fldComment;
private static Field fldEntries;
+ private static Field fldOffset;
+ private static Field fldLength;
+
+ private static Constructor newRAFStream;
+ private static Constructor newZipInflaterInputStream;
static {
fldCompressionMethod = findField(ZipEntry.class, "compressionMethod");
@@ -79,6 +97,28 @@ public class PatchMasterKey {
} catch (Throwable t) {
fldEntries = findField(ZipFile.class, "entries");
}
+ try {
+ fldComment = findField(ZipFile.class, "comment");
+ } catch (Throwable t) {
+ // This implementation didn't yet store the comment
+ fldComment = null;
+ }
+ Class> clsRAFStream = findClass("java.util.zip.ZipFile.RAFStream", ZipFile.class.getClassLoader());
+ newRAFStream = (Constructor) findConstructorExact(clsRAFStream, RandomAccessFile.class, long.class);
+ try {
+ fldOffset = findField(clsRAFStream, "offset");
+ } catch (Throwable t) {
+ fldOffset = findField(clsRAFStream, "mOffset");
+ }
+ try {
+ fldLength = findField(clsRAFStream, "length");
+ } catch (Throwable t) {
+ fldLength = findField(clsRAFStream, "mLength");
+ }
+ Class> clsZipInflaterInputStream = findClass("java.util.zip.ZipFile.ZipInflaterInputStream",
+ ZipFile.class.getClassLoader());
+ newZipInflaterInputStream = (Constructor) findConstructorExact(clsZipInflaterInputStream,
+ InputStream.class, Inflater.class, int.class, ZipEntry.class);
}
private static void log(String message) {
@@ -89,6 +129,18 @@ public static void initZygote() {
try {
log("Patching MasterKey vulnerabilities");
+ XposedHelpers.findAndHookMethod(ZipFile.class, "getInputStream", ZipEntry.class, new XC_MethodHook() {
+
+ @Override
+ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
+ try {
+ param.setResult(getInputStream((ZipFile) param.thisObject, (ZipEntry) param.args[0]));
+ } catch (Exception ex) {
+ param.setThrowable(ex);
+ }
+ }
+ });
+
XposedHelpers.findAndHookMethod(ZipFile.class, "readCentralDir", new XC_MethodHook() {
@Override
@@ -106,21 +158,89 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
}
+ private static InputStream getInputStream(ZipFile zipFile, ZipEntry entry) throws IOException {
+ try {
+ // Make sure this ZipEntry is in this Zip file. We run it through the name lookup.
+ entry = zipFile.getEntry(entry.getName());
+ if (entry == null) {
+ return null;
+ }
+
+ RandomAccessFile raf = (RandomAccessFile) fldRaf.get(zipFile);
+ // Create an InputStream at the right part of the file.
+ RandomAccessFile localRaf = raf;
+ synchronized (localRaf) {
+ // We don't know the entry data's start position. All we have is the
+ // position of the entry's local header.
+ // http://www.pkware.com/documents/casestudies/APPNOTE.TXT
+ InputStream rafStream = newRAFStream.newInstance(localRaf,
+ fldLocalHeaderRelOffset.getLong(entry));
+ DataInputStream is = new DataInputStream(rafStream);
+
+ final int localMagic = Integer.reverseBytes(is.readInt());
+ if (localMagic != LOCSIG) {
+ throwZipException("Local File Header", localMagic);
+ }
+
+ is.skipBytes(2);
+
+ // At position 6 we find the General Purpose Bit Flag.
+ int gpbf = Short.reverseBytes(is.readShort()) & 0xffff;
+
+ if ((gpbf & GPBF_UNSUPPORTED_MASK) != 0) {
+ throw new ZipException("Invalid General Purpose Bit Flag: " + gpbf);
+ }
+
+ // Offset 26 has the file name length, and offset 28 has the extra field length.
+ // These lengths can differ from the ones in the central header.
+ is.skipBytes(18);
+ int fileNameLength = Short.reverseBytes(is.readShort()) & 0xffff;
+ int extraFieldLength = Short.reverseBytes(is.readShort()) & 0xffff;
+ is.close();
+
+ // Skip the variable-size file name and extra field data.
+ rafStream.skip(fileNameLength + extraFieldLength);
+
+ // The compressed or stored file data follows immediately after.
+ if (fldCompressionMethod.getInt(entry) == ZipEntry.STORED) {
+ fldLength.setLong(rafStream, fldOffset.getLong(rafStream) + entry.getSize());
+ return rafStream;
+ } else {
+ fldLength.setLong(rafStream, fldOffset.getLong(rafStream) + entry.getCompressedSize());
+ int bufSize = Math.max(1024, (int) Math.min(entry.getSize(), 65535L));
+ return newZipInflaterInputStream.newInstance(rafStream, new Inflater(true), bufSize, entry);
+ }
+ }
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof IOException)
+ throw (IOException) cause;
+ if (cause instanceof RuntimeException)
+ throw (RuntimeException) cause;
+ throw new Error(cause);
+ } catch (InstantiationException e) {
+ throw new Error(e);
+ } catch (IllegalAccessException e) {
+ throw new IllegalAccessError(e.getMessage());
+ }
+ }
+
private static void readCentralDir(ZipFile zipFile) throws IOException {
try {
- /*
- * Scan back, looking for the End Of Central Directory field. If
- * the archive doesn't have a comment, we'll hit it on the first
- * try.
- *
- * No need to synchronize mRaf here -- we only do this when we
- * first open the Zip file.
- */
-
- RandomAccessFile mRaf = (RandomAccessFile) fldRaf.get(zipFile);
- long scanOffset = mRaf.length() - ENDHDR;
+ // Scan back, looking for the End Of Central Directory field. If the zip file doesn't
+ // have an overall comment (unrelated to any per-entry comments), we'll hit the EOCD
+ // on the first try.
+ // No need to synchronize raf here -- we only do this when we first open the zip file.
+ RandomAccessFile raf = (RandomAccessFile) fldRaf.get(zipFile);
+ long scanOffset = raf.length() - ENDHDR;
if (scanOffset < 0) {
- throw new ZipException("File too short to be a zip file: " + mRaf.length());
+ throw new ZipException("File too short to be a zip file: " + raf.length());
+ }
+
+ raf.seek(0);
+ final int headerMagic = Integer.reverseBytes(raf.readInt());
+ if (headerMagic != LOCSIG) {
+ throw new ZipException("Not a zip archive");
}
long stopOffset = scanOffset - 65536;
@@ -128,23 +248,22 @@ private static void readCentralDir(ZipFile zipFile) throws IOException {
stopOffset = 0;
}
- final int ENDHEADERMAGIC = 0x06054b50;
while (true) {
- mRaf.seek(scanOffset);
- if (Integer.reverseBytes(mRaf.readInt()) == ENDHEADERMAGIC) {
+ raf.seek(scanOffset);
+ if (Integer.reverseBytes(raf.readInt()) == ENDSIG) {
break;
}
scanOffset--;
if (scanOffset < stopOffset) {
- throw new ZipException("EOCD not found; not a Zip archive?");
+ throw new ZipException("End Of Central Directory signature not found");
}
}
- // Read the End Of Central Directory. We could use ENDHDR instead of the magic number 18,
- // but we don't actually need all the header.
- byte[] eocd = new byte[18];
- mRaf.readFully(eocd);
+ // Read the End Of Central Directory. ENDHDR includes the signature bytes,
+ // which we've already read.
+ byte[] eocd = new byte[ENDHDR - 4];
+ raf.readFully(eocd);
// Pull out the information we need.
BufferIterator it = HeapBufferIterator.iterator(eocd, 0, eocd.length, ByteOrder.LITTLE_ENDIAN);
@@ -153,90 +272,69 @@ private static void readCentralDir(ZipFile zipFile) throws IOException {
int numEntries = it.readShort() & 0xffff;
int totalNumEntries = it.readShort() & 0xffff;
it.skip(4); // Ignore centralDirSize.
- int centralDirOffset = it.readInt();
+ long centralDirOffset = ((long) it.readInt()) & 0xffffffffL;
+ int commentLength = it.readShort() & 0xffff;
if (numEntries != totalNumEntries || diskNumber != 0 || diskWithCentralDir != 0) {
throw new ZipException("spanned archives not supported");
}
-
+
+ if (commentLength > 0) {
+ byte[] commentBytes = new byte[commentLength];
+ raf.readFully(commentBytes);
+ if (fldComment != null)
+ fldComment.set(zipFile, new String(commentBytes, 0, commentBytes.length, UTF_8));
+ }
+
// Seek to the first CDE and read all entries.
- RAFStream rafs = new RAFStream(mRaf, centralDirOffset);
- BufferedInputStream bin = new BufferedInputStream(rafs, 4096);
+ // We have to do this now (from the constructor) rather than lazily because the
+ // public API doesn't allow us to throw IOException except from the constructor
+ // or from getInputStream.
+ InputStream rafStream = newRAFStream.newInstance(raf, centralDirOffset);
+ BufferedInputStream bufferedStream = new BufferedInputStream(rafStream, 4096);
byte[] hdrBuf = new byte[CENHDR]; // Reuse the same buffer for each entry.
- @SuppressWarnings("unchecked")
Map mEntries = (Map) fldEntries.get(zipFile);
for (int i = 0; i < numEntries; ++i) {
- ZipEntry newEntry = loadFromStream(hdrBuf, bin);
+ ZipEntry newEntry = loadFromStream(hdrBuf, bufferedStream);
+ if (fldLocalHeaderRelOffset.getLong(newEntry) >= centralDirOffset) {
+ throw new ZipException("Local file header offset is after central directory");
+ }
String entryName = newEntry.getName();
if (mEntries.put(entryName, newEntry) != null) {
throw new ZipException("Duplicate entry name: " + entryName);
}
}
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof IOException)
+ throw (IOException) cause;
+ if (cause instanceof RuntimeException)
+ throw (RuntimeException) cause;
+ throw new Error(cause);
+ } catch (InstantiationException e) {
+ throw new Error(e);
} catch (IllegalAccessException e) {
throw new IllegalAccessError(e.getMessage());
}
}
- private static class RAFStream extends InputStream {
-
- RandomAccessFile mSharedRaf;
- long mOffset;
- long mLength;
-
- public RAFStream(RandomAccessFile raf, long pos) throws IOException {
- mSharedRaf = raf;
- mOffset = pos;
- mLength = raf.length();
- }
-
- @Override
- public int available() throws IOException {
- return (mOffset < mLength ? 1 : 0);
- }
-
- @Override
- public int read() throws IOException {
- return Streams.readSingleByte(this);
- }
-
- @Override
- public int read(byte[] b, int off, int len) throws IOException {
- synchronized (mSharedRaf) {
- mSharedRaf.seek(mOffset);
- if (len > mLength - mOffset) {
- len = (int) (mLength - mOffset);
- }
- int count = mSharedRaf.read(b, off, len);
- if (count > 0) {
- mOffset += count;
- return count;
- } else {
- return -1;
- }
- }
- }
-
- @Override
- public long skip(long byteCount) throws IOException {
- if (byteCount > mLength - mOffset) {
- byteCount = mLength - mOffset;
- }
- mOffset += byteCount;
- return byteCount;
- }
+ private static void throwZipException(String msg, int magic) throws ZipException {
+ final String hexString = IntegralToString.intToHexString(magic, true, 8);
+ throw new ZipException(msg + " signature not found; was " + hexString);
}
- private static ZipEntry loadFromStream(byte[] hdrBuf, BufferedInputStream in) throws IOException {
+ private static ZipEntry loadFromStream(byte[] cdeHdrBuf, BufferedInputStream cdStream) throws IOException {
try {
ZipEntry result = new ZipEntry("");
- Streams.readFully(in, hdrBuf, 0, hdrBuf.length);
+ Streams.readFully(cdStream, cdeHdrBuf, 0, cdeHdrBuf.length);
- BufferIterator it = HeapBufferIterator.iterator(hdrBuf, 0, hdrBuf.length, ByteOrder.LITTLE_ENDIAN);
+ BufferIterator it = HeapBufferIterator.iterator(cdeHdrBuf, 0, cdeHdrBuf.length,
+ ByteOrder.LITTLE_ENDIAN);
int sig = it.readInt();
if (sig != CENSIG) {
- throw new ZipException("Central Directory Entry not found");
+ throwZipException("Central Directory Entry", sig);
}
it.seek(8);
@@ -280,31 +378,43 @@ private static ZipEntry loadFromStream(byte[] hdrBuf, BufferedInputStream in) th
fldLocalHeaderRelOffset.setLong(result, localHeaderRelOffset);
byte[] nameBytes = new byte[nameLength];
- Streams.readFully(in, nameBytes, 0, nameBytes.length);
+ Streams.readFully(cdStream, nameBytes, 0, nameBytes.length);
+ if (containsNulByte(nameBytes)) {
+ throw new ZipException("Filename contains NUL byte: " + Arrays.toString(nameBytes));
+ }
String name;
name = new String(nameBytes, 0, nameBytes.length, UTF_8);
fldName.set(result, name);
+ if (extraLength > 0) {
+ byte[] extra;
+ extra = new byte[extraLength];
+ Streams.readFully(cdStream, extra, 0, extraLength);
+ result.setExtra(extra);
+ }
+
// The RI has always assumed UTF-8. (If GPBF_UTF8_FLAG isn't set, the encoding is
// actually IBM-437.)
if (commentByteCount > 0) {
byte[] commentBytes = new byte[commentByteCount];
- Streams.readFully(in, commentBytes, 0, commentByteCount);
+ Streams.readFully(cdStream, commentBytes, 0, commentByteCount);
String comment;
comment = new String(commentBytes, 0, commentBytes.length, UTF_8);
result.setComment(comment);
-
}
- if (extraLength > 0) {
- byte[] extra;
- extra = new byte[extraLength];
- Streams.readFully(in, extra, 0, extraLength);
- result.setExtra(extra);
- }
return result;
} catch (IllegalAccessException e) {
throw new IllegalAccessError(e.getMessage());
}
}
+
+ private static boolean containsNulByte(byte[] bytes) {
+ for (byte b : bytes) {
+ if (b == 0) {
+ return true;
+ }
+ }
+ return false;
+ }
}
\ No newline at end of file
diff --git a/src/com/ceco/gm2/gravitybox/StatusBarIconManager.java b/src/com/ceco/gm2/gravitybox/StatusBarIconManager.java
index ac24e857a4..d1e64c2fd8 100644
--- a/src/com/ceco/gm2/gravitybox/StatusBarIconManager.java
+++ b/src/com/ceco/gm2/gravitybox/StatusBarIconManager.java
@@ -16,46 +16,86 @@
package com.ceco.gm2.gravitybox;
import java.lang.ref.SoftReference;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import de.robv.android.xposed.XposedBridge;
import android.content.Context;
+import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
+import android.os.Build;
-public class StatusBarIconManager {
+public class StatusBarIconManager implements BroadcastSubReceiver {
private static final String TAG = "GB:StatusBarIconManager";
private static final boolean DEBUG = false;
public static final int DEFAULT_DATA_ACTIVITY_COLOR = Color.WHITE;
- private Resources mResources;
- private int mIconColor;
- private int mDataActivityColor;
+ public static final int SI_MODE_GB = 0;
+ public static final int SI_MODE_STOCK = 1;
+ public static final int SI_MODE_DISABLED = 2;
+
+ public static final int JELLYBEAN = 0;
+ public static final int KITKAT = 1;
+
+ public static final int FLAG_COLORING_ENABLED_CHANGED = 1 << 0;
+ public static final int FLAG_SKIP_BATTERY_ICON_CHANGED = 1 << 1;
+ public static final int FLAG_SIGNAL_ICON_MODE_CHANGED = 1 << 2;
+ public static final int FLAG_FOLLOW_STOCK_BATTERY_COLOR_CHANGED = 1 << 3;
+ public static final int FLAG_ICON_COLOR_CHANGED = 1 << 4;
+ public static final int FLAG_ICON_COLOR_SECONDARY_CHANGED = 1 << 5;
+ public static final int FLAG_DATA_ACTIVITY_COLOR_CHANGED = 1 << 6;
+ public static final int FLAG_LOW_PROFILE_CHANGED = 1 << 7;
+ public static final int FLAG_ICON_STYLE_CHANGED = 1 << 8;
+ private static final int FLAG_ALL = 0x1FF;
+
+ private Context mContext;
+ private Resources mGbResources;
+ private Resources mSystemUiRes;
private Map mWifiIconIds;
private Map mMobileIconIds;
private Map mBatteryIconIds;
+ private Map mBasicIconIds;
private Map> mIconCache;
- private Integer mStockBatteryColor;
- private Integer mDefaultClockColor;
- private Integer mDefaultBatteryPercentageColor;
- private boolean mFollowStockBatteryColor;
+ private boolean[] mAllowMobileIconChange;
+ private ColorInfo mColorInfo;
+ private List mListeners;
+
+ public interface IconManagerListener {
+ void onIconManagerStatusChanged(int flags, ColorInfo colorInfo);
+ }
+
+ static class ColorInfo {
+ boolean coloringEnabled;
+ int defaultIconColor;
+ int[] iconColor;
+ int defaultDataActivityColor;
+ int[] dataActivityColor;
+ Integer stockBatteryColor;
+ int signalIconMode;
+ boolean skipBatteryIcon;
+ boolean followStockBatteryColor;
+ boolean lowProfile;
+ int iconStyle;
+ }
private static void log(String message) {
XposedBridge.log(TAG + ": " + message);
}
- public StatusBarIconManager(Resources res) {
- mResources = res;
- mIconColor = getDefaultIconColor();
- mDataActivityColor = DEFAULT_DATA_ACTIVITY_COLOR;
- mFollowStockBatteryColor = false;
+ public StatusBarIconManager(Context context, Context gbContext) {
+ mContext = context;
+ mSystemUiRes = mContext.getResources();
+ mGbResources = gbContext.getResources();
+ mAllowMobileIconChange = new boolean[] { true, true };
Map tmpMap = new HashMap();
tmpMap.put("stat_sys_wifi_signal_0", R.drawable.stat_sys_wifi_signal_0);
@@ -76,6 +116,10 @@ public StatusBarIconManager(Resources res) {
tmpMap.put("stat_sys_gemini_signal_2_blue", R.drawable.stat_sys_signal_2_fully);
tmpMap.put("stat_sys_gemini_signal_3_blue", R.drawable.stat_sys_signal_3_fully);
tmpMap.put("stat_sys_gemini_signal_4_blue", R.drawable.stat_sys_signal_4_fully);
+ tmpMap.put("stat_sys_gemini_signal_1_orange", R.drawable.stat_sys_signal_1_fully);
+ tmpMap.put("stat_sys_gemini_signal_2_orange", R.drawable.stat_sys_signal_2_fully);
+ tmpMap.put("stat_sys_gemini_signal_3_orange", R.drawable.stat_sys_signal_3_fully);
+ tmpMap.put("stat_sys_gemini_signal_4_orange", R.drawable.stat_sys_signal_4_fully);
mMobileIconIds = Collections.unmodifiableMap(tmpMap);
} else {
tmpMap = new HashMap();
@@ -111,98 +155,252 @@ public StatusBarIconManager(Resources res) {
tmpMap.put("stat_sys_battery_charge_anim100", R.drawable.stat_sys_battery_charge_anim100);
mBatteryIconIds = Collections.unmodifiableMap(tmpMap);
+ Map basicIconMap = new HashMap();
+ basicIconMap.put("stat_sys_data_bluetooth", new Integer[]
+ { R.drawable.stat_sys_data_bluetooth, R.drawable.stat_sys_data_bluetooth });
+ basicIconMap.put("stat_sys_data_bluetooth_connected", new Integer[] {
+ R.drawable.stat_sys_data_bluetooth_connected,
+ R.drawable.stat_sys_data_bluetooth_connected });
+ basicIconMap.put("stat_sys_alarm", new Integer[] {
+ null, R.drawable.stat_sys_alarm_kk });
+ basicIconMap.put("stat_sys_ringer_vibrate", new Integer[] {
+ null, R.drawable.stat_sys_ringer_vibrate_kk });
+ basicIconMap.put("stat_sys_ringer_silent", new Integer[] {
+ R.drawable.stat_sys_ringer_silent_jb, R.drawable.stat_sys_ringer_silent_kk });
+ basicIconMap.put("stat_sys_headset_with_mic", new Integer[] {
+ R.drawable.stat_sys_headset_with_mic_jb, null });
+ basicIconMap.put("stat_sys_headset_without_mic", new Integer[] {
+ R.drawable.stat_sys_headset_without_mic_jb, null });
+ mBasicIconIds = Collections.unmodifiableMap(basicIconMap);
+
mIconCache = new HashMap>();
+
+ initColorInfo();
+
+ mListeners = new ArrayList();
}
- public int getDefaultIconColor() {
- if (mFollowStockBatteryColor && mStockBatteryColor != null) {
- return mStockBatteryColor;
- } else {
- return mResources.getColor(android.R.color.holo_blue_dark);
- }
+ private void initColorInfo() {
+ mColorInfo = new ColorInfo();
+ mColorInfo.coloringEnabled = false;
+ mColorInfo.defaultIconColor = getDefaultIconColor();
+ mColorInfo.iconColor = new int[2];
+ mColorInfo.defaultDataActivityColor = DEFAULT_DATA_ACTIVITY_COLOR;
+ mColorInfo.dataActivityColor = new int[2];
+ mColorInfo.followStockBatteryColor = false;
+ mColorInfo.signalIconMode = SI_MODE_GB;
+ mColorInfo.lowProfile = false;
+ mColorInfo.iconStyle = JELLYBEAN;
+ initStockBatteryColor();
}
- public void initStockBatteryColor(Context context) {
+ private void initStockBatteryColor() {
try {
- final Resources res = context.getResources();
- final int resId = res.getIdentifier(
+ final int resId = mSystemUiRes.getIdentifier(
"stat_sys_battery_100", "drawable", "com.android.systemui");
if (resId != 0) {
- final Bitmap b = BitmapFactory.decodeResource(res, resId);
+ final Bitmap b = BitmapFactory.decodeResource(mSystemUiRes, resId);
final int x = b.getWidth() / 2;
final int y = b.getHeight() / 2;
- mStockBatteryColor = b.getPixel(x, y);
+ mColorInfo.stockBatteryColor = b.getPixel(x, y);
}
if (DEBUG) log("mStockBatteryColor = " +
- ((mStockBatteryColor != null ) ? Integer.toHexString(mStockBatteryColor) : "NULL"));
+ ((mColorInfo.stockBatteryColor != null ) ?
+ Integer.toHexString(mColorInfo.stockBatteryColor) : "NULL"));
} catch (Throwable t) {
log("Error initializing stock battery color: " + t.getMessage());
}
}
- public void setFollowStockBatteryColor(boolean follow) {
- mFollowStockBatteryColor = follow;
+ @Override
+ public void onBroadcastReceived(Context context, Intent intent) {
+ if (intent.getAction().equals(GravityBoxSettings.ACTION_PREF_STATUSBAR_COLOR_CHANGED)) {
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_ICON_COLOR)) {
+ setIconColor(intent.getIntExtra(
+ GravityBoxSettings.EXTRA_SB_ICON_COLOR, getDefaultIconColor()));
+ } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_ICON_STYLE)) {
+ setIconStyle(intent.getIntExtra(GravityBoxSettings.EXTRA_SB_ICON_STYLE, 0));
+ } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_ICON_COLOR_SECONDARY)) {
+ setIconColor(1, intent.getIntExtra(
+ GravityBoxSettings.EXTRA_SB_ICON_COLOR_SECONDARY,
+ getDefaultIconColor()));
+ } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_DATA_ACTIVITY_COLOR)) {
+ setDataActivityColor(intent.getIntExtra(
+ GravityBoxSettings.EXTRA_SB_DATA_ACTIVITY_COLOR,
+ StatusBarIconManager.DEFAULT_DATA_ACTIVITY_COLOR));
+ } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_DATA_ACTIVITY_COLOR_SECONDARY)) {
+ setDataActivityColor(1, intent.getIntExtra(
+ GravityBoxSettings.EXTRA_SB_DATA_ACTIVITY_COLOR_SECONDARY,
+ StatusBarIconManager.DEFAULT_DATA_ACTIVITY_COLOR));
+ } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_ICON_COLOR_ENABLE)) {
+ setColoringEnabled(intent.getBooleanExtra(
+ GravityBoxSettings.EXTRA_SB_ICON_COLOR_ENABLE, false));
+ if (DEBUG) log("Icon colors master switch set to: " + isColoringEnabled());
+ } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_COLOR_FOLLOW)) {
+ setFollowStockBatteryColor(intent.getBooleanExtra(
+ GravityBoxSettings.EXTRA_SB_COLOR_FOLLOW, false));
+ } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_COLOR_SKIP_BATTERY)) {
+ setSkipBatteryIcon(intent.getBooleanExtra(
+ GravityBoxSettings.EXTRA_SB_COLOR_SKIP_BATTERY, false));
+ } else if (intent.hasExtra(GravityBoxSettings.EXTRA_SB_SIGNAL_COLOR_MODE)) {
+ setSignalIconMode(intent.getIntExtra(
+ GravityBoxSettings.EXTRA_SB_SIGNAL_COLOR_MODE,
+ StatusBarIconManager.SI_MODE_GB));
+ }
+ }
+ }
+
+ public void registerListener(IconManagerListener listener) {
+ if (!mListeners.contains(listener)) {
+ mListeners.add(listener);
+ }
}
- public void setDefaultClockColor(int color) {
- mDefaultClockColor = color;
+ private void notifyListeners(int flags) {
+ for (IconManagerListener listener : mListeners) {
+ listener.onIconManagerStatusChanged(flags, mColorInfo);
+ }
}
- public Integer getDefaultClockColor() {
- return mDefaultClockColor;
+ public void refreshState() {
+ notifyListeners(FLAG_ALL);
}
- public int getClockColor() {
- if (mFollowStockBatteryColor && mStockBatteryColor != null) {
- return mStockBatteryColor;
- } else {
- return (mDefaultClockColor != null ?
- mDefaultClockColor : getDefaultIconColor());
+ public void setColoringEnabled(boolean enabled) {
+ if (mColorInfo.coloringEnabled != enabled) {
+ mColorInfo.coloringEnabled = enabled;
+ clearCache();
+ notifyListeners(FLAG_COLORING_ENABLED_CHANGED | FLAG_ICON_COLOR_CHANGED);
}
}
- public void setDefaultBatteryPercentageColor(int color) {
- mDefaultBatteryPercentageColor = color;
+ public boolean isColoringEnabled() {
+ return mColorInfo.coloringEnabled;
}
- public Integer getDefaultBatteryPercentageColor() {
- return mDefaultBatteryPercentageColor;
+ public void setLowProfile(boolean lowProfile) {
+ if (mColorInfo.lowProfile != lowProfile) {
+ mColorInfo.lowProfile = lowProfile;
+ notifyListeners(FLAG_LOW_PROFILE_CHANGED);
+ }
}
- public int getBatteryPercentageColor() {
- if (mFollowStockBatteryColor && mStockBatteryColor != null) {
- return mStockBatteryColor;
+ public void setSkipBatteryIcon(boolean skip) {
+ if (mColorInfo.skipBatteryIcon != skip) {
+ mColorInfo.skipBatteryIcon = skip;
+ notifyListeners(FLAG_SKIP_BATTERY_ICON_CHANGED);
+ }
+ }
+
+ public boolean shouldSkipBatteryIcon() {
+ return mColorInfo.skipBatteryIcon;
+ }
+
+ public int getDefaultIconColor() {
+ if (mColorInfo.followStockBatteryColor && mColorInfo.stockBatteryColor != null) {
+ return mColorInfo.stockBatteryColor;
} else {
- return (mDefaultBatteryPercentageColor != null ?
- mDefaultBatteryPercentageColor : getDefaultIconColor());
+ return (Build.VERSION.SDK_INT > 18 ? Color.WHITE :
+ mGbResources.getColor(android.R.color.holo_blue_dark));
+ }
+ }
+
+ public void setSignalIconMode(int mode) {
+ if (mColorInfo.signalIconMode != mode) {
+ mColorInfo.signalIconMode = mode;
+ clearCache();
+ notifyListeners(FLAG_SIGNAL_ICON_MODE_CHANGED);
+ }
+ }
+
+ public int getSignalIconMode() {
+ return mColorInfo.signalIconMode;
+ }
+
+ public void setFollowStockBatteryColor(boolean follow) {
+ if (Build.VERSION.SDK_INT < 19 &&
+ mColorInfo.followStockBatteryColor != follow) {
+ mColorInfo.followStockBatteryColor = follow;
+ mColorInfo.defaultIconColor = getDefaultIconColor();
+ int flags = FLAG_FOLLOW_STOCK_BATTERY_COLOR_CHANGED;
+ if (!mColorInfo.coloringEnabled) {
+ flags |= FLAG_ICON_COLOR_CHANGED;
+ }
+ notifyListeners(flags);
}
}
+ public int getIconColor(int index) {
+ return mColorInfo.iconColor[index];
+ }
+
public int getIconColor() {
- return mIconColor;
+ return getIconColor(0);
}
- public int getDataActivityColor() {
- return mDataActivityColor;
+ public int getDataActivityColor(int index) {
+ return mColorInfo.dataActivityColor[index];
+ }
+
+ public void setIconColor(int index, int color) {
+ if (mColorInfo.iconColor[index] != color) {
+ mColorInfo.iconColor[index] = color;
+ clearCache();
+ notifyListeners(index == 0 ?
+ FLAG_ICON_COLOR_CHANGED : FLAG_ICON_COLOR_SECONDARY_CHANGED);
+ }
}
public void setIconColor(int color) {
- mIconColor = color;
- clearCache();
+ setIconColor(0, color);
+ }
+
+ public void setDataActivityColor(int index, int color) {
+ if (mColorInfo.dataActivityColor[index] != color) {
+ mColorInfo.dataActivityColor[index] = color;
+ notifyListeners(FLAG_DATA_ACTIVITY_COLOR_CHANGED);
+ }
}
public void setDataActivityColor(int color) {
- mDataActivityColor = color;
+ setDataActivityColor(0, color);
+ }
+
+ public void setIconStyle(int style) {
+ if((style == JELLYBEAN || style == KITKAT) &&
+ mColorInfo.iconStyle != style) {
+ mColorInfo.iconStyle = style;
+ clearCache();
+ notifyListeners(FLAG_ICON_STYLE_CHANGED);
+ }
+ }
+
+ public Drawable applyColorFilter(int index, Drawable drawable, PorterDuff.Mode mode) {
+ if (drawable != null) {
+ drawable.setColorFilter(mColorInfo.iconColor[index], mode);
+ }
+ return drawable;
+ }
+
+ public Drawable applyColorFilter(int index, Drawable drawable) {
+ return applyColorFilter(index, drawable, PorterDuff.Mode.SRC_IN);
}
public Drawable applyColorFilter(Drawable drawable) {
- drawable.setColorFilter(mIconColor, PorterDuff.Mode.SRC_IN);
+ return applyColorFilter(0, drawable, PorterDuff.Mode.SRC_IN);
+ }
+
+ public Drawable applyColorFilter(Drawable drawable, PorterDuff.Mode mode) {
+ return applyColorFilter(0, drawable, mode);
+ }
+
+ public Drawable applyDataActivityColorFilter(int index, Drawable drawable) {
+ drawable.setColorFilter(mColorInfo.dataActivityColor[index], PorterDuff.Mode.SRC_IN);
return drawable;
}
public Drawable applyDataActivityColorFilter(Drawable drawable) {
- drawable.setColorFilter(mDataActivityColor, PorterDuff.Mode.SRC_IN);
- return drawable;
+ return applyDataActivityColorFilter(0, drawable);
}
public void clearCache() {
@@ -223,34 +421,96 @@ private void setCachedDrawable(String key, Drawable d) {
if (DEBUG) log("setCachedDrawable('" + key + "') - storing to cache");
}
- public Drawable getWifiIcon(String key) {
- Drawable cd = getCachedDrawable(key);
- if (cd != null) return cd;
+ public Drawable getWifiIcon(int resId) {
+ Drawable cd;
+ String key;
- if (mWifiIconIds.containsKey(key)) {
- Drawable d = mResources.getDrawable(mWifiIconIds.get(key)).mutate();
- d = applyColorFilter(d);
- setCachedDrawable(key, d);
- return d;
+ try {
+ key = mSystemUiRes.getResourceEntryName(resId);
+ } catch (Resources.NotFoundException nfe) {
+ return null;
}
- if (DEBUG) log("getWifiIcon: no drawable for key: " + key);
- return null;
+ switch(mColorInfo.signalIconMode) {
+ case SI_MODE_GB:
+ cd = getCachedDrawable(key);
+ if (cd != null) return cd;
+ if (mWifiIconIds.containsKey(key)) {
+ Drawable d = mGbResources.getDrawable(mWifiIconIds.get(key)).mutate();
+ d = applyColorFilter(d);
+ setCachedDrawable(key, d);
+ return d;
+ }
+ if (DEBUG) log("getWifiIcon: no drawable for key: " + key);
+ return null;
+
+ case SI_MODE_STOCK:
+ cd = getCachedDrawable(key);
+ if (cd != null) return cd;
+ Drawable d = mSystemUiRes.getDrawable(resId).mutate();
+ d = applyColorFilter(d);
+ setCachedDrawable(key, d);
+ return d;
+
+ case SI_MODE_DISABLED:
+ default:
+ return null;
+ }
}
- public Drawable getMobileIcon(String key) {
- Drawable cd = getCachedDrawable(key);
- if (cd != null) return cd;
+ public Drawable getMobileIcon(int index, int resId) {
+ Drawable cd;
+ String key;
- if (mMobileIconIds.containsKey(key)) {
- Drawable d = mResources.getDrawable(mMobileIconIds.get(key)).mutate();
- d = applyColorFilter(d);
- setCachedDrawable(key, d);
- return d;
+ try {
+ key = mSystemUiRes.getResourceEntryName(resId);
+ } catch (Resources.NotFoundException nfe) {
+ return null;
}
- if (DEBUG) log("getMobileIcon: no drawable for key: " + key);
- return null;
+ mAllowMobileIconChange[index] = !Utils.isMtkDevice() ||
+ key.contains("blue") || key.contains("orange");
+ if (!mAllowMobileIconChange[index]) {
+ return null;
+ }
+
+ switch(mColorInfo.signalIconMode) {
+ case SI_MODE_GB:
+ cd = getCachedDrawable(key);
+ if (cd != null) return cd;
+ if (mMobileIconIds.containsKey(key)) {
+ Drawable d = mGbResources.getDrawable(mMobileIconIds.get(key)).mutate();
+ d = applyColorFilter(index, d);
+ setCachedDrawable(key, d);
+ return d;
+ }
+ if (DEBUG) log("getMobileIcon: no drawable for key: " + key);
+ return null;
+
+ case SI_MODE_STOCK:
+ cd = getCachedDrawable(key);
+ if (cd != null) return cd;
+ Drawable d = mSystemUiRes.getDrawable(resId).mutate();
+ d = applyColorFilter(index, d);
+ setCachedDrawable(key, d);
+ return d;
+
+ case SI_MODE_DISABLED:
+ default:
+ return null;
+ }
+ }
+
+ public Drawable getMobileIcon(int resId) {
+ return getMobileIcon(0, resId);
+ }
+
+ public boolean isMobileIconChangeAllowed(int index) {
+ return mAllowMobileIconChange[index];
+ }
+
+ public boolean isMobileIconChangeAllowed() {
+ return isMobileIconChangeAllowed(0);
}
public Drawable getBatteryIcon(int level, boolean plugged) {
@@ -260,7 +520,7 @@ public Drawable getBatteryIcon(int level, boolean plugged) {
if (cd != null) return cd;
if (mBatteryIconIds.containsKey(key)) {
- Drawable d = mResources.getDrawable(mBatteryIconIds.get(key)).mutate();
+ Drawable d = mGbResources.getDrawable(mBatteryIconIds.get(key)).mutate();
d = applyColorFilter(d);
setCachedDrawable(key, d);
return d;
@@ -293,4 +553,36 @@ private String getKeyForBatteryStatus(int level, boolean plugged) {
return key;
}
+
+ public Drawable getBasicIcon(int resId) {
+ if (resId == 0) return null;
+
+ try {
+ String key = mSystemUiRes.getResourceEntryName(resId);
+ if (!mBasicIconIds.containsKey(key)) {
+ if (DEBUG) log("getBasicIcon: no record for key: " + key);
+ return null;
+ }
+
+ if (mColorInfo.coloringEnabled) {
+ Drawable d = getCachedDrawable(key);
+ if (d != null) return d;
+ if (mBasicIconIds.get(key)[mColorInfo.iconStyle] != null) {
+ d = mGbResources.getDrawable(mBasicIconIds.get(key)[mColorInfo.iconStyle]).mutate();
+ d = applyColorFilter(d);
+ } else {
+ d = mSystemUiRes.getDrawable(resId).mutate();
+ d = applyColorFilter(d, PorterDuff.Mode.SRC_ATOP);
+ }
+ setCachedDrawable(key, d);
+ if (DEBUG) log("getBasicIcon: returning drawable for key: " + key);
+ return d;
+ } else {
+ return mSystemUiRes.getDrawable(resId);
+ }
+ } catch (Throwable t) {
+ log("getBasicIcon: " + t.getMessage());
+ return null;
+ }
+ }
}
diff --git a/src/com/ceco/gm2/gravitybox/StatusbarBatteryPercentage.java b/src/com/ceco/gm2/gravitybox/StatusbarBatteryPercentage.java
new file mode 100644
index 0000000000..031ca98a87
--- /dev/null
+++ b/src/com/ceco/gm2/gravitybox/StatusbarBatteryPercentage.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2013 Peter Gregus for GravityBox Project (C3C076@xda)
+ * 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.
+ */
+
+package com.ceco.gm2.gravitybox;
+
+import com.ceco.gm2.gravitybox.StatusBarIconManager.ColorInfo;
+import com.ceco.gm2.gravitybox.StatusBarIconManager.IconManagerListener;
+
+import android.widget.TextView;
+
+public class StatusbarBatteryPercentage implements IconManagerListener {
+ private TextView mPercentage;
+ private int mDefaultColor;
+
+ public StatusbarBatteryPercentage(TextView clockView) {
+ mPercentage = clockView;
+ mDefaultColor = mPercentage.getCurrentTextColor();
+ }
+
+ public TextView getView() {
+ return mPercentage;
+ }
+
+ @Override
+ public void onIconManagerStatusChanged(int flags, ColorInfo colorInfo) {
+ if ((flags & StatusBarIconManager.FLAG_ICON_COLOR_CHANGED) != 0) {
+ if (colorInfo.coloringEnabled) {
+ mPercentage.setTextColor(colorInfo.iconColor[0]);
+ } else {
+ if (colorInfo.followStockBatteryColor && colorInfo.stockBatteryColor != null) {
+ mPercentage.setTextColor(colorInfo.stockBatteryColor);
+ } else {
+ mPercentage.setTextColor(mDefaultColor);
+ }
+ }
+ } else if ((flags & StatusBarIconManager.FLAG_LOW_PROFILE_CHANGED) != 0) {
+ mPercentage.setAlpha(colorInfo.lowProfile ? 0.5f : 1);
+ }
+ }
+}
diff --git a/src/com/ceco/gm2/gravitybox/StatusbarClock.java b/src/com/ceco/gm2/gravitybox/StatusbarClock.java
new file mode 100644
index 0000000000..9d863920b2
--- /dev/null
+++ b/src/com/ceco/gm2/gravitybox/StatusbarClock.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2013 Peter Gregus for GravityBox Project (C3C076@xda)
+ * 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.
+ */
+
+package com.ceco.gm2.gravitybox;
+
+import com.ceco.gm2.gravitybox.StatusBarIconManager.ColorInfo;
+import com.ceco.gm2.gravitybox.StatusBarIconManager.IconManagerListener;
+
+import android.widget.TextView;
+
+public class StatusbarClock implements IconManagerListener {
+ private TextView mClock;
+ private int mDefaultClockColor;
+ private int mOriginalPaddingLeft;
+
+ public StatusbarClock(TextView clockView) {
+ mClock = clockView;
+ mDefaultClockColor = mClock.getCurrentTextColor();
+ mOriginalPaddingLeft = mClock.getPaddingLeft();
+ }
+
+ public TextView getView() {
+ return mClock;
+ }
+
+ public void resetOriginalPaddingLeft() {
+ if (mClock != null) {
+ mClock.setPadding(mOriginalPaddingLeft, 0, 0, 0);
+ }
+ }
+
+ @Override
+ public void onIconManagerStatusChanged(int flags, ColorInfo colorInfo) {
+ if ((flags & StatusBarIconManager.FLAG_ICON_COLOR_CHANGED) != 0) {
+ if (colorInfo.coloringEnabled) {
+ mClock.setTextColor(colorInfo.iconColor[0]);
+ } else {
+ if (colorInfo.followStockBatteryColor && colorInfo.stockBatteryColor != null) {
+ mClock.setTextColor(colorInfo.stockBatteryColor);
+ } else {
+ mClock.setTextColor(mDefaultClockColor);
+ }
+ }
+ }
+ }
+}
diff --git a/src/com/ceco/gm2/gravitybox/StatusbarSignalCluster.java b/src/com/ceco/gm2/gravitybox/StatusbarSignalCluster.java
new file mode 100644
index 0000000000..c19bfc8fca
--- /dev/null
+++ b/src/com/ceco/gm2/gravitybox/StatusbarSignalCluster.java
@@ -0,0 +1,204 @@
+/*
+ * Copyright (C) 2013 Peter Gregus for GravityBox Project (C3C076@xda)
+ * 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.
+ */
+
+package com.ceco.gm2.gravitybox;
+
+import com.ceco.gm2.gravitybox.StatusBarIconManager.ColorInfo;
+import com.ceco.gm2.gravitybox.StatusBarIconManager.IconManagerListener;
+
+import de.robv.android.xposed.XC_MethodHook;
+import de.robv.android.xposed.XSharedPreferences;
+import de.robv.android.xposed.XposedBridge;
+import de.robv.android.xposed.XposedHelpers;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+public class StatusbarSignalCluster implements BroadcastSubReceiver, IconManagerListener {
+ public static final String TAG = "GB:StatusbarSignalCluster";
+
+ protected LinearLayout mView;
+ protected StatusBarIconManager mIconManager;
+ protected Resources mResources;
+
+ protected static void log(String message) {
+ XposedBridge.log(TAG + ": " + message);
+ }
+
+ public static StatusbarSignalCluster create(LinearLayout view, StatusBarIconManager iconManager) {
+ if (Utils.isMt6572Device()) {
+ return new StatusbarSignalClusterMt6572(view, iconManager);
+ } else if (Utils.isMtkDevice()) {
+ return new StatusbarSignalClusterMtk(view, iconManager);
+ } else {
+ return new StatusbarSignalCluster(view, iconManager);
+ }
+ }
+
+ public StatusbarSignalCluster(LinearLayout view, StatusBarIconManager iconManager) {
+ mView = view;
+ mIconManager = iconManager;
+ mResources = mView.getResources();
+
+ if (mView != null) {
+ try {
+ XposedHelpers.findAndHookMethod(mView.getClass(), "apply", new XC_MethodHook() {
+ @Override
+ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
+ apply();
+ }
+ });
+ } catch (Throwable t) {
+ log("Error hooking apply() method: " + t.getMessage());
+ }
+ }
+
+ mIconManager.registerListener(this);
+ }
+
+ @Override
+ public void onBroadcastReceived(Context context, Intent intent) { }
+
+ public void initPreferences(XSharedPreferences prefs) { }
+
+ private void update() {
+ if (mView != null) {
+ try {
+ XposedHelpers.callMethod(mView, "apply");
+ } catch (Throwable t) {
+ log("Error invoking apply() method: " + t.getMessage());
+ }
+ }
+ }
+
+ protected void apply() {
+ try {
+ if (XposedHelpers.getObjectField(mView, "mWifiGroup") != null) {
+ if (mIconManager.isColoringEnabled()) {
+ updateWiFiIcon();
+ if (!XposedHelpers.getBooleanField(mView, "mIsAirplaneMode")) {
+ updateMobileIcon();
+ }
+ }
+ updateAirplaneModeIcon();
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+
+ protected void updateWiFiIcon() {
+ try {
+ if (XposedHelpers.getBooleanField(mView, "mWifiVisible") &&
+ mIconManager.getSignalIconMode() != StatusBarIconManager.SI_MODE_DISABLED) {
+ ImageView wifiIcon = (ImageView) XposedHelpers.getObjectField(mView, "mWifi");
+ if (wifiIcon != null) {
+ int resId = XposedHelpers.getIntField(mView, "mWifiStrengthId");
+ Drawable d = mIconManager.getWifiIcon(resId);
+ if (d != null) wifiIcon.setImageDrawable(d);
+ }
+ if (Build.VERSION.SDK_INT < 19) {
+ ImageView wifiActivity = (ImageView) XposedHelpers.getObjectField(mView, "mWifiActivity");
+ if (wifiActivity != null) {
+ try {
+ int resId = XposedHelpers.getIntField(mView, "mWifiActivityId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyDataActivityColorFilter(d);
+ wifiActivity.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ wifiActivity.setImageDrawable(null);
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+
+ protected void updateMobileIcon() {
+ try {
+ if (XposedHelpers.getBooleanField(mView, "mMobileVisible") &&
+ mIconManager.getSignalIconMode() != StatusBarIconManager.SI_MODE_DISABLED) {
+ ImageView mobile = (ImageView) XposedHelpers.getObjectField(mView, "mMobile");
+ if (mobile != null) {
+ int resId = XposedHelpers.getIntField(mView, "mMobileStrengthId");
+ Drawable d = mIconManager.getMobileIcon(resId);
+ if (d != null) mobile.setImageDrawable(d);
+ }
+ if (mIconManager.isMobileIconChangeAllowed()) {
+ if (Build.VERSION.SDK_INT < 19) {
+ ImageView mobileActivity =
+ (ImageView) XposedHelpers.getObjectField(mView, "mMobileActivity");
+ if (mobileActivity != null) {
+ try {
+ int resId = XposedHelpers.getIntField(mView, "mMobileActivityId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyDataActivityColorFilter(d);
+ mobileActivity.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileActivity.setImageDrawable(null);
+ }
+ }
+ }
+ ImageView mobileType = (ImageView) XposedHelpers.getObjectField(mView, "mMobileType");
+ if (mobileType != null) {
+ try {
+ int resId = XposedHelpers.getIntField(mView, "mMobileTypeId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyColorFilter(d);
+ mobileType.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileType.setImageDrawable(null);
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+
+ protected void updateAirplaneModeIcon() {
+ try {
+ ImageView airplaneModeIcon = (ImageView) XposedHelpers.getObjectField(mView, "mAirplane");
+ if (airplaneModeIcon != null) {
+ Drawable d = airplaneModeIcon.getDrawable();
+ if (mIconManager.isColoringEnabled()) {
+ d = mIconManager.applyColorFilter(d);
+ } else if (d != null) {
+ d.setColorFilter(null);
+ }
+ airplaneModeIcon.setImageDrawable(d);
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+
+ @Override
+ public void onIconManagerStatusChanged(int flags, ColorInfo colorInfo) {
+ if ((flags & (StatusBarIconManager.FLAG_ICON_COLOR_CHANGED |
+ StatusBarIconManager.FLAG_DATA_ACTIVITY_COLOR_CHANGED |
+ StatusBarIconManager.FLAG_ICON_COLOR_SECONDARY_CHANGED |
+ StatusBarIconManager.FLAG_SIGNAL_ICON_MODE_CHANGED)) != 0) {
+ update();
+ }
+ }
+}
diff --git a/src/com/ceco/gm2/gravitybox/StatusbarSignalClusterMt6572.java b/src/com/ceco/gm2/gravitybox/StatusbarSignalClusterMt6572.java
new file mode 100644
index 0000000000..03f39aec46
--- /dev/null
+++ b/src/com/ceco/gm2/gravitybox/StatusbarSignalClusterMt6572.java
@@ -0,0 +1,101 @@
+package com.ceco.gm2.gravitybox;
+
+import de.robv.android.xposed.XposedBridge;
+import de.robv.android.xposed.XposedHelpers;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+public class StatusbarSignalClusterMt6572 extends StatusbarSignalClusterMtk {
+
+ public StatusbarSignalClusterMt6572(LinearLayout view, StatusBarIconManager iconManager) {
+ super(view, iconManager);
+ }
+
+ @Override
+ protected void updateMobileIcon() {
+ updateMobileIcon(0);
+ updateMobileIcon(1);
+ }
+
+ private void updateMobileIcon(int slot) {
+ try {
+ boolean mobileVisible = ((boolean[])XposedHelpers.getObjectField(mView, "mMobileVisible"))[slot];
+ if (mobileVisible &&
+ mIconManager.getSignalIconMode() != StatusBarIconManager.SI_MODE_DISABLED) {
+ ImageView mobile = ((ImageView[])XposedHelpers.getObjectField(mView, "mMobile"))[slot];
+ if (mobile != null) {
+ Object[][] mobileIconIds = (Object[][]) XposedHelpers.getObjectField(mView, "mMobileStrengthId");
+ int resId = (Integer) XposedHelpers.callMethod(mobileIconIds[slot][0], "getIconId");
+ Drawable d = mIconManager.getMobileIcon(slot, resId);
+ if (d != null) mobile.setImageDrawable(d);
+ }
+ if (mIconManager.isMobileIconChangeAllowed(slot)) {
+ ImageView mobileActivity =
+ ((ImageView[])XposedHelpers.getObjectField(mView, "mMobileActivity"))[slot];
+ if (mobileActivity != null) {
+ try {
+ Object[] mobileActivityIds =
+ (Object[]) XposedHelpers.getObjectField(mView, "mMobileActivityId");
+ int resId = (Integer) XposedHelpers.callMethod(mobileActivityIds[slot], "getIconId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyDataActivityColorFilter(slot, d);
+ mobileActivity.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileActivity.setImageDrawable(null);
+ }
+ }
+ ImageView mobileType = ((ImageView[])XposedHelpers.getObjectField(mView, "mMobileType"))[slot];
+ if (mobileType != null) {
+ try {
+ Object[] mobileTypeIds = (Object[]) XposedHelpers.getObjectField(mView, "mMobileTypeId");
+ int resId = (Integer) XposedHelpers.callMethod(mobileTypeIds[slot], "getIconId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyColorFilter(slot, d);
+ mobileType.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileType.setImageDrawable(null);
+ }
+ }
+ boolean roaming = ((boolean[]) XposedHelpers.getObjectField(mView, "mRoaming"))[slot];
+ if (roaming) {
+ ImageView mobileRoam =
+ ((ImageView[])XposedHelpers.getObjectField(mView, "mMobileRoam"))[slot];
+ if (mobileRoam != null) {
+ try {
+ int resId = ((int[]) XposedHelpers.getObjectField(mView, "mRoamingId"))[slot];
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyColorFilter(slot, d);
+ mobileRoam.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileRoam.setImageDrawable(null);
+ }
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+
+ @Override
+ protected void updateRoamingIndicator() {
+ try {
+ if (mRoamingIndicatorsDisabled) {
+ ImageView[] mobileRoam = (ImageView[]) XposedHelpers.getObjectField(mView, "mMobileRoam");
+ if (mobileRoam != null) {
+ for (ImageView iv : mobileRoam) {
+ if (iv != null) {
+ iv.setVisibility(View.GONE);
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+}
diff --git a/src/com/ceco/gm2/gravitybox/StatusbarSignalClusterMtk.java b/src/com/ceco/gm2/gravitybox/StatusbarSignalClusterMtk.java
new file mode 100644
index 0000000000..8cf3adb89b
--- /dev/null
+++ b/src/com/ceco/gm2/gravitybox/StatusbarSignalClusterMtk.java
@@ -0,0 +1,207 @@
+package com.ceco.gm2.gravitybox;
+
+import de.robv.android.xposed.XSharedPreferences;
+import de.robv.android.xposed.XposedBridge;
+import de.robv.android.xposed.XposedHelpers;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+public class StatusbarSignalClusterMtk extends StatusbarSignalCluster {
+ protected boolean mRoamingIndicatorsDisabled;
+
+ public StatusbarSignalClusterMtk(LinearLayout view, StatusBarIconManager iconManager) {
+ super(view, iconManager);
+
+ mRoamingIndicatorsDisabled = false;
+ }
+
+ @Override
+ public void onBroadcastReceived(Context context, Intent intent) {
+ super.onBroadcastReceived(context, intent);
+
+ if (intent.getAction().equals(GravityBoxSettings.ACTION_DISABLE_ROAMING_INDICATORS_CHANGED)) {
+ mRoamingIndicatorsDisabled = intent.getBooleanExtra(
+ GravityBoxSettings.EXTRA_INDICATORS_DISABLED, false);
+ }
+ }
+
+ @Override
+ public void initPreferences(XSharedPreferences prefs) {
+ super.initPreferences(prefs);
+
+ mRoamingIndicatorsDisabled = prefs.getBoolean(
+ GravityBoxSettings.PREF_KEY_DISABLE_ROAMING_INDICATORS, false);
+ }
+
+ @Override
+ protected void updateMobileIcon() {
+ try {
+ Object mobileIconId = null;
+ Object[] mobileIconIds = null, mobileIconIdsGemini = null;
+ Object mobileActivityId = null, mobileActivityIdGemini = null;
+ Object mobileTypeId = null, mobileTypeIdGemini = null;
+ if (Utils.hasGeminiSupport()) {
+ mobileIconIds = (Object[]) XposedHelpers.getObjectField(mView, "mMobileStrengthId");
+ mobileIconIdsGemini = (Object[]) XposedHelpers.getObjectField(mView, "mMobileStrengthIdGemini");
+ mobileActivityIdGemini = XposedHelpers.getObjectField(mView, "mMobileActivityIdGemini");
+ mobileTypeIdGemini = XposedHelpers.getObjectField(mView, "mMobileTypeIdGemini");
+ } else {
+ mobileIconId = (Object) XposedHelpers.getObjectField(mView, "mMobileStrengthId");
+ }
+ mobileActivityId = XposedHelpers.getObjectField(mView, "mMobileActivityId");
+ mobileTypeId = XposedHelpers.getObjectField(mView, "mMobileTypeId");
+
+ // for SIM Slot 1
+ if (XposedHelpers.getBooleanField(mView, "mMobileVisible") &&
+ mIconManager.getSignalIconMode() != StatusBarIconManager.SI_MODE_DISABLED) {
+ ImageView mobile = (ImageView) XposedHelpers.getObjectField(mView, "mMobile");
+ if (mobile != null) {
+ int resId = (Integer) XposedHelpers.callMethod(Utils.hasGeminiSupport() ?
+ mobileIconIds[0] : mobileIconId, "getIconId");
+ Drawable d = mIconManager.getMobileIcon(resId);
+ if (d != null) mobile.setImageDrawable(d);
+ }
+ if (mIconManager.isMobileIconChangeAllowed()) {
+ ImageView mobileActivity =
+ (ImageView) XposedHelpers.getObjectField(mView, "mMobileActivity");
+ if (mobileActivity != null) {
+ try {
+ int resId = (Integer) XposedHelpers.callMethod(mobileActivityId, "getIconId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyDataActivityColorFilter(d);
+ mobileActivity.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileActivity.setImageDrawable(null);
+ }
+ }
+ ImageView mobileType = (ImageView) XposedHelpers.getObjectField(mView, "mMobileType");
+ if (mobileType != null) {
+ try {
+ int resId = Utils.hasGeminiSupport() ?
+ (Integer) XposedHelpers.callMethod(mobileTypeId, "getIconId") :
+ XposedHelpers.getIntField(mView, "mMobileTypeId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyColorFilter(d);
+ mobileType.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileType.setImageDrawable(null);
+ }
+ }
+ if (XposedHelpers.getBooleanField(mView, "mRoaming")) {
+ ImageView mobileRoam = (ImageView) XposedHelpers.getObjectField(mView, "mMobileRoam");
+ if (mobileRoam != null) {
+ try {
+ int resId = XposedHelpers.getIntField(mView, "mRoamingId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyColorFilter(d);
+ mobileRoam.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileRoam.setImageDrawable(null);
+ }
+ }
+ }
+ }
+ }
+
+ // for SIM Slot 2
+ if (Utils.hasGeminiSupport() &&
+ XposedHelpers.getBooleanField(mView, "mMobileVisibleGemini") &&
+ mIconManager.getSignalIconMode() != StatusBarIconManager.SI_MODE_DISABLED) {
+ ImageView mobile = (ImageView) XposedHelpers.getObjectField(mView, "mMobileGemini");
+ if (mobile != null) {
+ int resId = (Integer) XposedHelpers.callMethod(mobileIconIdsGemini[0], "getIconId");
+ Drawable d = mIconManager.getMobileIcon(1, resId);
+ if (d != null) mobile.setImageDrawable(d);
+ }
+ if (mIconManager.isMobileIconChangeAllowed(1)) {
+ ImageView mobileActivity =
+ (ImageView) XposedHelpers.getObjectField(mView, "mMobileActivityGemini");
+ if (mobileActivity != null) {
+ try {
+ int resId = (Integer) XposedHelpers.callMethod(mobileActivityIdGemini, "getIconId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyDataActivityColorFilter(1, d);
+ mobileActivity.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileActivity.setImageDrawable(null);
+ }
+ }
+ ImageView mobileType = (ImageView) XposedHelpers.getObjectField(mView, "mMobileTypeGemini");
+ if (mobileType != null) {
+ try {
+ int resId = (Integer) XposedHelpers.callMethod(mobileTypeIdGemini, "getIconId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyColorFilter(1, d);
+ mobileType.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileType.setImageDrawable(null);
+ }
+ }
+ if (XposedHelpers.getBooleanField(mView, "mRoamingGemini")) {
+ ImageView mobileRoam = (ImageView) XposedHelpers.getObjectField(mView, "mMobileRoamGemini");
+ if (mobileRoam != null) {
+ try {
+ int resId = XposedHelpers.getIntField(mView, "mRoamingGeminiId");
+ Drawable d = mResources.getDrawable(resId).mutate();
+ d = mIconManager.applyColorFilter(1, d);
+ mobileRoam.setImageDrawable(d);
+ } catch (Resources.NotFoundException e) {
+ mobileRoam.setImageDrawable(null);
+ }
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+
+ @Override
+ protected void updateAirplaneModeIcon() {
+ try {
+ ImageView airplaneModeIcon = Utils.hasGeminiSupport() ?
+ (ImageView) XposedHelpers.getObjectField(mView, "mFlightMode") :
+ (ImageView) XposedHelpers.getObjectField(mView, "mAirplane");
+ if (airplaneModeIcon != null) {
+ Drawable d = airplaneModeIcon.getDrawable();
+ if (mIconManager.isColoringEnabled()) {
+ d = mIconManager.applyColorFilter(d);
+ } else if (d != null) {
+ d.setColorFilter(null);
+ }
+ airplaneModeIcon.setImageDrawable(d);
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+
+ @Override
+ public void apply() {
+ super.apply();
+
+ updateRoamingIndicator();
+ }
+
+ protected void updateRoamingIndicator() {
+ try {
+ if (mRoamingIndicatorsDisabled) {
+ ImageView mobileRoam;
+ mobileRoam = (ImageView) XposedHelpers.getObjectField(mView, "mMobileRoam");
+ if (mobileRoam != null) mobileRoam.setVisibility(View.GONE);
+ if (Utils.hasGeminiSupport()) {
+ mobileRoam = (ImageView) XposedHelpers.getObjectField(mView, "mMobileRoamGemini");
+ if (mobileRoam != null) mobileRoam.setVisibility(View.GONE);
+ }
+ }
+ } catch (Throwable t) {
+ XposedBridge.log(t);
+ }
+ }
+}
diff --git a/src/com/ceco/gm2/gravitybox/TrafficMeter.java b/src/com/ceco/gm2/gravitybox/TrafficMeter.java
index 7dd72e5505..fab31af88b 100644
--- a/src/com/ceco/gm2/gravitybox/TrafficMeter.java
+++ b/src/com/ceco/gm2/gravitybox/TrafficMeter.java
@@ -30,9 +30,12 @@
import java.text.DecimalFormat;
import java.text.NumberFormat;
+import com.ceco.gm2.gravitybox.StatusBarIconManager.ColorInfo;
+import com.ceco.gm2.gravitybox.StatusBarIconManager.IconManagerListener;
+
import de.robv.android.xposed.XposedBridge;
-public class TrafficMeter extends TextView {
+public class TrafficMeter extends TextView implements IconManagerListener {
public static final String TAG = "GB:TrafficMeter";
private static final boolean DEBUG = false;
@@ -263,4 +266,14 @@ public void setTrafficMeterPosition(int position) {
public int getTrafficMeterPosition() {
return mPosition;
}
+
+ @Override
+ public void onIconManagerStatusChanged(int flags, ColorInfo colorInfo) {
+ if ((flags & StatusBarIconManager.FLAG_ICON_COLOR_CHANGED) != 0) {
+ setTextColor(colorInfo.coloringEnabled ?
+ colorInfo.iconColor[0] : colorInfo.defaultIconColor);
+ } else if ((flags & StatusBarIconManager.FLAG_LOW_PROFILE_CHANGED) != 0) {
+ setAlpha(colorInfo.lowProfile ? 0 : 1);
+ }
+ }
}
diff --git a/src/com/ceco/gm2/gravitybox/TransparencyManager.java b/src/com/ceco/gm2/gravitybox/TransparencyManager.java
index b15c5e9740..97bdf50830 100644
--- a/src/com/ceco/gm2/gravitybox/TransparencyManager.java
+++ b/src/com/ceco/gm2/gravitybox/TransparencyManager.java
@@ -40,11 +40,13 @@
import android.view.View;
public class TransparencyManager implements BroadcastSubReceiver {
+ private static final String TAG = "GB:TransparencyManager";
private static final boolean DEBUG = false;
- public static final float KEYGUARD_ALPHA = 0.44f;
-
- private static final String TAG = "GB:TransparencyManager";
+ public static final int MODE_DISABLED = 0;
+ public static final int MODE_STATUSBAR = 1;
+ public static final int MODE_NAVBAR = 2;
+ public static final int MODE_FULL = 3;
Object mNavbar;
Object mStatusbar;
@@ -62,6 +64,8 @@ public class TransparencyManager implements BroadcastSubReceiver {
KeyguardManager km;
ActivityManager am;
+ int mMode = MODE_DISABLED;
+
private static void log(String message) {
XposedBridge.log(TAG + ": " + message);
}
@@ -71,7 +75,6 @@ private static class SomeInfo {
int color;
float keyguardAlpha;
float homeAlpha;
- boolean tempDisable;
}
private final Runnable updateTransparencyRunnable = new Runnable() {
@@ -81,8 +84,9 @@ public void run() {
}
};
- public TransparencyManager(Context context) {
+ public TransparencyManager(Context context, int mode) {
mContext = context;
+ mMode = mode;
km = (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE);
am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
@@ -98,13 +102,31 @@ public void onReceive(Context context, Intent intent) {
}, intentFilter);
}
+ public static boolean isStatusbarEnabled(int mode) {
+ return ((mode & MODE_STATUSBAR) != 0);
+ }
+
+ public boolean isStatusbarEnabled() {
+ return isStatusbarEnabled(mMode);
+ }
+
+ public static boolean isNavbarEnabled(int mode) {
+ return ((mode & MODE_NAVBAR) != 0);
+ }
+
+ public boolean isNavbarEnabled() {
+ return isNavbarEnabled(mMode);
+ }
+
private void update(boolean force) {
mHandler.removeCallbacks(updateTransparencyRunnable);
if (force ||
- mStatusbarInfo.homeAlpha != 1 ||
- mStatusbarInfo.keyguardAlpha != 1 ||
- mNavbarInfo.homeAlpha != 1 ||
- mNavbarInfo.keyguardAlpha != 1) {
+ (isStatusbarEnabled() &&
+ (mStatusbarInfo.homeAlpha != 1 ||
+ mStatusbarInfo.keyguardAlpha != 1 )) ||
+ (isNavbarEnabled() &&
+ (mNavbarInfo.homeAlpha != 1 ||
+ mNavbarInfo.keyguardAlpha != 1))) {
if (DEBUG) log("Updating transparency");
mHandler.postDelayed(updateTransparencyRunnable, 100);
}
@@ -122,14 +144,6 @@ public void setStatusbar(Object s) {
mStatusbar = s;
}
- public void setTempDisableStatusbarState(boolean state) {
- mStatusbarInfo.tempDisable = state;
- }
-
- public void setTempNavbarState(boolean state) {
- mNavbarInfo.tempDisable = state;
- }
-
private ValueAnimator createAnimation(final SomeInfo info, View v) {
if (info.anim != null) {
info.anim.cancel();
@@ -138,9 +152,7 @@ private ValueAnimator createAnimation(final SomeInfo info, View v) {
float a = 1;
- if (info.tempDisable) {
- info.tempDisable = false;
- } else if (mIsKeyguardShowing) {
+ if (mIsKeyguardShowing) {
a = info.keyguardAlpha;
} else if (mIsHomeShowing) {
a = info.homeAlpha;
@@ -193,20 +205,23 @@ private void doTransparentUpdate() {
mIsHomeShowing = isLauncherShowing();
ValueAnimator navAnim = null, sbAnim = null;
- if (mNavbar != null) {
+ if ((mMode & MODE_NAVBAR) != 0 && mNavbar != null) {
navAnim = createAnimation(mNavbarInfo, (View)mNavbar);
}
- if (mStatusbar != null) {
+ if ((mMode & MODE_STATUSBAR) != 0 && mStatusbar != null) {
sbAnim = createAnimation(mStatusbarInfo, (View)mStatusbar);
}
if (navAnim != null && sbAnim != null) {
+ if (DEBUG) log("Updating transparency for statusbar & navbar");
AnimatorSet set = new AnimatorSet();
set.playTogether(navAnim, sbAnim);
set.start();
} else {
if(navAnim != null) {
+ if (DEBUG) log("Updating transparency for navbar");
navAnim.start();
} else if(sbAnim != null) {
+ if (DEBUG) log("Updating transparency for statusbar");
sbAnim.start();
}
}
diff --git a/src/com/ceco/gm2/gravitybox/Utils.java b/src/com/ceco/gm2/gravitybox/Utils.java
index 27c991f427..e1ba819b88 100644
--- a/src/com/ceco/gm2/gravitybox/Utils.java
+++ b/src/com/ceco/gm2/gravitybox/Utils.java
@@ -42,6 +42,7 @@ public class Utils {
// Device type reference
private static int mDeviceType = -1;
private static Boolean mIsMtkDevice = null;
+ private static Boolean mIsXperiaDevice = null;
private static Boolean mIsWifiOnly = null;
private static String mDeviceCharacteristics = null;
@@ -54,7 +55,7 @@ public class Utils {
// Supported MTK devices
private static final Set MTK_DEVICES = new HashSet(Arrays.asList(
- new String[] {"mt6572", "mt6575","mt6577","mt6589","mt8389"}
+ new String[] {"mt6572","mt6575","mt6577","mt8377","mt6582","mt6589","mt8389"}
));
private static void log(String message) {
@@ -113,6 +114,18 @@ public static boolean isMtkDevice() {
return mIsMtkDevice;
}
+ public static boolean isMt6572Device() {
+ return (Build.HARDWARE.toLowerCase().contains("mt6572"));
+ }
+
+ public static boolean isXperiaDevice() {
+ if (mIsXperiaDevice != null) return mIsXperiaDevice;
+
+ mIsXperiaDevice = Build.MANUFACTURER.equalsIgnoreCase("sony")
+ && !isMtkDevice();
+ return mIsXperiaDevice;
+ }
+
public static boolean hasGeminiSupport() {
if (mHasGeminiSupport != null) return mHasGeminiSupport;
@@ -126,7 +139,7 @@ public static boolean isWifiOnly(Context con) {
try {
ConnectivityManager cm = (ConnectivityManager) con.getSystemService(
- Context.CONNECTIVITY_SERVICE);
+ Context.CONNECTIVITY_SERVICE);
mIsWifiOnly = (cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE) == null);
return mIsWifiOnly;
} catch (Throwable t) {
diff --git a/src/com/ceco/gm2/gravitybox/pie/PieController.java b/src/com/ceco/gm2/gravitybox/pie/PieController.java
index 36240e20ac..a0cc1c8acd 100644
--- a/src/com/ceco/gm2/gravitybox/pie/PieController.java
+++ b/src/com/ceco/gm2/gravitybox/pie/PieController.java
@@ -30,6 +30,7 @@
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Point;
+import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.hardware.input.InputManager;
import android.os.BatteryManager;
@@ -49,6 +50,9 @@
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
+import com.ceco.gm2.gravitybox.AppLauncher;
+import com.ceco.gm2.gravitybox.GravityBox;
+import com.ceco.gm2.gravitybox.GravityBoxSettings;
import com.ceco.gm2.gravitybox.ModPieControls;
import com.ceco.gm2.gravitybox.R;
import com.ceco.gm2.gravitybox.pie.PieItem;
@@ -58,6 +62,7 @@
import com.ceco.gm2.gravitybox.pie.PieSliceContainer;
import com.ceco.gm2.gravitybox.pie.PieSysInfo;
+import de.robv.android.xposed.XSharedPreferences;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.XposedHelpers.ClassNotFoundError;
@@ -79,7 +84,8 @@ private enum ButtonType {
HOME,
RECENT,
MENU,
- SEARCH
+ SEARCH,
+ APP_LAUNCHER
};
public static final float EMPTY_ANGLE = 10;
@@ -91,6 +97,7 @@ private enum ButtonType {
private Context mGbContext;
private Resources mGbResources;
private PieLayout mPieContainer;
+ private AppLauncher mAppLauncher;
/**
* This is only needed for #toggleRecentApps()
*/
@@ -110,7 +117,7 @@ private enum ButtonType {
private int mNavigationIconHints = 0;
private int mDisabledFlags = 0;
private boolean mShowMenu = false;
- private boolean mShowSearch = false;
+ private int mCustomKeyMode = GravityBoxSettings.PIE_CUSTOM_KEY_OFF;
private Drawable mBackIcon;
private Drawable mBackAltIcon;
@@ -188,7 +195,7 @@ public boolean move(MotionEvent event) {
if (x < gracePeriod) {
initialY = y;
}
- if (initialY - y < sDistance && y - initialY < sDistance) {
+ if (initialY - y < (sDistance*3) && y - initialY < (sDistance*3)) {
if (x - initialX <= sDistance) {
return false;
}
@@ -196,7 +203,7 @@ public boolean move(MotionEvent event) {
}
break;
case BOTTOM:
- if (initialX - x < sDistance && x - initialX < sDistance) {
+ if (initialX - x < (sDistance*3) && x - initialX < (sDistance*3)) {
if (initialY - y <= sDistance) {
return false;
}
@@ -204,7 +211,7 @@ public boolean move(MotionEvent event) {
}
break;
case TOP:
- if (initialX - x < sDistance && x - initialX < sDistance) {
+ if (initialX - x < (sDistance*3) && x - initialX < (sDistance*3)) {
if (y - initialY <= sDistance) {
return false;
}
@@ -215,7 +222,7 @@ public boolean move(MotionEvent event) {
if (x > gracePeriod) {
initialY = y;
}
- if (initialY - y < sDistance && y - initialY < sDistance) {
+ if (initialY - y < (sDistance*3) && y - initialY < (sDistance*3)) {
if (initialX - x <= sDistance) {
return false;
}
@@ -275,7 +282,16 @@ public void onServiceStateChanged(ServiceState serviceState) {
}
};
- public PieController(Context context, Context gbContext) {
+ final class ColorInfo {
+ int bgColor;
+ int fgColor;
+ int selectedColor;
+ int outlineColor;
+ int textColor;
+ }
+ private ColorInfo mColorInfo;
+
+ public PieController(Context context, Context gbContext, XSharedPreferences prefs) {
mContext = context;
mGbContext = gbContext;
mGbResources = gbContext.getResources();
@@ -298,6 +314,20 @@ public PieController(Context context, Context gbContext) {
} catch (ClassNotFoundError e) {
XposedBridge.log(e);
}
+
+ mColorInfo = new ColorInfo();
+ mColorInfo.bgColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_BG,
+ mGbResources.getColor(R.color.pie_background_color));
+ mColorInfo.selectedColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_SELECTED,
+ mGbResources.getColor(R.color.pie_selected_color));
+ mColorInfo.outlineColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_OUTLINE,
+ mGbResources.getColor(R.color.pie_outline_color));
+ mColorInfo.fgColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_FG,
+ mGbResources.getColor(R.color.pie_foreground_color));
+ mColorInfo.textColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_TEXT,
+ mGbResources.getColor(R.color.pie_text_color));
+
+ updateColors();
}
public void attachTo(Object statusBar) {
@@ -358,9 +388,12 @@ private void setupNavigationItems() {
mNavigationSlice.addItem(constructItem(2, ButtonType.RECENT,
res.getDrawable(res.getIdentifier("ic_sysbar_recent", "drawable", PACKAGE_NAME)),
minimumImageSize));
- if (mShowSearch) {
+ if (mCustomKeyMode == GravityBoxSettings.PIE_CUSTOM_KEY_SEARCH) {
mNavigationSlice.addItem(constructItem(1, ButtonType.SEARCH,
mGbResources.getDrawable(R.drawable.ic_sysbar_search_side), minimumImageSize));
+ } else if (mCustomKeyMode == GravityBoxSettings.PIE_CUSTOM_KEY_APP_LAUNCHER) {
+ mNavigationSlice.addItem(constructItem(1, ButtonType.APP_LAUNCHER,
+ mGbResources.getDrawable(R.drawable.ic_sysbar_apps), minimumImageSize));
}
mMenuButton = constructItem(1, ButtonType.MENU,
@@ -379,7 +412,7 @@ private PieItem constructItem(int width, ButtonType type, Drawable image, int mi
view.setMinimumHeight(minimumImageSize);
LayoutParams lp = new LayoutParams(minimumImageSize, minimumImageSize);
view.setLayoutParams(lp);
- PieItem item = new PieItem(mContext, mGbContext, mPieContainer, 0, width, type, view);
+ PieItem item = new PieItem(mContext, mGbContext, mPieContainer, 0, width, type, view, mColorInfo);
item.setOnClickListener(this);
return item;
}
@@ -472,6 +505,8 @@ protected void setDisabledFlags(int disabledFlags, boolean force) {
if (item != null) item.show(!disableRecent);
item = findItem(ButtonType.SEARCH);
if (item != null) item.show(!disableRecent && !disableSearch);
+ item = findItem(ButtonType.APP_LAUNCHER);
+ if (item != null) item.show(!disableRecent);
setMenuVisibility(mShowMenu);
}
@@ -485,8 +520,8 @@ public void setMenuVisibility(boolean showMenu) {
mShowMenu = showMenu;
}
- public void setSearchVisibility(boolean showSearch) {
- mShowSearch = showSearch;
+ public void setCustomKeyMode(int mode) {
+ mCustomKeyMode = mode;
setupNavigationItems();
}
@@ -544,6 +579,9 @@ public void onClick(PieItem item) {
case SEARCH:
launchAssistAction();
break;
+ case APP_LAUNCHER:
+ showAppLauncher();
+ break;
}
}
@@ -579,6 +617,21 @@ private void launchAssistAction() {
}
}
+ private void showAppLauncher() {
+ if (mAppLauncher == null) {
+ try {
+ mAppLauncher = new AppLauncher(mContext,
+ new XSharedPreferences(GravityBox.PACKAGE_NAME));
+ } catch (Throwable t) {
+ log ("Error creating app launcher: " + t.getMessage());
+ }
+ }
+
+ if (mAppLauncher != null) {
+ mAppLauncher.showDialog();
+ }
+ }
+
public boolean isShowing() {
return mPieContainer != null && mPieContainer.isShowing();
}
@@ -608,4 +661,56 @@ public String getBatteryLevel() {
}
return mGbResources.getString(R.string.pie_battery_status_discharging, mBatteryLevel);
}
+
+ public ColorInfo getColorInfo() {
+ return mColorInfo;
+ }
+
+ public void setBackgroundColor(int color) {
+ mColorInfo.bgColor = color;
+ updateColors();
+ }
+
+ public void setForegroundColor(int color) {
+ mColorInfo.fgColor = color;
+ updateColors();
+
+ }
+
+ public void setSelectedColor(int color) {
+ mColorInfo.selectedColor = color;
+ updateColors();
+ }
+
+ public void setOutlineColor(int color) {
+ mColorInfo.outlineColor = color;
+ updateColors();
+ }
+
+ public void setTextColor(int color) {
+ mColorInfo.textColor = color;
+ updateColors();
+ }
+
+ private void updateColors() {
+ if (mBackIcon != null) {
+ mBackIcon.setColorFilter(null);
+ mBackIcon.setColorFilter(mColorInfo.fgColor, Mode.SRC_ATOP);
+ }
+
+ if (mBackAltIcon != null) {
+ mBackAltIcon.setColorFilter(null);
+ mBackAltIcon.setColorFilter(mColorInfo.fgColor, Mode.SRC_ATOP);
+ }
+
+ if (mNavigationSlice != null) {
+ for (PieItem pi : mNavigationSlice.getItems()) {
+ pi.setColor(mColorInfo);
+ }
+ }
+
+ if (mSysInfo != null) {
+ mSysInfo.setColor(mColorInfo);
+ }
+ }
}
diff --git a/src/com/ceco/gm2/gravitybox/pie/PieItem.java b/src/com/ceco/gm2/gravitybox/pie/PieItem.java
index 66583c6662..950cef7d74 100644
--- a/src/com/ceco/gm2/gravitybox/pie/PieItem.java
+++ b/src/com/ceco/gm2/gravitybox/pie/PieItem.java
@@ -77,7 +77,8 @@ public interface PieOnClickListener {
*/
public final static int SELECTED = 0x100;
- public PieItem(Context context, Context gbContext, PieLayout parent, int flags, int width, Object tag, View view) {
+ public PieItem(Context context, Context gbContext, PieLayout parent, int flags, int width,
+ Object tag, View view, PieController.ColorInfo colorInfo) {
mContext = context;
mGbResources = gbContext.getResources();
mView = view;
@@ -86,16 +87,13 @@ public PieItem(Context context, Context gbContext, PieLayout parent, int flags,
this.width = width;
this.flags = flags | PieDrawable.VISIBLE | PieDrawable.DISPLAY_ALL;
- mBackgroundPaint.setColor(mGbResources.getColor(R.color.pie_background_color));
mBackgroundPaint.setAntiAlias(true);
- mSelectedPaint.setColor(mGbResources.getColor(R.color.pie_selected_color));
mSelectedPaint.setAntiAlias(true);
- mOutlinePaint.setColor(mGbResources.getColor(R.color.pie_outline_color));
mOutlinePaint.setAntiAlias(true);
mOutlinePaint.setStyle(Style.STROKE);
mOutlinePaint.setStrokeWidth(mGbResources.getDimensionPixelSize(R.dimen.pie_outline));
- setColor(mGbResources.getColor(R.color.pie_foreground_color));
+ setColor(colorInfo);
}
public void setGap(float gap) {
@@ -136,12 +134,16 @@ public void setImageDrawable(Drawable drawable) {
}
}
- public void setColor(int color) {
+ public void setColor(PieController.ColorInfo colorInfo) {
+ mBackgroundPaint.setColor(colorInfo.bgColor);
+ mSelectedPaint.setColor(colorInfo.selectedColor);
+ mOutlinePaint.setColor(colorInfo.outlineColor);
+
if (mView instanceof ImageView) {
ImageView imageView = (ImageView)mView;
Drawable drawable = imageView.getDrawable();
if (drawable != null) {
- drawable.setColorFilter(color, Mode.SRC_ATOP);
+ drawable.setColorFilter(colorInfo.fgColor, Mode.SRC_ATOP);
imageView.setImageDrawable(drawable);
}
}
diff --git a/src/com/ceco/gm2/gravitybox/pie/PieSysInfo.java b/src/com/ceco/gm2/gravitybox/pie/PieSysInfo.java
index 01946b7a1f..f8888bf538 100644
--- a/src/com/ceco/gm2/gravitybox/pie/PieSysInfo.java
+++ b/src/com/ceco/gm2/gravitybox/pie/PieSysInfo.java
@@ -77,15 +77,13 @@ public PieSysInfo(Context context, Context gbContext, PieLayout parent,
mContext = context;
mGbResources = gbContext.getResources();
- int textColor = mGbResources.getColor(R.color.pie_text_color);
-
- mClockPaint.setColor(textColor);
mClockPaint.setAntiAlias(true);
mClockPaint.setTypeface(Typeface.create("sans-serif-light", Typeface.BOLD));
- mInfoPaint.setColor(textColor);
mInfoPaint.setAntiAlias(true);
mInfoPaint.setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL));
+
+ setColor(controller.getColorInfo());
}
@Override
@@ -245,4 +243,9 @@ private SimpleDateFormat getTimeFormat() {
mTimeFormat = new SimpleDateFormat(formatBuilder.toString().trim());
return mTimeFormat;
}
+
+ public void setColor(PieController.ColorInfo colorInfo) {
+ mClockPaint.setColor(colorInfo.textColor);
+ mInfoPaint.setColor(colorInfo.textColor);
+ }
}
diff --git a/src/com/ceco/gm2/gravitybox/preference/AppPickerPreference.java b/src/com/ceco/gm2/gravitybox/preference/AppPickerPreference.java
index 14f3d6baf6..82f5a37d36 100644
--- a/src/com/ceco/gm2/gravitybox/preference/AppPickerPreference.java
+++ b/src/com/ceco/gm2/gravitybox/preference/AppPickerPreference.java
@@ -147,6 +147,10 @@ protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
}
}
+ public void setDefaultSummary(String summary) {
+ mDefaultSummaryText = summary;
+ }
+
private void setData() {
mAsyncTask = new AsyncTask() {
@Override
diff --git a/src/com/ceco/gm2/gravitybox/preference/OngoingNotifPreference.java b/src/com/ceco/gm2/gravitybox/preference/OngoingNotifPreference.java
index 477fcafef9..215ee594c7 100644
--- a/src/com/ceco/gm2/gravitybox/preference/OngoingNotifPreference.java
+++ b/src/com/ceco/gm2/gravitybox/preference/OngoingNotifPreference.java
@@ -181,7 +181,11 @@ public Drawable getIconLeft() {
}
}
- mIcon = res.getDrawable(mIconId);
+ try {
+ mIcon = res.getDrawable(mIconId);
+ } catch (Resources.NotFoundException nfe) {
+ //
+ }
}
return mIcon;
diff --git a/src/com/ceco/gm2/gravitybox/preference/SeekBarPreference.java b/src/com/ceco/gm2/gravitybox/preference/SeekBarPreference.java
index ab1e0e9933..373656df3e 100644
--- a/src/com/ceco/gm2/gravitybox/preference/SeekBarPreference.java
+++ b/src/com/ceco/gm2/gravitybox/preference/SeekBarPreference.java
@@ -19,15 +19,20 @@
import android.content.Context;
import android.content.res.TypedArray;
+import android.os.Handler;
import android.preference.Preference;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageButton;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
-public class SeekBarPreference extends Preference implements OnSeekBarChangeListener {
+public class SeekBarPreference extends Preference
+ implements OnSeekBarChangeListener, View.OnClickListener {
+
+ private static final int RAPID_PRESS_TIMEOUT = 600;
private int mMinimum = 0;
private int mMaximum = 100;
@@ -38,9 +43,22 @@ public class SeekBarPreference extends Preference implements OnSeekBarChangeList
private TextView mMonitorBox;
private SeekBar mBar;
+ private ImageButton mBtnPlus;
+ private ImageButton mBtnMinus;
private int mValue;
+ private int mTmpValue;
private boolean mTracking = false;
+ private boolean mRapidlyPressing = false;
+ private Handler mHandler;
+
+ private Runnable mRapidPressTimeout = new Runnable() {
+ @Override
+ public void run() {
+ mRapidlyPressing = false;
+ setValue(mTmpValue);
+ }
+ };
public SeekBarPreference(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -53,6 +71,8 @@ public SeekBarPreference(Context context, AttributeSet attrs) {
mMonitorBoxEnabled = attrs.getAttributeBooleanValue(null, "monitorBoxEnabled", false);
mMonitorBoxUnit = attrs.getAttributeValue(null, "monitorBoxUnit");
}
+
+ mHandler = new Handler();
}
@Override
@@ -66,6 +86,10 @@ protected View onCreateView(ViewGroup parent) {
mBar.setMax(mMaximum - mMinimum);
mBar.setOnSeekBarChangeListener(this);
mBar.setProgress(mValue - mMinimum);
+ mBtnPlus = (ImageButton) layout.findViewById(R.id.btnPlus);
+ mBtnPlus.setOnClickListener(this);
+ mBtnMinus = (ImageButton) layout.findViewById(R.id.btnMinus);
+ mBtnMinus.setOnClickListener(this);
setMonitorBoxText();
return layout;
}
@@ -128,4 +152,24 @@ public void onStopTrackingTouch(SeekBar seekBar) {
mTracking = false;
onProgressChanged(seekBar, seekBar.getProgress(), true);
}
+
+ @Override
+ public void onClick(View v) {
+ if (mRapidlyPressing) {
+ mHandler.removeCallbacks(mRapidPressTimeout);
+ } else {
+ mRapidlyPressing = true;
+ mTmpValue = mValue;
+ }
+ mHandler.postDelayed(mRapidPressTimeout, RAPID_PRESS_TIMEOUT);
+
+ if (v == mBtnPlus && ((mTmpValue+mInterval) <= mMaximum)) {
+ mTmpValue += mInterval;
+ } else if (v == mBtnMinus && ((mTmpValue-mInterval) >= mMinimum)) {
+ mTmpValue -= mInterval;
+ }
+
+ mBar.setProgress(mTmpValue - mMinimum);
+ setMonitorBoxText(mTmpValue);
+ }
}
\ No newline at end of file
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/AQuickSettingsTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/AQuickSettingsTile.java
index cd3d69df87..ef0878fd36 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/AQuickSettingsTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/AQuickSettingsTile.java
@@ -15,12 +15,16 @@
package com.ceco.gm2.gravitybox.quicksettings;
+import com.ceco.gm2.gravitybox.BroadcastSubReceiver;
+import com.ceco.gm2.gravitybox.GravityBoxSettings;
+
import de.robv.android.xposed.XSharedPreferences;
import de.robv.android.xposed.XposedHelpers;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
+import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
@@ -28,9 +32,14 @@
import android.view.ViewGroup;
import android.widget.FrameLayout;
-public abstract class AQuickSettingsTile implements OnClickListener {
+public abstract class AQuickSettingsTile implements OnClickListener, BroadcastSubReceiver {
protected static final String PACKAGE_NAME = "com.android.systemui";
+ public static final int JELLYBEAN = 0;
+ public static final int KITKAT = 1;
+ public static final int KK_COLOR_ON = Color.WHITE;
+ public static final int KK_COLOR_OFF = Color.parseColor("#404040");
+
protected Context mContext;
protected Context mGbContext;
protected FrameLayout mTile;
@@ -42,6 +51,7 @@ public abstract class AQuickSettingsTile implements OnClickListener {
protected String mLabel;
protected Object mStatusBar;
protected Object mPanelBar;
+ protected int mTileStyle;
public AQuickSettingsTile(Context context, Context gbContext, Object statusBar, Object panelBar) {
mContext = context;
@@ -50,6 +60,7 @@ public AQuickSettingsTile(Context context, Context gbContext, Object statusBar,
mGbResources = mGbContext.getResources();
mStatusBar = statusBar;
mPanelBar = panelBar;
+ mTileStyle = JELLYBEAN;
}
public void setupQuickSettingsTile(ViewGroup viewGroup, LayoutInflater inflater, XSharedPreferences prefs) {
@@ -66,17 +77,30 @@ public void setupQuickSettingsTile(ViewGroup viewGroup, LayoutInflater inflater,
onTilePostCreate();
}
- public void setupQuickSettingsTile(ViewGroup viewGroup, LayoutInflater inflater) {
- setupQuickSettingsTile(viewGroup, inflater, null);
- }
-
protected abstract void onTileCreate();
protected void onTilePostCreate() { };
protected abstract void updateTile();
- protected void onPreferenceInitialize(XSharedPreferences prefs) { };
+ protected void onPreferenceInitialize(XSharedPreferences prefs) {
+ try {
+ mTileStyle = Integer.valueOf(
+ prefs.getString(GravityBoxSettings.PREF_KEY_QUICK_SETTINGS_TILE_STYLE, "0"));
+ } catch (NumberFormatException nfe) {
+ //
+ }
+ }
+
+ @Override
+ public void onBroadcastReceived(Context context, Intent intent) {
+ if (intent.getAction().equals(GravityBoxSettings.ACTION_PREF_QUICKSETTINGS_CHANGED)) {
+ if (intent.hasExtra(GravityBoxSettings.EXTRA_QS_TILE_STYLE)) {
+ mTileStyle = intent.getIntExtra(GravityBoxSettings.EXTRA_QS_TILE_STYLE, JELLYBEAN);
+ updateResources();
+ }
+ }
+ }
public void updateResources() {
if (mTile != null) {
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/ExpandedDesktopTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/ExpandedDesktopTile.java
index 4d53a6342a..34dd25bd44 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/ExpandedDesktopTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/ExpandedDesktopTile.java
@@ -15,7 +15,6 @@
package com.ceco.gm2.gravitybox.quicksettings;
-import com.ceco.gm2.gravitybox.BroadcastSubReceiver;
import com.ceco.gm2.gravitybox.GravityBoxSettings;
import com.ceco.gm2.gravitybox.ModExpandedDesktop;
import com.ceco.gm2.gravitybox.R;
@@ -27,13 +26,15 @@
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
-public class ExpandedDesktopTile extends AQuickSettingsTile implements BroadcastSubReceiver {
+public class ExpandedDesktopTile extends AQuickSettingsTile {
private static final String TAG = "GB:ExpandedDesktopTile";
private TextView mTextView;
@@ -113,7 +114,13 @@ protected synchronized void updateTile() {
}
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(mExpanded ? KK_COLOR_ON : KK_COLOR_OFF, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
@Override
@@ -128,6 +135,8 @@ public void onPreferenceInitialize(XSharedPreferences prefs) {
@Override
public void onBroadcastReceived(Context context, Intent intent) {
+ super.onBroadcastReceived(context, intent);
+
if (intent.getAction().equals(GravityBoxSettings.ACTION_PREF_EXPANDED_DESKTOP_MODE_CHANGED) &&
intent.hasExtra(GravityBoxSettings.EXTRA_ED_MODE)) {
mMode = intent.getIntExtra(GravityBoxSettings.EXTRA_ED_MODE, GravityBoxSettings.ED_DISABLED);
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/GpsTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/GpsTile.java
index 074308c83a..f8d6431b8b 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/GpsTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/GpsTile.java
@@ -22,6 +22,8 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.location.LocationManager;
import android.provider.Settings;
import android.view.LayoutInflater;
@@ -123,6 +125,12 @@ protected synchronized void updateTile() {
}
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(mGpsEnabled ? KK_COLOR_ON : KK_COLOR_OFF, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
}
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/NetworkModeTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/NetworkModeTile.java
index f82ce06e06..3e841d1c02 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/NetworkModeTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/NetworkModeTile.java
@@ -15,7 +15,6 @@
package com.ceco.gm2.gravitybox.quicksettings;
-import com.ceco.gm2.gravitybox.BroadcastSubReceiver;
import com.ceco.gm2.gravitybox.GravityBoxSettings;
import com.ceco.gm2.gravitybox.PhoneWrapper;
import com.ceco.gm2.gravitybox.R;
@@ -28,13 +27,15 @@
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
-public class NetworkModeTile extends AQuickSettingsTile implements BroadcastSubReceiver {
+public class NetworkModeTile extends AQuickSettingsTile {
private static final String TAG = "GB:NetworkModeTile";
private static final boolean DEBUG = false;
@@ -150,6 +151,8 @@ protected void onPreferenceInitialize(XSharedPreferences prefs) {
@Override
public void onBroadcastReceived(Context context, Intent intent) {
+ super.onBroadcastReceived(context, intent);
+
if (intent.getAction().equals(GravityBoxSettings.ACTION_PREF_QUICKSETTINGS_CHANGED) &&
intent.hasExtra(GravityBoxSettings.EXTRA_NMT_MODE)) {
updateFlags(intent.getIntExtra(GravityBoxSettings.EXTRA_NMT_MODE, 0));
@@ -188,7 +191,13 @@ protected synchronized void updateTile() {
}
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(KK_COLOR_ON, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
private boolean hasLte() {
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/QuickAppTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/QuickAppTile.java
index 1eb5da32af..37e9e1be1b 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/QuickAppTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/QuickAppTile.java
@@ -18,7 +18,6 @@
import java.util.ArrayList;
import java.util.List;
-import com.ceco.gm2.gravitybox.BroadcastSubReceiver;
import com.ceco.gm2.gravitybox.GravityBoxSettings;
import com.ceco.gm2.gravitybox.R;
@@ -46,7 +45,7 @@
import android.view.WindowManager.LayoutParams;
import android.widget.TextView;
-public class QuickAppTile extends AQuickSettingsTile implements BroadcastSubReceiver {
+public class QuickAppTile extends AQuickSettingsTile {
private static final String TAG = "GB:QuickAppTile";
private static final String SEPARATOR = "#C3C0#";
private static final boolean DEBUG = false;
@@ -106,7 +105,7 @@ public String getValue() {
public Intent getIntent() {
if (mPackageName == null || mClassName == null) return null;
- Intent i = new Intent();
+ Intent i = new Intent(Intent.ACTION_MAIN);
i.setClassName(mPackageName, mClassName);
return i;
}
@@ -274,6 +273,7 @@ protected void onPreferenceInitialize(XSharedPreferences prefs) {
@Override
public void onBroadcastReceived(Context context, Intent intent) {
+ super.onBroadcastReceived(context, intent);
if (DEBUG) log("onBroadcastReceived: " + intent.toString());
if (intent.getAction().equals(GravityBoxSettings.ACTION_PREF_QUICKAPP_CHANGED)) {
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/QuickRecordTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/QuickRecordTile.java
index 7bbacbfdb8..9f5373d420 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/QuickRecordTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/QuickRecordTile.java
@@ -28,6 +28,8 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Environment;
@@ -188,7 +190,13 @@ protected void updateTile() {
}
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(KK_COLOR_ON, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
final Runnable autoStopRecord = new Runnable() {
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/RingerModeTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/RingerModeTile.java
index cef33836fe..282336d6ad 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/RingerModeTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/RingerModeTile.java
@@ -26,6 +26,8 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.database.ContentObserver;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.os.Handler;
import android.os.Vibrator;
@@ -149,7 +151,14 @@ protected synchronized void updateTile() {
}
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(mDrawableId == R.drawable.ic_qs_ring_off ?
+ KK_COLOR_OFF : KK_COLOR_ON, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
protected void toggleState() {
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/ScreenshotTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/ScreenshotTile.java
index d7851d3822..930e6c1929 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/ScreenshotTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/ScreenshotTile.java
@@ -20,6 +20,8 @@
import android.content.Context;
import android.content.Intent;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
@@ -59,6 +61,12 @@ protected synchronized void updateTile() {
mDrawableId = R.drawable.ic_qs_screenshot;
mLabel = mGbContext.getString(R.string.qs_tile_screenshot);
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(KK_COLOR_ON, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
}
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/SleepTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/SleepTile.java
index f98d091114..aa119946ef 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/SleepTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/SleepTile.java
@@ -21,6 +21,8 @@
import de.robv.android.xposed.XposedBridge;
import android.content.Context;
import android.content.Intent;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.os.PowerManager;
import android.os.SystemClock;
import android.view.LayoutInflater;
@@ -70,7 +72,13 @@ protected void onTileCreate() {
protected void updateTile() {
TextView tv = (TextView) mTile.findViewById(R.id.sleep_tileview);
tv.setText(mLabel);
- tv.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(KK_COLOR_ON, PorterDuff.Mode.SRC_ATOP);
+ tv.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ tv.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
}
\ No newline at end of file
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/StayAwakeTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/StayAwakeTile.java
index bdb0c26b0d..b6c98ea897 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/StayAwakeTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/StayAwakeTile.java
@@ -23,6 +23,8 @@
import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.provider.Settings;
import android.view.LayoutInflater;
@@ -94,7 +96,14 @@ protected synchronized void updateTile() {
}
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(mCurrentTimeout == NEVER_SLEEP ?
+ KK_COLOR_ON : KK_COLOR_OFF, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
private void toggleStayAwake() {
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/SyncTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/SyncTile.java
index 07c18dc124..c5d98e07ec 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/SyncTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/SyncTile.java
@@ -24,6 +24,8 @@
import android.content.Context;
import android.content.Intent;
import android.content.SyncStatusObserver;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
@@ -91,7 +93,14 @@ protected void updateTile() {
}
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(mSyncState ?
+ KK_COLOR_ON : KK_COLOR_OFF, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
private void getSyncState() {
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/TileOrderActivity.java b/src/com/ceco/gm2/gravitybox/quicksettings/TileOrderActivity.java
index d73ab83981..335ee4e8c3 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/TileOrderActivity.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/TileOrderActivity.java
@@ -33,6 +33,7 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
+import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@@ -77,10 +78,12 @@ public void onCreate(Bundle savedInstanceState) {
String[] allTileKeys = Utils.isMtkDevice() ?
mResources.getStringArray(R.array.qs_tile_values) :
- mResources.getStringArray(R.array.qs_tile_aosp_values);
+ mResources.getStringArray(Build.VERSION.SDK_INT > 18 ?
+ R.array.qs_tile_aosp_values_kk : R.array.qs_tile_aosp_values);
String[] allTileNames = Utils.isMtkDevice() ?
mResources.getStringArray(R.array.qs_tile_entries) :
- mResources.getStringArray(R.array.qs_tile_aosp_entries);
+ mResources.getStringArray(Build.VERSION.SDK_INT > 18 ?
+ R.array.qs_tile_aosp_entries_kk : R.array.qs_tile_aosp_entries);
mTileTexts = new HashMap();
for (int i = 0; i < allTileKeys.length; i++) {
mTileTexts.put(allTileKeys[i], allTileNames[i]);
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/TorchTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/TorchTile.java
index ecb8473f69..72e8a689cb 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/TorchTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/TorchTile.java
@@ -22,6 +22,8 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
@@ -78,7 +80,14 @@ protected void updateTile() {
}
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(mTorchStatus == TorchService.TORCH_STATUS_ON ?
+ KK_COLOR_ON : KK_COLOR_OFF, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
private void toggleState() {
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/VolumeTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/VolumeTile.java
index 2b3c7a98de..4daf77d0d1 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/VolumeTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/VolumeTile.java
@@ -20,6 +20,8 @@
import de.robv.android.xposed.XposedHelpers;
import android.content.Context;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.view.LayoutInflater;
import android.view.View;
@@ -63,6 +65,12 @@ protected void onTileCreate() {
protected synchronized void updateTile() {
TextView tv = (TextView) mTile.findViewById(R.id.volume_tileview);
tv.setText(mLabel);
- tv.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(KK_COLOR_ON, PorterDuff.Mode.SRC_ATOP);
+ tv.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ tv.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
}
\ No newline at end of file
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/WifiApTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/WifiApTile.java
index 1e4cd7db86..bf0213ed06 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/WifiApTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/WifiApTile.java
@@ -21,6 +21,8 @@
import android.content.Context;
import android.content.Intent;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
@@ -92,7 +94,14 @@ protected synchronized void updateTile() {
}
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(mDrawableId == R.drawable.ic_qs_wifi_ap_off ?
+ KK_COLOR_OFF : KK_COLOR_ON, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
@Override
diff --git a/src/com/ceco/gm2/gravitybox/quicksettings/WifiTile.java b/src/com/ceco/gm2/gravitybox/quicksettings/WifiTile.java
index 916917897f..40590bfc91 100644
--- a/src/com/ceco/gm2/gravitybox/quicksettings/WifiTile.java
+++ b/src/com/ceco/gm2/gravitybox/quicksettings/WifiTile.java
@@ -32,6 +32,8 @@
import android.content.Context;
import android.content.res.Resources.NotFoundException;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
@@ -110,7 +112,16 @@ protected void onTilePostCreate() {
@Override
protected synchronized void updateTile() {
mTextView.setText(mLabel);
- mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ if (mTileStyle == KITKAT && (mDrawableId == R.drawable.ic_qs_wifi_full_1 ||
+ mDrawableId == R.drawable.ic_qs_wifi_full_2 ||
+ mDrawableId == R.drawable.ic_qs_wifi_full_3 ||
+ mDrawableId == R.drawable.ic_qs_wifi_full_4)) {
+ Drawable d = mGbResources.getDrawable(mDrawableId).mutate();
+ d.setColorFilter(KK_COLOR_ON, PorterDuff.Mode.SRC_ATOP);
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null);
+ } else {
+ mTextView.setCompoundDrawablesWithIntrinsicBounds(0, mDrawableId, 0, 0);
+ }
}
private void prepareDrawableMap() {
diff --git a/src/net/margaritov/preference/colorpicker/ColorPickerDialog.java b/src/net/margaritov/preference/colorpicker/ColorPickerDialog.java
index d7eecb4209..88f540c301 100644
--- a/src/net/margaritov/preference/colorpicker/ColorPickerDialog.java
+++ b/src/net/margaritov/preference/colorpicker/ColorPickerDialog.java
@@ -97,7 +97,9 @@ public void afterTextChanged(Editable s) {
if (s.length() > 5 || s.length() < 10) {
try {
int c = ColorPickerPreference.convertToColorInt(s.toString());
+ mHexInternalTextChange = true;
mColorPicker.setColor(c, true);
+ mHexInternalTextChange = false;
mHexVal.setTextColor(mHexDefaultTextColor);
} catch (NumberFormatException e) {
mHexVal.setTextColor(Color.RED);
@@ -107,6 +109,7 @@ public void afterTextChanged(Editable s) {
}
}
});
+ setHexValueEnabled(true);
((LinearLayout) mOldColor.getParent()).setPadding(
Math.round(mColorPicker.getDrawingOffset()),
@@ -162,6 +165,8 @@ private void updateHexLengthFilter() {
}
private void updateHexValue(int color) {
+ if (mHexInternalTextChange) return;
+
mHexInternalTextChange = true;
if (getAlphaSliderVisible())
mHexVal.setText(ColorPickerPreference.convertToARGB(color));
diff --git a/src/net/margaritov/preference/colorpicker/ColorPickerPreference.java b/src/net/margaritov/preference/colorpicker/ColorPickerPreference.java
index 8ecfc58ef9..4232188659 100644
--- a/src/net/margaritov/preference/colorpicker/ColorPickerPreference.java
+++ b/src/net/margaritov/preference/colorpicker/ColorPickerPreference.java
@@ -146,6 +146,14 @@ public void onColorChanged(int color) {
}
}
+ public void setValue(int color) {
+ if (isPersistent()) {
+ persistInt(color);
+ }
+ mValue = color;
+ setPreviewColor();
+ }
+
public boolean onPreferenceClick(Preference preference) {
showDialog(null);
return false;