mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 02:25:28 +00:00
Handle vector drawables
This commit is contained in:
parent
920b60da19
commit
1d0b87246a
@ -125,6 +125,7 @@ public class SuRequestActivity extends BaseActivity {
|
||||
appIcon.setImageDrawable(policy.info.loadIcon(pm));
|
||||
appNameView.setText(policy.appName);
|
||||
packageNameView.setText(policy.packageName);
|
||||
warning.setCompoundDrawablesRelativeWithIntrinsicBounds(getDrawable(R.drawable.ic_warning), null, null, null);
|
||||
|
||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
|
||||
R.array.allow_timeout, android.R.layout.simple_spinner_item);
|
||||
|
@ -28,6 +28,7 @@ import android.widget.TextView;
|
||||
|
||||
import com.topjohnwu.magisk.R;
|
||||
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import butterknife.BindView;
|
||||
|
||||
/**
|
||||
@ -54,14 +55,10 @@ public class AboutCardRow extends LinearLayout {
|
||||
new AboutCardRow_ViewBinding(this, this);
|
||||
|
||||
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.AboutCardRow, 0, 0);
|
||||
String title;
|
||||
Drawable icon;
|
||||
try {
|
||||
title = a.getString(R.styleable.AboutCardRow_text);
|
||||
icon = a.getDrawable(R.styleable.AboutCardRow_icon);
|
||||
} finally {
|
||||
a.recycle();
|
||||
}
|
||||
String title = a.getString(R.styleable.AboutCardRow_text);
|
||||
Drawable icon = AppCompatResources.getDrawable(context,
|
||||
a.getResourceId(R.styleable.AboutCardRow_icon, R.drawable.ic_magisk));
|
||||
a.recycle();
|
||||
mTitle.setText(title);
|
||||
mIcon.setImageDrawable(icon);
|
||||
}
|
||||
|
@ -39,10 +39,10 @@
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
app:srcCompat="@drawable/ic_logo"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_logo"/>
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -2,6 +2,7 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/su_popup"
|
||||
tools:context=".SuRequestActivity"
|
||||
android:layout_height="wrap_content"
|
||||
@ -82,7 +83,6 @@
|
||||
android:id="@+id/warning"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_warning"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:text="@string/su_warning"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@ -121,7 +121,7 @@
|
||||
android:layout_weight="1"
|
||||
android:padding="7dp"
|
||||
android:tint="?attr/colorAccent"
|
||||
android:src="@drawable/ic_fingerprint" />
|
||||
app:srcCompat="@drawable/ic_fingerprint" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -41,7 +41,7 @@
|
||||
android:layout_height="25dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@+id/core_only"
|
||||
android:src="@drawable/ic_warning"/>
|
||||
app:srcCompat="@drawable/ic_warning"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/core_only"
|
||||
@ -173,7 +173,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="15dp"
|
||||
android:layout_toStartOf="@+id/safetyNet_status"
|
||||
android:src="@drawable/ic_refresh" />
|
||||
app:srcCompat="@drawable/ic_refresh" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/safetyNet_check_progress"
|
||||
|
@ -43,7 +43,7 @@
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_margin="@dimen/fab_padding"
|
||||
android:elevation="6dp"
|
||||
android:src="@drawable/ic_add"
|
||||
app:srcCompat="@drawable/ic_add"
|
||||
tools:fabSize="normal"
|
||||
tools:pressedTranslationZ="12dp" />
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="?attr/cardStyle"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -90,7 +91,6 @@
|
||||
android:focusable="false"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/checkbox_padding"
|
||||
android:src="@drawable/ic_menu_overflow_material"
|
||||
tools:ignore="ContentDescription"/>
|
||||
|
||||
<ImageView
|
||||
@ -101,7 +101,7 @@
|
||||
android:focusable="false"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/checkbox_padding"
|
||||
android:src="@drawable/ic_delete"
|
||||
app:srcCompat="@drawable/ic_delete"
|
||||
android:tint="@color/icon_grey"
|
||||
tools:ignore="ContentDescription"/>
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
<androidx.cardview.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="?attr/cardStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -99,7 +100,7 @@
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_notifications"
|
||||
app:srcCompat="@drawable/ic_notifications"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:tint="@color/icon_grey"
|
||||
android:layout_marginEnd="10dp" />
|
||||
@ -126,7 +127,7 @@
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_bug_report"
|
||||
app:srcCompat="@drawable/ic_bug_report"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:tint="@color/icon_grey"
|
||||
android:layout_marginEnd="10dp" />
|
||||
@ -147,7 +148,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:src="@drawable/ic_delete"
|
||||
app:srcCompat="@drawable/ic_delete"
|
||||
android:tint="@color/icon_grey"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
@ -157,7 +158,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:src="@drawable/ic_more"
|
||||
app:srcCompat="@drawable/ic_more"
|
||||
android:tint="@color/icon_grey"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
<androidx.cardview.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="?attr/cardStyle"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -83,8 +84,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/ic_file_download_black"
|
||||
android:backgroundTint="@color/icon_grey"
|
||||
app:srcCompat="@drawable/ic_file_download_black"
|
||||
android:tint="@color/icon_grey"
|
||||
android:clickable="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:focusable="false"
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
@ -13,7 +14,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:src="@drawable/ic_arrow" />
|
||||
app:srcCompat="@drawable/ic_arrow" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
|
Loading…
Reference in New Issue
Block a user