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

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

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

ImageView.setPressed介绍

暂无

代码示例

代码示例来源:origin: googlesamples/android-MediaBrowserService

@Override
public void onPlaybackStateChanged(PlaybackStateCompat playbackState) {
  mIsPlaying = playbackState != null &&
      playbackState.getState() == PlaybackStateCompat.STATE_PLAYING;
  mMediaControlsImage.setPressed(mIsPlaying);
}

代码示例来源:origin: skydoves/ColorPickerView

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
  if (colorPickerView != null) {
    switch (event.getActionMasked()) {
      case MotionEvent.ACTION_UP:
        selector.setPressed(true);
        onTouchReceived(event);
        return true;
      case MotionEvent.ACTION_DOWN:
      case MotionEvent.ACTION_MOVE:
        selector.setPressed(true);
        onTouchReceived(event);
        return true;
      default:
        selector.setPressed(false);
        return false;
    }
  } else return false;
}

代码示例来源:origin: skydoves/ColorPickerPreference

@SuppressLint("ClickableViewAccessibility")
 @Override
 public boolean onTouch(View v, MotionEvent event) {
  switch (event.getAction()) {
   case MotionEvent.ACTION_DOWN:
    if (flagView != null && flagMode == FlagMode.LAST) flagView.gone();
    selector.setPressed(true);
    return onTouchReceived(event);
   case MotionEvent.ACTION_MOVE:
    if (flagView != null && flagMode == FlagMode.LAST) flagView.gone();
    selector.setPressed(true);
    return onTouchReceived(event);
   case MotionEvent.ACTION_UP:
    if (flagView != null && flagMode == FlagMode.LAST) flagView.visible();
    selector.setPressed(true);
    return onTouchReceived(event);
   default:
    selector.setPressed(false);
    return false;
  }
 }
});

代码示例来源:origin: stackoverflow.com

public boolean onTouch(View v, MotionEvent event)
 {
   TextView text = (TextView) findViewById(R.id.textview);
   ImageView image = (ImageView) findViewById(R.id.imageview);
   RelativeLayout layout = (RelativeLayout) findViewById(R.id.relativelayout);
   if (event.getAction() == android.view.MotionEvent.ACTION_DOWN)
   {
     layout.setBackgroundResource(R.color.background_pressed);
     text.setPressed(true);
     image.setPressed(true);
   } else if (event.getAction() == android.view.MotionEvent.ACTION_UP)
   {
     layout.setBackgroundResource(R._background);
     text.setPressed(false);
     image.setPressed(false);
   }
   return false;
 }

代码示例来源:origin: AriesHoo/UIWidget

@Override
public void setPressed(boolean pressed) {
  super.setPressed(pressed);
  delegate.getAlphaViewHelper().onPressedChanged(this, pressed);
}

代码示例来源:origin: skydoves/ColorPickerView

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
  switch (event.getActionMasked()) {
    case MotionEvent.ACTION_DOWN:
      if (flagView != null && flagView.getFlagMode() == FlagMode.LAST) flagView.gone();
      selector.setPressed(true);
      return onTouchReceived(event);
    case MotionEvent.ACTION_MOVE:
      if (flagView != null && flagView.getFlagMode() == FlagMode.LAST) flagView.gone();
      selector.setPressed(true);
      return onTouchReceived(event);
    case MotionEvent.ACTION_UP:
      if (flagView != null && flagView.getFlagMode() == FlagMode.LAST) flagView.visible();
      selector.setPressed(true);
      return onTouchReceived(event);
    default:
      selector.setPressed(false);
      return false;
  }
}

代码示例来源:origin: com.albedinsky.android/ui-widget-image

/**
 */
@Override
public void setPressed(boolean pressed) {
  final boolean isPressed = isPressed();
  super.setPressed(pressed);
  if (!isPressed && pressed) onPressed();
  else if (isPressed) onReleased();
}

代码示例来源:origin: com.albedinsky.android/ui

/**
 */
@Override
public void setPressed(boolean pressed) {
  final boolean isPressed = isPressed();
  super.setPressed(pressed);
  if (!isPressed && pressed) onPressed();
  else if (isPressed) onReleased();
}

代码示例来源:origin: com.albedinsky.android/ui-widget-common

/**
 */
@Override
public void setPressed(boolean pressed) {
  final boolean isPressed = isPressed();
  super.setPressed(pressed);
  if (!isPressed && pressed) onPressed();
  else if (isPressed) onReleased();
}

代码示例来源:origin: fire3/sailorcast

@Override
  public void onClick(View v) {
    mVideoClose.requestFocus();
    mVideoClose.setPressed(true);
    mVideoTitle.requestFocus();
    mVideoTitle.setPressed(true);
    finish();
  }
});

代码示例来源:origin: guardianproject/Ripple

switch (event.getAction() & MotionEvent.ACTION_MASK) {
  case MotionEvent.ACTION_DOWN:
    mPanicSwipeButton.setPressed(true);
    mPanicSwipeButton.setPressed(false);
    mRipples.setSize(0);
    mRipples.invalidate();

相关文章

ImageView类方法