From fb173c42b64070f6eed95a9129399acf8fd18eb5 Mon Sep 17 00:00:00 2001 From: Vavassor Date: Fri, 28 Jul 2017 11:54:57 -0400 Subject: [PATCH] Fixes a incompatibility-related crash when the hiding media previews option is selected and the device is API level 19 or under. --- .../java/com/keylesspalace/tusky/adapter/StatusViewHolder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 250d133c..36aaf184 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java @@ -23,6 +23,7 @@ import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; +import android.support.v7.content.res.AppCompatResources; import android.support.v7.widget.RecyclerView; import android.text.Spanned; import android.view.View; @@ -344,7 +345,7 @@ public class StatusViewHolder extends RecyclerView.ViewHolder { // Set the icon next to the label. int drawableId = getLabelIcon(attachments[0].type); - Drawable drawable = ContextCompat.getDrawable(context, drawableId); + Drawable drawable = AppCompatResources.getDrawable(context, drawableId); ThemeUtils.setDrawableTint(context, drawable, android.R.attr.textColorTertiary); mediaLabel.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);