Example usage for android.support.v4.view WindowCompat FEATURE_ACTION_BAR_OVERLAY

List of usage examples for android.support.v4.view WindowCompat FEATURE_ACTION_BAR_OVERLAY

Introduction

In this page you can find the example usage for android.support.v4.view WindowCompat FEATURE_ACTION_BAR_OVERLAY.

Prototype

int FEATURE_ACTION_BAR_OVERLAY

To view the source code for android.support.v4.view WindowCompat FEATURE_ACTION_BAR_OVERLAY.

Click Source Link

Usage

From source file:com.example.android.supportv7.app.ActionBarHideOnScroll.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Hide on content scroll requires an overlay action bar, so request one
    supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);

    setContentView(R.layout.action_bar_hide_scroll);

    // Enable hide on scroll
    getSupportActionBar().setHideOnContentScrollEnabled(true);
}

From source file:jp.maju.wifiserver.camera.QRReaderActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTheme(R.style.Theme_AppCompat);/*from  w  w  w.j  a v  a 2  s.c o  m*/

    requestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);

    setContentView(R.layout.activity_qr_reader);

    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

From source file:android.support.v7.app.ActionBarActivityDelegateICS.java

@Override
public void onCreate(Bundle savedInstanceState) {
    // Set framework uiOptions from the support metadata value
    if (UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW.equals(getUiOptionsFromMetadata())) {
        mActivity.getWindow().setUiOptions(ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW,
                ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);
    }/*from  w  w w .  j a va2  s.c om*/

    super.onCreate(savedInstanceState);

    if (mHasActionBar) {
        // If action bar is requested by inheriting from the appcompat theme,
        // the system will not know about that. So explicitly request for an action bar.
        mActivity.requestWindowFeature(WindowCompat.FEATURE_ACTION_BAR);
    }
    if (mOverlayActionBar) {
        mActivity.requestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
    }

    /*
     * This goofy move needs some explanation.
     *
     * The verifier on older platform versions has some interesting side effects if
     * a class defines a method that takes a parameter of a type that doesn't exist.
     * In this case, that type is android.view.ActionMode. Therefore, ActionBarActivity
     * cannot override the onActionModeStarted/Finished methods without causing nastiness
     * when it is loaded on older platform versions.
     *
     * Since these methods are actually part of the window callback and not intrinsic to
     * Activity itself, we can install a little shim with the window instead that knows
     * about the ActionMode class. Note that this means that any new methods added to
     * Window.Callback in the future won't get proxied without updating the support lib,
     * but we shouldn't be adding new methods to public interfaces that way anyway...right? ;)
     */
    final Window w = mActivity.getWindow();
    w.setCallback(createWindowCallbackWrapper(w.getCallback()));
}

From source file:com.zandbee.floatingtitlebar.FloatingTitleBarActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    getWindow().requestFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
    super.onCreate(savedInstanceState);

    final View root = getLayoutInflater().inflate(R.layout.activity_floating_title_bar, null);
    setContentView(root);/*from www  .ja v a  2s  .  c  o  m*/

    scrollView = (ObservableScrollView) root.findViewById(R.id.floating_scroll);
    scrollView.addCallbacks(this);

    imageView = (ImageView) root.findViewById(R.id.floating_img);

    bodyLayout = (LinearLayout) root.findViewById(R.id.body_layout);
    bodyTextView = (TextView) root.findViewById(R.id.test_text);

    quasiFab = (ImageButton) root.findViewById(R.id.join_group_button);
    quasiFab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(getApplicationContext(), "I do nothing", Toast.LENGTH_SHORT).show();
        }
    });

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    titleLayout = (FrameLayout) findViewById(R.id.title_layout);
    titleView = (TextView) findViewById(R.id.floating_title_bar_text);
    titleBackground = findViewById(R.id.title_background_view);

    statusBarHeight = getStatusBarHeight();
}

From source file:org.mariotaku.twidere.activity.support.BaseDialogWhenLargeActivity.java

private void setupWindow() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        getWindow().addFlags(LayoutParams.FLAG_TRANSLUCENT_STATUS);
    }// w w  w.  j a  v a  2s . c o  m
    supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR);
    supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
    supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_MODE_OVERLAY);
}

From source file:tv.acfun.a63.CommentsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
    super.onCreate(savedInstanceState);
    aid = getIntent().getIntExtra("aid", 0);
    if (aid == 0)
        return;//  w w w .  ja v a 2 s.  c om
    setContentView(R.layout.activity_comments);
    MobclickAgent.onEvent(this, "view_comment", "ac" + aid);
    ActionBar ab = getSupportActionBar();

    ab.setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_bg_trans));
    mKeyboard = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    ActionBarUtil.setXiaomiFilterDisplayOptions(ab, false);
    ab.setTitle("ac" + aid + " / ");
    initCommentsBar();
    initList();
    requestData(1, true);
    handleKeyboardStatus();
}

From source file:org.getlantern.firetweet.activity.support.LinkHandlerActivity.java

private void requestWindowFeatures(Window window, int linkId, Uri uri) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        window.addFlags(LayoutParams.FLAG_TRANSLUCENT_STATUS);
    }//from   w w w. j  a  v  a 2 s  .c o m
    supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
    supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_MODE_OVERLAY);
    final int transitionRes;
    switch (linkId) {
    case LINK_ID_USER: {
        transitionRes = R.transition.transition_user;
        break;
    }
    //            case LINK_ID_STATUS: {
    //                transitionRes = R.transition.transition_status;
    //                break;
    //            }
    default: {
        transitionRes = 0;
        break;
    }
    }
    if (transitionRes != 0 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
            && !ThemeUtils.isTransparentBackground(this)) {
        Utils.setSharedElementTransition(this, window, transitionRes);
    }
}

From source file:android.support.v7.app.ActionBarActivityDelegateBase.java

@Override
public boolean supportRequestWindowFeature(int featureId) {
    switch (featureId) {
    case WindowCompat.FEATURE_ACTION_BAR:
        mHasActionBar = true;/*ww  w  .  ja va 2  s .c  o  m*/
        return true;
    case WindowCompat.FEATURE_ACTION_BAR_OVERLAY:
        mOverlayActionBar = true;
        return true;
    case Window.FEATURE_PROGRESS:
        mFeatureProgress = true;
        return true;
    case Window.FEATURE_INDETERMINATE_PROGRESS:
        mFeatureIndeterminateProgress = true;
        return true;
    default:
        return mActivity.requestWindowFeature(featureId);
    }
}

From source file:com.tingtingapps.securesms.ConversationActivity.java

@Override
protected void onCreate(Bundle state, @NonNull MasterSecret masterSecret) {
    this.masterSecret = masterSecret;

    supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
    setContentView(R.layout.conversation_activity);

    fragment = initFragment(R.id.fragment_content, new ConversationFragment(), masterSecret,
            dynamicLanguage.getCurrentLocale());

    initializeReceivers();//w ww.  j a va2 s.c  om
    initializeActionBar();
    initializeViews();
    initializeResources();
    initializeDraft();
}

From source file:org.smssecure.smssecure.ConversationActivity.java

@Override
protected void onCreate(Bundle state, @NonNull MasterSecret masterSecret) {
    Log.w(TAG, "onCreate()");
    this.masterSecret = masterSecret;

    supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
    setContentView(R.layout.conversation_activity);

    fragment = initFragment(R.id.fragment_content, new ConversationFragment(), masterSecret,
            dynamicLanguage.getCurrentLocale());

    initializeReceivers();/*from   w w w . ja va  2  s.com*/
    initializeActionBar();
    initializeViews();
    initializeResources();
    initializeSecurity();
    updateRecipientPreferences();
    initializeDraft();
}