Example usage for android.view Window addFlags

List of usage examples for android.view Window addFlags

Introduction

In this page you can find the example usage for android.view Window addFlags.

Prototype

public void addFlags(int flags) 

Source Link

Document

Convenience function to set the flag bits as specified in flags, as per #setFlags .

Usage

From source file:org.distantshoresmedia.keyboard.LatinIME.java

private void showOptionsMenu() {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setCancelable(true);/*from w  ww . j a  v a  2s  .c  o  m*/
    builder.setIcon(R.drawable.ic_dialog_keyboard);
    builder.setNegativeButton(android.R.string.cancel, null);
    CharSequence itemSettings = getString(R.string.english_ime_settings);
    CharSequence itemInputMethod = getString(R.string.selectInputMethod);
    builder.setItems(new CharSequence[] { itemInputMethod, itemSettings },
            new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface di, int position) {
                    di.dismiss();
                    switch (position) {
                    case POS_SETTINGS:
                        launchSettings();
                        break;
                    case POS_METHOD:
                        ((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)).showInputMethodPicker();
                        break;
                    }
                }
            });
    builder.setTitle(mResources.getString(R.string.english_ime_input_options));
    mOptionsDialog = builder.create();
    Window window = mOptionsDialog.getWindow();
    WindowManager.LayoutParams lp = window.getAttributes();
    lp.token = mKeyboardSwitcher.getInputView().getWindowToken();
    lp.type = WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
    window.setAttributes(lp);
    window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
    mOptionsDialog.show();
}

From source file:com.klinker.android.launcher.launcher3.Launcher.java

/**
 * Sets up transparent navigation and status bars in LMP.
 * This method is a no-op for other platform versions.
 *//*from  ww w.  j a v a  2  s .co m*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void setupTransparentSystemBarsForLmp() {
    if (Utilities.isLmpOrAbove()) {
        Window window = getWindow();
        window.getAttributes().systemUiVisibility |= (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
                | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(Color.TRANSPARENT);
        window.setNavigationBarColor(Color.TRANSPARENT);
    }
}