Java Code Examples for android.support.v7.app.ActionBar#show()

The following examples show how to use android.support.v7.app.ActionBar#show() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ActionBarControlListViewActivity.java    From Android-ObservableScrollView with Apache License 2.0 6 votes vote down vote up
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
    ActionBar ab = getSupportActionBar();
    if (ab == null) {
        return;
    }
    if (scrollState == ScrollState.UP) {
        if (ab.isShowing()) {
            ab.hide();
        }
    } else if (scrollState == ScrollState.DOWN) {
        if (!ab.isShowing()) {
            ab.show();
        }
    }
}
 
Example 2
Source File: ActionBarControlGridViewActivity.java    From Android-ObservableScrollView with Apache License 2.0 6 votes vote down vote up
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
    ActionBar ab = getSupportActionBar();
    if (ab == null) {
        return;
    }
    if (scrollState == ScrollState.UP) {
        if (ab.isShowing()) {
            ab.hide();
        }
    } else if (scrollState == ScrollState.DOWN) {
        if (!ab.isShowing()) {
            ab.show();
        }
    }
}
 
Example 3
Source File: ScreenResponseFragment.java    From walt with Apache License 2.0 6 votes vote down vote up
private void setFullScreen(boolean enable) {
    final AppCompatActivity activity = (AppCompatActivity) getActivity();
    final ActionBar actionBar = activity != null ? activity.getSupportActionBar() : null;
    int newVisibility = 0;
    if (enable) {
        if (actionBar != null) actionBar.hide();
        buttonBarView.setVisibility(View.GONE);
        newVisibility |= View.SYSTEM_UI_FLAG_FULLSCREEN
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    } else {
        if (actionBar != null) actionBar.show();
        buttonBarView.setVisibility(View.VISIBLE);
    }
    if (activity != null) activity.getWindow().getDecorView().setSystemUiVisibility(newVisibility);
}
 
Example 4
Source File: ActionBarControlRecyclerViewActivity.java    From Android-ObservableScrollView with Apache License 2.0 6 votes vote down vote up
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
    ActionBar ab = getSupportActionBar();
    if (ab == null) {
        return;
    }
    if (scrollState == ScrollState.UP) {
        if (ab.isShowing()) {
            ab.hide();
        }
    } else if (scrollState == ScrollState.DOWN) {
        if (!ab.isShowing()) {
            ab.show();
        }
    }
}
 
Example 5
Source File: ImageActivity.java    From android-slideshow with MIT License 5 votes vote down vote up
@Override
public void run() {
	// Delayed display of UI elements
	ActionBar actionBar = getSupportActionBar();
	if (actionBar != null) {
		actionBar.show();
	}
	mControlsView.setVisibility(View.VISIBLE);
}
 
Example 6
Source File: ImageViewerActivity.java    From android-imageviewer with Apache License 2.0 5 votes vote down vote up
public void onViewTap(View view, float x, float y) {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar.isShowing()) {
        actionBar.hide();
    } else {
        actionBar.show();
    }
}
 
Example 7
Source File: VideoPlayerUtils.java    From YCVideoPlayer with Apache License 2.0 5 votes vote down vote up
@SuppressLint("RestrictedApi")
public static void showActionBar(Context context) {
    ActionBar ab = getAppCompActivity(context).getSupportActionBar();
    if (ab != null) {
        ab.setShowHideAnimationEnabled(false);
        ab.show();
    }
    scanForActivity(context).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
 
Example 8
Source File: ActionBarControlScrollViewActivity.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
    ActionBar ab = getSupportActionBar();
    if (scrollState == ScrollState.UP) {
        if (ab.isShowing()) {
            ab.hide();
        }
    } else if (scrollState == ScrollState.DOWN) {
        if (!ab.isShowing()) {
            ab.show();
        }
    }
}
 
Example 9
Source File: SettingsActivity.java    From Acastus with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set up the {@link android.app.ActionBar}, if the API is available.
 */
private void setupActionBar() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        // Show the Up button in the action bar.
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.show();
    }
}
 
Example 10
Source File: AndroidMediaController.java    From UCDMediaPlayer_Android with MIT License 5 votes vote down vote up
public void setSupportActionBar(ActionBar actionBar) {
    this.actionBar = actionBar;
    if (isShowing()) {
        actionBar.show();
    }
    else {
        actionBar.hide();
    }
}
 
Example 11
Source File: IntroActivity.java    From WhatsAppStatusSaver with Apache License 2.0 5 votes vote down vote up
@Override
public void run() {
    // Delayed display of UI elements
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
    mControlsView.setVisibility(View.VISIBLE);
}
 
Example 12
Source File: StdGameActivity.java    From Primary with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    GridLayout answerarea = findViewById(R.id.answer_area);
    LinearLayout centercol = findViewById(R.id.centercol);
    ActionBar actionBar = getSupportActionBar();
    if (isLandscape()) {

        //answerarea.setOrientation(GridLayout.VERTICAL);
        setColumnCount(answerarea,2);

        centercol.setOrientation(LinearLayout.HORIZONTAL);

        if (actionBar != null) {
            actionBar.hide();
        }
    } else {
        //answerarea.setOrientation(GridLayout.VERTICAL);


        setColumnCount(answerarea,1);

        centercol.setOrientation(LinearLayout.VERTICAL);

        if (actionBar != null) {
            actionBar.show();
        }

    }

}
 
Example 13
Source File: WebcamActivity.java    From octoandroid with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void run() {
    // Delayed display of UI elements
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
    mControlsView.setVisibility(View.VISIBLE);
}
 
Example 14
Source File: AlbumFragment.java    From meizhi with Apache License 2.0 5 votes vote down vote up
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
    ActionBar actionBar = activity.getSupportActionBar();
    if (scrollState == ScrollState.UP) {
        if (actionBar.isShowing()) {
            actionBar.hide();
        }
    } else if (scrollState == ScrollState.DOWN) {
        if (!actionBar.isShowing()) {
            actionBar.show();
        }
    }
}
 
Example 15
Source File: LED2Activity.java    From styT with Apache License 2.0 5 votes vote down vote up
@Override
public void run() {
    // Delayed display of UI elements
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
    mControlsView.setVisibility(View.VISIBLE);
}
 
Example 16
Source File: BaseActivityHelper.java    From android-base-mvp with Apache License 2.0 5 votes vote down vote up
public static void setToolbarVisibility(BaseActivity baseActivity, boolean isVisible) {
    ActionBar actionBar = baseActivity.getSupportActionBar();
    if (actionBar != null) {
        if (isVisible)
            actionBar.show();
        else
            actionBar.hide();
    }
}
 
Example 17
Source File: PhotoCropActivity.java    From Yahala-Messenger with MIT License 4 votes vote down vote up
@Override
public void applySelfActionBar() {
    if (parentActivity == null) {
        return;
    }
    ActionBar actionBar = parentActivity.getSupportActionBar();
    actionBar.show();
    FileLog.e("Crop", "applySelfActionBar");
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayHomeAsUpEnabled(false);

    actionBar.setCustomView(R.layout.settings_do_action_layout);
    Button cancelButton = (Button) actionBar.getCustomView().findViewById(R.id.cancel_button);
    cancelButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            /*finishFragment();*/
            ((LaunchActivity) parentActivity).finishFragment(false);
            finishFragment();
            getFragmentManager().popBackStack();
            ((LaunchActivity) parentActivity).updateActionBar();

        }
    });
    View doneButton = actionBar.getCustomView().findViewById(R.id.done_button);
    doneButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (delegate != null && !doneButtonPressed) {
                Bitmap bitmap = view.getBitmap();
                if (bitmap == imageToCrop) {
                    sameBitmap = true;
                }
                delegate.didFinishCrop(bitmap);
                doneButtonPressed = true;
            }
            /*finishFragment();*/
            ((LaunchActivity) parentActivity).finishFragment(false);
            finishFragment();
            getFragmentManager().popBackStack();
            ((LaunchActivity) parentActivity).updateActionBar();


        }
    });

    cancelButton.setText(LocaleController.getString("Cancel", R.string.Cancel));
    TextView textView = (TextView) doneButton.findViewById(R.id.done_button_text);
    textView.setText(LocaleController.getString("Done", R.string.Done));
    actionBar.show();
}
 
Example 18
Source File: BaseActivity.java    From trust-wallet-android-source with GNU General Public License v3.0 4 votes vote down vote up
protected void showToolbar() {
    ActionBar actionBar = getSupportActionBar();
 if (actionBar != null) {
     actionBar.show();
    }
}
 
Example 19
Source File: BaseActivity.java    From ETHWallet with GNU General Public License v3.0 4 votes vote down vote up
protected void showToolbar() {
    ActionBar actionBar = getSupportActionBar();
 if (actionBar != null) {
     actionBar.show();
    }
}
 
Example 20
Source File: ActionBarDisplayOptions.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
@Override
public void onClick(View v) {
    final ActionBar bar = getSupportActionBar();
    int flags = 0;
    switch (v.getId()) {
        case R.id.toggle_home_as_up:
            flags = ActionBar.DISPLAY_HOME_AS_UP;
            break;
        case R.id.toggle_show_home:
            flags = ActionBar.DISPLAY_SHOW_HOME;
            break;
        case R.id.toggle_use_logo:
            flags = ActionBar.DISPLAY_USE_LOGO;
            break;
        case R.id.toggle_show_title:
            flags = ActionBar.DISPLAY_SHOW_TITLE;
            break;
        case R.id.toggle_show_custom:
            flags = ActionBar.DISPLAY_SHOW_CUSTOM;
            break;
        case R.id.toggle_navigation:
            bar.setNavigationMode(
                    bar.getNavigationMode() == ActionBar.NAVIGATION_MODE_STANDARD
                            ? ActionBar.NAVIGATION_MODE_TABS
                            : ActionBar.NAVIGATION_MODE_STANDARD);
            return;
        case R.id.cycle_custom_gravity: {
            ActionBar.LayoutParams lp = mCustomViewLayoutParams;
            int newGravity = 0;
            switch (lp.gravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
                case Gravity.LEFT:
                    newGravity = Gravity.CENTER_HORIZONTAL;
                    break;
                case Gravity.CENTER_HORIZONTAL:
                    newGravity = Gravity.RIGHT;
                    break;
                case Gravity.RIGHT:
                    newGravity = Gravity.LEFT;
                    break;
            }
            lp.gravity = lp.gravity & ~Gravity.HORIZONTAL_GRAVITY_MASK | newGravity;
            bar.setCustomView(mCustomView, lp);
            return;
        }
        case R.id.toggle_visibility:
            if (bar.isShowing()) {
                bar.hide();
            } else {
                bar.show();
            }
            return;
    }

    int change = bar.getDisplayOptions() ^ flags;
    bar.setDisplayOptions(change, flags);
}