Search in sources :

Example 21 with NotificationHeaderView

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

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

Example 22 with NotificationHeaderView

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

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

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

the class HeaderTransformState method prepareFadeIn.

@Override
public void prepareFadeIn() {
    super.prepareFadeIn();
    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 (headerChild.getVisibility() == View.GONE) {
            continue;
        }
        headerChild.animate().cancel();
        headerChild.setVisibility(View.VISIBLE);
        headerChild.setAlpha(1.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 24 with NotificationHeaderView

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

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

Example 25 with NotificationHeaderView

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

the class HeaderTransformState method prepareFadeIn.

@Override
public void prepareFadeIn() {
    super.prepareFadeIn();
    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 (headerChild.getVisibility() == View.GONE) {
            continue;
        }
        headerChild.animate().cancel();
        headerChild.setVisibility(View.VISIBLE);
        headerChild.setAlpha(1.0f);
        if (headerChild == mWorkProfileIcon) {
            headerChild.setTranslationX(0);
            headerChild.setTranslationY(0);
        }
    }
}
Also used : NotificationHeaderView(android.view.NotificationHeaderView) View(android.view.View) 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