Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
package com.ubtech.view;
/* loaded from: classes2.dex */
public interface BaseView<T> {
void setPresenter(T t);
}

View File

@@ -0,0 +1,25 @@
package com.ubtech.view.dialog;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import com.ubtech.R$style;
/* loaded from: classes2.dex */
public class BaseDialog extends Dialog {
protected Context a;
public BaseDialog(Context context) {
this(context, R$style.Dialog);
}
@Override // android.app.Dialog
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
}
public BaseDialog(Context context, int i) {
super(context, i);
this.a = context;
}
}

View File

@@ -0,0 +1,212 @@
package com.ubtech.view.dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import com.ubtech.R$color;
import com.ubtech.R$dimen;
import com.ubtech.R$layout;
import com.ubtech.utils.DisplayUtil;
import com.ubtech.view.dialog.SimpleDialog;
/* loaded from: classes2.dex */
public class BigDialog$Builder extends SimpleDialog.Builder {
public BigDialog$Builder(Context context) {
super(context);
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public /* bridge */ /* synthetic */ SimpleDialog.Builder a(int i) {
a(i);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public /* bridge */ /* synthetic */ SimpleDialog.Builder b(String str) {
b(str);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public /* bridge */ /* synthetic */ SimpleDialog.Builder c(int i) {
c(i);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public /* bridge */ /* synthetic */ SimpleDialog.Builder d(int i) {
d(i);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public /* bridge */ /* synthetic */ SimpleDialog.Builder a(int i, boolean z) {
a(i, z);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public /* bridge */ /* synthetic */ SimpleDialog.Builder b(DialogInterface.OnClickListener onClickListener) {
b(onClickListener);
return this;
}
public BigDialog$Builder c(String str) {
this.b = str;
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public BigDialog$Builder d(int i) {
this.e = this.a.getString(i);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public /* bridge */ /* synthetic */ SimpleDialog.Builder a(String str) {
a(str);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public SimpleDialog.Builder b(int i) {
this.c = this.a.getString(i);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public BigDialog$Builder c(int i) {
this.f = i;
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public /* bridge */ /* synthetic */ SimpleDialog.Builder a(boolean z) {
a(z);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public BigDialog$Builder b(String str) {
this.e = str;
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public /* bridge */ /* synthetic */ SimpleDialog.Builder a(CharSequence charSequence) {
a(charSequence);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public BigDialog$Builder b(DialogInterface.OnClickListener onClickListener) {
this.l = onClickListener;
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public /* bridge */ /* synthetic */ SimpleDialog.Builder a(DialogInterface.OnClickListener onClickListener) {
a(onClickListener);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public SimpleDialog a() {
SimpleDialog simpleDialog = new SimpleDialog(this.a);
simpleDialog.requestWindowFeature(1);
simpleDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
simpleDialog.e = this.n;
simpleDialog.b = this.c;
simpleDialog.d = this.e;
simpleDialog.c = this.d;
simpleDialog.j = this.l;
simpleDialog.i = this.k;
simpleDialog.k = this.m;
simpleDialog.f = this.o;
simpleDialog.h = this.q;
simpleDialog.g = this.p;
View inflate = LayoutInflater.from(this.a).inflate(R$layout.comm_dialog_big, (ViewGroup) null, false);
simpleDialog.a(inflate, this);
simpleDialog.setContentView(inflate);
simpleDialog.setCanceledOnTouchOutside(this.h);
simpleDialog.setCancelable(this.i);
Window window = simpleDialog.getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
window.setBackgroundDrawableResource(R$color.comm_transparent);
int a = DisplayUtil.a(this.a, R$dimen.theme_big_dialog_window_width);
int a2 = DisplayUtil.a(this.a, R$dimen.theme_big_dialog_window_height);
attributes.width = a;
attributes.height = a2;
attributes.gravity = 17;
window.setAttributes(attributes);
return simpleDialog;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public BigDialog$Builder a(CharSequence charSequence) {
this.c = charSequence;
return this;
}
public BigDialog$Builder a(CharSequence charSequence, int i) {
this.c = charSequence;
this.o = i;
return this;
}
public BigDialog$Builder a(View.OnClickListener onClickListener) {
this.m = onClickListener;
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public BigDialog$Builder a(String str) {
this.d = str;
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public SimpleDialog.Builder a(String str, boolean z) {
this.d = str;
this.n = z;
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public BigDialog$Builder a(int i) {
this.d = this.a.getString(i);
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public BigDialog$Builder a(int i, boolean z) {
this.d = this.a.getString(i);
this.n = z;
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public BigDialog$Builder a(boolean z) {
this.h = z;
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public SimpleDialog.Builder a(String str, int i, int i2) {
this.g = str;
this.p = i;
this.q = i2;
return this;
}
@Override // com.ubtech.view.dialog.SimpleDialog.Builder
public BigDialog$Builder a(DialogInterface.OnClickListener onClickListener) {
this.k = onClickListener;
return this;
}
}

View File

@@ -0,0 +1,283 @@
package com.ubtech.view.dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.text.TextUtils;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.ubtech.R$color;
import com.ubtech.R$dimen;
import com.ubtech.R$id;
import com.ubtech.R$layout;
import com.ubtech.utils.DisplayUtil;
import com.ubtech.view.widget.UButton;
/* loaded from: classes2.dex */
public class SimpleDialog extends BaseDialog implements View.OnClickListener {
public CharSequence b;
public String c;
public String d;
public boolean e;
public int f;
public int g;
public int h;
public DialogInterface.OnClickListener i;
public DialogInterface.OnClickListener j;
public View.OnClickListener k;
private TextView l;
private TextView m;
private ImageView n;
public UButton o;
public UButton p;
public UButton q;
public UButton r;
public static class Builder {
protected Context a;
protected String b;
protected CharSequence c;
protected String d;
protected String e;
protected String g;
protected DialogInterface.OnClickListener k;
protected DialogInterface.OnClickListener l;
protected View.OnClickListener m;
protected int o;
protected int f = 0;
protected boolean h = true;
protected boolean i = true;
protected int j = 17;
protected boolean n = false;
protected int p = -1;
protected int q = -1;
public Builder(Context context) {
this.o = 0;
this.a = context;
this.o = context.getResources().getColor(R$color.comm_bg_596F80);
}
public SimpleDialog a() {
SimpleDialog simpleDialog = new SimpleDialog(this.a);
simpleDialog.requestWindowFeature(1);
simpleDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
simpleDialog.e = this.n;
simpleDialog.b = this.c;
simpleDialog.d = this.e;
simpleDialog.c = this.d;
simpleDialog.j = this.l;
simpleDialog.i = this.k;
simpleDialog.k = this.m;
simpleDialog.f = this.o;
simpleDialog.h = this.q;
simpleDialog.g = this.p;
View inflate = LayoutInflater.from(this.a).inflate(R$layout.comm_dialog_simple, (ViewGroup) null, false);
simpleDialog.a(inflate, this);
simpleDialog.setContentView(inflate);
simpleDialog.setCanceledOnTouchOutside(this.h);
simpleDialog.setCancelable(this.i);
Window window = simpleDialog.getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
window.setBackgroundDrawableResource(R$color.comm_transparent);
int a = DisplayUtil.a(this.a, R$dimen.theme_dialog_window_width);
int a2 = DisplayUtil.a(this.a, R$dimen.theme_dialog_window_height);
attributes.width = a;
attributes.height = a2;
attributes.gravity = 17;
window.setAttributes(attributes);
return simpleDialog;
}
public Builder b(int i) {
this.c = this.a.getString(i);
return this;
}
public Builder c(int i) {
this.f = i;
return this;
}
public Builder d(int i) {
this.e = this.a.getString(i);
return this;
}
public Builder b(String str) {
this.e = str;
return this;
}
public Builder b(boolean z) {
this.i = z;
return this;
}
public Builder b(DialogInterface.OnClickListener onClickListener) {
this.l = onClickListener;
return this;
}
public Builder a(CharSequence charSequence) {
this.c = charSequence;
return this;
}
public Builder a(String str) {
this.d = str;
return this;
}
public Builder a(String str, boolean z) {
this.d = str;
this.n = z;
return this;
}
public Builder a(int i) {
this.d = this.a.getString(i);
return this;
}
public Builder a(int i, boolean z) {
this.d = this.a.getString(i);
this.n = z;
return this;
}
public Builder a(boolean z) {
this.h = z;
return this;
}
public Builder a(String str, int i, int i2) {
this.g = str;
this.p = i;
this.q = i2;
return this;
}
public Builder a(DialogInterface.OnClickListener onClickListener) {
this.k = onClickListener;
return this;
}
}
public SimpleDialog(Context context) {
super(context);
this.e = false;
this.f = 0;
this.g = -1;
this.h = -1;
}
public void a(View view, Builder builder) {
this.l = (TextView) view.findViewById(R$id.tvDialogTitle);
this.m = (TextView) view.findViewById(R$id.tvTips);
this.n = (ImageView) view.findViewById(R$id.imgLogo);
this.p = (UButton) view.findViewById(R$id.btn_gray_cancel);
this.q = (UButton) view.findViewById(R$id.btn_blue_cancel);
this.q.setOnClickListener(this);
this.o = (UButton) view.findViewById(R$id.btn_ok);
this.r = (UButton) view.findViewById(R$id.btn_gray_cancel);
this.r.setOnClickListener(this);
this.o.setOnClickListener(this);
if (!TextUtils.isEmpty(this.b)) {
this.m.setText(this.b);
this.m.setMovementMethod(ScrollingMovementMethod.getInstance());
}
this.m.setOnClickListener(this);
if (this.j == null) {
this.o.setVisibility(8);
}
if (!TextUtils.isEmpty(this.d)) {
this.o.setText(this.d);
}
if (TextUtils.isEmpty(builder.b)) {
this.l.setVisibility(8);
} else {
this.l.setVisibility(0);
this.l.setText(builder.b);
}
if (TextUtils.isEmpty(builder.g)) {
int i = builder.f;
if (i != 0) {
this.n.setImageResource(i);
this.n.setVisibility(0);
} else {
this.n.setVisibility(8);
}
} else {
Glide.e(getContext()).a(builder.g).a(this.n);
this.n.setVisibility(0);
if (this.h > 0 && this.g > 0) {
ViewGroup.LayoutParams layoutParams = this.n.getLayoutParams();
layoutParams.height = this.h;
layoutParams.width = this.g;
this.n.setLayoutParams(layoutParams);
}
}
int i2 = builder.j;
if (17 != i2) {
this.m.setGravity(i2);
}
if (this.e) {
this.q.setVisibility(8);
this.p.setVisibility(0);
this.r = this.p;
} else {
this.q.setVisibility(0);
this.p.setVisibility(8);
this.r = this.q;
}
if (this.i == null) {
this.p.setVisibility(8);
this.q.setVisibility(8);
}
if (!TextUtils.isEmpty(this.c)) {
this.r.setText(this.c);
}
this.m.setTextColor(this.f);
}
@Override // android.view.View.OnClickListener
public void onClick(View view) {
int id = view.getId();
if (id == R$id.btn_gray_cancel || id == R$id.btn_blue_cancel) {
DialogInterface.OnClickListener onClickListener = this.i;
if (onClickListener != null) {
onClickListener.onClick(this, 0);
return;
} else {
dismiss();
return;
}
}
if (id == R$id.btn_ok) {
DialogInterface.OnClickListener onClickListener2 = this.j;
if (onClickListener2 != null) {
onClickListener2.onClick(this, 0);
return;
} else {
dismiss();
return;
}
}
if (id != R$id.tvTips) {
dismiss();
return;
}
View.OnClickListener onClickListener3 = this.k;
if (onClickListener3 != null) {
onClickListener3.onClick(this.m);
}
}
}

View File

@@ -0,0 +1,60 @@
package com.ubtech.view.fragment;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import com.ubtrobot.ubtlib.analytics.JimuAnalytics;
/* loaded from: classes2.dex */
public class BaseFragment extends Fragment {
public final String TAG = getClass().getSimpleName();
protected Activity mActivity;
protected View mView;
@Override // androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
this.mActivity = (Activity) context;
}
public boolean onBackPressed() {
return false;
}
@Override // androidx.fragment.app.Fragment
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (this.mActivity == null) {
this.mActivity = getActivity();
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
return super.onCreateView(layoutInflater, viewGroup, bundle);
}
protected void onPagePause() {
}
protected void onPageResume() {
}
protected void recordEvent(String str) {
JimuAnalytics.b().a(str);
}
@Override // androidx.fragment.app.Fragment
public void setUserVisibleHint(boolean z) {
super.setUserVisibleHint(z);
if (z) {
onPageResume();
} else {
onPagePause();
}
}
}

View File

@@ -0,0 +1,43 @@
package com.ubtech.view.fragment;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.Fragment;
/* loaded from: classes2.dex */
public abstract class LazyLoadFragment extends Fragment {
private boolean isLoaded;
protected Activity mActivity;
protected void lazyLoad() {
if (this.isLoaded && getUserVisibleHint()) {
loadData();
this.isLoaded = false;
}
}
protected abstract void loadData();
@Override // androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
this.mActivity = (Activity) context;
}
@Override // androidx.fragment.app.Fragment
public void onViewCreated(View view, Bundle bundle) {
super.onViewCreated(view, bundle);
this.isLoaded = true;
lazyLoad();
}
@Override // androidx.fragment.app.Fragment
public void setUserVisibleHint(boolean z) {
super.setUserVisibleHint(z);
if (z) {
lazyLoad();
}
}
}

View File

@@ -0,0 +1,58 @@
package com.ubtech.view.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.webkit.WebView;
/* loaded from: classes2.dex */
public class AWebView extends WebView {
private int a;
private WebViewScrollChangeListener b;
public interface WebViewScrollChangeListener {
void a(int i, int i2, int i3, int i4);
void b(int i, int i2, int i3, int i4);
void c(int i, int i2, int i3, int i4);
}
public AWebView(Context context) {
super(context);
this.a = 150;
}
@Override // android.webkit.WebView, android.view.View
protected void onScrollChanged(int i, int i2, int i3, int i4) {
super.onScrollChanged(i, i2, i3, i4);
if (this.b == null) {
return;
}
if (Math.abs((getContentHeight() * getScale()) - (getHeight() + getScrollY())) < this.a) {
this.b.b(i, i2, i3, i4);
} else if (getScrollY() == 0) {
this.b.a(i, i2, i3, i4);
} else {
this.b.c(i, i2, i3, i4);
}
}
public void setOnScrollChangeListener(WebViewScrollChangeListener webViewScrollChangeListener) {
this.b = webViewScrollChangeListener;
}
public AWebView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.a = 150;
}
public AWebView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.a = 150;
}
public AWebView(Context context, AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
this.a = 150;
}
}

View File

@@ -0,0 +1,102 @@
package com.ubtech.view.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.ubtech.R$id;
import com.ubtech.R$layout;
/* loaded from: classes2.dex */
public class ErrorView extends LinearLayout {
private ImageView a;
private TextView b;
private ResAgent c;
private Observable d;
private View[] e;
public interface Observable {
boolean a();
}
public interface ResAgent {
ResData[] a();
}
public static class ResData {
public int a;
public int b;
public int c;
public ResData(int i, int i2, int i3) {
this.a = i;
this.b = i2;
this.c = i3;
}
}
public ErrorView(Context context) {
this(context, null);
}
private void a(Context context, AttributeSet attributeSet) {
setOrientation(1);
setGravity(17);
LayoutInflater.from(context).inflate(R$layout.comm_error, this);
this.a = (ImageView) findViewById(R$id.iv_icon);
this.b = (TextView) findViewById(R$id.tv_msg);
}
public void setType(int i) {
ResData[] a = this.c.a();
if (a == null) {
return;
}
for (ResData resData : a) {
if (resData != null && resData.a == i) {
this.a.setBackgroundResource(resData.b);
this.b.setText(resData.c);
return;
}
}
}
public ErrorView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public ErrorView(Context context, AttributeSet attributeSet, int i) {
this(context, attributeSet, i, 0);
}
public ErrorView(Context context, AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
a(context, attributeSet);
}
public void a(ResAgent resAgent) {
this.c = resAgent;
}
public void a(Observable observable, View... viewArr) {
this.d = observable;
this.e = viewArr;
}
public void a() {
Observable observable = this.d;
boolean a = observable != null ? observable.a() : false;
setVisibility(a ? 0 : 8);
View[] viewArr = this.e;
if (viewArr != null) {
for (View view : viewArr) {
if (view != null) {
view.setVisibility(!a ? 0 : 8);
}
}
}
}
}

View File

@@ -0,0 +1,68 @@
package com.ubtech.view.widget;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.ubtech.R$id;
import com.ubtech.R$layout;
import com.ubtech.utils.DisplayUtil;
/* loaded from: classes2.dex */
public class ToastView {
private static ToastView c;
private Toast a = null;
private long b = 0;
public enum Type {
NORMAL,
SUCCESS,
ERROR
}
private ToastView() {
}
public static ToastView a(Context context, CharSequence charSequence, Type type) {
if (c == null) {
c = new ToastView();
}
ToastView toastView = c;
if (toastView.a == null) {
toastView.a = new Toast(context);
c.a.setView(LayoutInflater.from(context).inflate(R$layout.comm_layout_toast, (ViewGroup) null));
c.a.setGravity(17, 0, 0);
}
TextView textView = (TextView) c.a.getView().findViewById(R$id.textView);
textView.setText(charSequence);
if (!TextUtils.isEmpty(charSequence)) {
float b = (DisplayUtil.b(context) / 3.0f) * 2.0f;
if (textView.getPaint().measureText(charSequence.toString()) > b) {
ViewGroup.LayoutParams layoutParams = textView.getLayoutParams();
layoutParams.width = (int) b;
textView.setLayoutParams(layoutParams);
}
}
return c;
}
public static ToastView a(Context context, CharSequence charSequence) {
return a(context, charSequence, Type.NORMAL);
}
public static ToastView a(Context context, int i) {
return a(context, context.getResources().getString(i), Type.NORMAL);
}
public void a() {
Log.e("Test", "显示Toast");
long currentTimeMillis = System.currentTimeMillis();
if (currentTimeMillis - this.b > 1000) {
this.a.show();
this.b = currentTimeMillis;
}
}
}

View File

@@ -0,0 +1,24 @@
package com.ubtech.view.widget;
import android.content.Context;
import android.util.AttributeSet;
import androidx.appcompat.widget.AppCompatButton;
/* loaded from: classes2.dex */
public class UButton extends AppCompatButton {
public UButton(Context context) {
this(context, null);
}
private void a(Context context, AttributeSet attributeSet) {
}
public UButton(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public UButton(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
a(context, attributeSet);
}
}

View File

@@ -0,0 +1,145 @@
package com.ubtech.view.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.ubtech.R$styleable;
import com.ubtech.utils.DensityUtils;
/* loaded from: classes2.dex */
public class UFrameLayout extends FrameLayout {
private int a;
private float b;
public static class LayoutParams extends FrameLayout.LayoutParams {
private float a;
private float b;
private float c;
private float d;
private float e;
private float f;
public LayoutParams(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.u_layout, 0, 0);
this.a = obtainStyledAttributes.getFloat(R$styleable.u_layout_height_percent, 0.0f);
this.b = obtainStyledAttributes.getFloat(R$styleable.u_layout_width_percent, 0.0f);
this.c = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_left_percent, 0.0f);
this.d = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_top_percent, 0.0f);
this.e = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_right_percent, 0.0f);
this.f = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_bottom_percent, 0.0f);
obtainStyledAttributes.recycle();
}
public float a() {
return this.f;
}
public float b() {
return this.a;
}
public float c() {
return this.c;
}
public float d() {
return this.e;
}
public float e() {
return this.d;
}
public float f() {
return this.b;
}
}
public UFrameLayout(Context context) {
this(context, null);
}
private void a(Context context, AttributeSet attributeSet) {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
this.a = Math.min(displayMetrics.widthPixels, displayMetrics.heightPixels);
this.b = this.a / (DensityUtils.a(context, 720) * 1.0f);
}
@Override // android.view.ViewGroup
public void addView(View view, int i, ViewGroup.LayoutParams layoutParams) {
super.addView(view, i, layoutParams);
if (view instanceof TextView) {
TextView textView = (TextView) view;
textView.setTextSize(0, textView.getTextSize() * this.b);
}
}
@Override // android.widget.FrameLayout, android.view.ViewGroup, android.view.View
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
}
@Override // android.widget.FrameLayout, android.view.View
protected void onMeasure(int i, int i2) {
float f;
float f2;
float f3;
float f4;
float f5;
float f6;
for (int i3 = 0; i3 < getChildCount(); i3++) {
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) getChildAt(i3).getLayoutParams();
if (layoutParams instanceof LayoutParams) {
LayoutParams layoutParams2 = (LayoutParams) layoutParams;
f2 = layoutParams2.f();
f3 = layoutParams2.b();
f4 = layoutParams2.c();
f5 = layoutParams2.e();
f6 = layoutParams2.d();
f = layoutParams2.a();
} else {
f = 0.0f;
f2 = 0.0f;
f3 = 0.0f;
f4 = 0.0f;
f5 = 0.0f;
f6 = 0.0f;
}
if (f3 != 0.0f) {
layoutParams.height = (int) Math.ceil(this.a * f3);
}
if (f2 != 0.0f) {
layoutParams.width = (int) Math.ceil(layoutParams.height * f2);
}
if (f4 != 0.0f) {
layoutParams.leftMargin = (int) Math.ceil(this.a * f4);
}
if (f5 != 0.0f) {
layoutParams.topMargin = (int) Math.ceil(this.a * f5);
}
if (f6 != 0.0f) {
layoutParams.rightMargin = (int) Math.ceil(this.a * f6);
}
if (f != 0.0f) {
layoutParams.bottomMargin = (int) Math.ceil(this.a * f);
}
}
super.onMeasure(i, i2);
}
public UFrameLayout(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
a(context, attributeSet);
}
@Override // android.widget.FrameLayout, android.view.ViewGroup
public FrameLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
return new LayoutParams(getContext(), attributeSet);
}
}

View File

@@ -0,0 +1,140 @@
package com.ubtech.view.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.ubtech.R$styleable;
import com.ubtech.utils.DensityUtils;
/* loaded from: classes2.dex */
public class ULinearLayout extends LinearLayout {
private int a;
private float b;
public static class LayoutParams extends LinearLayout.LayoutParams {
private float a;
private float b;
private float c;
private float d;
private float e;
private float f;
public LayoutParams(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.u_layout, 0, 0);
this.a = obtainStyledAttributes.getFloat(R$styleable.u_layout_height_percent, 0.0f);
this.b = obtainStyledAttributes.getFloat(R$styleable.u_layout_width_percent, 0.0f);
this.c = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_left_percent, 0.0f);
this.d = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_top_percent, 0.0f);
this.e = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_right_percent, 0.0f);
this.f = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_bottom_percent, 0.0f);
obtainStyledAttributes.recycle();
}
public float a() {
return this.f;
}
public float b() {
return this.a;
}
public float c() {
return this.c;
}
public float d() {
return this.e;
}
public float e() {
return this.d;
}
public float f() {
return this.b;
}
}
public ULinearLayout(Context context) {
this(context, null);
}
private void a(Context context, AttributeSet attributeSet) {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
this.a = Math.min(displayMetrics.widthPixels, displayMetrics.heightPixels);
this.b = this.a / (DensityUtils.a(context, 720) * 1.0f);
}
@Override // android.view.ViewGroup
public void addView(View view, int i, ViewGroup.LayoutParams layoutParams) {
super.addView(view, i, layoutParams);
if (view instanceof TextView) {
TextView textView = (TextView) view;
textView.setTextSize(0, textView.getTextSize() * this.b);
}
}
@Override // android.widget.LinearLayout, android.view.View
protected void onMeasure(int i, int i2) {
float f;
float f2;
float f3;
float f4;
float f5;
float f6;
for (int i3 = 0; i3 < getChildCount(); i3++) {
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) getChildAt(i3).getLayoutParams();
if (layoutParams instanceof LayoutParams) {
LayoutParams layoutParams2 = (LayoutParams) layoutParams;
f2 = layoutParams2.f();
f3 = layoutParams2.b();
f4 = layoutParams2.c();
f5 = layoutParams2.e();
f6 = layoutParams2.d();
f = layoutParams2.a();
} else {
f = 0.0f;
f2 = 0.0f;
f3 = 0.0f;
f4 = 0.0f;
f5 = 0.0f;
f6 = 0.0f;
}
if (f3 != 0.0f) {
layoutParams.height = (int) Math.ceil(this.a * f3);
}
if (f2 != 0.0f) {
layoutParams.width = (int) Math.ceil(layoutParams.height * f2);
}
if (f4 != 0.0f) {
layoutParams.leftMargin = (int) Math.ceil(this.a * f4);
}
if (f5 != 0.0f) {
layoutParams.topMargin = (int) Math.ceil(this.a * f5);
}
if (f6 != 0.0f) {
layoutParams.rightMargin = (int) Math.ceil(this.a * f6);
}
if (f != 0.0f) {
layoutParams.bottomMargin = (int) Math.ceil(this.a * f);
}
}
super.onMeasure(i, i2);
}
public ULinearLayout(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
a(context, attributeSet);
}
@Override // android.widget.LinearLayout, android.view.ViewGroup
public LinearLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
return new LayoutParams(getContext(), attributeSet);
}
}

View File

@@ -0,0 +1,146 @@
package com.ubtech.view.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.ViewFlipper;
import com.ubtech.R$styleable;
import com.ubtech.utils.DensityUtils;
/* loaded from: classes2.dex */
public class UViewFlipper extends ViewFlipper {
private int a;
private float b;
public static class LayoutParams extends FrameLayout.LayoutParams {
private float a;
private float b;
private float c;
private float d;
private float e;
private float f;
public LayoutParams(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.u_layout, 0, 0);
this.a = obtainStyledAttributes.getFloat(R$styleable.u_layout_height_percent, 0.0f);
this.b = obtainStyledAttributes.getFloat(R$styleable.u_layout_width_percent, 0.0f);
this.c = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_left_percent, 0.0f);
this.d = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_top_percent, 0.0f);
this.e = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_right_percent, 0.0f);
this.f = obtainStyledAttributes.getFloat(R$styleable.u_layout_margin_bottom_percent, 0.0f);
obtainStyledAttributes.recycle();
}
public float a() {
return this.f;
}
public float b() {
return this.a;
}
public float c() {
return this.c;
}
public float d() {
return this.e;
}
public float e() {
return this.d;
}
public float f() {
return this.b;
}
}
public UViewFlipper(Context context) {
this(context, null);
}
private void a(Context context, AttributeSet attributeSet) {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
this.a = Math.min(displayMetrics.widthPixels, displayMetrics.heightPixels);
this.b = this.a / (DensityUtils.a(context, 720) * 1.0f);
}
@Override // android.widget.ViewAnimator, android.view.ViewGroup
public void addView(View view, int i, ViewGroup.LayoutParams layoutParams) {
super.addView(view, i, layoutParams);
if (view instanceof TextView) {
TextView textView = (TextView) view;
textView.setTextSize(0, textView.getTextSize() * this.b);
}
}
@Override // android.widget.FrameLayout, android.view.ViewGroup, android.view.View
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
}
@Override // android.widget.FrameLayout, android.view.View
protected void onMeasure(int i, int i2) {
float f;
float f2;
float f3;
float f4;
float f5;
float f6;
for (int i3 = 0; i3 < getChildCount(); i3++) {
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) getChildAt(i3).getLayoutParams();
if (layoutParams instanceof LayoutParams) {
LayoutParams layoutParams2 = (LayoutParams) layoutParams;
f2 = layoutParams2.f();
f3 = layoutParams2.b();
f4 = layoutParams2.c();
f5 = layoutParams2.e();
f6 = layoutParams2.d();
f = layoutParams2.a();
} else {
f = 0.0f;
f2 = 0.0f;
f3 = 0.0f;
f4 = 0.0f;
f5 = 0.0f;
f6 = 0.0f;
}
if (f3 != 0.0f) {
layoutParams.height = (int) Math.ceil(this.a * f3);
}
if (f2 != 0.0f) {
layoutParams.width = (int) Math.ceil(layoutParams.height * f2);
}
if (f4 != 0.0f) {
layoutParams.leftMargin = (int) Math.ceil(this.a * f4);
}
if (f5 != 0.0f) {
layoutParams.topMargin = (int) Math.ceil(this.a * f5);
}
if (f6 != 0.0f) {
layoutParams.rightMargin = (int) Math.ceil(this.a * f6);
}
if (f != 0.0f) {
layoutParams.bottomMargin = (int) Math.ceil(this.a * f);
}
}
super.onMeasure(i, i2);
}
public UViewFlipper(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
a(context, attributeSet);
}
@Override // android.widget.FrameLayout, android.view.ViewGroup
public FrameLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
return new LayoutParams(getContext(), attributeSet);
}
}

View File

@@ -0,0 +1,66 @@
package com.ubtech.view.widget;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.FrameLayout;
import com.ubtech.R$id;
import com.ubtech.R$layout;
import com.ubtech.view.widget.AWebView;
/* loaded from: classes2.dex */
public class UWebLayout extends FrameLayout {
private AWebView a;
public UWebLayout(Context context) {
this(context, null);
}
private void a(Context context, AttributeSet attributeSet) {
LayoutInflater.from(context).inflate(R$layout.lay_webview, this);
this.a = (AWebView) findViewById(R$id.wv_content);
if (Build.VERSION.SDK_INT >= 11) {
this.a.removeJavascriptInterface("searchBoxJavaBridge_");
this.a.removeJavascriptInterface("accessibility");
this.a.removeJavascriptInterface("accessibilityTraversal");
}
WebSettings settings = this.a.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
settings.setAllowFileAccess(true);
settings.setSupportZoom(true);
settings.setCacheMode(-1);
settings.setBuiltInZoomControls(false);
settings.setLoadsImagesAutomatically(true);
settings.setDefaultTextEncodingName("UTF-8");
settings.setLoadWithOverviewMode(true);
}
public WebView b() {
return this.a;
}
public void setOnScollChangeListener(AWebView.WebViewScrollChangeListener webViewScrollChangeListener) {
this.a.setOnScrollChangeListener(webViewScrollChangeListener);
}
public UWebLayout(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public UWebLayout(Context context, AttributeSet attributeSet, int i) {
this(context, attributeSet, i, 0);
}
public UWebLayout(Context context, AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
a(context, attributeSet);
}
public WebSettings a() {
return this.a.getSettings();
}
}