android.widget.ImageView.setImageState()方法的使用及代码示例

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

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

ImageView.setImageState介绍

暂无

代码示例

代码示例来源:origin: north2016/T-MVP

@Override
public void initView() {
  BindingUtils.loadImg(mViewBinding.image, mArticle.image);
  setTitle(mArticle.title);
  mViewBinding.lvComment.setHeadData(mArticle);
  mPresenter.initAdapterPresenter(mViewBinding.lvComment.getPresenter(), mArticle);
  mViewBinding.appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
    boolean newAppBarExpanded = Math.abs(verticalOffset) <= 200;
    if (appBarExpanded != newAppBarExpanded) {
      appBarExpanded = newAppBarExpanded;
      invalidateOptionsMenu();
    }
  });
  mViewBinding.liked.setOnClickListener(v->{
    isChecked = !isChecked;
    final int[] stateSet = {android.R.attr.state_checked * (isChecked ? 1 : -1)};
    mViewBinding.liked.setImageState(stateSet, true);
  });
}

代码示例来源:origin: mime-mob/AndroidAdvanceAnimation

public void onTwitterClick(View view) {
  isTwitterChecked = !isTwitterChecked;
  final int[] stateSet = {android.R.attr.state_checked * (isTwitterChecked ? 1 : -1)};
  iv2.setImageState(stateSet, true);
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.rootview)
 void onClick() {
  isChecked = !isChecked;
  final int[] stateSet = {android.R.attr.state_checked * (isChecked ? 1 : -1)};
  airplaneView.setImageState(stateSet, true);
  eyeView.setImageState(stateSet, true);
  flashlightView.setImageState(stateSet, true);
  searchbackView.setImageState(stateSet, true);
  heartView.setImageState(stateSet, true);
 }
}

代码示例来源:origin: mime-mob/AndroidAdvanceAnimation

public void onSearchBoxClick(View view) {
  isSearchBoxChecked = !isSearchBoxChecked;
  final int[] stateSet = {android.R.attr.state_checked * (isSearchBoxChecked ? 1 : -1)};
  iv1.setImageState(stateSet, true);
}

代码示例来源:origin: mime-mob/AndroidAdvanceAnimation

public void onFavoriteClick(View view) {
    isFavoriteClick = !isFavoriteClick;
    final int[] stateSet = {android.R.attr.state_checked * (isFavoriteClick ? 1 : -1)};
    iv3.setImageState(stateSet, true);
  }
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.rootview)
 void onClick() {
  isChecked = !isChecked;
  final int[] stateSet = {android.R.attr.state_checked * (isChecked ? 1 : -1)};
  radioButtonView.setImageState(stateSet, true);
  checkBoxView.setImageState(stateSet, true);
  expandCollapseView.setImageState(stateSet, true);
 }
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.rootview)
 void onClick() {
  isChecked = !isChecked;
  final int[] stateSet = {android.R.attr.state_checked * (isChecked ? 1 : -1)};
  drawerView.setImageState(stateSet, true);
  crossTickView.setImageState(stateSet, true);
  plusMinusView.setImageState(stateSet, true);
  arrowoverflowView.setImageState(stateSet, true);
 }
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.rootview)
 void onClick() {
  // Decrement the countdown view by one.
  final int numStates = DIGIT_STATES.length;
  final int[] stateSet = new int[numStates];
  for (int i = 0; i < stateSet.length; i++) {
   if (i == nextDigitStateIndex) {
    stateSet[i] = DIGIT_STATES[numStates - i - 1];
   } else {
    stateSet[i] = -DIGIT_STATES[numStates - i - 1];
   }
  }
  countdownView.setImageState(stateSet, true);
  nextDigitStateIndex = (nextDigitStateIndex + 1) % numStates;
 }
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.off)
void setFingerprintOff() {
 onButton.setEnabled(true);
 offButton.setEnabled(false);
 errorButton.setEnabled(false);
 iconView.setImageState(STATE_SET_OFF, true);
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.pause)
void setPause() {
 playButton.setEnabled(true);
 pauseButton.setEnabled(false);
 stopButton.setEnabled(true);
 iconView.setImageState(STATE_SET_PAUSE, true);
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.buffalo)
void setBuffalo() {
 hippoButton.setEnabled(true);
 buffaloButton.setEnabled(false);
 elephantButton.setEnabled(true);
 iconView.setImageState(STATE_SET_BUFFALO, true);
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.play)
void setPlay() {
 playButton.setEnabled(false);
 pauseButton.setEnabled(true);
 stopButton.setEnabled(true);
 iconView.setImageState(STATE_SET_PLAY, true);
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.on)
void setFingerprintOn() {
 onButton.setEnabled(false);
 offButton.setEnabled(true);
 errorButton.setEnabled(true);
 iconView.setImageState(STATE_SET_ON, true);
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.error)
 void setFingerprintError() {
  onButton.setEnabled(true);
  offButton.setEnabled(false);
  errorButton.setEnabled(false);
  iconView.setImageState(STATE_SET_ERROR, true);
 }
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.hippo)
void setHippo() {
 hippoButton.setEnabled(false);
 buffaloButton.setEnabled(true);
 elephantButton.setEnabled(true);
 iconView.setImageState(STATE_SET_HIPPO, true);
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.elephant)
 void setElephant() {
  hippoButton.setEnabled(true);
  buffaloButton.setEnabled(true);
  elephantButton.setEnabled(false);
  iconView.setImageState(STATE_SET_ELEPHANT, true);
 }
}

代码示例来源:origin: alexjlockwood/adp-delightful-details

@OnClick(R.id.stop)
 void setStop() {
  playButton.setEnabled(true);
  pauseButton.setEnabled(true);
  stopButton.setEnabled(false);
  iconView.setImageState(STATE_SET_STOP, true);
 }
}

代码示例来源:origin: QuickBlox/ChatMessagesAdapter-android

private void setPlayStateIcon() {
  iconPlayPauseView.setActivated(false);
  iconPlayPauseView.setImageState(STATE_SET_PLAY, true);
}

代码示例来源:origin: QuickBlox/ChatMessagesAdapter-android

private void setPauseStateIcon() {
  iconPlayPauseView.setActivated(true);
  iconPlayPauseView.setImageState(STATE_SET_PAUSE, true);
}

代码示例来源:origin: QuickBlox/ChatMessagesAdapter-android

public void clickIconPlayPauseView() {
  if(iconPlayPauseView != null) {
    if (!iconPlayPauseView.isActivated()) {
      iconPlayPauseView.setImageState(STATE_SET_PAUSE, true);
      performPlayClick();
    } else {
      iconPlayPauseView.setImageState(STATE_SET_PLAY, true);
      performPauseClick();
    }
    iconPlayPauseView.setActivated(!iconPlayPauseView.isActivated());
  }
}

相关文章

ImageView类方法