Force the build tools to generate .pngs for each vector.
This results in a slightly larger apk (e.g. 500KiB), but it reduces the scope for bugs greatly. We still get all the benefits of only having to maintain a single density-independent vector (rather than several density dependent PNGs and all the work that involves). The class of bugs that it solves is that there are several places where vectors cannot be used, and you wont notice when developing on a device newer than 5.0. For example, notification icons, `TextView` and its `android:drawableStart` attribute. Fixes #913.
This commit is contained in:
parent
e28e29455e
commit
432eee0f83
@ -211,7 +211,6 @@ android {
|
||||
versionCode 103001
|
||||
versionName getVersionName()
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
}
|
||||
|
||||
testOptions {
|
||||
|
@ -37,7 +37,6 @@ import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.os.StrictMode;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v7.app.AppCompatDelegate;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
@ -79,10 +78,6 @@ import sun.net.www.protocol.bluetooth.Handler;
|
||||
)
|
||||
public class FDroidApp extends Application {
|
||||
|
||||
static {
|
||||
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
|
||||
}
|
||||
|
||||
private static final String TAG = "FDroidApp";
|
||||
|
||||
public static final String SYSTEM_DIR_NAME = Environment.getRootDirectory().getAbsolutePath();
|
||||
|
@ -12,7 +12,6 @@ import android.graphics.Point;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.support.graphics.drawable.VectorDrawableCompat;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.support.v4.app.NotificationManagerCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
@ -526,7 +525,7 @@ class NotificationHelper {
|
||||
if (entry.status == AppUpdateStatusManager.Status.Downloading || entry.status == AppUpdateStatusManager.Status.Installing) {
|
||||
Bitmap bitmap = Bitmap.createBitmap(largeIconSize.x, largeIconSize.y, Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
Drawable downloadIcon = VectorDrawableCompat.create(context.getResources(), R.drawable.ic_notification_download, context.getTheme());
|
||||
Drawable downloadIcon = ContextCompat.getDrawable(context, R.drawable.ic_notification_download);
|
||||
if (downloadIcon != null) {
|
||||
downloadIcon.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
downloadIcon.draw(canvas);
|
||||
|
@ -27,7 +27,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:srcCompat="@drawable/ic_back_black_24dp" />
|
||||
android:src="@drawable/ic_back_black_24dp" />
|
||||
|
||||
<EditText
|
||||
android:layout_width="0dp"
|
||||
@ -53,7 +53,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@drawable/ic_close_black_24dp" />
|
||||
android:src="@drawable/ic_close_black_24dp" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
|
@ -8,5 +8,5 @@
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
app:srcCompat="@drawable/donation_option_bitcoin"
|
||||
android:src="@drawable/donation_option_bitcoin"
|
||||
android:contentDescription="@string/menu_bitcoin" />
|
@ -8,5 +8,5 @@
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
app:srcCompat="@drawable/donation_option_flattr"
|
||||
android:src="@drawable/donation_option_flattr"
|
||||
android:contentDescription="@string/menu_flattr" />
|
@ -4,5 +4,5 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="20dp"
|
||||
app:srcCompat="@drawable/donation_option_litecoin"
|
||||
android:src="@drawable/donation_option_litecoin"
|
||||
android:contentDescription="@string/menu_litecoin" />
|
@ -56,7 +56,7 @@
|
||||
android:id="@+id/image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:srcCompat="@drawable/nearby_splash"
|
||||
android:src="@drawable/nearby_splash"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
|
@ -19,7 +19,7 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_nearby_share"
|
||||
android:src="@drawable/ic_nearby_share"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
/>
|
||||
|
@ -60,7 +60,7 @@
|
||||
android:contentDescription="@string/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_cancel"
|
||||
android:src="@drawable/ic_cancel"
|
||||
android:background="@android:color/transparent"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
|
@ -24,7 +24,7 @@
|
||||
android:id="@+id/button_download_all"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
app:srcCompat="@drawable/ic_download_progress_0"
|
||||
android:src="@drawable/ic_download_progress_0"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:contentDescription="@string/updates__tts__download_updates_for_all_apps"
|
||||
|
Loading…
x
Reference in New Issue
Block a user