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


Java ActionBar.setHomeButtonEnabled方法代码示例

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


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

示例1: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_preview_photo);

    initializeMembers();

    Bitmap bitmap = PhotoUtils.prepareBitmap(photoUri, photoImage);
    photoImage.setImageBitmap(bitmap);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setTitle(R.string.medicine_photo);
    actionBar.show();
}
 
开发者ID:lmnpWmi,项目名称:wirtualnaApteczka,代码行数:17,代码来源:PreviewPhotoActivity.java

示例2: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_container);
	ButterKnife.bind(this);
	setSupportActionBar(toolbar);

	ActionBar ab = initActionBar(getSupportActionBar(), R.string.title_activity_main);
	ab.setDisplayHomeAsUpEnabled(false);
	ab.setHomeButtonEnabled(false);

	boolean isNoBrowser = false;
	if (getIntent() != null) {
		isNoBrowser = getIntent().getBooleanExtra("no_browser", false);
	}

	Fragment fragment = MainFragment.newInstance(isNoBrowser);
	FragmentManager fragmentManager = getSupportFragmentManager();
	fragmentManager.beginTransaction()
			.replace(R.id.container, fragment)
			.commit();
}
 
开发者ID:collaction,项目名称:content-farm-blocker-android,代码行数:23,代码来源:MainActivity.java

示例3: setAllView

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
private void setAllView() {
    setContentView(R.layout.activity_edit);
    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setHomeButtonEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    editListAdapter = new EditListAdapter(this, EditWordMethod.viewExtraWordList(ExtraWordsPath));
    RecyclerView recyclerView = findViewById(R.id.list_edit);
    recyclerView.setAdapter(editListAdapter);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
}
 
开发者ID:XFY9326,项目名称:CatchSpy,代码行数:14,代码来源:EditActivity.java

示例4: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setHomeButtonEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }

    mActivity = this;
}
 
开发者ID:Jusenr,项目名称:zxing_qrcode_demo,代码行数:13,代码来源:BaseActivity.java

示例5: setAllView

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
private void setAllView() {
    setContentView(R.layout.activity_rule);
    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setHomeButtonEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    String data = IOMethod.getFromAssets(this, Config.DEFAULT_RULE_FILE_NAME);
    if (data != null) {
        ((TextView) findViewById(R.id.textview_rule)).setText(data);
    }
}
 
开发者ID:XFY9326,项目名称:CatchSpy,代码行数:14,代码来源:RuleActivity.java

示例6: onCreateView

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.dialog_book_info_read_more, container, false);

    Bundle args = getArguments();
    String title = args.getString(KEY_DIALOG_FRAGMENT_TITLE, getResources().getString(R.string.authors));
    Toolbar toolbar = rootView.findViewById(R.id.toolbar);
    toolbar.setTitle(title);

    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);

    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeButtonEnabled(true);

        Drawable drawable = getResources()
                .getDrawable(R.drawable.ic_close_white_24dp);
        drawable = DrawableCompat.wrap(drawable);
        DrawableCompat.setTint(drawable, Color.WHITE);
        actionBar.setHomeAsUpIndicator(drawable);
    }


    String body = args.getString(KEY_DIALOG_BODY, getResources().getString(R.string.authors));
    TextView bodyTextView = rootView.findViewById(R.id.more_dialog_body_text_view);
    bodyTextView.setText(body);
    setHasOptionsMenu(true);
    return rootView;
}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:32,代码来源:BookInformationMoreDialogFragment.java

示例7: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_restore);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowHomeEnabled(true);

    // address
    mAdView = (AdView) findViewById(R.id.adView1);
    mText = (TextView) findViewById(R.id.textView);
    mList = (ListView) findViewById(R.id.list1);
    mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swiperefresh1);

    // ads
    MobileAds.initialize(this, "ca-app-pub-9646303341923759~9003031985");
    AdRequest adRequest = new AdRequest.Builder().build();
    mAdView.loadAd(adRequest);

    show_list();

    mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            mSwipeRefreshLayout.setRefreshing(true);
            refreshItems();
        }
    });

}
 
开发者ID:Fast0n,项目名称:WiFiView,代码行数:33,代码来源:RestoreActivity.java

示例8: setupToolBar

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
private void setupToolBar() {

        final ActionBar actionBar = getSupportActionBar();

        if (actionBar != null) {
            actionBar.setDisplayShowTitleEnabled(false);
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setHomeButtonEnabled(true);
        }

    }
 
开发者ID:adib2149,项目名称:FormMaster,代码行数:12,代码来源:LoginFormActivity.java

示例9: createMenu

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void createMenu() {
    Toolbar toolbar = (Toolbar) mRootView.findViewById(R.id.toolbar);
    toolbar.setTitle(R.string.add_title);

    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);

    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeButtonEnabled(true);
        actionBar.setHomeAsUpIndicator(R.drawable.ic_clear_white_24dp);
    }
}
 
开发者ID:seeing-eye,项目名称:UnforgetIt,代码行数:15,代码来源:AddTaskDialogFragment.java

示例10: initToolbar

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
/**
 * Initialize the toolbar.
 */
private void initToolbar() {
    final Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeButtonEnabled(true);
    }
}
 
开发者ID:MBach,项目名称:home-automation,代码行数:13,代码来源:MainActivity.java

示例11: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActionBar actionBar=getSupportActionBar();
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);

    actionBar.setHomeAsUpIndicator(R.drawable.ic_arrow_back_black_24dp);
    actionBar.setDisplayShowHomeEnabled(true);
    setContentView(R.layout.activity_main4);
    go();
}
 
开发者ID:iamjaspreetsingh,项目名称:LifeSaver,代码行数:13,代码来源:Main4Activity.java

示例12: initActionBar

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
protected ActionBar initActionBar(ActionBar ab, int titleId, int subtitleId) {
	if (ab != null) {
		ab.setElevation(100);
		ab.setDisplayHomeAsUpEnabled(true);
		ab.setHomeButtonEnabled(true);
		ab.setTitle(titleId);

		if (subtitleId != 0) {
			ab.setSubtitle(subtitleId);
		}
	}
	return ab;
}
 
开发者ID:collaction,项目名称:freehkkai-android,代码行数:14,代码来源:BaseActivity.java

示例13: initWindow

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void initWindow() {
    super.initWindow();
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeButtonEnabled(false);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:10,代码来源:BaseBackActivity.java

示例14: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle bundle) {
	super.onCreate(bundle);

	ActionBar actionBar = getSupportActionBar();
	if (actionBar != null) {
		actionBar.setHomeButtonEnabled(true);
		actionBar.setDisplayHomeAsUpEnabled(true);
	}

	setContentView(R.layout.activity_panic_preferences);
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:13,代码来源:PanicPreferencesActivity.java

示例15: enableHomeUp

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
protected void enableHomeUp() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setHomeButtonEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}
 
开发者ID:zmeiko,项目名称:LoriApp,代码行数:8,代码来源:BaseActivity.java


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