android.support.v7.widget.Toolbar.getNavigationIcon()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中android.support.v7.widget.Toolbar.getNavigationIcon()方法的一些代码示例,展示了Toolbar.getNavigationIcon()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolbar.getNavigationIcon()方法的具体详情如下:
包路径:android.support.v7.widget.Toolbar
类名称:Toolbar
方法名:getNavigationIcon

Toolbar.getNavigationIcon介绍

暂无

代码示例

代码示例来源:origin: yanzhenjie/NoHttp

@Override
void setActionBar(Toolbar actionBar) {
  this.mActionBar = actionBar;
  if (mActionBar != null) {
    mActionBar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
      @Override
      public boolean onMenuItemClick(MenuItem item) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onMenuClick(item);
        }
        return true;
      }
    });
    mActionBar.setNavigationOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onHomeClick();
        }
      }
    });
    mActionBarIcon = mActionBar.getNavigationIcon();
  }
}

代码示例来源:origin: yanzhenjie/NoHttp

@Override
void setActionBar(Toolbar actionBar) {
  this.mActionBar = actionBar;
  Activity activity = getSource();
  if (mActionBar != null) {
    setTitle(activity.getTitle());
    mActionBar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
      @Override
      public boolean onMenuItemClick(MenuItem item) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onMenuClick(item);
        }
        return true;
      }
    });
    mActionBar.setNavigationOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onHomeClick();
        }
      }
    });
    mActionBarIcon = mActionBar.getNavigationIcon();
  }
}

代码示例来源:origin: zhihu/Matisse

actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
Drawable navigationIcon = toolbar.getNavigationIcon();
TypedArray ta = getTheme().obtainStyledAttributes(new int[]{R.attr.album_element_color});
int color = ta.getColor(0, 0);

代码示例来源:origin: henrichg/PhoneProfilesPlus

@Override
public Drawable getNavigationIcon() {
 return toolbar.getNavigationIcon();
}

代码示例来源:origin: ywwynm/EverythingDone

@Override
  public void run() {
    DisplayUtil.playDrawerToggleAnim((DrawerArrowDrawable) mActionbar.getNavigationIcon());
  }
}, 160);

代码示例来源:origin: OceanLabs/Android-Print-SDK

ToolbarCompatDelegate( Toolbar toolbar )
 {
 mToolbar = toolbar;
 mDefaultUpIndicator = toolbar.getNavigationIcon();
 mDefaultContentDescription = toolbar.getNavigationContentDescription();
 }

代码示例来源:origin: yanzhenjie/Kalle

@Override
void setActionBar(Toolbar actionBar) {
  this.mActionBar = actionBar;
  if (mActionBar != null) {
    mActionBar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
      @Override
      public boolean onMenuItemClick(MenuItem item) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onMenuClick(item);
        }
        return true;
      }
    });
    mActionBar.setNavigationOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onHomeClick();
        }
      }
    });
    mActionBarIcon = mActionBar.getNavigationIcon();
  }
}

代码示例来源:origin: yanzhenjie/mvp-sample

@Override
void setActionBar(Toolbar actionBar) {
  this.mActionBar = actionBar;
  if (mActionBar != null) {
    mActionBar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
      @Override
      public boolean onMenuItemClick(MenuItem item) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onMenuClick(item);
        }
        return true;
      }
    });
    mActionBar.setNavigationOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onHomeClick();
        }
      }
    });
    mActionBarIcon = mActionBar.getNavigationIcon();
  }
}

代码示例来源:origin: SmartDengg/SmartDrawing

@Override protected void setupToolBar() {
 DrawingActivity.this.setNavigationIcon(toolbar, R.drawable.ic_arrow_back);
 DrawingActivity.this.polishDrawable(toolbar.getNavigationIcon(), android.R.color.white);
}

代码示例来源:origin: vickychijwani/udacity-p1-p2-popular-movies

@Override
  public void onColorUpdate(int color) {
    mToolbar.setTitleTextColor(titleTextColor);
    tintDrawable(mToolbar.getNavigationIcon(), titleTextColor);
    tintMenuItems(mToolbar.getMenu(), titleTextColor);
  }
});

代码示例来源:origin: materialos/android-icon-pack

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_picker);
  ButterKnife.bind(this);
  toolbar.setTitle(R.string.select_icon);
  setSupportActionBar(toolbar);
  //noinspection ConstantConditions
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_action_close);
  if (toolbar.getNavigationIcon() != null) {
    toolbar.setNavigationIcon(TintUtils.createTintedDrawable(toolbar.getNavigationIcon(),
        DialogUtils.resolveColor(this, R.attr.tab_icon_color)));
  }
  getFragmentManager().beginTransaction().replace(R.id.container, IconsFragment.create(true)).commit();
}

代码示例来源:origin: yanzhenjie/Kalle

@Override
void setActionBar(Toolbar actionBar) {
  this.mActionBar = actionBar;
  Activity activity = getSource();
  if (mActionBar != null) {
    setTitle(activity.getTitle());
    mActionBar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
      @Override
      public boolean onMenuItemClick(MenuItem item) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onMenuClick(item);
        }
        return true;
      }
    });
    mActionBar.setNavigationOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onHomeClick();
        }
      }
    });
    mActionBarIcon = mActionBar.getNavigationIcon();
  }
}

代码示例来源:origin: yanzhenjie/mvp-sample

@Override
void setActionBar(Toolbar actionBar) {
  this.mActionBar = actionBar;
  Activity activity = getSource();
  if (mActionBar != null) {
    setTitle(activity.getTitle());
    mActionBar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
      @Override
      public boolean onMenuItemClick(MenuItem item) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onMenuClick(item);
        }
        return true;
      }
    });
    mActionBar.setNavigationOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (mMenuItemSelectedListener != null) {
          mMenuItemSelectedListener.onHomeClick();
        }
      }
    });
    mActionBarIcon = mActionBar.getNavigationIcon();
  }
}

代码示例来源:origin: jbruchanov/AnUitor

result.put("Menu:", view.getMenu());
result.put("NavigationContentDescription", view.getNavigationContentDescription());
result.put("NavigationIcon:", view.getNavigationIcon());
result.put("PopupTheme", IdsHelper.getNameForId(view.getPopupTheme()));
result.put("Subtitle", view.getSubtitle());

代码示例来源:origin: materialos/android-icon-pack

getSupportActionBar().setTitle(category.getName());
if (mToolbar.getNavigationIcon() != null) {
  mToolbar.setNavigationIcon(TintUtils.createTintedDrawable(mToolbar.getNavigationIcon(),
      DialogUtils.resolveColor(this, R.attr.tab_icon_color)));

代码示例来源:origin: konradrenner/kolabnotes-android

toolbar.setTitleTextColor(android.graphics.Color.WHITE);
toolbar.getNavigationIcon().clearColorFilter();
final Drawable navIcon = toolbar.getNavigationIcon().mutate();
navIcon.setColorFilter(colorFilter_Negative);
toolbar.setNavigationIcon(navIcon);

代码示例来源:origin: imLibo/FilePicker

Drawable navigationIcon = toolbar.getNavigationIcon();
TypedArray ta = getTheme().obtainStyledAttributes(new int[]{R.attr.album_element_color});
int color = ta.getColor(0, 0);

代码示例来源:origin: roomanl/AndroidDownload

Drawable navigationIcon = toolbar.getNavigationIcon();
TypedArray ta = getTheme().obtainStyledAttributes(new int[]{R.attr.album_element_color});
int color = ta.getColor(0, 0);

代码示例来源:origin: vickychijwani/udacity-p1-p2-popular-movies

tintDrawable(mToolbar.getNavigationIcon(), titleTextColor);
tintMenuItems(mToolbar.getMenu(), titleTextColor);

代码示例来源:origin: garretyoder/app-theme-engine

mOriginalNavIcon = mToolbar.getNavigationIcon();
if (mOriginalNavIcon != null)
  mToolbar.setNavigationIcon(TintHelper.createTintedDrawable(mOriginalNavIcon, tintColor));

相关文章

Toolbar类方法