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:org.thoughtcrime.securesms.conversation.ConversationActivity.java

@Override
protected void onCreate(Bundle state, boolean ready) {
    Log.i(TAG, "onCreate()");

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

    TypedArray typedArray = obtainStyledAttributes(new int[] { R.attr.conversation_background });
    int color = typedArray.getColor(0, Color.WHITE);
    typedArray.recycle();/*ww w  . ja v  a2s .c  om*/

    getWindow().getDecorView().setBackgroundColor(color);

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

    initializeReceivers();
    initializeActionBar();
    initializeViews();
    initializeResources();
    initializeLinkPreviewObserver();
    initializeSearchObserver();
    initializeSecurity(false, isDefaultSms).addListener(new AssertedSuccessListener<Boolean>() {
        @Override
        public void onSuccess(Boolean result) {
            initializeProfiles();
            initializeDraft().addListener(new AssertedSuccessListener<Boolean>() {
                @Override
                public void onSuccess(Boolean loadedDraft) {
                    if (loadedDraft != null && loadedDraft) {
                        Log.i(TAG, "Finished loading draft");
                        Util.runOnMain(() -> {
                            if (fragment != null && fragment.isResumed()) {
                                fragment.moveToLastSeen();
                            } else {
                                Log.w(TAG,
                                        "Wanted to move to the last seen position, but the fragment was in an invalid state");
                            }
                        });
                    }

                    if (TextSecurePreferences.isTypingIndicatorsEnabled(ConversationActivity.this)) {
                        composeText.addTextChangedListener(typingTextWatcher);
                    }
                    composeText.setSelection(composeText.length(), composeText.length());
                }
            });
        }
    });
}