Fix crash when loading vector from typed array.

Fixes #9933
master
Alex Hart 2020-08-19 10:45:01 -03:00 committed by GitHub
parent 56392b87f7
commit b3e247e9cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package org.thoughtcrime.securesms.components;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.ImageView;
@ -36,9 +35,9 @@ public final class ConversationScrollToView extends FrameLayout {
if (attrs != null) {
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.ConversationScrollToView);
Drawable src = array.getDrawable(R.styleable.ConversationScrollToView_cstv_scroll_button_src);
int srcId = array.getResourceId(R.styleable.ConversationScrollToView_cstv_scroll_button_src, 0);
scrollButton.setImageDrawable(src);
scrollButton.setImageResource(srcId);
array.recycle();
}