android.app.ActionBar#show ( )源码实例Demo

下面列出了android.app.ActionBar#show ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

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();
}
 
源代码2 项目: VIA-AI   文件: ListPreferenceEx.java
@Override
protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    ActionBar bar = ((Activity)mContext).getActionBar();
    if(bar != null) bar.show();
}
 
源代码3 项目: EhViewer   文件: SystemUiHelperImplHC.java
protected void onSystemUiShown() {
    ActionBar ab = mActivity.getActionBar();
    if (ab != null) {
        ab.show();
    }

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

    setIsShowing(true);
}
 
源代码4 项目: MHViewer   文件: SystemUiHelperImplJB.java
@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);
}
 
源代码5 项目: MHViewer   文件: SystemUiHelperImplHC.java
protected void onSystemUiShown() {
    ActionBar ab = mActivity.getActionBar();
    if (ab != null) {
        ab.show();
    }

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

    setIsShowing(true);
}
 
源代码6 项目: ShareBox   文件: AndroidMediaController.java
public void setSupportActionBar( ActionBar actionBar) {
    mActionBar = actionBar;
    if (isShowing()) {
        actionBar.show();
    } else {
        actionBar.hide();
    }
}
 
@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);
}
 
源代码8 项目: starcor.xul   文件: SystemUiHiderHoneycomb.java
@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;
    }
}
 
@Override
public void run() {
    // Delayed display of UI elements
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
    mControlsView.setVisibility(View.VISIBLE);
}
 
源代码10 项目: Overchan-Android   文件: CompatibilityImpl.java
@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;
}
 
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActionBar actionBar = getActionBar();
    actionBar.show();
    actionBar.setTitle(null);
    actionBar.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
 
源代码12 项目: Dashchan   文件: ExpandedScreen.java
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();
		}
	}
}
 
源代码13 项目: AndrOBD   文件: ChartActivity.java
@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;
	}
}
 
源代码14 项目: codeexamples-android   文件: ContentFragment.java
/** 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);
}
 
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();
}
 
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();
		}

	}
}
 
源代码17 项目: turbo-editor   文件: SystemUiHelperImplJB.java
@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);
}
 
@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);
}
 
源代码19 项目: codeexamples-android   文件: ContentFragment.java
/** 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);
}
 
@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);

}