use of android.view.NotificationHeaderView in project android_frameworks_base by DirtyUnicorns.
the class NotificationHeaderUtil method sanitizeChild.
private void sanitizeChild(View child) {
if (child != null) {
NotificationHeaderView header = (NotificationHeaderView) child.findViewById(com.android.internal.R.id.notification_header);
sanitizeHeader(header);
}
}
use of android.view.NotificationHeaderView in project android_frameworks_base by DirtyUnicorns.
the class HeaderTransformState method transformViewFrom.
@Override
public void transformViewFrom(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;
}
NotificationHeaderView header = (NotificationHeaderView) mTransformedView;
header.setVisibility(View.VISIBLE);
header.setAlpha(1.0f);
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) {
CrossFadeHelper.fadeIn(mExpandButton, transformationAmount);
} else {
headerChild.setVisibility(View.VISIBLE);
if (headerChild == mWorkProfileIcon) {
mWorkProfileState.transformViewFullyFrom(((HeaderTransformState) otherState).mWorkProfileState, transformationAmount);
}
}
}
return;
}
use of android.view.NotificationHeaderView in project android_frameworks_base by DirtyUnicorns.
the class HeaderTransformState method initFrom.
@Override
public void initFrom(View view) {
super.initFrom(view);
if (view instanceof NotificationHeaderView) {
NotificationHeaderView header = (NotificationHeaderView) view;
mExpandButton = header.getExpandButton();
mWorkProfileState = TransformState.obtain();
mWorkProfileIcon = header.getWorkProfileIcon();
mWorkProfileState.initFrom(mWorkProfileIcon);
}
}
use of android.view.NotificationHeaderView in project android_frameworks_base by AOSPA.
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 AOSPA.
the class NotificationHeaderUtil method sanitizeHeader.
private void sanitizeHeader(NotificationHeaderView rowHeader) {
if (rowHeader == null) {
return;
}
final int childCount = rowHeader.getChildCount();
View time = rowHeader.findViewById(com.android.internal.R.id.time);
boolean hasVisibleText = false;
for (int i = 1; i < childCount - 1; i++) {
View child = rowHeader.getChildAt(i);
if (child instanceof TextView && child.getVisibility() != View.GONE && !mDividers.contains(Integer.valueOf(child.getId())) && child != time) {
hasVisibleText = true;
break;
}
}
// in case no view is visible we make sure the time is visible
int timeVisibility = !hasVisibleText || mRow.getStatusBarNotification().getNotification().showsTime() ? View.VISIBLE : View.GONE;
time.setVisibility(timeVisibility);
View left = null;
View right;
for (int i = 1; i < childCount - 1; i++) {
View child = rowHeader.getChildAt(i);
if (mDividers.contains(Integer.valueOf(child.getId()))) {
boolean visible = false;
// Lets find the item to the right
for (i++; i < childCount - 1; i++) {
right = rowHeader.getChildAt(i);
if (mDividers.contains(Integer.valueOf(right.getId()))) {
// A divider was found, this needs to be hidden
i--;
break;
} else if (right.getVisibility() != View.GONE && right instanceof TextView) {
visible = left != null;
left = right;
break;
}
}
child.setVisibility(visible ? View.VISIBLE : View.GONE);
} else if (child.getVisibility() != View.GONE && child instanceof TextView) {
left = child;
}
}
}
Aggregations