Merge cherrypicks of ['googleplex-android-review.googlesource.com/34523268'] into 25Q3-release.
Change-Id: I01fb6a4c734f9da1853e18732d1e1fd02550b032
This commit is contained in:
@@ -40,6 +40,7 @@ import android.text.TextUtils;
|
||||
import android.util.SparseIntArray;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.Display;
|
||||
import android.view.Gravity;
|
||||
import android.view.SurfaceControlViewHost;
|
||||
import android.view.View;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
@@ -344,15 +345,14 @@ public class PreviewSurfaceRenderer {
|
||||
}
|
||||
|
||||
private void setContentRoot(View view) {
|
||||
view.setPivotX(0);
|
||||
view.setPivotY(0);
|
||||
// This aspect scales the view to fit in the surface and centers it
|
||||
final float scale = Math.min(mWidth / (float) view.getMeasuredWidth(),
|
||||
mHeight / (float) view.getMeasuredHeight());
|
||||
view.setScaleX(scale);
|
||||
view.setScaleY(scale);
|
||||
view.setTranslationX((mWidth - scale * view.getWidth()) / 2);
|
||||
view.setTranslationY((mHeight - scale * view.getHeight()) / 2);
|
||||
LayoutParams lp = new LayoutParams(view.getMeasuredWidth(), view.getMeasuredHeight());
|
||||
lp.gravity = Gravity.CENTER;
|
||||
view.setLayoutParams(lp);
|
||||
|
||||
if (!Flags.newCustomizationPickerUi()) {
|
||||
view.setAlpha(mSkipAnimations ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user