michael@0: package org.mozilla.gecko.widget; michael@0: michael@0: import android.content.Context; michael@0: import android.util.AttributeSet; michael@0: import android.widget.FrameLayout; michael@0: import org.mozilla.gecko.R; michael@0: michael@0: michael@0: public class TabThumbnailWrapper extends FrameLayout { michael@0: private boolean mRecording = false; michael@0: private static final int[] STATE_RECORDING = { R.attr.state_recording }; michael@0: michael@0: public TabThumbnailWrapper(Context context, AttributeSet attrs, int defStyle) { michael@0: super(context, attrs, defStyle); michael@0: } michael@0: michael@0: public TabThumbnailWrapper(Context context, AttributeSet attrs) { michael@0: super(context, attrs); michael@0: } michael@0: michael@0: public TabThumbnailWrapper(Context context) { michael@0: super(context); michael@0: } michael@0: michael@0: @Override michael@0: public int[] onCreateDrawableState(int extraSpace) { michael@0: final int[] drawableState = super.onCreateDrawableState(extraSpace + 1); michael@0: michael@0: if (mRecording) { michael@0: mergeDrawableStates(drawableState, STATE_RECORDING); michael@0: } michael@0: return drawableState; michael@0: } michael@0: michael@0: public void setRecording(boolean recording) { michael@0: if (mRecording != recording) { michael@0: mRecording = recording; michael@0: refreshDrawableState(); michael@0: } michael@0: } michael@0: michael@0: }