use of android.view.NotificationHeaderView in project android_frameworks_base by ResurrectionRemix.
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 ResurrectionRemix.
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 ResurrectionRemix.
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 ResurrectionRemix.
the class NotificationChildrenContainer method recreateNotificationHeader.
public void recreateNotificationHeader(OnClickListener listener, StatusBarNotification notification) {
final Notification.Builder builder = Notification.Builder.recoverBuilder(getContext(), mNotificationParent.getStatusBarNotification().getNotification());
final RemoteViews header = builder.makeNotificationHeader();
if (mNotificationHeader == null) {
mNotificationHeader = (NotificationHeaderView) header.apply(getContext(), this);
final View expandButton = mNotificationHeader.findViewById(com.android.internal.R.id.expand_button);
expandButton.setVisibility(VISIBLE);
mNotificationHeader.setOnClickListener(listener);
mNotificationHeaderWrapper = NotificationViewWrapper.wrap(getContext(), mNotificationHeader, mNotificationParent);
addView(mNotificationHeader, 0);
invalidate();
} else {
header.reapply(getContext(), mNotificationHeader);
mNotificationHeaderWrapper.notifyContentUpdated(notification);
}
updateChildrenHeaderAppearance();
}
use of android.view.NotificationHeaderView in project android_frameworks_base by ResurrectionRemix.
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;
}
}
Aggregations