Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 package org.mozilla.gecko.widget;
3 import android.content.Context;
4 import android.util.AttributeSet;
5 import android.widget.FrameLayout;
6 import org.mozilla.gecko.R;
9 public class TabThumbnailWrapper extends FrameLayout {
10 private boolean mRecording = false;
11 private static final int[] STATE_RECORDING = { R.attr.state_recording };
13 public TabThumbnailWrapper(Context context, AttributeSet attrs, int defStyle) {
14 super(context, attrs, defStyle);
15 }
17 public TabThumbnailWrapper(Context context, AttributeSet attrs) {
18 super(context, attrs);
19 }
21 public TabThumbnailWrapper(Context context) {
22 super(context);
23 }
25 @Override
26 public int[] onCreateDrawableState(int extraSpace) {
27 final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
29 if (mRecording) {
30 mergeDrawableStates(drawableState, STATE_RECORDING);
31 }
32 return drawableState;
33 }
35 public void setRecording(boolean recording) {
36 if (mRecording != recording) {
37 mRecording = recording;
38 refreshDrawableState();
39 }
40 }
42 }