当前位置: 首页>>代码示例>>Java>>正文


Java ActionBarActivity.getSupportActionBar方法代码示例

本文整理汇总了Java中android.support.v7.app.ActionBarActivity.getSupportActionBar方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBarActivity.getSupportActionBar方法的具体用法?Java ActionBarActivity.getSupportActionBar怎么用?Java ActionBarActivity.getSupportActionBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v7.app.ActionBarActivity的用法示例。


在下文中一共展示了ActionBarActivity.getSupportActionBar方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onUpOrCancelMotionEvent

import android.support.v7.app.ActionBarActivity; //导入方法依赖的package包/类
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
    ActionBarActivity activity = (ActionBarActivity) getActivity();
    if (activity == null) {
        return;
    }
    ActionBar ab = activity.getSupportActionBar();
    if (scrollState == ScrollState.UP) {
        if (ab.isShowing()) {
            ab.hide();
        }
    } else if (scrollState == ScrollState.DOWN) {
        if (!ab.isShowing()) {
            ab.show();
        }
    }
}
 
开发者ID:brucetoo,项目名称:Android-ObservableScrollView,代码行数:18,代码来源:FragmentActionBarControlListViewFragment.java

示例2: changeToBack

import android.support.v7.app.ActionBarActivity; //导入方法依赖的package包/类
private ToolbarWrapper changeToBack(final ViewGroup contentView) {
    final ActionBarActivity aty = (ActionBarActivity) contentView.getContext();
    ToolbarWrapper contain = (ToolbarWrapper) View.inflate(mContext, R.layout.view_toolbar, null);
    Toolbar newTb = ButterKnife.findById(contain, R.id.toolbar);
    newTb.setTag("backToolbar");
    aty.setSupportActionBar(newTb);/*替换toolBar为actionBar*/
    final ActionBar supportActionBar = aty.getSupportActionBar();
    supportActionBar.setHomeButtonEnabled(true); // 设置返回键可用
    supportActionBar.setDisplayHomeAsUpEnabled(true);
    /*supportActionBar.setHomeAsUpIndicator(R.drawable.ic_launcher);*//*设置返回键样式*/
    newTb.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            aty.finish();
        }
    });
    return contain;
}
 
开发者ID:vihuela,项目名称:Lulu,代码行数:20,代码来源:TopManager.java

示例3: showGlobalContextActionBar

import android.support.v7.app.ActionBarActivity; //导入方法依赖的package包/类
/**
 * Per the navigation drawer design guidelines, updates the action bar to show the global app
 * 'context', rather than just what's in the current screen.
 */
private void showGlobalContextActionBar() {
    ActionBarActivity actionBarActivity = (ActionBarActivity) getActivity();
    actionBarActivity.getSupportActionBar();
    actionBarActivity.getSupportActionBar().setTitle(R.string.app_name);
    ((ActionBarActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    ((ActionBarActivity) getActivity()).getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
}
 
开发者ID:championswimmer,项目名称:Bookd_Android_App,代码行数:12,代码来源:NavigationDrawerFragment.java

示例4: setActionbarTitle

import android.support.v7.app.ActionBarActivity; //导入方法依赖的package包/类
public static void setActionbarTitle(ActionBarActivity activity, Spanned title,
        String subtitle) {
    android.support.v7.app.ActionBar actionBar = activity.getSupportActionBar();
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    if(PreferencesState.getInstance().isDevelopOptionActive()) {
        actionBar.setCustomView(R.layout.dev_custom_action_bar);
        String server = PreferencesState.getInstance().getServerUrl();
        ((CustomTextView) actionBar.getCustomView().findViewById(R.id.action_bar_multititle_dev_subtitle)).setText(server);
    }else {
        actionBar.setCustomView(R.layout.custom_action_bar);
    }
    ((CustomTextView) activity.findViewById(R.id.action_bar_multititle_title)).setText(title);
    ((CustomTextView) activity.findViewById(R.id.action_bar_multititle_subtitle)).setText(subtitle);
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:16,代码来源:LayoutUtils.java

示例5: setActionbarAppName

import android.support.v7.app.ActionBarActivity; //导入方法依赖的package包/类
public static void setActionbarAppName(ActionBarActivity activity) {
    android.support.v7.app.ActionBar actionBar = activity.getSupportActionBar();
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setCustomView(R.layout.abc_action_bar_title_item);
    actionBar.setSubtitle(null);
    actionBar.setTitle(activity.getResources().getString(R.string.app_name));
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:9,代码来源:LayoutUtils.java

示例6: showGlobalContextActionBar

import android.support.v7.app.ActionBarActivity; //导入方法依赖的package包/类
/**
 * Per the navigation drawer design guidelines, updates the action bar to show the global app
 * 'context', rather than just what's in the current screen.
 */
private void showGlobalContextActionBar() {
    //ActionBar actionBar = getActionBar();
    //actionBar.setDisplayShowTitleEnabled(true);
    //actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    //actionBar.setTitle(R.string.app_name);
    Toolbar toolbar = (Toolbar) getActivity().findViewById(R.id.toolbar);
    ActionBarActivity actionBarActivity = (ActionBarActivity) getActivity();
    actionBarActivity.getSupportActionBar();
    actionBarActivity.getSupportActionBar().setTitle(R.string.app_name);
    //toolbar.setTitle(R.string.app_name);
    ((ActionBarActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    ((ActionBarActivity) getActivity()).getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
}
 
开发者ID:teamOSC,项目名称:Studddinv2_android,代码行数:18,代码来源:NavigationDrawerFragment.java

示例7: onStart

import android.support.v7.app.ActionBarActivity; //导入方法依赖的package包/类
@Override public void onStart() {
    super.onStart();
    ActionBarActivity activity = (ActionBarActivity) getActivity();
    if (activity != null) {
        ActionBar actionBar = activity.getSupportActionBar();
        final Integer titleResId = getActionBarTitle();
        if (actionBar != null && titleResId != null) {
            actionBar.setTitle(titleResId);
        }
    }
}
 
开发者ID:nikitin-da,项目名称:sticky-dictionary,代码行数:12,代码来源:BaseFragment.java

示例8: setActionBarBackButton

import android.support.v7.app.ActionBarActivity; //导入方法依赖的package包/类
public static void setActionBarBackButton(ActionBarActivity activity) {
    android.support.v7.app.ActionBar actionBar = activity.getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:5,代码来源:LayoutUtils.java


注:本文中的android.support.v7.app.ActionBarActivity.getSupportActionBar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。