diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 9722083639338860d34f90277967ad3858d3fab3..64b54d7f702796de2678ca5d3a9e91d6f7c257e6 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -19818,6 +19818,46 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @see #onMeasure(int, int) */ public final void measure(int widthMeasureSpec, int heightMeasureSpec) { + /* *********************** -App View WhiteList- *********************** */ + // Log.d(VIEW_LOG_TAG, "view=" + this.getClass().getName() + " (" + + // MeasureSpec.toString(widthMeasureSpec) + "," + MeasureSpec.toString(heightMeasureSpec) + ")"); + + final int widthSize = MeasureSpec.getSize(widthMeasureSpec); + final int heightSize = MeasureSpec.getSize(heightMeasureSpec); + + if (this.getClass().getName().startsWith("com.zhihu.android.base.widget.ZHFrameLayout")) { + if (heightSize > 960) { + heightMeasureSpec = MeasureSpec.makeMeasureSpec(960, MeasureSpec.EXACTLY); + } + } + + if (this.getClass().getName().startsWith("com.ss.android.ugc.aweme.homepage.ui.view.MainScrollableViewPager")) { + if (heightSize > 960) { + heightMeasureSpec = MeasureSpec.makeMeasureSpec(960, MeasureSpec.EXACTLY); + } + } + + if (this.getClass().getName().startsWith("com.ss.android.ugc.playerkit.videoview.KeepSurfaceTextureView")) { + if (widthSize > 540) { + widthMeasureSpec = MeasureSpec.makeMeasureSpec(540, MeasureSpec.EXACTLY); + heightMeasureSpec = MeasureSpec.makeMeasureSpec(540 * heightSize / widthSize, MeasureSpec.EXACTLY); + } + } + + if (this.getClass().getName().startsWith("com.ss.android.videoshop.mediaview.SimpleMediaView")) { + if (widthSize > 540) { + widthMeasureSpec = MeasureSpec.makeMeasureSpec(540, MeasureSpec.EXACTLY); + heightMeasureSpec = MeasureSpec.makeMeasureSpec(303, MeasureSpec.EXACTLY); + } + } + + if (this.getClass().getName().startsWith("com.ixigua.commonui.view.RoundRelativeLayout")) { + if (widthSize == 508) { + heightMeasureSpec = MeasureSpec.makeMeasureSpec(303, MeasureSpec.EXACTLY); + } + } + /* ******************************************************************** */ + boolean optical = isLayoutModeOptical(this); if (optical != isLayoutModeOptical(mParent)) { Insets insets = getOpticalInsets(); diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java index da737f0180d606446a6c6b6e715a753b90d75508..b8c74d88b58079a14d990b3bd97e0b594c37eb9f 100644 --- a/core/java/android/widget/FrameLayout.java +++ b/core/java/android/widget/FrameLayout.java @@ -170,11 +170,6 @@ public class FrameLayout extends ViewGroup { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int count = getChildCount(); - if ((this.getClass().getName().startsWith("com.zhihu.android.base.widget.ZHFrameLayout")) && - (this.mParent.getClass().getName().startsWith("androidx.appcompat.widget.ContentFrameLayout"))) { - heightMeasureSpec = MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(heightMeasureSpec) - 42, MeasureSpec.EXACTLY); - } - final boolean measureMatchParentChildren = MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.EXACTLY || MeasureSpec.getMode(heightMeasureSpec) != MeasureSpec.EXACTLY;