Fix NoSuchMethodError for getTypeInfo()
Load an icon image for audio files from app resources instead because ContentResolver#getTypeInfo() is for API level >= 29. And it includes size-fit ic_photo_library_light images also. Bug: 159987488 Test: Manual Change-Id: Ie8f766f148a30e105e598e4b7e6b1b22bccda6ae Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
@@ -161,14 +161,9 @@ public class GalleryGridItemView extends FrameLayout {
|
||||
} else {
|
||||
final String contentType = mData.getContentType();
|
||||
if (ContentType.isAudioType(contentType)) {
|
||||
final Context context = getContext();
|
||||
setBackgroundColor(
|
||||
getResources().getColor(R.color.gallery_image_default_background));
|
||||
mIcon.setImageDrawable(
|
||||
context.getContentResolver()
|
||||
.getTypeInfo(contentType)
|
||||
.getIcon()
|
||||
.loadDrawable(context));
|
||||
mIcon.setImageResource(R.drawable.ic_music);
|
||||
mIcon.setColorFilter(
|
||||
ConversationDrawables.get().getConversationThemeColor(),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
|
||||
Reference in New Issue
Block a user