soul-browser/sources/java/androidx/appcompat/widget/ActionMenuView.java
KaKi87 550ddb0413
Decompile and recreate Soul Browser v1.4.85 with APK CI builds (#1)
* Decompile and recreate Soul Browser v1.4.85 with APK CI builds

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix CI build: include bundled google.jks and remove PR trigger

The apktool build failed in CI because app/unknown/.../google.jks was
excluded by the *.jks gitignore rule. Whitelist app-bundled JKS files
and commit the missing resource.

Also remove the redundant pull_request workflow trigger.

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Change package ID to com.github.kaki87.soulbrowser

Rename the application ID so the rebuilt APK can be installed
alongside the original Soul Browser from Google Play.

- Update AndroidManifest package, permissions, providers, and actions
- Update R class references in smali (com/github/kaki87/soulbrowser/R)
- Update shortcuts.xml targetPackage
- Rename app label to "Soul Rebuild" for easy identification

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix install compatibility: remove split APK metadata and bundle native libs

The rebuilt APK still declared requiredSplitTypes and Play Store split
metadata, causing Android to reject standalone installs as incompatible.

- Remove requiredSplitTypes and split-related manifest meta-data
- Merge native libs from all ABI splits with uncompressed storage
- Page-align before signing for extractNativeLibs=false
- Add .so to apktool doNotCompress list

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix install failure: use apksigner v2/v3 and bundle arm64 native libs

Target SDK 36 requires APK Signature Scheme v2+, but jarsigner only
produces v1 signatures, causing Android to reject the install.

- Sign with apksigner (v1+v2+v3) instead of jarsigner
- Add arm64-v8a native libraries from universal Soul Browser 1.4.79
- Set extractNativeLibs=true for reliable sideload installs
- Commit stable debug keystore for consistent signatures across builds

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Add committed debug keystore for consistent APK signatures

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix startup crash: use original classes2.dex desugar libraries

Apktool recompiles smali_classes2 into a broken classes2.dex, causing
ClassNotFoundException for j$.com.android.tools.r8.a at ML Kit init.

Inject the original classes2.dex (Java 8+ desugar libs) after apktool
build instead of using the recompiled version.

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix missing drawable resources from density split APKs

The base APK is an app bundle module; density-specific drawables like
seek_thumb_nor_b live in config.xhdpi.apk and were missing after rebuild,
causing Resources$NotFoundException at runtime.

- Merge non-9-patch resources from split APKs before apktool build
- Sync public.xml IDs from R smali only when backing files exist
- Add 713 density-specific resource IDs to public.xml

Co-authored-by: KaKi87 <KaKi87@pm.me>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-10 16:07:14 +02:00

728 lines
28 KiB
Java

package androidx.appcompat.widget;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ContextThemeWrapper;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.annotation.StyleRes;
import androidx.appcompat.view.menu.ActionMenuItemView;
import androidx.appcompat.view.menu.MenuBuilder;
import androidx.appcompat.view.menu.MenuItemImpl;
import androidx.appcompat.view.menu.MenuPresenter;
import androidx.appcompat.view.menu.MenuView;
import androidx.appcompat.widget.ActionMenuPresenter;
import androidx.appcompat.widget.LinearLayoutCompat;
import kotlin.jvm.internal.IntCompanionObject;
/* loaded from: classes.dex */
public class ActionMenuView extends LinearLayoutCompat implements MenuBuilder.ItemInvoker, MenuView {
public boolean A;
public int B;
public final int C;
public final int D;
public OnMenuItemClickListener E;
public MenuBuilder t;
public Context u;
public int v;
public boolean w;
public ActionMenuPresenter x;
public MenuPresenter.Callback y;
public MenuBuilder.Callback z;
@RestrictTo
/* loaded from: classes.dex */
public interface ActionMenuChildView {
boolean a();
boolean b();
}
/* loaded from: classes.dex */
public static class ActionMenuPresenterCallback implements MenuPresenter.Callback {
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
public final void c(MenuBuilder menuBuilder, boolean z) {
}
@Override // androidx.appcompat.view.menu.MenuPresenter.Callback
public final boolean d(MenuBuilder menuBuilder) {
return false;
}
}
/* loaded from: classes.dex */
public static class LayoutParams extends LinearLayoutCompat.LayoutParams {
/* renamed from: a, reason: collision with root package name */
public boolean f205a;
public int b;
/* renamed from: c, reason: collision with root package name */
public int f206c;
public boolean d;
public boolean e;
public boolean f;
}
/* loaded from: classes.dex */
public class MenuBuilderCallback implements MenuBuilder.Callback {
public MenuBuilderCallback() {
}
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
public final boolean a(MenuBuilder menuBuilder, MenuItem menuItem) {
OnMenuItemClickListener onMenuItemClickListener = ActionMenuView.this.E;
if (onMenuItemClickListener != null && onMenuItemClickListener.onMenuItemClick(menuItem)) {
return true;
}
return false;
}
@Override // androidx.appcompat.view.menu.MenuBuilder.Callback
public final void b(MenuBuilder menuBuilder) {
MenuBuilder.Callback callback = ActionMenuView.this.z;
if (callback != null) {
callback.b(menuBuilder);
}
}
}
/* loaded from: classes.dex */
public interface OnMenuItemClickListener {
boolean onMenuItemClick(MenuItem menuItem);
}
public ActionMenuView(@NonNull Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet, 0);
setBaselineAligned(false);
float f = context.getResources().getDisplayMetrics().density;
this.C = (int) (56.0f * f);
this.D = (int) (f * 4.0f);
this.u = context;
this.v = 0;
}
/* JADX WARN: Type inference failed for: r0v0, types: [androidx.appcompat.widget.ActionMenuView$LayoutParams, android.widget.LinearLayout$LayoutParams] */
public static LayoutParams j() {
?? layoutParams = new LinearLayout.LayoutParams(-2, -2);
layoutParams.f205a = false;
((LinearLayout.LayoutParams) layoutParams).gravity = 16;
return layoutParams;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r0v3, types: [androidx.appcompat.widget.ActionMenuView$LayoutParams, android.widget.LinearLayout$LayoutParams] */
public static LayoutParams k(ViewGroup.LayoutParams layoutParams) {
LayoutParams layoutParams2;
if (layoutParams != null) {
if (layoutParams instanceof LayoutParams) {
LayoutParams layoutParams3 = (LayoutParams) layoutParams;
?? layoutParams4 = new LinearLayout.LayoutParams((ViewGroup.LayoutParams) layoutParams3);
layoutParams4.f205a = layoutParams3.f205a;
layoutParams2 = layoutParams4;
} else {
layoutParams2 = new LinearLayout.LayoutParams(layoutParams);
}
if (((LinearLayout.LayoutParams) layoutParams2).gravity <= 0) {
((LinearLayout.LayoutParams) layoutParams2).gravity = 16;
}
return layoutParams2;
}
return j();
}
@Override // androidx.appcompat.view.menu.MenuBuilder.ItemInvoker
public final boolean a(MenuItemImpl menuItemImpl) {
return this.t.q(menuItemImpl, null, 0);
}
@Override // androidx.appcompat.view.menu.MenuView
public final void b(MenuBuilder menuBuilder) {
this.t = menuBuilder;
}
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup
public final boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
return layoutParams instanceof LayoutParams;
}
@Override // android.view.View
public final boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
return false;
}
@Override // androidx.appcompat.widget.LinearLayoutCompat
/* renamed from: f */
public final /* bridge */ /* synthetic */ LinearLayoutCompat.LayoutParams generateDefaultLayoutParams() {
return j();
}
/* JADX WARN: Type inference failed for: r0v0, types: [androidx.appcompat.widget.LinearLayoutCompat$LayoutParams, android.widget.LinearLayout$LayoutParams] */
@Override // androidx.appcompat.widget.LinearLayoutCompat
/* renamed from: g */
public final LinearLayoutCompat.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
return new LinearLayout.LayoutParams(getContext(), attributeSet);
}
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup
public final /* bridge */ /* synthetic */ ViewGroup.LayoutParams generateDefaultLayoutParams() {
return j();
}
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup
public final /* bridge */ /* synthetic */ ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
return k(layoutParams);
}
/* JADX WARN: Multi-variable type inference failed */
public Menu getMenu() {
if (this.t == null) {
Context context = getContext();
MenuBuilder menuBuilder = new MenuBuilder(context);
this.t = menuBuilder;
menuBuilder.e = new MenuBuilderCallback();
ActionMenuPresenter actionMenuPresenter = new ActionMenuPresenter(context);
this.x = actionMenuPresenter;
actionMenuPresenter.p = true;
actionMenuPresenter.q = true;
MenuPresenter.Callback callback = this.y;
MenuPresenter.Callback callback2 = callback;
if (callback == null) {
callback2 = new Object();
}
actionMenuPresenter.i = callback2;
this.t.b(actionMenuPresenter, this.u);
ActionMenuPresenter actionMenuPresenter2 = this.x;
actionMenuPresenter2.l = this;
this.t = actionMenuPresenter2.g;
}
return this.t;
}
@Nullable
public Drawable getOverflowIcon() {
getMenu();
ActionMenuPresenter actionMenuPresenter = this.x;
ActionMenuPresenter.OverflowMenuButton overflowMenuButton = actionMenuPresenter.m;
if (overflowMenuButton != null) {
return overflowMenuButton.getDrawable();
}
if (actionMenuPresenter.o) {
return actionMenuPresenter.n;
}
return null;
}
public int getPopupTheme() {
return this.v;
}
@RestrictTo
public int getWindowAnimations() {
return 0;
}
@Override // androidx.appcompat.widget.LinearLayoutCompat
/* renamed from: h */
public final /* bridge */ /* synthetic */ LinearLayoutCompat.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
return k(layoutParams);
}
public final boolean l(int i) {
boolean z = false;
if (i == 0) {
return false;
}
KeyEvent.Callback childAt = getChildAt(i - 1);
KeyEvent.Callback childAt2 = getChildAt(i);
if (i < getChildCount() && (childAt instanceof ActionMenuChildView)) {
z = ((ActionMenuChildView) childAt).a();
}
if (i > 0 && (childAt2 instanceof ActionMenuChildView)) {
return ((ActionMenuChildView) childAt2).b() | z;
}
return z;
}
@Override // android.view.View
public final void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
ActionMenuPresenter actionMenuPresenter = this.x;
if (actionMenuPresenter != null) {
actionMenuPresenter.d(false);
if (this.x.n()) {
this.x.m();
this.x.p();
}
}
}
@Override // android.view.ViewGroup, android.view.View
public final void onDetachedFromWindow() {
super.onDetachedFromWindow();
ActionMenuPresenter actionMenuPresenter = this.x;
if (actionMenuPresenter != null) {
actionMenuPresenter.m();
ActionMenuPresenter.ActionButtonSubmenu actionButtonSubmenu = actionMenuPresenter.x;
if (actionButtonSubmenu != null && actionButtonSubmenu.b()) {
actionButtonSubmenu.i.dismiss();
}
}
}
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup, android.view.View
public final void onLayout(boolean z, int i, int i2, int i3, int i4) {
boolean z2;
int i5;
int width;
int i6;
if (!this.A) {
super.onLayout(z, i, i2, i3, i4);
return;
}
int childCount = getChildCount();
int i7 = (i4 - i2) / 2;
int dividerWidth = getDividerWidth();
int i8 = i3 - i;
int paddingRight = (i8 - getPaddingRight()) - getPaddingLeft();
boolean z3 = ViewUtils.f351a;
if (getLayoutDirection() == 1) {
z2 = true;
} else {
z2 = false;
}
int i9 = 0;
int i10 = 0;
for (int i11 = 0; i11 < childCount; i11++) {
View childAt = getChildAt(i11);
if (childAt.getVisibility() != 8) {
LayoutParams layoutParams = (LayoutParams) childAt.getLayoutParams();
if (layoutParams.f205a) {
int measuredWidth = childAt.getMeasuredWidth();
if (l(i11)) {
measuredWidth += dividerWidth;
}
int measuredHeight = childAt.getMeasuredHeight();
if (z2) {
i6 = getPaddingLeft() + ((LinearLayout.LayoutParams) layoutParams).leftMargin;
width = i6 + measuredWidth;
} else {
width = (getWidth() - getPaddingRight()) - ((LinearLayout.LayoutParams) layoutParams).rightMargin;
i6 = width - measuredWidth;
}
int i12 = i7 - (measuredHeight / 2);
childAt.layout(i6, i12, width, measuredHeight + i12);
paddingRight -= measuredWidth;
i9 = 1;
} else {
paddingRight -= (childAt.getMeasuredWidth() + ((LinearLayout.LayoutParams) layoutParams).leftMargin) + ((LinearLayout.LayoutParams) layoutParams).rightMargin;
l(i11);
i10++;
}
}
}
if (childCount == 1 && i9 == 0) {
View childAt2 = getChildAt(0);
int measuredWidth2 = childAt2.getMeasuredWidth();
int measuredHeight2 = childAt2.getMeasuredHeight();
int i13 = (i8 / 2) - (measuredWidth2 / 2);
int i14 = i7 - (measuredHeight2 / 2);
childAt2.layout(i13, i14, measuredWidth2 + i13, measuredHeight2 + i14);
return;
}
int i15 = i10 - (i9 ^ 1);
if (i15 > 0) {
i5 = paddingRight / i15;
} else {
i5 = 0;
}
int max = Math.max(0, i5);
if (z2) {
int width2 = getWidth() - getPaddingRight();
for (int i16 = 0; i16 < childCount; i16++) {
View childAt3 = getChildAt(i16);
LayoutParams layoutParams2 = (LayoutParams) childAt3.getLayoutParams();
if (childAt3.getVisibility() != 8 && !layoutParams2.f205a) {
int i17 = width2 - ((LinearLayout.LayoutParams) layoutParams2).rightMargin;
int measuredWidth3 = childAt3.getMeasuredWidth();
int measuredHeight3 = childAt3.getMeasuredHeight();
int i18 = i7 - (measuredHeight3 / 2);
childAt3.layout(i17 - measuredWidth3, i18, i17, measuredHeight3 + i18);
width2 = i17 - ((measuredWidth3 + ((LinearLayout.LayoutParams) layoutParams2).leftMargin) + max);
}
}
return;
}
int paddingLeft = getPaddingLeft();
for (int i19 = 0; i19 < childCount; i19++) {
View childAt4 = getChildAt(i19);
LayoutParams layoutParams3 = (LayoutParams) childAt4.getLayoutParams();
if (childAt4.getVisibility() != 8 && !layoutParams3.f205a) {
int i20 = paddingLeft + ((LinearLayout.LayoutParams) layoutParams3).leftMargin;
int measuredWidth4 = childAt4.getMeasuredWidth();
int measuredHeight4 = childAt4.getMeasuredHeight();
int i21 = i7 - (measuredHeight4 / 2);
childAt4.layout(i20, i21, i20 + measuredWidth4, measuredHeight4 + i21);
paddingLeft = android.support.v4.media.a.b(measuredWidth4, ((LinearLayout.LayoutParams) layoutParams3).rightMargin, max, i20);
}
}
}
/* JADX WARN: Type inference failed for: r11v15 */
/* JADX WARN: Type inference failed for: r11v16, types: [int, boolean] */
/* JADX WARN: Type inference failed for: r11v18 */
/* JADX WARN: Type inference failed for: r11v41 */
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.View
public final void onMeasure(int i, int i2) {
boolean z;
int i3;
boolean z2;
int i4;
boolean z3;
int i5;
int i6;
?? r11;
boolean z4;
int i7;
int i8;
ActionMenuItemView actionMenuItemView;
boolean z5;
int i9;
boolean z6;
MenuBuilder menuBuilder;
boolean z7 = this.A;
if (View.MeasureSpec.getMode(i) == 1073741824) {
z = true;
} else {
z = false;
}
this.A = z;
if (z7 != z) {
this.B = 0;
}
int size = View.MeasureSpec.getSize(i);
if (this.A && (menuBuilder = this.t) != null && size != this.B) {
this.B = size;
menuBuilder.p(true);
}
int childCount = getChildCount();
if (this.A && childCount > 0) {
int mode = View.MeasureSpec.getMode(i2);
int size2 = View.MeasureSpec.getSize(i);
int size3 = View.MeasureSpec.getSize(i2);
int paddingRight = getPaddingRight() + getPaddingLeft();
int paddingBottom = getPaddingBottom() + getPaddingTop();
int childMeasureSpec = ViewGroup.getChildMeasureSpec(i2, paddingBottom, -2);
int i10 = size2 - paddingRight;
int i11 = this.C;
int i12 = i10 / i11;
int i13 = i10 % i11;
if (i12 == 0) {
setMeasuredDimension(i10, 0);
return;
}
int i14 = (i13 / i12) + i11;
int childCount2 = getChildCount();
int i15 = 0;
int i16 = 0;
int i17 = 0;
int i18 = 0;
boolean z8 = false;
int i19 = 0;
long j = 0;
while (true) {
i3 = this.D;
if (i18 >= childCount2) {
break;
}
View childAt = getChildAt(i18);
int i20 = size3;
int i21 = paddingBottom;
if (childAt.getVisibility() == 8) {
i8 = i14;
} else {
boolean z9 = childAt instanceof ActionMenuItemView;
i16++;
if (z9) {
childAt.setPadding(i3, 0, i3, 0);
}
LayoutParams layoutParams = (LayoutParams) childAt.getLayoutParams();
layoutParams.f = false;
layoutParams.f206c = 0;
layoutParams.b = 0;
layoutParams.d = false;
((LinearLayout.LayoutParams) layoutParams).leftMargin = 0;
((LinearLayout.LayoutParams) layoutParams).rightMargin = 0;
if (z9 && !TextUtils.isEmpty(((ActionMenuItemView) childAt).getText())) {
z4 = true;
} else {
z4 = false;
}
layoutParams.e = z4;
if (layoutParams.f205a) {
i7 = 1;
} else {
i7 = i12;
}
LayoutParams layoutParams2 = (LayoutParams) childAt.getLayoutParams();
int i22 = i12;
i8 = i14;
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(View.MeasureSpec.getSize(childMeasureSpec) - i21, View.MeasureSpec.getMode(childMeasureSpec));
if (z9) {
actionMenuItemView = (ActionMenuItemView) childAt;
} else {
actionMenuItemView = null;
}
if (actionMenuItemView != null && !TextUtils.isEmpty(actionMenuItemView.getText())) {
z5 = true;
} else {
z5 = false;
}
boolean z10 = z5;
if (i7 > 0 && (!z5 || i7 >= 2)) {
childAt.measure(View.MeasureSpec.makeMeasureSpec(i8 * i7, IntCompanionObject.MIN_VALUE), makeMeasureSpec);
int measuredWidth = childAt.getMeasuredWidth();
i9 = measuredWidth / i8;
if (measuredWidth % i8 != 0) {
i9++;
}
if (z10 && i9 < 2) {
i9 = 2;
}
} else {
i9 = 0;
}
if (!layoutParams2.f205a && z10) {
z6 = true;
} else {
z6 = false;
}
layoutParams2.d = z6;
layoutParams2.b = i9;
childAt.measure(View.MeasureSpec.makeMeasureSpec(i9 * i8, 1073741824), makeMeasureSpec);
i17 = Math.max(i17, i9);
if (layoutParams.d) {
i19++;
}
if (layoutParams.f205a) {
z8 = true;
}
i12 = i22 - i9;
i15 = Math.max(i15, childAt.getMeasuredHeight());
if (i9 == 1) {
j |= 1 << i18;
}
}
i18++;
size3 = i20;
paddingBottom = i21;
i14 = i8;
}
int i23 = size3;
int i24 = i12;
int i25 = i14;
if (z8 && i16 == 2) {
z2 = true;
} else {
z2 = false;
}
int i26 = i24;
boolean z11 = false;
while (i19 > 0 && i26 > 0) {
int i27 = Integer.MAX_VALUE;
long j2 = 0;
int i28 = 0;
int i29 = 0;
while (i29 < childCount2) {
int i30 = i15;
LayoutParams layoutParams3 = (LayoutParams) getChildAt(i29).getLayoutParams();
boolean z12 = z2;
if (layoutParams3.d) {
int i31 = layoutParams3.b;
if (i31 < i27) {
j2 = 1 << i29;
i27 = i31;
i28 = 1;
} else if (i31 == i27) {
j2 |= 1 << i29;
i28++;
}
}
i29++;
z2 = z12;
i15 = i30;
}
i4 = i15;
boolean z13 = z2;
j |= j2;
if (i28 > i26) {
break;
}
int i32 = i27 + 1;
int i33 = 0;
while (i33 < childCount2) {
View childAt2 = getChildAt(i33);
LayoutParams layoutParams4 = (LayoutParams) childAt2.getLayoutParams();
boolean z14 = z8;
long j3 = 1 << i33;
if ((j2 & j3) == 0) {
if (layoutParams4.b == i32) {
j |= j3;
}
} else {
if (z13 && layoutParams4.e) {
r11 = 1;
r11 = 1;
if (i26 == 1) {
childAt2.setPadding(i3 + i25, 0, i3, 0);
}
} else {
r11 = 1;
}
layoutParams4.b += r11;
layoutParams4.f = r11;
i26--;
}
i33++;
z8 = z14;
}
z2 = z13;
i15 = i4;
z11 = true;
}
i4 = i15;
if (!z8 && i16 == 1) {
z3 = true;
} else {
z3 = false;
}
if (i26 > 0 && j != 0 && (i26 < i16 - 1 || z3 || i17 > 1)) {
float bitCount = Long.bitCount(j);
if (!z3) {
if ((j & 1) != 0 && !((LayoutParams) getChildAt(0).getLayoutParams()).e) {
bitCount -= 0.5f;
}
int i34 = childCount2 - 1;
if ((j & (1 << i34)) != 0 && !((LayoutParams) getChildAt(i34).getLayoutParams()).e) {
bitCount -= 0.5f;
}
}
if (bitCount > 0.0f) {
i6 = (int) ((i26 * i25) / bitCount);
} else {
i6 = 0;
}
boolean z15 = z11;
for (int i35 = 0; i35 < childCount2; i35++) {
if ((j & (1 << i35)) != 0) {
View childAt3 = getChildAt(i35);
LayoutParams layoutParams5 = (LayoutParams) childAt3.getLayoutParams();
if (childAt3 instanceof ActionMenuItemView) {
layoutParams5.f206c = i6;
layoutParams5.f = true;
if (i35 == 0 && !layoutParams5.e) {
((LinearLayout.LayoutParams) layoutParams5).leftMargin = (-i6) / 2;
}
z15 = true;
} else if (layoutParams5.f205a) {
layoutParams5.f206c = i6;
layoutParams5.f = true;
((LinearLayout.LayoutParams) layoutParams5).rightMargin = (-i6) / 2;
z15 = true;
} else {
if (i35 != 0) {
((LinearLayout.LayoutParams) layoutParams5).leftMargin = i6 / 2;
}
if (i35 != childCount2 - 1) {
((LinearLayout.LayoutParams) layoutParams5).rightMargin = i6 / 2;
}
}
}
}
z11 = z15;
}
if (z11) {
for (int i36 = 0; i36 < childCount2; i36++) {
View childAt4 = getChildAt(i36);
LayoutParams layoutParams6 = (LayoutParams) childAt4.getLayoutParams();
if (layoutParams6.f) {
childAt4.measure(View.MeasureSpec.makeMeasureSpec((layoutParams6.b * i25) + layoutParams6.f206c, 1073741824), childMeasureSpec);
}
}
}
if (mode != 1073741824) {
i5 = i4;
} else {
i5 = i23;
}
setMeasuredDimension(i10, i5);
return;
}
for (int i37 = 0; i37 < childCount; i37++) {
LayoutParams layoutParams7 = (LayoutParams) getChildAt(i37).getLayoutParams();
((LinearLayout.LayoutParams) layoutParams7).rightMargin = 0;
((LinearLayout.LayoutParams) layoutParams7).leftMargin = 0;
}
super.onMeasure(i, i2);
}
@RestrictTo
public void setExpandedActionViewsExclusive(boolean z) {
this.x.u = z;
}
public void setOnMenuItemClickListener(OnMenuItemClickListener onMenuItemClickListener) {
this.E = onMenuItemClickListener;
}
public void setOverflowIcon(@Nullable Drawable drawable) {
getMenu();
ActionMenuPresenter actionMenuPresenter = this.x;
ActionMenuPresenter.OverflowMenuButton overflowMenuButton = actionMenuPresenter.m;
if (overflowMenuButton != null) {
overflowMenuButton.setImageDrawable(drawable);
} else {
actionMenuPresenter.o = true;
actionMenuPresenter.n = drawable;
}
}
@RestrictTo
public void setOverflowReserved(boolean z) {
this.w = z;
}
public void setPopupTheme(@StyleRes int i) {
if (this.v != i) {
this.v = i;
if (i == 0) {
this.u = getContext();
} else {
this.u = new ContextThemeWrapper(getContext(), i);
}
}
}
@RestrictTo
public void setPresenter(ActionMenuPresenter actionMenuPresenter) {
this.x = actionMenuPresenter;
actionMenuPresenter.l = this;
this.t = actionMenuPresenter.g;
}
@Override // androidx.appcompat.widget.LinearLayoutCompat, android.view.ViewGroup
public final ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
return new LinearLayout.LayoutParams(getContext(), attributeSet);
}
}