本文整理汇总了Java中android.support.v7.widget.Toolbar.setOverflowIcon方法的典型用法代码示例。如果您正苦于以下问题:Java Toolbar.setOverflowIcon方法的具体用法?Java Toolbar.setOverflowIcon怎么用?Java Toolbar.setOverflowIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.Toolbar
的用法示例。
在下文中一共展示了Toolbar.setOverflowIcon方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initToolbar
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
protected void initToolbar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setTitle("AndroidSkin");
toolbar.setSubtitle("Welcome to AndroidSkin");
toolbar.setNavigationIcon(R.drawable.apk_all_bottomfind);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, SkinSelectActivity.class));
}
});
toolbar.setOverflowIcon(getResources().getDrawable(R.drawable.apk_all_bottomfind));
}
示例2: initToolBar
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
private void initToolBar(Toolbar toolbarDoubanDetail, String title) {
setSupportActionBar(toolbarDoubanDetail);
toolbarDoubanDetail.setTitle(title);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默认Title显示
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.mipmap.icon_back);
}
toolbarDoubanDetail.setTitleTextColor(Color.WHITE);
toolbarDoubanDetail.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onBackPressed();
}
});
toolbarDoubanDetail.setTitleTextAppearance(this, R.style.ToolBar_Title);
toolbarDoubanDetail.setSubtitleTextAppearance(this, R.style.Toolbar_SubTitle);
toolbarDoubanDetail.inflateMenu(R.menu.base_header_menu);
toolbarDoubanDetail.setOverflowIcon(getDrawable(R.mipmap.actionbar_more));
toolbarDoubanDetail.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.actionbar_more:// 更多信息
setTitleClickMore();
break;
}
return true;
}
});
}
示例3: initToolbar
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
protected void initToolbar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setTitle("Title");
toolbar.setSubtitle("Subtitle");
toolbar.setNavigationIcon(R.drawable.ic_settings_black_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(BaseActivity.this, SettingsActivity.class));
}
});
toolbar.setOverflowIcon(getResources().getDrawable(R.drawable.ic_camera_24dp));
}
示例4: colorToolbarOverflowMenuIcon
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
public static void colorToolbarOverflowMenuIcon(Toolbar toolbar, int color) {
//set Toolbar overflow icon color
Drawable drawable = toolbar.getOverflowIcon();
if (drawable != null) {
drawable = DrawableCompat.wrap(drawable);
DrawableCompat.setTint(drawable.mutate(), color);
toolbar.setOverflowIcon(drawable);
}
}
示例5: initTitle
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
private void initTitle() {
StatusBarUtil.setColor(this, CommonUtils.getColor(R.color.colorTheme), 0);
mProgressBar = (ProgressBar) findViewById(R.id.pb_progress);
webView = (WebView) findViewById(R.id.webview_detail);
videoFullView = (FrameLayout) findViewById(R.id.video_fullView);
mTitleToolBar = (Toolbar) findViewById(R.id.title_tool_bar);
setSupportActionBar(mTitleToolBar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默认Title显示
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.drawable.icon_back);
}
setTitle(mTitle);
mTitleToolBar.setOverflowIcon(ContextCompat.getDrawable(this, R.drawable.actionbar_more));
mTitleToolBar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mTitleToolBar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.actionbar_share:// 分享到
String shareText = mWebChromeClient.getTitle() + mUrl + "(分享自云阅)";
ShareUtils.share(WebViewActivity.this, shareText);
break;
case R.id.actionbar_cope:// 复制链接
BaseTools.copy(mUrl);
ToastUtil.showToast("复制成功");
break;
case R.id.actionbar_open:// 打开链接
BaseTools.openLink(WebViewActivity.this, mUrl);
break;
}
return false;
}
});
}
示例6: initTitle
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
private void initTitle() {
StatusBarUtil.setColor(this, CommonUtils.getColor(R.color.colorTheme), 0);
mProgressBar = (ProgressBar) findViewById(R.id.pb_progress);
webView = (WebView) findViewById(R.id.webview_detail);
videoFullView = (FrameLayout) findViewById(R.id.video_fullView);
mTitleToolBar = (Toolbar) findViewById(R.id.title_tool_bar);
setSupportActionBar(mTitleToolBar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默认Title显示
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.mipmap.icon_back);
}
setTitle(mTitle);
mTitleToolBar.setOverflowIcon(ContextCompat.getDrawable(this, R.mipmap.actionbar_more));
mTitleToolBar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mTitleToolBar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.actionbar_share:// 分享到
String shareText = mWebChromeClient.getTitle() + mUrl + "(分享自"+R.string.app_name+")";
ShareUtils.share(WebViewActivity.this, shareText);
break;
case R.id.actionbar_cope:// 复制链接
BaseTools.copy(mUrl);
ToastUtils.showShortToast("复制成功");
break;
case R.id.actionbar_open:// 打开链接
BaseTools.openLink(WebViewActivity.this, mUrl);
break;
}
return false;
}
});
}