From 6513ee29b55ff81adf38f7d8ee9f6af7bf537e1e Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Sun, 9 Sep 2018 22:29:11 +0200 Subject: [PATCH] remove drawable compat code --- app/build.gradle | 1 - .../main/java/com/keylesspalace/tusky/TuskyApplication.java | 3 --- .../keylesspalace/tusky/adapter/NotificationsAdapter.java | 3 --- .../com/keylesspalace/tusky/adapter/StatusViewHolder.java | 6 ------ app/src/main/res/layout/item_follow.xml | 1 + app/src/main/res/layout/item_status.xml | 1 + 6 files changed, 2 insertions(+), 13 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e578957c4..4ad8776b4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,7 +22,6 @@ android { versionCode 49 versionName "3.1" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - vectorDrawables.useSupportLibrary true } buildTypes { release { diff --git a/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java b/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java index 1e723114b..105e098e2 100644 --- a/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java +++ b/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java @@ -24,7 +24,6 @@ import android.content.Context; import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.text.emoji.EmojiCompat; -import android.support.v7.app.AppCompatDelegate; import com.evernote.android.job.JobManager; import com.jakewharton.picasso.OkHttp3Downloader; @@ -95,8 +94,6 @@ public class TuskyApplication extends Application implements HasActivityInjector JobManager.create(this).addJobCreator(notificationPullJobCreator); - //necessary for Android < API 21 - AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); } /** diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java index 3ceaf8b4e..6cbd7bec4 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java @@ -257,9 +257,6 @@ public class NotificationsAdapter extends RecyclerView.Adapter { usernameView = itemView.findViewById(R.id.notification_username); displayNameView = itemView.findViewById(R.id.notification_display_name); avatar = itemView.findViewById(R.id.notification_avatar); - //workaround because Android < API 21 does not support setting drawableLeft from xml when it is a vector image - Drawable followIcon = ContextCompat.getDrawable(message.getContext(), R.drawable.ic_person_add_24dp); - message.setCompoundDrawablesWithIntrinsicBounds(followIcon, null, null, null); } void setMessage(Account account, BidiFormatter bidiFormatter) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java index a1c940363..d4250e1f5 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java @@ -16,7 +16,6 @@ package com.keylesspalace.tusky.adapter; import android.content.Context; -import android.graphics.drawable.Drawable; import android.support.annotation.Nullable; import android.view.View; import android.widget.ImageView; @@ -24,7 +23,6 @@ import android.widget.TextView; import com.keylesspalace.tusky.R; import com.keylesspalace.tusky.interfaces.StatusActionListener; -import com.keylesspalace.tusky.util.ThemeUtils; import com.keylesspalace.tusky.viewdata.StatusViewData; import com.squareup.picasso.Picasso; @@ -38,10 +36,6 @@ public class StatusViewHolder extends StatusBaseViewHolder { super(itemView, useAbsoluteTime); avatarReblog = itemView.findViewById(R.id.status_avatar_reblog); rebloggedBar = itemView.findViewById(R.id.status_reblogged); - //workaround because Android < API 21 does not support setting drawableLeft from xml when it is a vector image - Drawable rebloggedIcon = ThemeUtils.getDrawable(rebloggedBar.getContext(), - R.attr.status_reblog_small_drawable, R.drawable.ic_reblog_dark_18dp); - rebloggedBar.setCompoundDrawablesWithIntrinsicBounds(rebloggedIcon, null, null, null); } @Override diff --git a/app/src/main/res/layout/item_follow.xml b/app/src/main/res/layout/item_follow.xml index fd1c935f7..899b6d376 100644 --- a/app/src/main/res/layout/item_follow.xml +++ b/app/src/main/res/layout/item_follow.xml @@ -18,6 +18,7 @@ android:layout_marginBottom="4dp" android:layout_marginTop="8dp" android:drawablePadding="10dp" + android:drawableStart="@drawable/ic_person_add_24dp" android:ellipsize="end" android:gravity="center_vertical" android:maxLines="1" diff --git a/app/src/main/res/layout/item_status.xml b/app/src/main/res/layout/item_status.xml index 252011882..61cd1ee02 100644 --- a/app/src/main/res/layout/item_status.xml +++ b/app/src/main/res/layout/item_status.xml @@ -13,6 +13,7 @@