Merge "Updating Chips UI" into sc-dev
This commit is contained in:
commit
8eced27076
3 files changed
+2
-31
No files matched your search
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="@android:color/transparent"
|
||||
android:startColor="@color/chip_scrim_start_color"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@@ -17,6 +17,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:defaultFocusHighlightEnabled="false"
|
||||
android:elevation="4dp"
|
||||
android:focusable="true">
|
||||
|
||||
@@ -52,8 +52,6 @@ import android.graphics.Outline;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.graphics.drawable.InsetDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.AttributeSet;
|
||||
@@ -436,9 +434,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
mContextualChip.setScaleX(comp(modalness));
|
||||
mContextualChip.setScaleY(comp(modalness));
|
||||
}
|
||||
if (mContextualChipWrapper != null) {
|
||||
mContextualChipWrapper.setAlpha(comp(modalness));
|
||||
}
|
||||
mDigitalWellBeingToast.updateBannerOffset(modalness);
|
||||
}
|
||||
|
||||
@@ -775,30 +770,16 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
layoutParams.gravity = BOTTOM | CENTER_HORIZONTAL;
|
||||
int expectedChipHeight = getExpectedViewHeight(view);
|
||||
float chipOffset = getResources().getDimension(R.dimen.chip_hint_vertical_offset);
|
||||
layoutParams.bottomMargin = (int)
|
||||
(((MarginLayoutParams) mSnapshotView.getLayoutParams()).bottomMargin
|
||||
- expectedChipHeight + chipOffset);
|
||||
layoutParams.bottomMargin = -expectedChipHeight - (int) chipOffset;
|
||||
mContextualChip = ((FrameLayout) mContextualChipWrapper).getChildAt(0);
|
||||
mContextualChip.setScaleX(0f);
|
||||
mContextualChip.setScaleY(0f);
|
||||
GradientDrawable scrimDrawable = (GradientDrawable) getResources().getDrawable(
|
||||
R.drawable.chip_scrim_gradient, mActivity.getTheme());
|
||||
float cornerRadius = getTaskCornerRadius();
|
||||
scrimDrawable.setCornerRadii(
|
||||
new float[]{0, 0, 0, 0, cornerRadius, cornerRadius, cornerRadius,
|
||||
cornerRadius});
|
||||
InsetDrawable scrimDrawableInset = new InsetDrawable(scrimDrawable, 0, 0, 0,
|
||||
(int) (expectedChipHeight - chipOffset));
|
||||
mContextualChipWrapper.setBackground(scrimDrawableInset);
|
||||
mContextualChipWrapper.setPadding(0, 0, 0, 0);
|
||||
mContextualChipWrapper.setAlpha(0f);
|
||||
addView(view, getChildCount(), layoutParams);
|
||||
if (mContextualChip != null) {
|
||||
mContextualChip.animate().scaleX(1f).scaleY(1f).setDuration(50);
|
||||
}
|
||||
if (mContextualChipWrapper != null) {
|
||||
mChipTouchDelegate = new TransformingTouchDelegate(mContextualChipWrapper);
|
||||
mContextualChipWrapper.animate().alpha(1f).setDuration(50);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1098,10 +1079,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
public void setFullscreenProgress(float progress) {
|
||||
progress = Utilities.boundToRange(progress, 0, 1);
|
||||
mFullscreenProgress = progress;
|
||||
boolean isFullscreen = mFullscreenProgress > 0;
|
||||
mIconView.setVisibility(progress < 1 ? VISIBLE : INVISIBLE);
|
||||
setClipChildren(!isFullscreen);
|
||||
setClipToPadding(!isFullscreen);
|
||||
|
||||
updateTaskScaling();
|
||||
|
||||
|
||||
Reference in new issue
Block a user