Java Code Examples for android.support.v7.widget.Toolbar#setOverflowIcon()

The following examples show how to use android.support.v7.widget.Toolbar#setOverflowIcon() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ByWebViewActivity.java    From ByWebView with Apache License 2.0 6 votes vote down vote up
private void initToolBar() {
    // 可滚动的title 使用简单 没有渐变效果,文字两旁有阴影
    Toolbar mTitleToolBar = findViewById(R.id.title_tool_bar);
    tvGunTitle = findViewById(R.id.tv_gun_title);
    setSupportActionBar(mTitleToolBar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        //去除默认Title显示
        actionBar.setDisplayShowTitleEnabled(false);
    }
    mTitleToolBar.setOverflowIcon(ContextCompat.getDrawable(this, R.drawable.actionbar_more));
    tvGunTitle.postDelayed(new Runnable() {
        @Override
        public void run() {
            tvGunTitle.setSelected(true);
        }
    }, 1900);
    tvGunTitle.setText(mTitle);
}
 
Example 2
Source File: MainActivity.java    From Android-Skin with MIT License 5 votes vote down vote up
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));
}
 
Example 3
Source File: BaseActivity.java    From Android-skin-support with MIT License 5 votes vote down vote up
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));
}
 
Example 4
Source File: Util.java    From RetroMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public static void setOverflowButtonColor(final Toolbar toolbar, final int color) {
    Drawable drawable = toolbar.getOverflowIcon();
    if (drawable != null) {
        drawable = DrawableCompat.wrap(drawable);
        DrawableCompat.setTint(drawable.mutate(), color);
        toolbar.setOverflowIcon(drawable);
    }
}
 
Example 5
Source File: Util.java    From Camera-Roll-Android-App with Apache License 2.0 5 votes vote down vote up
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);
    }
}
 
Example 6
Source File: MainActivity.java    From explorer with Apache License 2.0 3 votes vote down vote up
private void initAppBarLayout() {

        toolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar_layout);

        toolbar = (Toolbar) findViewById(R.id.toolbar);

        toolbar.setOverflowIcon(ContextCompat.getDrawable(this, R.drawable.ic_more));

        setSupportActionBar(toolbar);
    }