convert VKLayoutInflater and VKUILayoutFactory to java
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package com.vk.core.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
public class VKLayoutInflater extends LayoutInflater {
|
||||
|
||||
private final static String[] DEFAULT_PACKAGES = {
|
||||
"android.widget.", "android.webkit.", "android.app."
|
||||
};
|
||||
|
||||
protected VKLayoutInflater(LayoutInflater original, Context context) {
|
||||
super(original, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LayoutInflater cloneInContext(Context newContext) {
|
||||
return new VKLayoutInflater(this, newContext);
|
||||
}
|
||||
|
||||
public final View createView(View parent, String name, Context context, AttributeSet attrs) {
|
||||
if (!name.startsWith("android.")) {
|
||||
try {
|
||||
return onCreateView(parent, name, attrs);
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
try {
|
||||
return createView(name, null, attrs);
|
||||
} catch (ClassNotFoundException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoundException {
|
||||
for (var defPackage : DEFAULT_PACKAGES) {
|
||||
try {
|
||||
View view = createView(name, defPackage, attrs);
|
||||
if (view != null) return view;
|
||||
} catch (ClassCastException | ClassNotFoundException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
return super.onCreateView(name, attrs);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.vk.core.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.InflateException;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
|
||||
import com.vk.core.ui.themes.VKThemeHelper;
|
||||
import com.vk.core.util.OsUtil;
|
||||
import com.vk.core.view.NavigationSpinner;
|
||||
import com.vk.core.view.TextViewColorStateListAndAlphaSupportPreV23;
|
||||
import com.vk.core.view.VKAppBarLayout;
|
||||
|
||||
public class VKUILayoutFactory implements LayoutInflater.Factory2 {
|
||||
|
||||
private final static int[] FONT_ATTR = { android.R.attr.font };
|
||||
private AppCompatDelegate mDelegate;
|
||||
private VKLayoutInflater mInflater;
|
||||
|
||||
public VKUILayoutFactory(AppCompatDelegate delegate, VKLayoutInflater inflater) {
|
||||
mDelegate = delegate;
|
||||
mInflater = inflater;
|
||||
}
|
||||
|
||||
private void setTypeface(TextView textView, Context context, AttributeSet attrs) {
|
||||
TypedArray ta = context.obtainStyledAttributes(attrs, FONT_ATTR, android.R.attr.textViewStyle, 0);
|
||||
if (ta == null) return;
|
||||
Font font = Font.Companion.a(ta.getString(0));
|
||||
if (font != null && Build.VERSION.SDK_INT < font.a())
|
||||
textView.setTypeface(font.c());
|
||||
ta.recycle();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@Nullable View parent, @NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
|
||||
View view = null;
|
||||
try {
|
||||
if (!(parent instanceof NavigationSpinner) && !OsUtil.b())
|
||||
view = new TextViewColorStateListAndAlphaSupportPreV23(context, attrs, 0);
|
||||
else if (mDelegate != null)
|
||||
view = mDelegate.createView(parent, name, context, attrs);
|
||||
else if (mInflater != null)
|
||||
view = mInflater.createView(parent, name, context, attrs);
|
||||
} catch (Throwable unused) {
|
||||
throw new InflateException(
|
||||
"parent=" + parent.getClass().getName()
|
||||
+ ":" + getResourceIdName(view)
|
||||
+ ", view=" + name
|
||||
+ ":" + getResourceIdName(context, attrs));
|
||||
}
|
||||
if (view == null &&
|
||||
("com.google.android.material.appbar.AppBarLayout".equals(name)
|
||||
|| "android.support.design.widget.AppBarLayout".equals(name)))
|
||||
view = new VKAppBarLayout(context, attrs);
|
||||
|
||||
if (view != null) {
|
||||
if (!(view.getTag() instanceof String)) {
|
||||
if (view instanceof TextView) {
|
||||
setTypeface((TextView) view, context, attrs);
|
||||
if (view instanceof CheckBox)
|
||||
VKThemeHelper.k.a((CheckBox) view);
|
||||
else if (view instanceof RadioButton)
|
||||
VKThemeHelper.k.a((RadioButton) view);
|
||||
else if (view instanceof SwitchCompat)
|
||||
VKThemeHelper.k.a((SwitchCompat) view);
|
||||
else if (view instanceof Switch)
|
||||
VKThemeHelper.k.a((Switch) view);
|
||||
} else if (view instanceof WebView) {
|
||||
VKThemeHelper.a((WebView) view);
|
||||
}
|
||||
VKThemeHelper.k.a(view, attrs);
|
||||
}
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
private String getResourceIdName(View view) {
|
||||
try {
|
||||
if (view != null) {
|
||||
if (view.getId() != -1)
|
||||
return view.getResources().getResourceName(view.getId());
|
||||
return "NO_ID";
|
||||
}
|
||||
return "null";
|
||||
} catch (Throwable unused) {
|
||||
return "FAILED_TO_GET_ID";
|
||||
}
|
||||
}
|
||||
|
||||
private String getResourceIdName(Context context, AttributeSet attrs) {
|
||||
TypedArray ta = context.obtainStyledAttributes(attrs, new int[] { android.R.attr.id });
|
||||
int resId = ta.getResourceId(0, -1);
|
||||
ta.recycle();
|
||||
return resId != -1
|
||||
? context.getResources().getResourceName(resId)
|
||||
: "NO_ID";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
|
||||
return onCreateView(null, name, context, attrs);
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class ThemeModel {
|
||||
}
|
||||
|
||||
public static ThemeModel fromJson(JSONObject json) {
|
||||
List<String> palettes = null;
|
||||
List<String> palettes;
|
||||
if (json.has("palettes")) {
|
||||
palettes = new ArrayList<>();
|
||||
var arr = json.optString("palettes")
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
package ru.vtosters.lite.themes.proxy;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.graphics.Color;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import android.util.SparseArray;
|
||||
import android.util.Xml;
|
||||
import android.view.InflateException;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.themes.Recolor;
|
||||
import ru.vtosters.lite.themes.models.ViewModel;
|
||||
import ru.vtosters.lite.utils.AndroidUtils;
|
||||
import ru.vtosters.lite.utils.ThemesUtils;
|
||||
|
||||
public class ProxyLayoutInflater extends LayoutInflater {
|
||||
|
||||
private static final List<Integer> parsedLayouts = new ArrayList<>();
|
||||
private static final SparseArray<SparseArray<ViewModel>> layouts = new SparseArray<>();
|
||||
|
||||
public ProxyLayoutInflater(LayoutInflater layoutInflater, Context context) {
|
||||
super(layoutInflater, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LayoutInflater cloneInContext(Context newContext) {
|
||||
return new ProxyLayoutInflater(this, newContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View inflate(int resource, @Nullable ViewGroup root, boolean attachToRoot) {
|
||||
var target = super.inflate(resource, root, attachToRoot);
|
||||
// if (ThemesUtils.isCustomThemeApplied()) {
|
||||
// parseLayout(resource);
|
||||
// Recolor.recolorViewOrViewGroup(target, layouts.get(resource));
|
||||
// }
|
||||
return target;
|
||||
}
|
||||
|
||||
public static void parseLayout(int layoutId) {
|
||||
if (parsedLayouts.contains(layoutId)) return;
|
||||
var sattrs = new SparseArray<ViewModel>();
|
||||
var parser = AndroidUtils.getResources().getLayout(layoutId);
|
||||
try {
|
||||
checkParser(parser);
|
||||
while (parser.next() != XmlPullParser.END_DOCUMENT) {
|
||||
var name = parser.getName();
|
||||
var attrs = Xml.asAttributeSet(parser);
|
||||
if ("include".equals(name) || "ViewStub".equals(name))
|
||||
parseNodeWithLayoutAttr(attrs);
|
||||
else
|
||||
parseOtherNode(attrs, sattrs);
|
||||
}
|
||||
layouts.put(layoutId, sattrs);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
parsedLayouts.add(layoutId);
|
||||
}
|
||||
|
||||
// parse nodes with names <include> and <ViewStub>, which contain attribute "layout"
|
||||
private static void parseNodeWithLayoutAttr(AttributeSet attrs) {
|
||||
for (int i = 0; i < attrs.getAttributeCount(); i++) {
|
||||
if ("layout".equals(attrs.getAttributeName(i))) {
|
||||
var avalue = attrs.getAttributeResourceValue(i, 0);
|
||||
if (avalue == 0) continue;
|
||||
parseLayout(avalue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void parseOtherNode(AttributeSet attrs, SparseArray<ViewModel> sattrs) {
|
||||
int id = -1;
|
||||
for (int i = 0; i < attrs.getAttributeCount(); i++)
|
||||
if ("id".equals(attrs.getAttributeName(i))) {
|
||||
var avalue = attrs.getAttributeValue(i);
|
||||
if (avalue != null)
|
||||
id = Integer.parseInt(avalue.substring(1));
|
||||
break;
|
||||
}
|
||||
if (id == -1) return;
|
||||
var viewModel = new ViewModel();
|
||||
viewModel.id = id;
|
||||
for (int i = 0; i < attrs.getAttributeCount(); i++) {
|
||||
var aname = attrs.getAttributeNameResource(i);
|
||||
var avalue = attrs.getAttributeValue(i);
|
||||
if (!avalue.startsWith("?")) continue;
|
||||
int val;
|
||||
if (avalue.matches("\\?\\d+")) {
|
||||
val = Integer.parseInt(avalue.substring(1)); // strip "?"
|
||||
} else {
|
||||
var androidAttr = avalue.contains("android:");
|
||||
try {
|
||||
val = AndroidUtils.getResources().getIdentifier(
|
||||
avalue.substring(androidAttr ? 9 : 1), // strip "@android:" or "@"
|
||||
"attr",
|
||||
androidAttr ? "android" : AndroidUtils.getPackageName());
|
||||
} catch (Resources.NotFoundException ignored) {
|
||||
val = 0;
|
||||
}
|
||||
}
|
||||
viewModel.attrs.add(new Pair<>(aname, val));
|
||||
}
|
||||
sattrs.put(id, viewModel);
|
||||
}
|
||||
|
||||
private static void checkParser(XmlResourceParser parser)
|
||||
throws XmlPullParserException, IOException {
|
||||
int type;
|
||||
while ((type = parser.next()) != XmlPullParser.START_TAG
|
||||
&& type != XmlPullParser.END_DOCUMENT) {
|
||||
// Empty
|
||||
}
|
||||
if (type != XmlPullParser.START_TAG)
|
||||
throw new InflateException(parser.getPositionDescription()
|
||||
+ ": No start tag found!");
|
||||
}
|
||||
}
|
||||
@@ -1,379 +0,0 @@
|
||||
.class public Lcom/vk/core/ui/VKLayoutInflater;
|
||||
.super Lru/vtosters/lite/themes/proxy/ProxyLayoutInflater;
|
||||
.source "VKLayoutInflater.kt"
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/MemberClasses;
|
||||
value = {
|
||||
Lcom/vk/core/ui/VKLayoutInflater$a;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
|
||||
# static fields
|
||||
.field static final synthetic c:[Lkotlin/u/KProperty5;
|
||||
|
||||
.field private static final d:[Ljava/lang/String;
|
||||
|
||||
|
||||
# instance fields
|
||||
.field private final a:Lkotlin/Lazy2;
|
||||
|
||||
.field private final b:Lkotlin/Lazy2;
|
||||
|
||||
|
||||
# direct methods
|
||||
.method static constructor <clinit>()V
|
||||
.locals 5
|
||||
|
||||
const/4 v0, 0x2
|
||||
|
||||
new-array v0, v0, [Lkotlin/u/KProperty5;
|
||||
|
||||
new-instance v1, Lkotlin/jvm/internal/PropertyReference1Impl;
|
||||
|
||||
const-class v2, Lcom/vk/core/ui/VKLayoutInflater;
|
||||
|
||||
invoke-static {v2}, Lkotlin/jvm/internal/Reflection;->a(Ljava/lang/Class;)Lkotlin/u/KClass;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
const-string v3, "privateFactory"
|
||||
|
||||
const-string v4, "getPrivateFactory()Landroid/view/LayoutInflater$Factory2;"
|
||||
|
||||
invoke-direct {v1, v2, v3, v4}, Lkotlin/jvm/internal/PropertyReference1Impl;-><init>(Lkotlin/u/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
||||
|
||||
invoke-static {v1}, Lkotlin/jvm/internal/Reflection;->a(Lkotlin/jvm/internal/PropertyReference1;)Lkotlin/u/KProperty2;
|
||||
|
||||
const/4 v2, 0x0
|
||||
|
||||
aput-object v1, v0, v2
|
||||
|
||||
new-instance v1, Lkotlin/jvm/internal/PropertyReference1Impl;
|
||||
|
||||
const-class v2, Lcom/vk/core/ui/VKLayoutInflater;
|
||||
|
||||
invoke-static {v2}, Lkotlin/jvm/internal/Reflection;->a(Ljava/lang/Class;)Lkotlin/u/KClass;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
const-string v3, "constructorArgs"
|
||||
|
||||
const-string v4, "getConstructorArgs()[Ljava/lang/Object;"
|
||||
|
||||
invoke-direct {v1, v2, v3, v4}, Lkotlin/jvm/internal/PropertyReference1Impl;-><init>(Lkotlin/u/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
||||
|
||||
invoke-static {v1}, Lkotlin/jvm/internal/Reflection;->a(Lkotlin/jvm/internal/PropertyReference1;)Lkotlin/u/KProperty2;
|
||||
|
||||
const/4 v2, 0x1
|
||||
|
||||
aput-object v1, v0, v2
|
||||
|
||||
sput-object v0, Lcom/vk/core/ui/VKLayoutInflater;->c:[Lkotlin/u/KProperty5;
|
||||
|
||||
new-instance v0, Lcom/vk/core/ui/VKLayoutInflater$a;
|
||||
|
||||
const/4 v1, 0x0
|
||||
|
||||
invoke-direct {v0, v1}, Lcom/vk/core/ui/VKLayoutInflater$a;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
|
||||
const-string v0, "android.widget."
|
||||
|
||||
const-string v1, "android.webkit."
|
||||
|
||||
const-string v2, "android.app."
|
||||
|
||||
.line 1
|
||||
filled-new-array {v0, v1, v2}, [Ljava/lang/String;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
sput-object v0, Lcom/vk/core/ui/VKLayoutInflater;->d:[Ljava/lang/String;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public constructor <init>(Landroid/view/LayoutInflater;Landroid/content/Context;)V
|
||||
.locals 0
|
||||
|
||||
.line 1
|
||||
invoke-direct {p0, p1, p2}, Lru/vtosters/lite/themes/proxy/ProxyLayoutInflater;-><init>(Landroid/view/LayoutInflater;Landroid/content/Context;)V
|
||||
|
||||
.line 2
|
||||
new-instance p1, Lcom/vk/core/ui/VKLayoutInflater$privateFactory$2;
|
||||
|
||||
invoke-direct {p1, p0}, Lcom/vk/core/ui/VKLayoutInflater$privateFactory$2;-><init>(Lcom/vk/core/ui/VKLayoutInflater;)V
|
||||
|
||||
invoke-static {p1}, Lkotlin/g;->a(Lkotlin/jvm/b/Functions;)Lkotlin/Lazy2;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
iput-object p1, p0, Lcom/vk/core/ui/VKLayoutInflater;->a:Lkotlin/Lazy2;
|
||||
|
||||
.line 3
|
||||
new-instance p1, Lcom/vk/core/ui/VKLayoutInflater$constructorArgs$2;
|
||||
|
||||
invoke-direct {p1, p0}, Lcom/vk/core/ui/VKLayoutInflater$constructorArgs$2;-><init>(Lcom/vk/core/ui/VKLayoutInflater;)V
|
||||
|
||||
invoke-static {p1}, Lkotlin/g;->a(Lkotlin/jvm/b/Functions;)Lkotlin/Lazy2;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
iput-object p1, p0, Lcom/vk/core/ui/VKLayoutInflater;->b:Lkotlin/Lazy2;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method private final a()[Ljava/lang/Object;
|
||||
.locals 3
|
||||
|
||||
iget-object v0, p0, Lcom/vk/core/ui/VKLayoutInflater;->b:Lkotlin/Lazy2;
|
||||
|
||||
sget-object v1, Lcom/vk/core/ui/VKLayoutInflater;->c:[Lkotlin/u/KProperty5;
|
||||
|
||||
const/4 v2, 0x1
|
||||
|
||||
aget-object v1, v1, v2
|
||||
|
||||
invoke-interface {v0}, Lkotlin/Lazy2;->getValue()Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
check-cast v0, [Ljava/lang/Object;
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
.method private final b()Landroid/view/LayoutInflater$Factory2;
|
||||
.locals 3
|
||||
|
||||
iget-object v0, p0, Lcom/vk/core/ui/VKLayoutInflater;->a:Lkotlin/Lazy2;
|
||||
|
||||
sget-object v1, Lcom/vk/core/ui/VKLayoutInflater;->c:[Lkotlin/u/KProperty5;
|
||||
|
||||
const/4 v2, 0x0
|
||||
|
||||
aget-object v1, v1, v2
|
||||
|
||||
invoke-interface {v0}, Lkotlin/Lazy2;->getValue()Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
check-cast v0, Landroid/view/LayoutInflater$Factory2;
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public final a(Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
.locals 9
|
||||
|
||||
.line 1
|
||||
invoke-direct {p0}, Lcom/vk/core/ui/VKLayoutInflater;->b()Landroid/view/LayoutInflater$Factory2;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
const/4 v1, 0x0
|
||||
|
||||
if-eqz v0, :cond_0
|
||||
|
||||
.line 2
|
||||
invoke-interface {v0, p1, p2, p3, p4}, Landroid/view/LayoutInflater$Factory2;->onCreateView(Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_0
|
||||
move-object v0, v1
|
||||
|
||||
:goto_0
|
||||
if-nez v0, :cond_2
|
||||
|
||||
.line 3
|
||||
invoke-direct {p0}, Lcom/vk/core/ui/VKLayoutInflater;->a()[Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
const/4 v2, 0x0
|
||||
|
||||
aget-object v0, v0, v2
|
||||
|
||||
.line 4
|
||||
invoke-direct {p0}, Lcom/vk/core/ui/VKLayoutInflater;->a()[Ljava/lang/Object;
|
||||
|
||||
move-result-object v3
|
||||
|
||||
aput-object p3, v3, v2
|
||||
|
||||
const/4 p3, -0x1
|
||||
|
||||
if-eqz p2, :cond_1
|
||||
|
||||
const/16 v4, 0x2e
|
||||
|
||||
const/4 v5, 0x0
|
||||
|
||||
const/4 v6, 0x0
|
||||
|
||||
const/4 v7, 0x6
|
||||
|
||||
const/4 v8, 0x0
|
||||
|
||||
move-object v3, p2
|
||||
|
||||
.line 5
|
||||
:try_start_0
|
||||
invoke-static/range {v3 .. v8}, Lkotlin/text/l;->a(Ljava/lang/CharSequence;CIZILjava/lang/Object;)I
|
||||
|
||||
move-result v3
|
||||
|
||||
if-ne p3, v3, :cond_1
|
||||
|
||||
.line 6
|
||||
invoke-virtual {p0, p1, p2, p4}, Lru/vtosters/lite/themes/proxy/ProxyLayoutInflater;->onCreateView(Landroid/view/View;Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
goto :goto_1
|
||||
|
||||
.line 7
|
||||
:cond_1
|
||||
invoke-virtual {p0, p2, v1, p4}, Landroid/view/LayoutInflater;->createView(Ljava/lang/String;Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
|
||||
move-result-object p1
|
||||
:try_end_0
|
||||
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||||
|
||||
.line 8
|
||||
:goto_1
|
||||
invoke-direct {p0}, Lcom/vk/core/ui/VKLayoutInflater;->a()[Ljava/lang/Object;
|
||||
|
||||
move-result-object p2
|
||||
|
||||
aput-object v0, p2, v2
|
||||
|
||||
goto :goto_2
|
||||
|
||||
:catchall_0
|
||||
move-exception p1
|
||||
|
||||
invoke-direct {p0}, Lcom/vk/core/ui/VKLayoutInflater;->a()[Ljava/lang/Object;
|
||||
|
||||
move-result-object p2
|
||||
|
||||
aput-object v0, p2, v2
|
||||
|
||||
throw p1
|
||||
|
||||
:cond_2
|
||||
move-object p1, v0
|
||||
|
||||
:goto_2
|
||||
return-object p1
|
||||
.end method
|
||||
|
||||
.method public cloneInContext(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
||||
.locals 1
|
||||
|
||||
.line 1
|
||||
new-instance v0, Lcom/vk/core/ui/VKLayoutInflater;
|
||||
|
||||
invoke-direct {v0, p0, p1}, Lcom/vk/core/ui/VKLayoutInflater;-><init>(Landroid/view/LayoutInflater;Landroid/content/Context;)V
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
.method protected onCreateView(Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
.locals 4
|
||||
.annotation system Ldalvik/annotation/Throws;
|
||||
value = {
|
||||
Ljava/lang/ClassNotFoundException;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.line 1
|
||||
sget-object v0, Lcom/vk/core/ui/VKLayoutInflater;->d:[Ljava/lang/String;
|
||||
|
||||
array-length v1, v0
|
||||
|
||||
const/4 v2, 0x0
|
||||
|
||||
:goto_0
|
||||
if-ge v2, v1, :cond_1
|
||||
|
||||
aget-object v3, v0, v2
|
||||
|
||||
.line 2
|
||||
:try_start_0
|
||||
invoke-virtual {p0, p1, v3, p2}, Landroid/view/LayoutInflater;->createView(Ljava/lang/String;Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
|
||||
move-result-object v3
|
||||
:try_end_0
|
||||
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
||||
|
||||
if-eqz v3, :cond_0
|
||||
|
||||
return-object v3
|
||||
|
||||
:catch_0
|
||||
:cond_0
|
||||
add-int/lit8 v2, v2, 0x1
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 3
|
||||
:cond_1
|
||||
invoke-super {p0, p1, p2}, Lru/vtosters/lite/themes/proxy/ProxyLayoutInflater;->onCreateView(Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
const-string p2, "super.onCreateView(name, attrs)"
|
||||
|
||||
invoke-static {p1, p2}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
||||
|
||||
return-object p1
|
||||
.end method
|
||||
|
||||
.method public inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
|
||||
.registers 4
|
||||
|
||||
invoke-super {p0, p1, p2}, Lru/vtosters/lite/themes/proxy/ProxyLayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
return-object p1
|
||||
.end method
|
||||
|
||||
.method public inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
||||
.registers 4
|
||||
|
||||
invoke-super {p0, p1, p2, p3}, Lru/vtosters/lite/themes/proxy/ProxyLayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
return-object p1
|
||||
.end method
|
||||
|
||||
.method public inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;)Landroid/view/View;
|
||||
.registers 4
|
||||
|
||||
invoke-super {p0, p1, p2}, Lru/vtosters/lite/themes/proxy/ProxyLayoutInflater;->inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;)Landroid/view/View;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
return-object p1
|
||||
.end method
|
||||
|
||||
.method public inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;Z)Landroid/view/View;
|
||||
.registers 4
|
||||
|
||||
invoke-super {p0, p1, p2, p3}, Lru/vtosters/lite/themes/proxy/ProxyLayoutInflater;->inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;Z)Landroid/view/View;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
return-object p1
|
||||
.end method
|
||||
@@ -1,177 +0,0 @@
|
||||
.class public final Lcom/vk/core/ui/VKUILayoutFactory$a;
|
||||
.super Ljava/lang/Object;
|
||||
.source "VKUILayoutFactory.kt"
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/EnclosingClass;
|
||||
value = Lcom/vk/core/ui/VKUILayoutFactory;
|
||||
.end annotation
|
||||
|
||||
.annotation system Ldalvik/annotation/InnerClass;
|
||||
accessFlags = 0x19
|
||||
name = "a"
|
||||
.end annotation
|
||||
|
||||
|
||||
# direct methods
|
||||
.method private constructor <init>()V
|
||||
.locals 0
|
||||
|
||||
.line 1
|
||||
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
.locals 0
|
||||
|
||||
.line 2
|
||||
invoke-direct {p0}, Lcom/vk/core/ui/VKUILayoutFactory$a;-><init>()V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method private final a(Landroid/content/Context;Landroid/util/AttributeSet;)Ljava/lang/String;
|
||||
.locals 3
|
||||
|
||||
const/4 v0, 0x1
|
||||
|
||||
:try_start_0
|
||||
new-array v0, v0, [I
|
||||
|
||||
const v1, 0x10100d0
|
||||
|
||||
const/4 v2, 0x0
|
||||
|
||||
aput v1, v0, v2
|
||||
|
||||
.line 5
|
||||
invoke-static {p1, p2, v0}, Lru/vtosters/lite/themes/VTLResources;->obtainStyledAttributes(Landroid/content/Context;Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
|
||||
|
||||
move-result-object p2
|
||||
|
||||
const/4 v0, -0x1
|
||||
|
||||
.line 6
|
||||
invoke-virtual {p2, v2, v0}, Landroid/content/res/TypedArray;->getResourceId(II)I
|
||||
|
||||
move-result v1
|
||||
|
||||
.line 7
|
||||
invoke-virtual {p2}, Landroid/content/res/TypedArray;->recycle()V
|
||||
|
||||
if-ne v1, v0, :cond_0
|
||||
|
||||
const-string p1, "NO_ID"
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 8
|
||||
:cond_0
|
||||
invoke-static {p1}, Lru/vtosters/lite/themes/proxy/ProxyResources;->addProxyResources(Ljava/lang/Object;)V
|
||||
|
||||
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
|
||||
|
||||
invoke-virtual {p1, v1}, Landroid/content/res/Resources;->getResourceName(I)Ljava/lang/String;
|
||||
|
||||
move-result-object p1
|
||||
:try_end_0
|
||||
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:catchall_0
|
||||
const-string p1, "FAILED_TO_GET_ID"
|
||||
|
||||
:goto_0
|
||||
return-object p1
|
||||
.end method
|
||||
|
||||
.method private final a(Landroid/view/View;)Ljava/lang/String;
|
||||
.locals 2
|
||||
|
||||
if-nez p1, :cond_0
|
||||
|
||||
:try_start_0
|
||||
const-string p1, "null"
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 3
|
||||
:cond_0
|
||||
invoke-virtual {p1}, Landroid/view/View;->getId()I
|
||||
|
||||
move-result v0
|
||||
|
||||
const/4 v1, -0x1
|
||||
|
||||
if-ne v0, v1, :cond_1
|
||||
|
||||
const-string p1, "NO_ID"
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 4
|
||||
:cond_1
|
||||
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
const-string v1, "view.context"
|
||||
|
||||
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
||||
|
||||
invoke-static {v0}, Lru/vtosters/lite/themes/proxy/ProxyResources;->addProxyResources(Ljava/lang/Object;)V
|
||||
|
||||
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
|
||||
|
||||
invoke-virtual {p1}, Landroid/view/View;->getId()I
|
||||
|
||||
move-result p1
|
||||
|
||||
invoke-virtual {v0, p1}, Landroid/content/res/Resources;->getResourceName(I)Ljava/lang/String;
|
||||
|
||||
move-result-object p1
|
||||
:try_end_0
|
||||
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:catchall_0
|
||||
const-string p1, "FAILED_TO_GET_ID"
|
||||
|
||||
:goto_0
|
||||
return-object p1
|
||||
.end method
|
||||
|
||||
.method public static final synthetic a(Lcom/vk/core/ui/VKUILayoutFactory$a;Landroid/content/Context;Landroid/util/AttributeSet;)Ljava/lang/String;
|
||||
.locals 0
|
||||
|
||||
.line 1
|
||||
invoke-direct {p0, p1, p2}, Lcom/vk/core/ui/VKUILayoutFactory$a;->a(Landroid/content/Context;Landroid/util/AttributeSet;)Ljava/lang/String;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
return-object p0
|
||||
.end method
|
||||
|
||||
.method public static final synthetic a(Lcom/vk/core/ui/VKUILayoutFactory$a;Landroid/view/View;)Ljava/lang/String;
|
||||
.locals 0
|
||||
|
||||
.line 2
|
||||
invoke-direct {p0, p1}, Lcom/vk/core/ui/VKUILayoutFactory$a;->a(Landroid/view/View;)Ljava/lang/String;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
return-object p0
|
||||
.end method
|
||||
@@ -1,505 +0,0 @@
|
||||
.class public final Lcom/vk/core/ui/VKUILayoutFactory;
|
||||
.super Ljava/lang/Object;
|
||||
.source "VKUILayoutFactory.kt"
|
||||
|
||||
# interfaces
|
||||
.implements Landroid/view/LayoutInflater$Factory2;
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/MemberClasses;
|
||||
value = {
|
||||
Lcom/vk/core/ui/VKUILayoutFactory$a;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
|
||||
# static fields
|
||||
.field private static final c:[I
|
||||
|
||||
.field public static final d:Lcom/vk/core/ui/VKUILayoutFactory$a;
|
||||
|
||||
|
||||
# instance fields
|
||||
.field private final a:Landroidx/appcompat/app/AppCompatDelegate;
|
||||
|
||||
.field private final b:Lcom/vk/core/ui/VKLayoutInflater;
|
||||
|
||||
|
||||
# direct methods
|
||||
.method static constructor <clinit>()V
|
||||
.locals 3
|
||||
|
||||
new-instance v0, Lcom/vk/core/ui/VKUILayoutFactory$a;
|
||||
|
||||
const/4 v1, 0x0
|
||||
|
||||
invoke-direct {v0, v1}, Lcom/vk/core/ui/VKUILayoutFactory$a;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
|
||||
sput-object v0, Lcom/vk/core/ui/VKUILayoutFactory;->d:Lcom/vk/core/ui/VKUILayoutFactory$a;
|
||||
|
||||
const/4 v0, 0x1
|
||||
|
||||
new-array v0, v0, [I
|
||||
|
||||
const/4 v1, 0x0
|
||||
|
||||
const v2, 0x10103ac
|
||||
|
||||
aput v2, v0, v1
|
||||
|
||||
.line 1
|
||||
sput-object v0, Lcom/vk/core/ui/VKUILayoutFactory;->c:[I
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public constructor <init>(Landroidx/appcompat/app/AppCompatDelegate;Lcom/vk/core/ui/VKLayoutInflater;)V
|
||||
.locals 0
|
||||
|
||||
.line 1
|
||||
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||
|
||||
iput-object p1, p0, Lcom/vk/core/ui/VKUILayoutFactory;->a:Landroidx/appcompat/app/AppCompatDelegate;
|
||||
|
||||
iput-object p2, p0, Lcom/vk/core/ui/VKUILayoutFactory;->b:Lcom/vk/core/ui/VKLayoutInflater;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method private final a(Landroid/widget/TextView;Landroid/content/Context;Landroid/util/AttributeSet;)V
|
||||
.locals 4
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 1
|
||||
:try_start_0
|
||||
sget-object v1, Lcom/vk/core/ui/VKUILayoutFactory;->c:[I
|
||||
|
||||
const v2, 0x1010084
|
||||
|
||||
const/4 v3, 0x0
|
||||
|
||||
invoke-static {p2, p3, v1, v2, v3}, Lru/vtosters/lite/themes/VTLResources;->obtainStyledAttributes(Landroid/content/Context;Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
|
||||
|
||||
move-result-object p2
|
||||
:try_end_0
|
||||
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
|
||||
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
||||
|
||||
.line 2
|
||||
:try_start_1
|
||||
sget-object p3, Lcom/vk/core/ui/Font;->Companion:Lcom/vk/core/ui/Font$a;
|
||||
|
||||
if-eqz p2, :cond_0
|
||||
|
||||
invoke-virtual {p2, v3}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
:cond_0
|
||||
invoke-virtual {p3, v0}, Lcom/vk/core/ui/Font$a;->a(Ljava/lang/String;)Lcom/vk/core/ui/Font;
|
||||
|
||||
move-result-object p3
|
||||
|
||||
if-eqz p3, :cond_1
|
||||
|
||||
.line 3
|
||||
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
||||
|
||||
invoke-virtual {p3}, Lcom/vk/core/ui/Font;->a()I
|
||||
|
||||
move-result v1
|
||||
|
||||
if-ge v0, v1, :cond_1
|
||||
|
||||
.line 4
|
||||
invoke-virtual {p3}, Lcom/vk/core/ui/Font;->c()Landroid/graphics/Typeface;
|
||||
|
||||
move-result-object p3
|
||||
|
||||
invoke-virtual {p1, p3}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V
|
||||
:try_end_1
|
||||
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
|
||||
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
||||
|
||||
:cond_1
|
||||
if-eqz p2, :cond_3
|
||||
|
||||
.line 5
|
||||
:goto_0
|
||||
invoke-virtual {p2}, Landroid/content/res/TypedArray;->recycle()V
|
||||
|
||||
goto :goto_3
|
||||
|
||||
:catchall_0
|
||||
move-exception p1
|
||||
|
||||
goto :goto_1
|
||||
|
||||
:catch_0
|
||||
nop
|
||||
|
||||
goto :goto_2
|
||||
|
||||
:catchall_1
|
||||
move-exception p1
|
||||
|
||||
move-object p2, v0
|
||||
|
||||
:goto_1
|
||||
if-eqz p2, :cond_2
|
||||
|
||||
invoke-virtual {p2}, Landroid/content/res/TypedArray;->recycle()V
|
||||
|
||||
:cond_2
|
||||
throw p1
|
||||
|
||||
:catch_1
|
||||
move-object p2, v0
|
||||
|
||||
:goto_2
|
||||
if-eqz p2, :cond_3
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_3
|
||||
:goto_3
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public onCreateView(Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
.locals 8
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
:try_start_0
|
||||
const-string v1, "TextView"
|
||||
|
||||
.line 2
|
||||
invoke-static {v1, p2}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/Object;)Z
|
||||
|
||||
move-result v1
|
||||
|
||||
if-eqz v1, :cond_0
|
||||
|
||||
instance-of v1, p1, Lcom/vk/core/view/NavigationSpinner;
|
||||
|
||||
if-nez v1, :cond_0
|
||||
|
||||
invoke-static {}, Lcom/vk/core/util/OsUtil;->b()Z
|
||||
|
||||
move-result v1
|
||||
|
||||
if-nez v1, :cond_0
|
||||
|
||||
new-instance v1, Lcom/vk/core/view/TextViewColorStateListAndAlphaSupportPreV23;
|
||||
|
||||
const/4 v5, 0x0
|
||||
|
||||
const/4 v6, 0x4
|
||||
|
||||
const/4 v7, 0x0
|
||||
|
||||
move-object v2, v1
|
||||
|
||||
move-object v3, p3
|
||||
|
||||
move-object v4, p4
|
||||
|
||||
invoke-direct/range {v2 .. v7}, Lcom/vk/core/view/TextViewColorStateListAndAlphaSupportPreV23;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 3
|
||||
:cond_0
|
||||
iget-object v1, p0, Lcom/vk/core/ui/VKUILayoutFactory;->a:Landroidx/appcompat/app/AppCompatDelegate;
|
||||
|
||||
if-eqz v1, :cond_1
|
||||
|
||||
invoke-virtual {v1, p1, p2, p3, p4}, Landroidx/appcompat/app/AppCompatDelegate;->createView(Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_1
|
||||
move-object v1, v0
|
||||
|
||||
:goto_0
|
||||
if-nez v1, :cond_3
|
||||
|
||||
.line 4
|
||||
iget-object v1, p0, Lcom/vk/core/ui/VKUILayoutFactory;->b:Lcom/vk/core/ui/VKLayoutInflater;
|
||||
|
||||
if-eqz v1, :cond_2
|
||||
|
||||
invoke-virtual {v1, p1, p2, p3, p4}, Lcom/vk/core/ui/VKLayoutInflater;->a(Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
|
||||
move-result-object p1
|
||||
:try_end_0
|
||||
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||||
|
||||
move-object v1, p1
|
||||
|
||||
goto :goto_1
|
||||
|
||||
:cond_2
|
||||
move-object v1, v0
|
||||
|
||||
:cond_3
|
||||
:goto_1
|
||||
if-nez v1, :cond_8
|
||||
|
||||
if-nez p2, :cond_4
|
||||
|
||||
goto :goto_3
|
||||
|
||||
.line 5
|
||||
:cond_4
|
||||
invoke-virtual {p2}, Ljava/lang/String;->hashCode()I
|
||||
|
||||
move-result p1
|
||||
|
||||
const v1, -0x1fc92048
|
||||
|
||||
if-eq p1, v1, :cond_6
|
||||
|
||||
const v1, 0x2f753cb4
|
||||
|
||||
if-eq p1, v1, :cond_5
|
||||
|
||||
goto :goto_3
|
||||
|
||||
:cond_5
|
||||
const-string p1, "android.support.design.widget.AppBarLayout"
|
||||
|
||||
.line 6
|
||||
invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
||||
|
||||
move-result p1
|
||||
|
||||
if-eqz p1, :cond_7
|
||||
|
||||
goto :goto_2
|
||||
|
||||
:cond_6
|
||||
const-string p1, "com.google.android.material.appbar.AppBarLayout"
|
||||
|
||||
invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
||||
|
||||
move-result p1
|
||||
|
||||
if-eqz p1, :cond_7
|
||||
|
||||
.line 7
|
||||
:goto_2
|
||||
new-instance v0, Lcom/vk/core/view/VKAppBarLayout;
|
||||
|
||||
invoke-direct {v0, p3, p4}, Lcom/vk/core/view/VKAppBarLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
||||
|
||||
:cond_7
|
||||
:goto_3
|
||||
move-object v1, v0
|
||||
|
||||
:cond_8
|
||||
if-eqz v1, :cond_f
|
||||
|
||||
.line 8
|
||||
invoke-virtual {v1}, Landroid/view/View;->getTag()Ljava/lang/Object;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
.line 9
|
||||
instance-of p2, p1, Ljava/lang/String;
|
||||
|
||||
if-eqz p2, :cond_9
|
||||
|
||||
sget p2, Lb/h/z/k;->dynamic_theme_ignored:I
|
||||
|
||||
invoke-virtual {p3, p2}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
||||
|
||||
move-result-object p2
|
||||
|
||||
invoke-static {p1, p2}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/Object;)Z
|
||||
|
||||
move-result p1
|
||||
|
||||
if-eqz p1, :cond_9
|
||||
|
||||
return-object v1
|
||||
|
||||
.line 10
|
||||
:cond_9
|
||||
instance-of p1, v1, Landroid/widget/TextView;
|
||||
|
||||
if-eqz p1, :cond_d
|
||||
|
||||
.line 11
|
||||
move-object p1, v1
|
||||
|
||||
check-cast p1, Landroid/widget/TextView;
|
||||
|
||||
invoke-direct {p0, p1, p3, p4}, Lcom/vk/core/ui/VKUILayoutFactory;->a(Landroid/widget/TextView;Landroid/content/Context;Landroid/util/AttributeSet;)V
|
||||
|
||||
.line 12
|
||||
instance-of p1, v1, Landroid/widget/CheckBox;
|
||||
|
||||
if-eqz p1, :cond_a
|
||||
|
||||
sget-object p1, Lcom/vk/core/ui/themes/VKThemeHelper;->k:Lcom/vk/core/ui/themes/VKThemeHelper;
|
||||
|
||||
move-object p2, v1
|
||||
|
||||
check-cast p2, Landroid/widget/CheckBox;
|
||||
|
||||
invoke-virtual {p1, p2}, Lcom/vk/core/ui/themes/VKThemeHelper;->a(Landroid/widget/CheckBox;)V
|
||||
|
||||
goto :goto_4
|
||||
|
||||
.line 13
|
||||
:cond_a
|
||||
instance-of p1, v1, Landroid/widget/RadioButton;
|
||||
|
||||
if-eqz p1, :cond_b
|
||||
|
||||
sget-object p1, Lcom/vk/core/ui/themes/VKThemeHelper;->k:Lcom/vk/core/ui/themes/VKThemeHelper;
|
||||
|
||||
move-object p2, v1
|
||||
|
||||
check-cast p2, Landroid/widget/RadioButton;
|
||||
|
||||
invoke-virtual {p1, p2}, Lcom/vk/core/ui/themes/VKThemeHelper;->a(Landroid/widget/RadioButton;)V
|
||||
|
||||
goto :goto_4
|
||||
|
||||
.line 14
|
||||
:cond_b
|
||||
instance-of p1, v1, Landroidx/appcompat/widget/SwitchCompat;
|
||||
|
||||
if-eqz p1, :cond_c
|
||||
|
||||
sget-object p1, Lcom/vk/core/ui/themes/VKThemeHelper;->k:Lcom/vk/core/ui/themes/VKThemeHelper;
|
||||
|
||||
move-object p2, v1
|
||||
|
||||
check-cast p2, Landroidx/appcompat/widget/SwitchCompat;
|
||||
|
||||
invoke-virtual {p1, p2}, Lcom/vk/core/ui/themes/VKThemeHelper;->a(Landroidx/appcompat/widget/SwitchCompat;)V
|
||||
|
||||
goto :goto_4
|
||||
|
||||
.line 15
|
||||
:cond_c
|
||||
instance-of p1, v1, Landroid/widget/Switch;
|
||||
|
||||
if-eqz p1, :cond_e
|
||||
|
||||
sget-object p1, Lcom/vk/core/ui/themes/VKThemeHelper;->k:Lcom/vk/core/ui/themes/VKThemeHelper;
|
||||
|
||||
move-object p2, v1
|
||||
|
||||
check-cast p2, Landroid/widget/Switch;
|
||||
|
||||
invoke-virtual {p1, p2}, Lcom/vk/core/ui/themes/VKThemeHelper;->a(Landroid/widget/Switch;)V
|
||||
|
||||
goto :goto_4
|
||||
|
||||
.line 16
|
||||
:cond_d
|
||||
instance-of p1, v1, Landroid/webkit/WebView;
|
||||
|
||||
if-eqz p1, :cond_e
|
||||
|
||||
.line 17
|
||||
move-object p1, v1
|
||||
|
||||
check-cast p1, Landroid/webkit/WebView;
|
||||
|
||||
invoke-static {p1}, Lcom/vk/core/ui/themes/VKThemeHelper;->a(Landroid/webkit/WebView;)V
|
||||
|
||||
.line 18
|
||||
:cond_e
|
||||
:goto_4
|
||||
sget-object p1, Lcom/vk/core/ui/themes/VKThemeHelper;->k:Lcom/vk/core/ui/themes/VKThemeHelper;
|
||||
|
||||
invoke-virtual {p1, v1, p4}, Lcom/vk/core/ui/themes/VKThemeHelper;->a(Landroid/view/View;Landroid/util/AttributeSet;)V
|
||||
|
||||
:cond_f
|
||||
return-object v1
|
||||
|
||||
:catchall_0
|
||||
move-exception v1
|
||||
|
||||
.line 19
|
||||
new-instance v2, Ljava/lang/StringBuilder;
|
||||
|
||||
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
||||
|
||||
const-string v3, "parent="
|
||||
|
||||
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||
|
||||
if-eqz p1, :cond_10
|
||||
|
||||
invoke-static {p1}, Lcom/vk/core/extensions/GeneralFunctions;->a(Ljava/lang/Object;)Ljava/lang/String;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
:cond_10
|
||||
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||
|
||||
const/16 v0, 0x3a
|
||||
|
||||
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
||||
|
||||
sget-object v3, Lcom/vk/core/ui/VKUILayoutFactory;->d:Lcom/vk/core/ui/VKUILayoutFactory$a;
|
||||
|
||||
invoke-static {v3, p1}, Lcom/vk/core/ui/VKUILayoutFactory$a;->a(Lcom/vk/core/ui/VKUILayoutFactory$a;Landroid/view/View;)Ljava/lang/String;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||
|
||||
const-string p1, ", view="
|
||||
|
||||
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||
|
||||
invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||
|
||||
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
||||
|
||||
sget-object p1, Lcom/vk/core/ui/VKUILayoutFactory;->d:Lcom/vk/core/ui/VKUILayoutFactory$a;
|
||||
|
||||
invoke-static {p1, p3, p4}, Lcom/vk/core/ui/VKUILayoutFactory$a;->a(Lcom/vk/core/ui/VKUILayoutFactory$a;Landroid/content/Context;Landroid/util/AttributeSet;)Ljava/lang/String;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||
|
||||
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
.line 20
|
||||
new-instance p2, Landroid/view/InflateException;
|
||||
|
||||
invoke-direct {p2, p1, v1}, Landroid/view/InflateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
||||
|
||||
throw p2
|
||||
.end method
|
||||
|
||||
.method public onCreateView(Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
.locals 1
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 1
|
||||
invoke-virtual {p0, v0, p1, p2, p3}, Lcom/vk/core/ui/VKUILayoutFactory;->onCreateView(Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
return-object p1
|
||||
.end method
|
||||
Reference in New Issue
Block a user