當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。