Search in sources :

Example 16 with NotificationHeaderView

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

the class HeaderTransformState method setVisible.

@Override
public void setVisible(boolean visible, boolean force) {
    super.setVisible(visible, force);
    if (!(mTransformedView instanceof NotificationHeaderView)) {
        return;
    }
    NotificationHeaderView header = (NotificationHeaderView) mTransformedView;
    int childCount = header.getChildCount();
    for (int i = 0; i < childCount; i++) {
        View headerChild = header.getChildAt(i);
        if (!force && headerChild.getVisibility() == View.GONE) {
            continue;
        }
        headerChild.animate().cancel();
        if (headerChild.getVisibility() != View.GONE) {
            headerChild.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
        }
        if (headerChild == mExpandButton) {
            headerChild.setAlpha(visible ? 1.0f : 0.0f);
        }
        if (headerChild == mWorkProfileIcon) {
            headerChild.setTranslationX(0);
            headerChild.setTranslationY(0);
        }
    }
}
Also used : NotificationHeaderView(android.view.NotificationHeaderView) View(android.view.View) NotificationHeaderView(android.view.NotificationHeaderView)

Example 17 with NotificationHeaderView

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

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 18 with NotificationHeaderView

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

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

Example 19 with NotificationHeaderView

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

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

Example 20 with NotificationHeaderView

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

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)

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