use of com.android.systemui.ViewInvertHelper 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);
}
use of com.android.systemui.ViewInvertHelper in project android_frameworks_base by ResurrectionRemix.
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);
}
use of com.android.systemui.ViewInvertHelper in project android_frameworks_base by ResurrectionRemix.
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;
}
}
use of com.android.systemui.ViewInvertHelper 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);
}
use of com.android.systemui.ViewInvertHelper in project platform_frameworks_base by android.
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);
}
Aggregations