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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations