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

x33g5p2x  于2022-01-18 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(191)

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

CardView.setOnTouchListener介绍

暂无

代码示例

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

private void stimulateFeedbackForUserTouch(final CardView cv) {
  final float density = DisplayUtil.getScreenDensity(mActivity);
  final int dp2 = (int) (density * 2);
  final int dp3 = (int) (density * 3);
  cv.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View view, MotionEvent motionEvent) {
      int action = motionEvent.getAction();
      if (action == MotionEvent.ACTION_DOWN) {
        cv.setCardElevation(dp3);
      } else if (action == MotionEvent.ACTION_UP) {
        cv.setCardElevation(dp2);
      }
      return false;
    }
  });
}

代码示例来源:origin: arthur-ghazaryan/floating-action-menu

mFabWithOptions.getMiniFabs().get(miniFabIndex).getCard().setOnTouchListener(new OnTouchListener() {
  @Override
  public boolean onTouch(View v, MotionEvent event) {

代码示例来源:origin: mjn1369/ScaleTouchListener

sb_alpha.setProgress((int) (config.getAlpha()*100));
cv_dog.setOnTouchListener(listener_dog);
tv_next.setOnTouchListener(listener_next);
fab_share.setOnTouchListener(listener_share);

相关文章