use of android.view.Window in project android_frameworks_base by AOSPA.
the class Activity method onPostResume.
/**
* Called when activity resume is complete (after {@link #onResume} has
* been called). Applications will generally not implement this method;
* it is intended for system classes to do final setup after application
* resume code has run.
*
* <p><em>Derived classes must call through to the super class's
* implementation of this method. If they do not, an exception will be
* thrown.</em></p>
*
* @see #onResume
*/
@CallSuper
protected void onPostResume() {
final Window win = getWindow();
if (win != null)
win.makeActive();
if (mActionBar != null)
mActionBar.setShowHideAnimationEnabled(true);
mCalled = true;
}
use of android.view.Window in project android_frameworks_base by AOSPA.
the class BrightnessDialog method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Window window = getWindow();
window.setGravity(Gravity.TOP);
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
window.requestFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.quick_settings_brightness_dialog);
final ImageView icon = (ImageView) findViewById(R.id.brightness_icon);
final ToggleSlider slider = (ToggleSlider) findViewById(R.id.brightness_slider);
mBrightnessController = new BrightnessController(this, icon, slider);
}
use of android.view.Window in project android_frameworks_base by AOSPA.
the class ActivityTransitionState method setEnterActivityOptions.
public void setEnterActivityOptions(Activity activity, ActivityOptions options) {
final Window window = activity.getWindow();
if (window == null) {
return;
}
// ensure Decor View has been created so that the window features are activated
window.getDecorView();
if (window.hasFeature(Window.FEATURE_ACTIVITY_TRANSITIONS) && options != null && mEnterActivityOptions == null && mEnterTransitionCoordinator == null && options.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) {
mEnterActivityOptions = options;
mIsEnterTriggered = false;
if (mEnterActivityOptions.isReturning()) {
restoreExitedViews();
int result = mEnterActivityOptions.getResultCode();
if (result != 0) {
activity.onActivityReenter(result, mEnterActivityOptions.getResultData());
}
}
}
}
use of android.view.Window in project android_frameworks_base by ResurrectionRemix.
the class OnTheGoDialog method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Window window = getWindow();
window.setType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY);
window.getAttributes().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
window.requestFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.quick_settings_onthego_dialog);
setCanceledOnTouchOutside(true);
final ContentResolver resolver = mContext.getContentResolver();
final SeekBar mSlider = (SeekBar) findViewById(R.id.alpha_slider);
final float value = Settings.System.getFloat(resolver, Settings.System.ON_THE_GO_ALPHA, 0.5f);
final int progress = ((int) (value * 100));
mSlider.setProgress(progress);
mSlider.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
sendAlphaBroadcast(String.valueOf(i + 10));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
removeAllOnTheGoDialogCallbacks();
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
dismissOnTheGoDialog(mOnTheGoDialogShortTimeout);
}
});
if (!OnTheGoUtils.hasFrontCamera(getContext())) {
findViewById(R.id.onthego_category_1).setVisibility(View.GONE);
} else {
final Switch mServiceToggle = (Switch) findViewById(R.id.onthego_service_toggle);
final boolean restartService = Settings.System.getInt(resolver, Settings.System.ON_THE_GO_SERVICE_RESTART, 0) == 1;
mServiceToggle.setChecked(restartService);
mServiceToggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
Settings.System.putInt(resolver, Settings.System.ON_THE_GO_SERVICE_RESTART, (b ? 1 : 0));
dismissOnTheGoDialog(mOnTheGoDialogShortTimeout);
}
});
final Switch mCamSwitch = (Switch) findViewById(R.id.onthego_camera_toggle);
final boolean useFrontCam = (Settings.System.getInt(resolver, Settings.System.ON_THE_GO_CAMERA, 0) == 1);
mCamSwitch.setChecked(useFrontCam);
mCamSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
Settings.System.putInt(resolver, Settings.System.ON_THE_GO_CAMERA, (b ? 1 : 0));
sendCameraBroadcast();
dismissOnTheGoDialog(mOnTheGoDialogShortTimeout);
}
});
}
}
use of android.view.Window in project android_frameworks_base by ResurrectionRemix.
the class DecorView method getStackId.
/**
* Returns the Id of the stack which contains this window.
* Note that if no stack can be determined - which usually means that it was not
* created for an activity - the fullscreen stack ID will be returned.
* @return Returns the stack id which contains this window.
**/
private int getStackId() {
int workspaceId = INVALID_STACK_ID;
final Window.WindowControllerCallback callback = mWindow.getWindowControllerCallback();
if (callback != null) {
try {
workspaceId = callback.getWindowStackId();
} catch (RemoteException ex) {
Log.e(mLogTag, "Failed to get the workspace ID of a PhoneWindow.");
}
}
if (workspaceId == INVALID_STACK_ID) {
return FULLSCREEN_WORKSPACE_STACK_ID;
}
return workspaceId;
}
Aggregations