当前位置: 首页>>代码示例>>Java>>正文


Java Utilities.mapCoordInSelfToDescendent方法代码示例

本文整理汇总了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;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:33,代码来源:AllAppsContainerView.java

示例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);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:7,代码来源:DragLayer.java


注:本文中的com.android.launcher3.Utilities.mapCoordInSelfToDescendent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。