Search in sources :

Example 1 with StackScrollerDecorView

use of com.android.systemui.statusbar.StackScrollerDecorView in project platform_frameworks_base by android.

the class NotificationStackScrollLayout method getChildAtPosition.

@Override
public ExpandableView getChildAtPosition(float touchX, float touchY) {
    // find the view under the pointer, accounting for GONE views
    final int count = getChildCount();
    for (int childIdx = 0; childIdx < count; childIdx++) {
        ExpandableView slidingChild = (ExpandableView) getChildAt(childIdx);
        if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView) {
            continue;
        }
        float childTop = slidingChild.getTranslationY();
        float top = childTop + slidingChild.getClipTopAmount();
        float bottom = childTop + slidingChild.getActualHeight();
        // Allow the full width of this view to prevent gesture conflict on Keyguard (phone and
        // camera affordance).
        int left = 0;
        int right = getWidth();
        if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
            if (slidingChild instanceof ExpandableNotificationRow) {
                ExpandableNotificationRow row = (ExpandableNotificationRow) slidingChild;
                if (!mIsExpanded && row.isHeadsUp() && row.isPinned() && mHeadsUpManager.getTopEntry().entry.row != row && mGroupManager.getGroupSummary(mHeadsUpManager.getTopEntry().entry.row.getStatusBarNotification()) != row) {
                    continue;
                }
                return row.getViewAtPosition(touchY - childTop);
            }
            return slidingChild;
        }
    }
    return null;
}
Also used : StackScrollerDecorView(com.android.systemui.statusbar.StackScrollerDecorView) ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 2 with StackScrollerDecorView

use of com.android.systemui.statusbar.StackScrollerDecorView in project android_frameworks_base by DirtyUnicorns.

the class NotificationStackScrollLayout method getClosestChildAtRawPosition.

public ExpandableView getClosestChildAtRawPosition(float touchX, float touchY) {
    getLocationOnScreen(mTempInt2);
    float localTouchY = touchY - mTempInt2[1];
    ExpandableView closestChild = null;
    float minDist = Float.MAX_VALUE;
    // find the view closest to the location, accounting for GONE views
    final int count = getChildCount();
    for (int childIdx = 0; childIdx < count; childIdx++) {
        ExpandableView slidingChild = (ExpandableView) getChildAt(childIdx);
        if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView) {
            continue;
        }
        float childTop = slidingChild.getTranslationY();
        float top = childTop + slidingChild.getClipTopAmount();
        float bottom = childTop + slidingChild.getActualHeight();
        float dist = Math.min(Math.abs(top - localTouchY), Math.abs(bottom - localTouchY));
        if (dist < minDist) {
            closestChild = slidingChild;
            minDist = dist;
        }
    }
    return closestChild;
}
Also used : StackScrollerDecorView(com.android.systemui.statusbar.StackScrollerDecorView) ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint)

Example 3 with StackScrollerDecorView

use of com.android.systemui.statusbar.StackScrollerDecorView in project android_frameworks_base by crdroidandroid.

the class NotificationStackScrollLayout method getClosestChildAtRawPosition.

public ExpandableView getClosestChildAtRawPosition(float touchX, float touchY) {
    getLocationOnScreen(mTempInt2);
    float localTouchY = touchY - mTempInt2[1];
    ExpandableView closestChild = null;
    float minDist = Float.MAX_VALUE;
    // find the view closest to the location, accounting for GONE views
    final int count = getChildCount();
    for (int childIdx = 0; childIdx < count; childIdx++) {
        ExpandableView slidingChild = (ExpandableView) getChildAt(childIdx);
        if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView) {
            continue;
        }
        float childTop = slidingChild.getTranslationY();
        float top = childTop + slidingChild.getClipTopAmount();
        float bottom = childTop + slidingChild.getActualHeight();
        float dist = Math.min(Math.abs(top - localTouchY), Math.abs(bottom - localTouchY));
        if (dist < minDist) {
            closestChild = slidingChild;
            minDist = dist;
        }
    }
    return closestChild;
}
Also used : StackScrollerDecorView(com.android.systemui.statusbar.StackScrollerDecorView) ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint)

Example 4 with StackScrollerDecorView

use of com.android.systemui.statusbar.StackScrollerDecorView in project android_frameworks_base by crdroidandroid.

the class NotificationStackScrollLayout method getChildAtPosition.

@Override
public ExpandableView getChildAtPosition(float touchX, float touchY) {
    // find the view under the pointer, accounting for GONE views
    final int count = getChildCount();
    for (int childIdx = 0; childIdx < count; childIdx++) {
        ExpandableView slidingChild = (ExpandableView) getChildAt(childIdx);
        if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView) {
            continue;
        }
        float childTop = slidingChild.getTranslationY();
        float top = childTop + slidingChild.getClipTopAmount();
        float bottom = childTop + slidingChild.getActualHeight();
        // Allow the full width of this view to prevent gesture conflict on Keyguard (phone and
        // camera affordance).
        int left = 0;
        int right = getWidth();
        if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
            if (slidingChild instanceof ExpandableNotificationRow) {
                ExpandableNotificationRow row = (ExpandableNotificationRow) slidingChild;
                if (!mIsExpanded && row.isHeadsUp() && row.isPinned() && mHeadsUpManager.getTopEntry().entry.row != row && mGroupManager.getGroupSummary(mHeadsUpManager.getTopEntry().entry.row.getStatusBarNotification()) != row) {
                    continue;
                }
                return row.getViewAtPosition(touchY - childTop);
            }
            return slidingChild;
        }
    }
    return null;
}
Also used : StackScrollerDecorView(com.android.systemui.statusbar.StackScrollerDecorView) ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 5 with StackScrollerDecorView

use of com.android.systemui.statusbar.StackScrollerDecorView in project platform_frameworks_base by android.

the class NotificationStackScrollLayout method getClosestChildAtRawPosition.

public ExpandableView getClosestChildAtRawPosition(float touchX, float touchY) {
    getLocationOnScreen(mTempInt2);
    float localTouchY = touchY - mTempInt2[1];
    ExpandableView closestChild = null;
    float minDist = Float.MAX_VALUE;
    // find the view closest to the location, accounting for GONE views
    final int count = getChildCount();
    for (int childIdx = 0; childIdx < count; childIdx++) {
        ExpandableView slidingChild = (ExpandableView) getChildAt(childIdx);
        if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView) {
            continue;
        }
        float childTop = slidingChild.getTranslationY();
        float top = childTop + slidingChild.getClipTopAmount();
        float bottom = childTop + slidingChild.getActualHeight();
        float dist = Math.min(Math.abs(top - localTouchY), Math.abs(bottom - localTouchY));
        if (dist < minDist) {
            closestChild = slidingChild;
            minDist = dist;
        }
    }
    return closestChild;
}
Also used : StackScrollerDecorView(com.android.systemui.statusbar.StackScrollerDecorView) ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint)

Aggregations

Paint (android.graphics.Paint)10 ExpandableView (com.android.systemui.statusbar.ExpandableView)10 StackScrollerDecorView (com.android.systemui.statusbar.StackScrollerDecorView)10 ExpandableNotificationRow (com.android.systemui.statusbar.ExpandableNotificationRow)5