Search in sources :

Example 1 with TransformableView

use of com.android.systemui.statusbar.TransformableView 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 2 with TransformableView

use of com.android.systemui.statusbar.TransformableView in project android_frameworks_base by crdroidandroid.

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 TransformableView

use of com.android.systemui.statusbar.TransformableView in project platform_frameworks_base by android.

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 4 with TransformableView

use of com.android.systemui.statusbar.TransformableView in project android_frameworks_base by AOSPA.

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 5 with TransformableView

use of com.android.systemui.statusbar.TransformableView in project android_frameworks_base by DirtyUnicorns.

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)

Aggregations

ViewInvertHelper (com.android.systemui.ViewInvertHelper)5 TransformableView (com.android.systemui.statusbar.TransformableView)5 ViewTransformationHelper (com.android.systemui.statusbar.ViewTransformationHelper)5