Messaging: Fix warnings about drawables and colors
* They need the theme provided now * Follow the suggestion by AS (sometimes we use ResourcesCompat, sometimes not) Change-Id: Ie3023fee13a6fc04bd4b912721ba19dcc08befba
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.android.messaging.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Path;
|
||||
@@ -32,6 +33,8 @@ import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
|
||||
import com.android.messaging.Factory;
|
||||
import com.android.messaging.R;
|
||||
import com.android.messaging.datamodel.data.MessagePartData;
|
||||
@@ -350,11 +353,13 @@ public class AudioAttachmentView extends LinearLayout {
|
||||
mChronometer.setVisibility(GONE);
|
||||
((MarginLayoutParams) mPlayPauseButton.getLayoutParams()).setMargins(0, 0, 0, 0);
|
||||
final ImageView playButton = (ImageView) findViewById(R.id.play_button);
|
||||
final Resources res = getResources();
|
||||
final Resources.Theme theme = getContext().getTheme();
|
||||
playButton.setImageDrawable(
|
||||
getResources().getDrawable(R.drawable.ic_preview_play));
|
||||
ResourcesCompat.getDrawable(res, R.drawable.ic_preview_play, theme));
|
||||
final ImageView pauseButton = (ImageView) findViewById(R.id.pause_button);
|
||||
pauseButton.setImageDrawable(
|
||||
getResources().getDrawable(R.drawable.ic_preview_pause));
|
||||
ResourcesCompat.getDrawable(res, R.drawable.ic_preview_pause, theme));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user