Search in sources :

Example 1 with ViewInvertHelper

use of com.android.systemui.ViewInvertHelper in project platform_frameworks_base by android.

the class NotificationChildrenContainer method updateGroupOverflow.

public void updateGroupOverflow() {
    int childCount = mChildren.size();
    int maxAllowedVisibleChildren = getMaxAllowedVisibleChildren(true);
    if (childCount > maxAllowedVisibleChildren) {
        mOverflowNumber = mHybridGroupManager.bindOverflowNumber(mOverflowNumber, childCount - maxAllowedVisibleChildren);
        if (mOverflowInvertHelper == null) {
            mOverflowInvertHelper = new ViewInvertHelper(mOverflowNumber, NotificationPanelView.DOZE_ANIMATION_DURATION);
        }
        if (mGroupOverFlowState == null) {
            mGroupOverFlowState = new ViewState();
            mNeverAppliedGroupState = true;
        }
    } else if (mOverflowNumber != null) {
        removeView(mOverflowNumber);
        if (isShown()) {
            final View removedOverflowNumber = mOverflowNumber;
            addTransientView(removedOverflowNumber, getTransientViewCount());
            CrossFadeHelper.fadeOut(removedOverflowNumber, new Runnable() {

                @Override
                public void run() {
                    removeTransientView(removedOverflowNumber);
                }
            });
        }
        mOverflowNumber = null;
        mOverflowInvertHelper = null;
        mGroupOverFlowState = null;
    }
}
Also used : TextView(android.widget.TextView) NotificationPanelView(com.android.systemui.statusbar.phone.NotificationPanelView) View(android.view.View) HybridNotificationView(com.android.systemui.statusbar.notification.HybridNotificationView) NotificationHeaderView(android.view.NotificationHeaderView) ViewInvertHelper(com.android.systemui.ViewInvertHelper)

Example 2 with ViewInvertHelper

use of com.android.systemui.ViewInvertHelper in project android_frameworks_base by ResurrectionRemix.

the class HybridNotificationView method onFinishInflate.

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mTitleView = (TextView) findViewById(R.id.notification_title);
    mTextView = (TextView) findViewById(R.id.notification_text);
    mInvertHelper = new ViewInvertHelper(this, NotificationPanelView.DOZE_ANIMATION_DURATION);
    mTransformationHelper = new ViewTransformationHelper();
    mTransformationHelper.setCustomTransformation(new ViewTransformationHelper.CustomTransformation() {

        @Override
        public boolean transformTo(TransformState ownState, TransformableView notification, float transformationAmount) {
            // We want to transform to the same y location as the title
            TransformState otherState = notification.getCurrentState(TRANSFORMING_VIEW_TITLE);
            CrossFadeHelper.fadeOut(mTextView, transformationAmount);
            if (otherState != null) {
                ownState.transformViewVerticalTo(otherState, transformationAmount);
                otherState.recycle();
            }
            return true;
        }

        @Override
        public boolean transformFrom(TransformState ownState, TransformableView notification, float transformationAmount) {
            // We want to transform from the same y location as the title
            TransformState otherState = notification.getCurrentState(TRANSFORMING_VIEW_TITLE);
            CrossFadeHelper.fadeIn(mTextView, transformationAmount);
            if (otherState != null) {
                ownState.transformViewVerticalFrom(otherState, transformationAmount);
                otherState.recycle();
            }
            return true;
        }
    }, TRANSFORMING_VIEW_TEXT);
    mTransformationHelper.addTransformedView(TRANSFORMING_VIEW_TITLE, mTitleView);
    mTransformationHelper.addTransformedView(TRANSFORMING_VIEW_TEXT, mTextView);
}
Also used : TransformableView(com.android.systemui.statusbar.TransformableView) ViewTransformationHelper(com.android.systemui.statusbar.ViewTransformationHelper) ViewInvertHelper(com.android.systemui.ViewInvertHelper)

Example 3 with ViewInvertHelper

use of com.android.systemui.ViewInvertHelper in project android_frameworks_base by DirtyUnicorns.

the class NotificationOverflowContainer method onFinishInflate.

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mIconsView = (NotificationOverflowIconsView) findViewById(R.id.overflow_icons_view);
    mIconsView.setMoreText((TextView) findViewById(R.id.more_text));
    mIconsView.setOverflowIndicator(findViewById(R.id.more_icon_overflow));
    mContent = findViewById(R.id.content);
    mViewInvertHelper = new ViewInvertHelper(mContent, NotificationPanelView.DOZE_ANIMATION_DURATION);
}
Also used : ViewInvertHelper(com.android.systemui.ViewInvertHelper)

Example 4 with ViewInvertHelper

use of com.android.systemui.ViewInvertHelper in project android_frameworks_base by AOSPA.

the class NotificationOverflowContainer method onFinishInflate.

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mIconsView = (NotificationOverflowIconsView) findViewById(R.id.overflow_icons_view);
    mIconsView.setMoreText((TextView) findViewById(R.id.more_text));
    mIconsView.setOverflowIndicator(findViewById(R.id.more_icon_overflow));
    mContent = findViewById(R.id.content);
    mViewInvertHelper = new ViewInvertHelper(mContent, NotificationPanelView.DOZE_ANIMATION_DURATION);
}
Also used : ViewInvertHelper(com.android.systemui.ViewInvertHelper)

Example 5 with ViewInvertHelper

use of com.android.systemui.ViewInvertHelper in project android_frameworks_base by crdroidandroid.

the class NotificationOverflowContainer method onFinishInflate.

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mIconsView = (NotificationOverflowIconsView) findViewById(R.id.overflow_icons_view);
    mIconsView.setMoreText((TextView) findViewById(R.id.more_text));
    mIconsView.setOverflowIndicator(findViewById(R.id.more_icon_overflow));
    mContent = findViewById(R.id.content);
    mViewInvertHelper = new ViewInvertHelper(mContent, NotificationPanelView.DOZE_ANIMATION_DURATION);
}
Also used : ViewInvertHelper(com.android.systemui.ViewInvertHelper)

Aggregations

ViewInvertHelper (com.android.systemui.ViewInvertHelper)15 NotificationHeaderView (android.view.NotificationHeaderView)5 View (android.view.View)5 TextView (android.widget.TextView)5 TransformableView (com.android.systemui.statusbar.TransformableView)5 ViewTransformationHelper (com.android.systemui.statusbar.ViewTransformationHelper)5 HybridNotificationView (com.android.systemui.statusbar.notification.HybridNotificationView)5 NotificationPanelView (com.android.systemui.statusbar.phone.NotificationPanelView)5