Fixes a incompatibility-related crash when the hiding media previews option is selected and the device is API level 19 or under.

main
Vavassor 8 years ago
parent a86c8df81b
commit 4a30af43df
  1. 3
      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);

Loading…
Cancel
Save