Files
firefox/mobile/android/base/widget/TabThumbnailWrapper.java
T
Michael Comella 66e4c131c3 Bug 1187538 - Wrap tab tray thumbnails in TabThumbnailWrapper and add id. r=mhaigh
I don't have a device to screen cast to test this makes state_recording work in
*_tabs_item_cell, but following the code, the bits to turn state_recording on
or off are in place in TabsListLayout and presumably working for tabs_item_row,
so it should automatically work for tabs_item_cell, and the same bits are in
TabsGridLayout so this should presumably work for new_tablet_tabs_item_cell.

I verified the changes do not cause crashing or a difference in appearance.
2015-07-28 11:58:25 -07:00

38 lines
1016 B
Java

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