本文整理汇总了Java中com.android.launcher3.Utilities.mapCoordInSelfToDescendent方法的典型用法代码示例。如果您正苦于以下问题:Java Utilities.mapCoordInSelfToDescendent方法的具体用法?Java Utilities.mapCoordInSelfToDescendent怎么用?Java Utilities.mapCoordInSelfToDescendent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.launcher3.Utilities
的用法示例。
在下文中一共展示了Utilities.mapCoordInSelfToDescendent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldContainerScroll
import com.android.launcher3.Utilities; //导入方法依赖的package包/类
/**
* Returns whether the view itself will handle the touch event or not.
*/
public boolean shouldContainerScroll(MotionEvent ev) {
int[] point = new int[2];
point[0] = (int) ev.getX();
point[1] = (int) ev.getY();
Utilities.mapCoordInSelfToDescendent(mAppsRecyclerView, this, point);
// IF the MotionEvent is inside the search box, and the container keeps on receiving
// touch input, container should move down.
if (mLauncher.getDragLayer().isEventOverView(mSearchContainer, ev)) {
return true;
}
// IF the MotionEvent is inside the thumb, container should not be pulled down.
if (mAppsRecyclerView.getScrollBar().isNearThumb(point[0], point[1])) {
return false;
}
// IF a shortcuts container is open, container should not be pulled down.
if (mLauncher.getOpenShortcutsContainer() != null) {
return false;
}
// IF scroller is at the very top OR there is no scroll bar because there is probably not
// enough items to scroll, THEN it's okay for the container to be pulled down.
if (mAppsRecyclerView.getScrollBar().getThumbOffset().y <= 0) {
return true;
}
return false;
}
示例2: mapCoordInSelfToDescendent
import com.android.launcher3.Utilities; //导入方法依赖的package包/类
/**
* Inverse of {@link #getDescendantCoordRelativeToSelf(View, int[])}.
*/
public float mapCoordInSelfToDescendent(View descendant, int[] coord) {
return Utilities.mapCoordInSelfToDescendent(descendant, this, coord);
}