android.widget.ImageButton.setImageTintList()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(157)

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

ImageButton.setImageTintList介绍

暂无

代码示例

代码示例来源:origin: codekidX/storage-chooser

mBackButton.setImageTintList(ColorStateList.valueOf(scheme[Theme.SEC_ADDRESS_TINT_INDEX]));

代码示例来源:origin: gateship-one/odyssey

case REPEAT_OFF:
  mBottomRepeatButton.setImageResource(R.drawable.ic_repeat_24dp);
  mBottomRepeatButton.setImageTintList(ColorStateList.valueOf(ThemeUtils.getThemeColor(getContext(), R.attr.odyssey_color_text_accent)));
  break;
case REPEAT_ALL:
  mBottomRepeatButton.setImageResource(R.drawable.ic_repeat_24dp);
  mBottomRepeatButton.setImageTintList(ColorStateList.valueOf(ThemeUtils.getThemeColor(getContext(), android.R.attr.colorAccent)));
  break;
case REPEAT_TRACK:
  mBottomRepeatButton.setImageResource(R.drawable.ic_repeat_one_24dp);
  mBottomRepeatButton.setImageTintList(ColorStateList.valueOf(ThemeUtils.getThemeColor(getContext(), android.R.attr.colorAccent)));
  break;
  mBottomRandomButton.setImageTintList(ColorStateList.valueOf(ThemeUtils.getThemeColor(getContext(), R.attr.odyssey_color_text_accent)));
  break;
case RANDOM_ON:
  mBottomRandomButton.setImageTintList(ColorStateList.valueOf(ThemeUtils.getThemeColor(getContext(), android.R.attr.colorAccent)));
  break;

代码示例来源:origin: gateship-one/odyssey

/**
 * Set the viewswitcher of cover/playlist view to the requested state.
 *
 * @param view the view which should be displayed.
 */
public void setViewSwitcherStatus(NowPlayingDragStatusReceiver.VIEW_SWITCHER_STATUS view) {
  int color = 0;
  switch (view) {
    case COVER_VIEW:
      // change the view only if the requested view is not displayed
      if (mViewSwitcher.getCurrentView() != mCoverImage) {
        mViewSwitcher.showNext();
      }
      color = ThemeUtils.getThemeColor(getContext(), R.attr.odyssey_color_text_accent);
      TooltipCompat.setTooltipText(mTopPlaylistButton, getResources().getString(R.string.action_npv_show_playlist));
      break;
    case PLAYLIST_VIEW:
      // change the view only if the requested view is not displayed
      if (mViewSwitcher.getCurrentView() != mPlaylistView) {
        mViewSwitcher.showNext();
      }
      color = ThemeUtils.getThemeColor(getContext(), R.attr.colorAccent);
      TooltipCompat.setTooltipText(mTopPlaylistButton, getResources().getString(R.string.action_npv_show_cover));
      break;
  }
  // tint the button according to the requested view
  mTopPlaylistButton.setImageTintList(ColorStateList.valueOf(color));
}

相关文章

ImageButton类方法