Simplify layouts

This commit is contained in:
topjohnwu 2019-01-24 15:15:31 -05:00
parent d3ebd763a2
commit 4a8375355c
33 changed files with 99 additions and 166 deletions

View File

@ -1,5 +1,6 @@
package com.topjohnwu.magisk.adapters; package com.topjohnwu.magisk.adapters;
import android.content.Context;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -93,11 +94,12 @@ public class SuLogAdapter extends SectionedAdapter<SuLogAdapter.SectionHolder, S
itemExpanded.add(realIdx); itemExpanded.add(realIdx);
} }
}); });
Context context = holder.itemView.getContext();
holder.appName.setText(entry.appName); holder.appName.setText(entry.appName);
holder.action.setText(entry.action ? R.string.grant : R.string.deny); holder.action.setText(entry.action ? R.string.grant : R.string.deny);
holder.command.setText(entry.command); holder.pid.setText(context.getString(R.string.pid, entry.fromPid));
holder.fromPid.setText(String.valueOf(entry.fromPid)); holder.uid.setText(context.getString(R.string.target_uid, entry.toUid));
holder.toUid.setText(String.valueOf(entry.toUid)); holder.command.setText(context.getString(R.string.command, entry.command));
holder.time.setText(entry.getTimeString()); holder.time.setText(entry.getTimeString());
} }
@ -125,9 +127,9 @@ public class SuLogAdapter extends SectionedAdapter<SuLogAdapter.SectionHolder, S
@BindView(R.id.app_name) TextView appName; @BindView(R.id.app_name) TextView appName;
@BindView(R.id.action) TextView action; @BindView(R.id.action) TextView action;
@BindView(R.id.time) TextView time; @BindView(R.id.time) TextView time;
@BindView(R.id.fromPid) TextView fromPid; @BindView(R.id.pid) TextView pid;
@BindView(R.id.toUid) TextView toUid; @BindView(R.id.uid) TextView uid;
@BindView(R.id.command) TextView command; @BindView(R.id.cmd) TextView command;
@BindView(R.id.expand_layout) ViewGroup expandLayout; @BindView(R.id.expand_layout) ViewGroup expandLayout;
private Container container = new Container(); private Container container = new Container();

View File

@ -60,79 +60,40 @@
android:id="@+id/expand_layout" android:id="@+id/expand_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:layout_gravity="center_horizontal"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:gravity="center" android:gravity="center"
android:layout_gravity="center_horizontal"> android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingTop="5dp"
android:paddingEnd="10dp"
android:paddingBottom="5dp">
<LinearLayout <TextView
android:orientation="horizontal" android:id="@+id/pid"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:layout_weight="1"
android:layout_weight="1"> android:text="@string/pid"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp" />
<TextView <TextView
android:text="@string/pid" android:id="@+id/uid"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/fromPid"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:layout_weight="1"
android:layout_weight="1"> android:text="@string/target_uid"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp" />
<TextView <TextView
android:text="@string/target_uid" android:id="@+id/cmd"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/toUid"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:layout_weight="2"
android:layout_weight="2"> android:text="@string/command"
android:textColor="?android:attr/textColorSecondary"
<TextView android:textSize="12sp" />
android:text="@string/command"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/command"
android:textColor="?android:attr/textColorSecondary"
android:gravity="start"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>

View File

@ -11,7 +11,7 @@
<string name="checking_for_updates">البحث عن تحديثات…</string> <string name="checking_for_updates">البحث عن تحديثات…</string>
<string name="checking_safetyNet_status">التحقق من حالة SafetyNet…</string> <string name="checking_safetyNet_status">التحقق من حالة SafetyNet…</string>
<string name="close">إغلاق</string> <string name="close">إغلاق</string>
<string name="command">"الأمر: "</string> <string name="command">الأمر: %1$s</string>
<string name="current_magisk_title">نسخة Magisk المثبته: %1$s</string> <string name="current_magisk_title">نسخة Magisk المثبته: %1$s</string>
<string name="deny">رفض</string> <string name="deny">رفض</string>
<string name="deny_with_str">رفض%1$s</string> <string name="deny_with_str">رفض%1$s</string>
@ -48,8 +48,7 @@
<string name="once">مرة</string> <string name="once">مرة</string>
<string name="owner_manage_summary">يمكن للمالك فقط إدارة صلاحيات الروت وتلقي مطالبات الطلب</string> <string name="owner_manage_summary">يمكن للمالك فقط إدارة صلاحيات الروت وتلقي مطالبات الطلب</string>
<string name="owner_only_summary">المالك فقط لديه صلاحيات الروت</string> <string name="owner_only_summary">المالك فقط لديه صلاحيات الروت</string>
<string name="pid">"PID: "</string> <string name="process_error">خطأ في العملية</string>
<string name="process_error">خطأ في العملية</string>
<string name="prompt">طلب</string> <string name="prompt">طلب</string>
<string name="reboot">إعادة التشغيل</string> <string name="reboot">إعادة التشغيل</string>
<string name="release_notes">ملاحظات الإصدار</string> <string name="release_notes">ملاحظات الإصدار</string>
@ -105,7 +104,7 @@
<string name="superuser_access">Superuser صلاحيات</string> <string name="superuser_access">Superuser صلاحيات</string>
<string name="superuser_notification">Superuser إشعارات</string> <string name="superuser_notification">Superuser إشعارات</string>
<string name="support_thread">منتدى الدعم</string> <string name="support_thread">منتدى الدعم</string>
<string name="target_uid">"الهدف UID: "</string> <string name="target_uid">الهدف UID: %1$d</string>
<string name="tenmin">10 دقائق</string> <string name="tenmin">10 دقائق</string>
<string name="thirtymin">30 دقائق</string> <string name="thirtymin">30 دقائق</string>
<string name="toast">ملاحظة منبثقة</string> <string name="toast">ملاحظة منبثقة</string>

View File

@ -222,8 +222,7 @@
<string name="auth_fail">Неуспешна заверка.</string> <string name="auth_fail">Неуспешна заверка.</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Целеви UID: %1$d</string>
<string name="target_uid">Целеви UID:\u0020</string> <string name="command">Команда: %1$s</string>
<string name="command">Команда:\u0020</string>
</resources> </resources>

View File

@ -217,8 +217,7 @@
<string name="auth_fail">Autenticació fallida</string> <string name="auth_fail">Autenticació fallida</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">UID de lobjectiu: %1$d</string>
<string name="target_uid">UID de lobjectiu:\u0020</string> <string name="command">Ordre: %1$s</string>
<string name="command">Ordre:\u0020</string>
</resources> </resources>

View File

@ -133,8 +133,7 @@
<string name="none">Žádné</string> <string name="none">Žádné</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Cílové UID: %1$d</string>
<string name="target_uid">Cílové UID:\u0020</string> <string name="command">Příkaz: %1$s</string>
<string name="command">Příkaz:\u0020</string>
</resources> </resources>

View File

@ -221,8 +221,7 @@
<string name="auth_fail">Authentifizierung fehlgeschlagen</string> <string name="auth_fail">Authentifizierung fehlgeschlagen</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Ziel-UID: %1$d</string>
<string name="target_uid">Ziel-UID:\u0020</string> <string name="command">Befehl: %1$s</string>
<string name="command">Befehl:\u0020</string>
</resources> </resources>

View File

@ -200,7 +200,6 @@
<string name="none">Κανένα</string> <string name="none">Κανένα</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">UID Στόχος: %1$d</string>
<string name="target_uid">UID Στόχος:\u0020</string> <string name="command">Εντολή: %1$s</string>
<string name="command">Εντολή:\u0020</string>
</resources> </resources>

View File

@ -228,8 +228,7 @@
<string name="auth_fail">Autenticación fallida</string> <string name="auth_fail">Autenticación fallida</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">UID de objetivo: %1$d</string>
<string name="target_uid">UID de objetivo:\u0020</string> <string name="command">Comando: %1$s</string>
<string name="command">Comando:\u0020</string>
</resources> </resources>

View File

@ -216,8 +216,7 @@
<string name="auth_fail">Autentimine ebaõnnestus</string> <string name="auth_fail">Autentimine ebaõnnestus</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\\u0020</string> <string name="target_uid">Siht-UID: %1$d</string>
<string name="target_uid">Siht-UID:\\u0020</string> <string name="command">Käsklus: %1$s</string>
<string name="command">Käsklus:\\u0020</string>
</resources> </resources>

View File

@ -227,8 +227,7 @@
<string name="auth_fail">Échec de lauthentification</string> <string name="auth_fail">Échec de lauthentification</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID :\u0020</string> <string name="target_uid">UID cible : %1$d</string>
<string name="target_uid">UID cible :\u0020</string> <string name="command">Commande : %1$s</string>
<string name="command">Commande :\u0020</string>
</resources> </resources>

View File

@ -187,8 +187,7 @@
<string name="none">Nijedan</string> <string name="none">Nijedan</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Ciljani UID: %1$d</string>
<string name="target_uid">Ciljani UID:\u0020</string> <string name="command">Naredba: %1$s</string>
<string name="command">Naredba:\u0020</string>
</resources> </resources>

View File

@ -226,7 +226,6 @@
<string name="auth_fail">Otentikasi Gagal</string> <string name="auth_fail">Otentikasi Gagal</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">UID target: %1$d</string>
<string name="target_uid">UID target:\u0020</string> <string name="command">Perintah: %1$s</string>
<string name="command">Perintah:\u0020</string>
</resources> </resources>

View File

@ -229,8 +229,7 @@
<string name="auth_fail">Autenticatione fallita</string> <string name="auth_fail">Autenticatione fallita</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">UID destinazione: %1$d</string>
<string name="target_uid">UID destinazione:\u0020</string> <string name="command">Comando: %1$s</string>
<string name="command">Comando:\u0020</string>
</resources> </resources>

View File

@ -202,8 +202,7 @@
<string name="auth_fail">認証に失敗しました</string> <string name="auth_fail">認証に失敗しました</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">ターゲット UID: %1$d</string>
<string name="target_uid">ターゲット UID:\u0020</string> <string name="command">コマンド: %1$s</string>
<string name="command">コマンド:\u0020</string>
</resources> </resources>

View File

@ -133,9 +133,8 @@
<string name="none">없음</string> <string name="none">없음</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">대상 UID: %1$d</string>
<string name="target_uid">대상 UID:\u0020</string> <string name="command">명령: %1$s</string>
<string name="command">명령:\u0020</string>
<string name="download">다운로드</string> <string name="download">다운로드</string>
</resources> </resources>

View File

@ -215,8 +215,7 @@
<string name="auth_fail">Patvirtinimas žlugo</string> <string name="auth_fail">Patvirtinimas žlugo</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Target UID: %1$d</string>
<string name="target_uid">Target UID:\u0020</string> <string name="command">Komanda: %1$s</string>
<string name="command">Komanda:\u0020</string>
</resources> </resources>

View File

@ -226,8 +226,7 @@
<string name="auth_fail">Autentisering mislyktes</string> <string name="auth_fail">Autentisering mislyktes</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Mål-UID: %1$d</string>
<string name="target_uid">Mål-UID:\u0020</string> <string name="command">Kommando: %1$s</string>
<string name="command">Kommando:\u0020</string>
</resources> </resources>

View File

@ -209,8 +209,7 @@
<string name="auth_fail">Authenticatie mislukt</string> <string name="auth_fail">Authenticatie mislukt</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Doel UID: %1$d</string>
<string name="target_uid">Doel UID:\u0020</string> <string name="command">Opdracht: %1$s</string>
<string name="command">Opdracht:\u0020</string>
</resources> </resources>

View File

@ -226,8 +226,7 @@
<string name="auth_fail">Uwierzytelnienie Nieudane</string> <string name="auth_fail">Uwierzytelnienie Nieudane</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Identyfikator UID: %1$d</string>
<string name="target_uid">Identyfikator UID:\u0020</string> <string name="command">Komenda: %1$s</string>
<string name="command">Komenda:\u0020</string>
</resources> </resources>

View File

@ -210,8 +210,7 @@
<string name="auth_fail">Falha de Autenticação</string> <string name="auth_fail">Falha de Autenticação</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Alvo UID: %1$d</string>
<string name="target_uid">Alvo UID:\u0020</string> <string name="command">Comando: %1$s</string>
<string name="command">Comando:\u0020</string>
</resources> </resources>

View File

@ -175,8 +175,7 @@
<string name="none">Nenhum</string> <string name="none">Nenhum</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Alvo UID: %1$d</string>
<string name="target_uid">Alvo UID:\u0020</string> <string name="command">Comando: %1$s</string>
<string name="command">Comando:\u0020</string>
</resources> </resources>

View File

@ -226,8 +226,7 @@
<string name="auth_fail">Autentificare eşuată</string> <string name="auth_fail">Autentificare eşuată</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">UID: %1$d</string>
<string name="target_uid">UID:\u0020</string> <string name="command">Comandă: %1$s</string>
<string name="command">Comandă:\u0020</string>
</resources> </resources>

View File

@ -221,8 +221,7 @@
<string name="auth_fail">Ошибка аутентификации</string> <string name="auth_fail">Ошибка аутентификации</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">UID: %1$d</string>
<string name="target_uid">UID:\u0020</string> <string name="command">Команда: %1$s</string>
<string name="command">Команда:\u0020</string>
</resources> </resources>

View File

@ -217,8 +217,7 @@
<string name="auth_fail">Autentifikácia zlyhala</string> <string name="auth_fail">Autentifikácia zlyhala</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Target UID: %1$d</string>
<string name="target_uid">Target UID:\u0020</string> <string name="command">Príkaz: %1$s</string>
<string name="command">Príkaz:\u0020</string>
</resources> </resources>

View File

@ -192,8 +192,7 @@
<string name="none">Ниједан</string> <string name="none">Ниједан</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">ПИД:\u0020</string> <string name="target_uid">Циљани УИД: %1$d</string>
<string name="target_uid">Циљани УИД:\u0020</string> <string name="command">Команда: %1$s</string>
<string name="command">Команда:\u0020</string>
</resources> </resources>

View File

@ -159,8 +159,7 @@
<string name="none">Inga</string> <string name="none">Inga</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Mål-UID: %1$d</string>
<string name="target_uid">Mål-UID:\u0020</string> <string name="command">Kommando: %1$s</string>
<string name="command">Kommando:\u0020</string>
</resources> </resources>

View File

@ -226,8 +226,7 @@
<string name="auth_fail">Kimlik Doğrulama Başarısız</string> <string name="auth_fail">Kimlik Doğrulama Başarısız</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Hedef UID: %1$d</string>
<string name="target_uid">Hedef UID:\u0020</string> <string name="command">Komut: %1$s</string>
<string name="command">Komut:\u0020</string>
</resources> </resources>

View File

@ -227,8 +227,7 @@
<string name="auth_fail">Помилка автентифікації</string> <string name="auth_fail">Помилка автентифікації</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Цільовий UID: %1$d</string>
<string name="target_uid">Цільовий UID:\u0020</string> <string name="command">Команда: %1$s</string>
<string name="command">Команда:\u0020</string>
</resources> </resources>

View File

@ -219,7 +219,6 @@
<string name="auth_fail">Xác thực thất bại</string> <string name="auth_fail">Xác thực thất bại</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">Mục UID: %1$d</string>
<string name="target_uid">Mục UID:\u0020</string> <string name="command">Điều khiển: %1$s</string>
<string name="command">Điều khiển:\u0020</string>
</resources> </resources>

View File

@ -227,8 +227,7 @@
<string name="auth_fail">验证失败</string> <string name="auth_fail">验证失败</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">目标 UID: %1$d</string>
<string name="target_uid">目标 UID:\u0020</string> <string name="command">命令: %1$s</string>
<string name="command">命令:\u0020</string>
</resources> </resources>

View File

@ -126,9 +126,8 @@
<string name="none"></string> <string name="none"></string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="target_uid">目標 UID: %1$d</string>
<string name="target_uid">目標 UID:\u0020</string> <string name="command">指令: %1$s</string>
<string name="command">"指令: "</string>
<string name="close">關閉</string> <string name="close">關閉</string>
<string name="internal_storage">Zip 已被儲存到:\n[內部儲存空間]%1$s</string> <string name="internal_storage">Zip 已被儲存到:\n[內部儲存空間]%1$s</string>
<string name="process_error">處理失敗</string> <string name="process_error">處理失敗</string>

View File

@ -227,8 +227,8 @@
<string name="auth_fail">Authentication Failed</string> <string name="auth_fail">Authentication Failed</string>
<!--Superuser logs--> <!--Superuser logs-->
<string name="pid">PID:\u0020</string> <string name="pid" translatable="false">PID: %1$d</string>
<string name="target_uid">Target UID:\u0020</string> <string name="target_uid">Target UID: %1$d</string>
<string name="command">Command:\u0020</string> <string name="command">Command: %1$s</string>
</resources> </resources>