aboutsummaryrefslogtreecommitdiff
path: root/src/com/android/tv/menu/PlayControlsButton.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/tv/menu/PlayControlsButton.java')
-rw-r--r--src/com/android/tv/menu/PlayControlsButton.java24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/com/android/tv/menu/PlayControlsButton.java b/src/com/android/tv/menu/PlayControlsButton.java
index 77715f28..aff39db3 100644
--- a/src/com/android/tv/menu/PlayControlsButton.java
+++ b/src/com/android/tv/menu/PlayControlsButton.java
@@ -39,9 +39,6 @@ public class PlayControlsButton extends FrameLayout {
private final int mIconColor;
private int mIconFocusedColor;
- private int mImageResourceId;
- private int mTintColor;
-
public PlayControlsButton(Context context) {
this(context, null);
}
@@ -70,21 +67,10 @@ public class PlayControlsButton extends FrameLayout {
* Sets the resource ID of the image to be displayed in the center of this control.
*/
public void setImageResId(int imageResId) {
- int newTintColor = hasFocus() ? mIconFocusedColor : mIconColor;
- if (mImageResourceId != imageResId) {
- mImageResourceId = imageResId;
- mIcon.setImageResource(imageResId);
- updateTint(newTintColor);
- } else if (newTintColor != mTintColor) {
- updateTint(newTintColor);
- }
- }
-
- private void updateTint(int tintColor) {
- mTintColor = tintColor;
- // Since on focus changing, icons' color should be switched with animation,
+ mIcon.setImageResource(imageResId);
+ // Since on foucus changing, icons' color should be switched with animation,
// as a result, selectors cannot be used to switch colors in this case.
- mIcon.getDrawable().setTint(tintColor);
+ mIcon.getDrawable().setTint(hasFocus() ? mIconFocusedColor : mIconColor);
}
/**
@@ -131,9 +117,7 @@ public class PlayControlsButton extends FrameLayout {
} else {
mIcon.setVisibility(View.GONE);
mLabel.setVisibility(View.VISIBLE);
- if (!TextUtils.equals(mLabel.getText(), label)) {
- mLabel.setText(label);
- }
+ mLabel.setText(label);
}
}