Search in sources :

Example 31 with NotificationHeaderView

use of android.view.NotificationHeaderView in project platform_frameworks_base by android.

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;
}
Also used : NotificationHeaderView(android.view.NotificationHeaderView) View(android.view.View) NotificationHeaderView(android.view.NotificationHeaderView)

Example 32 with NotificationHeaderView

use of android.view.NotificationHeaderView in project platform_frameworks_base by android.

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);
    }
}
Also used : NotificationHeaderView(android.view.NotificationHeaderView)

Example 33 with NotificationHeaderView

use of android.view.NotificationHeaderView in project platform_frameworks_base by android.

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);
}
Also used : NotificationHeaderView(android.view.NotificationHeaderView)

Example 34 with NotificationHeaderView

use of android.view.NotificationHeaderView in project android_frameworks_base by DirtyUnicorns.

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();
}
Also used : RemoteViews(android.widget.RemoteViews) View(android.view.View) HybridNotificationView(com.android.systemui.statusbar.notification.HybridNotificationView) TextView(android.widget.TextView) NotificationPanelView(com.android.systemui.statusbar.phone.NotificationPanelView) NotificationHeaderView(android.view.NotificationHeaderView) Notification(android.app.Notification) StatusBarNotification(android.service.notification.StatusBarNotification)

Example 35 with NotificationHeaderView

use of android.view.NotificationHeaderView in project android_frameworks_base by AOSPA.

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);
}
Also used : NotificationHeaderView(android.view.NotificationHeaderView)

Aggregations

NotificationHeaderView (android.view.NotificationHeaderView)55 View (android.view.View)30 ImageView (android.widget.ImageView)10 TextView (android.widget.TextView)10 Notification (android.app.Notification)5 StatusBarNotification (android.service.notification.StatusBarNotification)5 RemoteViews (android.widget.RemoteViews)5 HybridNotificationView (com.android.systemui.statusbar.notification.HybridNotificationView)5 NotificationPanelView (com.android.systemui.statusbar.phone.NotificationPanelView)5