138 lines
5.9 KiB
Java
138 lines
5.9 KiB
Java
package o;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.TypedArray;
|
|
import android.util.AttributeSet;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.FragmentContainerView;
|
|
import o.IUF;
|
|
import org.simpleframework.xml.strategy.Name;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.dlK, reason: case insensitive filesystem */
|
|
/* loaded from: classes.dex */
|
|
public final class LayoutInflaterFactory2C9519dlK implements LayoutInflater.Factory2 {
|
|
final yRS a;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public LayoutInflaterFactory2C9519dlK(yRS yrs) {
|
|
this.a = yrs;
|
|
}
|
|
|
|
@Override // android.view.LayoutInflater.Factory
|
|
public final View onCreateView(String str, Context context, AttributeSet attributeSet) {
|
|
return onCreateView(null, str, context, attributeSet);
|
|
}
|
|
|
|
@Override // android.view.LayoutInflater.Factory2
|
|
public final View onCreateView(View view, String str, Context context, AttributeSet attributeSet) {
|
|
zMt e;
|
|
if (FragmentContainerView.class.getName().equals(str)) {
|
|
return new FragmentContainerView(context, attributeSet, this.a);
|
|
}
|
|
if (!"fragment".equals(str)) {
|
|
return null;
|
|
}
|
|
String attributeValue = attributeSet.getAttributeValue(null, Name.LABEL);
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, IUF.LWm.Fragment);
|
|
if (attributeValue == null) {
|
|
attributeValue = obtainStyledAttributes.getString(IUF.LWm.Fragment_android_name);
|
|
}
|
|
int resourceId = obtainStyledAttributes.getResourceId(IUF.LWm.Fragment_android_id, -1);
|
|
String string = obtainStyledAttributes.getString(IUF.LWm.Fragment_android_tag);
|
|
obtainStyledAttributes.recycle();
|
|
if (attributeValue == null || !iAz.isFragmentClass(context.getClassLoader(), attributeValue)) {
|
|
return null;
|
|
}
|
|
int id = view != null ? view.getId() : 0;
|
|
if (id == -1 && resourceId == -1 && string == null) {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(attributeSet.getPositionDescription());
|
|
sb.append(": Must specify unique android:id, android:tag, or have a parent with an id for ");
|
|
sb.append(attributeValue);
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
Fragment findFragmentById = resourceId != -1 ? this.a.findFragmentById(resourceId) : null;
|
|
if (findFragmentById == null && string != null) {
|
|
findFragmentById = this.a.findFragmentByTag(string);
|
|
}
|
|
if (findFragmentById == null && id != -1) {
|
|
findFragmentById = this.a.findFragmentById(id);
|
|
}
|
|
if (findFragmentById == null) {
|
|
findFragmentById = this.a.p().instantiate(context.getClassLoader(), attributeValue);
|
|
findFragmentById.mFromLayout = true;
|
|
findFragmentById.mFragmentId = resourceId != 0 ? resourceId : id;
|
|
findFragmentById.mContainerId = id;
|
|
findFragmentById.mTag = string;
|
|
findFragmentById.mInLayout = true;
|
|
findFragmentById.mFragmentManager = this.a;
|
|
findFragmentById.mHost = this.a.q();
|
|
findFragmentById.onInflate(this.a.q().c, attributeSet, findFragmentById.mSavedFragmentState);
|
|
e = this.a.a(findFragmentById);
|
|
yRS.b(2);
|
|
} else {
|
|
if (findFragmentById.mInLayout) {
|
|
StringBuilder sb2 = new StringBuilder();
|
|
sb2.append(attributeSet.getPositionDescription());
|
|
sb2.append(": Duplicate id 0x");
|
|
sb2.append(Integer.toHexString(resourceId));
|
|
sb2.append(", tag ");
|
|
sb2.append(string);
|
|
sb2.append(", or parent id 0x");
|
|
sb2.append(Integer.toHexString(id));
|
|
sb2.append(" with another fragment for ");
|
|
sb2.append(attributeValue);
|
|
throw new IllegalArgumentException(sb2.toString());
|
|
}
|
|
findFragmentById.mInLayout = true;
|
|
findFragmentById.mFragmentManager = this.a;
|
|
findFragmentById.mHost = this.a.q();
|
|
findFragmentById.onInflate(this.a.q().c, attributeSet, findFragmentById.mSavedFragmentState);
|
|
e = this.a.e(findFragmentById);
|
|
yRS.b(2);
|
|
}
|
|
ViewGroup viewGroup = (ViewGroup) view;
|
|
gFT.zl_(findFragmentById, viewGroup);
|
|
findFragmentById.mContainer = viewGroup;
|
|
e.a();
|
|
e.b();
|
|
if (findFragmentById.mView == null) {
|
|
StringBuilder sb3 = new StringBuilder("Fragment ");
|
|
sb3.append(attributeValue);
|
|
sb3.append(" did not create a view.");
|
|
throw new IllegalStateException(sb3.toString());
|
|
}
|
|
if (resourceId != 0) {
|
|
findFragmentById.mView.setId(resourceId);
|
|
}
|
|
if (findFragmentById.mView.getTag() == null) {
|
|
findFragmentById.mView.setTag(string);
|
|
}
|
|
findFragmentById.mView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener(this, e) { // from class: o.dlK.4
|
|
final LayoutInflaterFactory2C9519dlK a;
|
|
final zMt e;
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
public final void onViewDetachedFromWindow(View view2) {
|
|
}
|
|
|
|
{
|
|
this.a = this;
|
|
this.e = e;
|
|
}
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
public final void onViewAttachedToWindow(View view2) {
|
|
Fragment fragment = this.e.e;
|
|
this.e.a();
|
|
AbstractC17389wOZ.zi_((ViewGroup) fragment.mView.getParent(), this.a.a.v()).d();
|
|
}
|
|
});
|
|
return findFragmentById.mView;
|
|
}
|
|
}
|