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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations