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

The following examples show how to use android.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: UserInfoEditActivity.java    From WeCenterMobile-Android with GNU General Public License v2.0 6 votes vote down vote up
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.user_information_edit);
	// ��ӷ��ذ�ť��ActionBar
	ActionBar actionBar = getActionBar();
	actionBar.setIcon(null);
	actionBar.setDisplayHomeAsUpEnabled(true);
	actionBar.setDisplayUseLogoEnabled(false);
	actionBar.show();
	// ��������Activity�����IJ���
	Intent intent = this.getIntent();
	Bundle bundle = intent.getExtras();
	uid = bundle.getString("uid");
	avatar_file = bundle.getString("avatar_file");
	// ͼ�ν����ʼ��
	init();
}
 
Example 2
Source File: ExpandedScreen.java    From Dashchan with Apache License 2.0 5 votes vote down vote up
private void applyShowActionBar(boolean show) {
	ActionBar actionBar = activity.getActionBar();
	if (fullScreenLayoutEnabled) {
		boolean showing = isActionBarShowing();
		ValueAnimator foregroundAnimator = ExpandedScreen.this.foregroundAnimator;
		if (foregroundAnimator != null) {
			foregroundAnimator.cancel();
		}
		if (showing != show) {
			if (toolbarView != null) {
				actionBar.show();
			}
			foregroundAnimator = ValueAnimator.ofFloat(show ? 0f : 1f, show ? 1f : 0f);
			ForegroundAnimatorListener listener = new ForegroundAnimatorListener(show);
			foregroundAnimator.setInterpolator(AnimationUtils.ACCELERATE_DECELERATE_INTERPOLATOR);
			foregroundAnimator.setDuration(ACTION_BAR_ANIMATION_TIME);
			foregroundAnimator.addListener(listener);
			foregroundAnimator.addUpdateListener(listener);
			foregroundAnimator.start();
			ExpandedScreen.this.foregroundAnimator = foregroundAnimator;
			foregroundAnimatorShow = show;
		}
	}
	if (toolbarView == null) {
		if (show) {
			actionBar.show();
		} else {
			actionBar.hide();
		}
	}
}
 
Example 3
Source File: ContentFragment.java    From codeexamples-android with Eclipse Public License 1.0 5 votes vote down vote up
/** Toggle whether the system UI (status bar / system bar) is visible.
 *  This also toggles the action bar visibility.
 * @param show True to show the system UI, false to hide it.
 */
void setSystemUiVisible(boolean show) {
    mSystemUiVisible = show;

    Window window = getActivity().getWindow();
    WindowManager.LayoutParams winParams = window.getAttributes();
    View view = getView();
    ActionBar actionBar = getActivity().getActionBar();

    if (show) {
        // Show status bar (remove fullscreen flag)
        window.setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        // Show system bar
        view.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
        // Show action bar
        actionBar.show();
    } else {
        // Add fullscreen flag (hide status bar)
        window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
        // Hide system bar
        view.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
        // Hide action bar
        actionBar.hide();
    }
    window.setAttributes(winParams);
}
 
Example 4
Source File: TopicFragmentActivity.java    From WeCenterMobile-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onCreate(savedInstanceState);
	ActionBar actionBar = getActionBar();
	actionBar.setIcon(null);
	actionBar.setDisplayHomeAsUpEnabled(true);
	actionBar.setDisplayUseLogoEnabled(false);
	actionBar.show();
	setContentView(R.layout.topic_activity);
}
 
Example 5
Source File: SystemUiHelperImplJB.java    From turbo-editor with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onSystemUiShown() {
    if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
        // Manually show the action bar when in low profile mode.
        ActionBar ab = mActivity.getActionBar();
        if (ab != null) {
            ab.show();
        }
    }

    setIsShowing(false);
}
 
Example 6
Source File: UserInfoShowActivity.java    From WeCenterMobile-Android with GNU General Public License v2.0 5 votes vote down vote up
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.user_information_show);
	LinearLayout hidePart = (LinearLayout) findViewById(R.id.llHidePart);
	hidePart.setVisibility(View.GONE);
	// ��ӷ��ذ�ť��ActionBar
	ActionBar actionBar = getActionBar();
	actionBar.setIcon(null);
	actionBar.setDisplayHomeAsUpEnabled(true);
	actionBar.setDisplayUseLogoEnabled(false);
	// actionBar.setDisplayShowHomeEnabled(true);
	actionBar.show();
	// Bundle bundle = intent.getExtras();
	// ��ȡ����activity�Ĵ�������ֵ��
	Intent intent = this.getIntent();
	uid = intent.getStringExtra("uid");
	status = intent
			.getIntExtra("status", GlobalVariables.DISAVAILABLE_EDIT);
	// �ж�UID�Dz��DZ������ѵ�¼�û�������ǿ��Ա༭�����ع�ע��ť���������ر༭��ť��ʾ��ע��ť��
	ffGetUid = new FanfanSharedPreferences(this);
	if (uid.equals(ffGetUid.getUid(""))) {
		status = GlobalVariables.AVAILABLE_EDIT;
	}
	init();// ��ʼ������
	// ��ȡ����״̬����������״̬����
	if (uid != null) {
		NetworkState networkState = new NetworkState();
		if (networkState.isNetworkConnected(UserInfoShowActivity.this)) {
			getUserInfo();
		} else {
			Toast.makeText(UserInfoShowActivity.this, "�����磬�����ú����ԣ�",
					Toast.LENGTH_LONG).show();
		}

	}
}
 
Example 7
Source File: CoreMaterialActivity.java    From MaterialDesignSupport with MIT License 5 votes vote down vote up
private void setupActionBarVisibility() {
    final ActionBar actionBar = getActionBar();
    if (actionBar == null) {
        return;
    }

    final Intent intent = getIntent();
    if (intent == null) {
        mActionBarShowing = true;
        actionBar.show();
        return;
    }

    final Bundle bundle = intent.getExtras();
    if (bundle == null) {
        mActionBarShowing = true;
        actionBar.show();
        return;
    }

    mActionBarShowing = bundle.getBoolean(ACTION_BAR_SHOWING);
    if (mActionBarShowing == null || mActionBarShowing) {
        mActionBarShowing = true;
        actionBar.show();
        return;
    }

    mActionBarShowing = false;
    actionBar.hide();
}
 
Example 8
Source File: ContentFragment.java    From codeexamples-android with Eclipse Public License 1.0 5 votes vote down vote up
/** Toggle whether the system UI (status bar / system bar) is visible.
 *  This also toggles the action bar visibility.
 * @param show True to show the system UI, false to hide it.
 */
void setSystemUiVisible(boolean show) {
    mSystemUiVisible = show;

    Window window = getActivity().getWindow();
    WindowManager.LayoutParams winParams = window.getAttributes();
    View view = getView();
    ActionBar actionBar = getActivity().getActionBar();

    if (show) {
        // Show status bar (remove fullscreen flag)
        window.setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        // Show system bar
        view.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
        // Show action bar
        actionBar.show();
    } else {
        // Add fullscreen flag (hide status bar)
        window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
        // Hide system bar
        view.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
        // Hide action bar
        actionBar.hide();
    }
    window.setAttributes(winParams);
}
 
Example 9
Source File: ChartActivity.java    From AndrOBD with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void handleMessage(Message msg)
{

	switch (msg.what)
	{
		case MainActivity.MESSAGE_UPDATE_VIEW:
			/* update chart */
			chartView.invalidate();
			break;

		// set toolbar visibility
		case MainActivity.MESSAGE_TOOLBAR_VISIBLE:
			Boolean visible = (Boolean)msg.obj;
			// set action bar visibility
			ActionBar ab = getActionBar();
			if(ab != null)
			{
				if(visible)
				{
					ab.show();
				} else
				{
					ab.hide();
				}
			}
			break;
	}
}
 
Example 10
Source File: ListPreferenceEx.java    From VIA-AI with MIT License 5 votes vote down vote up
@Override
protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    ActionBar bar = ((Activity)mContext).getActionBar();
    if(bar != null) bar.show();
}
 
Example 11
Source File: PresentationActivity.java    From MaterialDesignSupport with MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActionBar actionBar = getActionBar();
    actionBar.show();
    actionBar.setTitle(null);
    actionBar.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
 
Example 12
Source File: CompatibilityImpl.java    From Overchan-Android with GNU General Public License v3.0 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static boolean showActionBar(Activity activity) {
    ActionBar actionBar = activity.getActionBar();
    if (actionBar == null || actionBar.isShowing()) return false;
    actionBar.show();
    return true;
}
 
Example 13
Source File: DocumentScannerActivity.java    From Document-Scanner with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void run() {
    // Delayed display of UI elements
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
    mControlsView.setVisibility(View.VISIBLE);
}
 
Example 14
Source File: SystemUiHiderHoneycomb.java    From starcor.xul with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onSystemUiVisibilityChange(int vis) {
    // Test against mTestFlags to see if the system UI is visible.
    final ActionBar actionBar = mActivity.getActionBar();
    if ((vis & mTestFlags) != 0) {
        if (Build.VERSION.SDK_INT < 16) { //Build.VERSION_CODES.JELLY_BEAN) {
            // Pre-Jelly Bean, we must manually hide the action bar
            // and use the old window flags API.
            if (actionBar != null) {
                actionBar.hide();
            }
            mActivity.getWindow().setFlags(
                    WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }

        // Trigger the registered listener and cache the visibility
        // state.
        mOnVisibilityChangeListener.onVisibilityChange(false);
        mVisible = false;

    } else {
        mAnchorView.setSystemUiVisibility(mShowFlags);
        if (Build.VERSION.SDK_INT < 16) { //Build.VERSION_CODES.JELLY_BEAN) {
            // Pre-Jelly Bean, we must manually show the action bar
            // and use the old window flags API.
            if (actionBar != null) {
                actionBar.show();
            }
            mActivity.getWindow().setFlags(
                    0,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }

        // Trigger the registered listener and cache the visibility
        // state.
        mOnVisibilityChangeListener.onVisibilityChange(true);
        mVisible = true;
    }
}
 
Example 15
Source File: InterstitialActivity.java    From MaterialDesignSupport with MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActionBar actionBar = getActionBar();
    actionBar.show();
    actionBar.setTitle(null);
    actionBar.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));

    interstitialFragment = new InterstitialFragment();
    addFragment(interstitialFragment, InterstitialFragment.TAG);
}
 
Example 16
Source File: AndroidMediaController.java    From ShareBox with Apache License 2.0 5 votes vote down vote up
public void setSupportActionBar( ActionBar actionBar) {
    mActionBar = actionBar;
    if (isShowing()) {
        actionBar.show();
    } else {
        actionBar.hide();
    }
}
 
Example 17
Source File: SystemUiHelperImplHC.java    From MHViewer with Apache License 2.0 5 votes vote down vote up
protected void onSystemUiShown() {
    ActionBar ab = mActivity.getActionBar();
    if (ab != null) {
        ab.show();
    }

    mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setIsShowing(true);
}
 
Example 18
Source File: SystemUiHelperImplJB.java    From MHViewer with Apache License 2.0 5 votes vote down vote up
@Override
protected void onSystemUiShown() {
    if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
        // Manually show the action bar when in low profile mode.
        ActionBar ab = mActivity.getActionBar();
        if (ab != null) {
            ab.show();
        }
    }

    setIsShowing(true);
}
 
Example 19
Source File: SystemUiHelperImplHC.java    From EhViewer with Apache License 2.0 5 votes vote down vote up
protected void onSystemUiShown() {
    ActionBar ab = mActivity.getActionBar();
    if (ab != null) {
        ab.show();
    }

    mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setIsShowing(true);
}
 
Example 20
Source File: EssayCommentActivity.java    From WeCenterMobile-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onCreate(savedInstanceState);
	setContentView(R.layout.comment_list);

	ActionBar actionBar = getActionBar();
	actionBar.setIcon(null);
	actionBar.setTitle("��������");
	actionBar.setDisplayUseLogoEnabled(false);
	actionBar.setDisplayHomeAsUpEnabled(true);
	actionBar.show();
	Intent intent = getIntent();
	id = intent.getStringExtra("artid");
	client = new AsyncHttpClient();
	myCookieStore = new PersistentCookieStore(this);
	client.setCookieStore(myCookieStore);
	comment = (EditText) findViewById(R.id.comment);
	publish = (ImageButton) findViewById(R.id.publish);
	publish.setOnClickListener(new OnClickListener() {

		@Override
		public void onClick(View arg0) {
			// TODO Auto-generated method stub
			RequestParams params = new RequestParams();
			params.put("article_id", id);
			params.put("message", comment.getText().toString());
			params.put("at_uid", atuid);
			postcom(params);
			comment.setText("");
			refresh();
		}
	});
	comitems = new ArrayList<EssayCommentModel>();
	imageDownLoader = new ImageDownLoader(this);
	comlist = (ListView) findViewById(R.id.comlist);
	isFirstEnter = true;
	comlist.setOnItemClickListener(this);
	comlist.setOnScrollListener(this);

	Getcom(id);

}