mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-27 13:40:37 -10:00
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.
38 lines
1016 B
Java
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();
|
|
}
|
|
}
|
|
|
|
}
|