use of android.view.NotificationHeaderView in project android_frameworks_base by ResurrectionRemix.
the class ExpandableNotificationRow method disallowSingleClick.
@Override
protected boolean disallowSingleClick(MotionEvent event) {
float x = event.getX();
float y = event.getY();
NotificationHeaderView header = getVisibleNotificationHeader();
if (header != null) {
return header.isInTouchRect(x - getTranslation(), y);
}
return super.disallowSingleClick(event);
}
use of android.view.NotificationHeaderView in project android_frameworks_base by DirtyUnicorns.
the class NotificationContentView method updateContractedHeaderWidth.
private boolean updateContractedHeaderWidth() {
// We need to update the expanded and the collapsed header to have exactly the same with to
// have the expand buttons laid out at the same location.
NotificationHeaderView contractedHeader = mContractedWrapper.getNotificationHeader();
if (contractedHeader != null) {
if (mExpandedChild != null && mExpandedWrapper.getNotificationHeader() != null) {
NotificationHeaderView expandedHeader = mExpandedWrapper.getNotificationHeader();
int expandedSize = expandedHeader.getMeasuredWidth() - expandedHeader.getPaddingEnd();
int collapsedSize = contractedHeader.getMeasuredWidth() - expandedHeader.getPaddingEnd();
if (expandedSize != collapsedSize) {
int paddingEnd = contractedHeader.getMeasuredWidth() - expandedSize;
contractedHeader.setPadding(contractedHeader.isLayoutRtl() ? paddingEnd : contractedHeader.getPaddingLeft(), contractedHeader.getPaddingTop(), contractedHeader.isLayoutRtl() ? contractedHeader.getPaddingLeft() : paddingEnd, contractedHeader.getPaddingBottom());
contractedHeader.setShowWorkBadgeAtEnd(true);
return true;
}
} else {
int paddingEnd = mNotificationContentMarginEnd;
if (contractedHeader.getPaddingEnd() != paddingEnd) {
contractedHeader.setPadding(contractedHeader.isLayoutRtl() ? paddingEnd : contractedHeader.getPaddingLeft(), contractedHeader.getPaddingTop(), contractedHeader.isLayoutRtl() ? contractedHeader.getPaddingLeft() : paddingEnd, contractedHeader.getPaddingBottom());
contractedHeader.setShowWorkBadgeAtEnd(false);
return true;
}
}
}
return false;
}
use of android.view.NotificationHeaderView in project android_frameworks_base by DirtyUnicorns.
the class NotificationContentView method focusExpandButtonIfNecessary.
private void focusExpandButtonIfNecessary() {
if (mFocusOnVisibilityChange) {
NotificationHeaderView header = getVisibleNotificationHeader();
if (header != null) {
ImageView expandButton = header.getExpandButton();
if (expandButton != null) {
expandButton.requestAccessibilityFocus();
}
}
mFocusOnVisibilityChange = false;
}
}
use of android.view.NotificationHeaderView in project android_frameworks_base by DirtyUnicorns.
the class ExpandableNotificationRow method disallowSingleClick.
@Override
protected boolean disallowSingleClick(MotionEvent event) {
float x = event.getX();
float y = event.getY();
NotificationHeaderView header = getVisibleNotificationHeader();
if (header != null) {
return header.isInTouchRect(x - getTranslation(), y);
}
return super.disallowSingleClick(event);
}
use of android.view.NotificationHeaderView in project android_frameworks_base by DirtyUnicorns.
the class HeaderTransformState method transformViewTo.
@Override
public boolean transformViewTo(TransformState otherState, float transformationAmount) {
// but the expand button, so lets fade just that one and transform the work profile icon.
if (!(mTransformedView instanceof NotificationHeaderView)) {
return false;
}
NotificationHeaderView header = (NotificationHeaderView) mTransformedView;
int childCount = header.getChildCount();
for (int i = 0; i < childCount; i++) {
View headerChild = header.getChildAt(i);
if (headerChild.getVisibility() == View.GONE) {
continue;
}
if (headerChild != mExpandButton) {
headerChild.setVisibility(View.INVISIBLE);
} else {
CrossFadeHelper.fadeOut(mExpandButton, transformationAmount);
}
}
return true;
}
Aggregations