放大视图的TouchDelegate

时间:2018-12-10 15:02:21

标签: android layout android-support-library right-to-left rect

我有一个Android视图,想要将其TouchDelegate的宽度增大。

     private void expandDiscTouchArea() {
        ...

        discOsbParent.post(() -> {
          // Post in the parent's message queue to make sure the parent
          // lays out its children before we call getHitRect()
          Rect delegateArea = new Rect();
          discOsb.getHitRect(delegateArea);
          delegateArea.right += getResources().getDimensionPixelSize(R.dimen.disc_in_osb_extra_touch_area);
          TouchDelegate expandedArea = new TouchDelegate(delegateArea, discOsb);
          // give the delegate to an ancestor of the view we're delegating the area to
...
        });
      }

我看到只有一个选项可以更改touchArea right,而不能更改end

有什么方法可以将触摸区域扩展到end吗?

0 个答案:

没有答案