android.view.View.drawableHotspotChanged()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(188)

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

View.drawableHotspotChanged介绍

暂无

代码示例

代码示例来源:origin: jdsjlzx/LRecyclerView

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void drawableHotspotChanged(float x, float y) {
  super.drawableHotspotChanged(x, y);
  if (mIndicator != null) {
    mIndicator.setHotspot(x, y);
  }
}

代码示例来源:origin: mikepenz/AboutLibraries

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent event) {
  // Convert to view coordinates. Assumes the host view is
  // a direct child and the view is not scrollable.
  float x = event.getX() + v.getLeft();
  float y = event.getY() + v.getTop();
  final View rippleView = findRippleView(v);
  //if we were not able to find the view to display the ripple on, continue.
  if (rippleView == null) {
    return false;
  }
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    // Simulate motion on the view.
    rippleView.drawableHotspotChanged(x, y);
  }
  // Simulate pressed state on the view.
  switch (event.getActionMasked()) {
    case MotionEvent.ACTION_DOWN:
      rippleView.setPressed(true);
      break;
    case MotionEvent.ACTION_UP:
    case MotionEvent.ACTION_CANCEL:
      rippleView.setPressed(false);
      break;
  }
  // Pass all events through to the host view.
  return false;
}

代码示例来源:origin: dongjunkun/GanK

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void drawableHotspotChanged(float x, float y) {
  super.drawableHotspotChanged(x, y);
  if (mIndicator != null) {
    mIndicator.setHotspot(x, y);
  }
}

代码示例来源:origin: darkskygit/VirtualApp

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void drawableHotspotChanged(float x, float y) {
  super.drawableHotspotChanged(x, y);
  if (mIndicator != null) {
    mIndicator.setHotspot(x, y);
  }
}

代码示例来源:origin: chengzichen/KrGallery

@Override
  public boolean onTouchEvent(MotionEvent event) {
    if (Build.VERSION.SDK_INT >= 21) {
      selector.drawableHotspotChanged(event.getX(), event.getY());
    }
    return super.onTouchEvent(event);
  }
}

代码示例来源:origin: bzsome/VirtualApp-x326

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void drawableHotspotChanged(float x, float y) {
  super.drawableHotspotChanged(x, y);
  if (mIndicator != null) {
    mIndicator.setHotspot(x, y);
  }
}

代码示例来源:origin: chengzichen/KrGallery

@Override
  public boolean onTouchEvent(MotionEvent event) {
    if (Build.VERSION.SDK_INT >= 21) {
      selector.drawableHotspotChanged(event.getX(), event.getY());
    }
    return super.onTouchEvent(event);
  }
}

代码示例来源:origin: chengzichen/KrGallery

child.getBackground().setVisible(true, false);
child.drawableHotspotChanged(x, y - child.getTop());

相关文章

微信公众号

最新文章

更多

View类方法