mobile/android/base/widget/TabThumbnailWrapper.java

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 package org.mozilla.gecko.widget;
michael@0 2
michael@0 3 import android.content.Context;
michael@0 4 import android.util.AttributeSet;
michael@0 5 import android.widget.FrameLayout;
michael@0 6 import org.mozilla.gecko.R;
michael@0 7
michael@0 8
michael@0 9 public class TabThumbnailWrapper extends FrameLayout {
michael@0 10 private boolean mRecording = false;
michael@0 11 private static final int[] STATE_RECORDING = { R.attr.state_recording };
michael@0 12
michael@0 13 public TabThumbnailWrapper(Context context, AttributeSet attrs, int defStyle) {
michael@0 14 super(context, attrs, defStyle);
michael@0 15 }
michael@0 16
michael@0 17 public TabThumbnailWrapper(Context context, AttributeSet attrs) {
michael@0 18 super(context, attrs);
michael@0 19 }
michael@0 20
michael@0 21 public TabThumbnailWrapper(Context context) {
michael@0 22 super(context);
michael@0 23 }
michael@0 24
michael@0 25 @Override
michael@0 26 public int[] onCreateDrawableState(int extraSpace) {
michael@0 27 final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
michael@0 28
michael@0 29 if (mRecording) {
michael@0 30 mergeDrawableStates(drawableState, STATE_RECORDING);
michael@0 31 }
michael@0 32 return drawableState;
michael@0 33 }
michael@0 34
michael@0 35 public void setRecording(boolean recording) {
michael@0 36 if (mRecording != recording) {
michael@0 37 mRecording = recording;
michael@0 38 refreshDrawableState();
michael@0 39 }
michael@0 40 }
michael@0 41
michael@0 42 }

mercurial