mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
7b7954aa61
--HG-- rename : mobile/android/base/resources/drawable/address_bar_back_button.xml => mobile/android/base/resources/drawable/address_bar_nav_button.xml.in extra : rebase_source : 402a8d8202172a3480b8a10bd1e36ba107b9340b
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
package org.mozilla.gecko;
|
|
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
import android.widget.@VIEWTYPE@;
|
|
|
|
public class Gecko@VIEWTYPE@ extends @VIEWTYPE@ {
|
|
private static final int[] STATE_PRIVATE_MODE = { R.attr.state_private };
|
|
|
|
private boolean mIsPrivate = false;
|
|
|
|
public Gecko@VIEWTYPE@(Context context, AttributeSet attrs) {
|
|
super(context, attrs);
|
|
}
|
|
|
|
@Override
|
|
public int[] onCreateDrawableState(int extraSpace) {
|
|
final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
|
|
|
|
if (mIsPrivate)
|
|
mergeDrawableStates(drawableState, STATE_PRIVATE_MODE);
|
|
|
|
return drawableState;
|
|
}
|
|
|
|
public boolean isPrivateMode() {
|
|
return mIsPrivate;
|
|
}
|
|
|
|
public void setPrivateMode(boolean isPrivate) {
|
|
if (mIsPrivate != isPrivate) {
|
|
mIsPrivate = isPrivate;
|
|
refreshDrawableState();
|
|
}
|
|
}
|
|
}
|