导航菜单

页面标题

页面副标题

Minits v4.9.3.32 - EditViewHyper.java 源代码

正在查看: Minits v4.9.3.32 应用的 EditViewHyper.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.xone.android.framework.activities;

import C8.m;
import C8.o;
import C9.e;
import C9.h;
import F8.C0159v;
import F8.C0164w;
import F8.C0169x;
import F8.I;
import F8.K;
import Q8.k;
import ab.AbstractC0399a;
import android.R;
import android.app.AlertDialog;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.AssetFileDescriptor;
import android.content.res.Configuration;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.shapes.RoundRectShape;
import android.net.Uri;
import android.nfc.NfcAdapter;
import android.nfc.Tag;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.UnderlineSpan;
import android.util.TypedValue;
import android.view.DragEvent;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewStub;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.inputmethod.InputMethodManager;
import android.webkit.ValueCallback;
import android.webkit.WebView;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
import androidx.appcompat.widget.AppCompatButton;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.viewpager.widget.ViewPager;
import b8.DialogInterfaceOnClickListenerC0471n0;
import b8.RunnableC0508z0;
import bb.AbstractC0515a;
import c8.C0527e;
import com.google.android.material.tabs.TabLayout;
import com.xone.android.framework.AbstractC0563e;
import com.xone.android.framework.AbstractC0564f;
import com.xone.android.framework.AbstractC0565g;
import com.xone.android.framework.AbstractC0566h;
import com.xone.android.framework.AbstractC0568j;
import com.xone.android.framework.activities.EditViewHyper;
import com.xone.android.framework.mainEntry;
import com.xone.android.framework.runtimeobjects.PopupObject;
import com.xone.android.framework.views.EditFramePage;
import com.xone.android.framework.views.EditGroupViewPager;
import com.xone.android.framework.views.XOneEditText;
import com.xone.android.framework.xoneApp;
import com.xone.android.nfc.runtimeobjects.XoneNFCRuntime;
import com.xone.android.script.events.EventCallbackTask;
import com.xone.android.script.events.EventOnAfterEdit;
import com.xone.android.script.events.EventOnBeforeEdit;
import com.xone.android.script.events.EventOnDrawerClosed;
import com.xone.android.script.events.EventOnDrawerOpened;
import com.xone.android.script.events.EventOnDrawerSlide;
import com.xone.android.script.events.EventOnDrawerStateChanged;
import com.xone.android.script.events.EventOnResumeEdit;
import com.xone.android.script.runtimeobjects.ImageDrawing;
import com.xone.android.utils.Utils;
import com.xone.annotations.ScriptAllowed;
import com.xone.interfaces.IXoneApp;
import com.xone.interfaces.IXoneCollection;
import com.xone.interfaces.IXoneObject;
import com.xone.interfaces.OnEventFinishedCallback;
import com.xone.replicator.helpers.DatabaseFilesHelper;
import d8.C0586c;
import eb.AbstractC0665a;
import f8.C0670e;
import f8.C0679n;
import fa.h;
import fb.AbstractC0689b;
import fb.AbstractC0698k;
import fb.q;
import fb.t;
import fb.u;
import g8.ProgressDialogC0704d;
import gb.AbstractC0734d;
import h8.C0738c;
import ha.AbstractC0751f;
import ha.AbstractC0752g;
import ha.AbstractC0757l;
import ha.M;
import ha.r;
import ha.s;
import ha.v;
import ja.C0789a;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Callable;
import k8.HandlerC0802c;
import l8.C0834e;
import n.P;
import n8.f;
import n8.g;
import o8.C0874b;
import org.mozilla.javascript.C0893d0;
import org.mozilla.javascript.C0932x0;
import ta.FutureC0996a;
import ua.InterfaceC1016b0;
import ua.InterfaceC1018c0;
import ua.InterfaceC1028h0;
import ua.InterfaceC1032j0;
import ua.InterfaceC1034k0;
import ua.InterfaceC1046q0;
import ua.InterfaceC1056w;
import ua.K0;
import ua.L0;
import va.C1066a;
import xone.runtime.core.XoneDataObject;
import y8.RunnableC1097a;
import y8.j;

public class EditViewHyper extends XoneBaseActivity implements TabLayout.d, g, InterfaceC1016b0, DrawerLayout.e {
    public Map D0;
    public boolean E0;
    public String F0;
    public int M0;
    public int N0;
    public int O0;
    public int P0;
    public int Q0;
    public Configuration R0;
    public Configuration S0;
    public boolean T0;
    public List U0;
    public boolean[] V0;
    public boolean W0;
    public List X0;
    public int Z0;
    public int a1;
    public HorizontalScrollView b1;
    public ViewPager c1;
    public Thread d1;
    public final List G0 = new ArrayList();
    public final List H0 = new ArrayList();
    public final List I0 = new ArrayList();
    public final Map J0 = new HashMap();
    public final Map K0 = new HashMap();
    public final Map L0 = new HashMap();
    public Thread Y0 = null;
    public Handler e1 = new HandlerC0802c(this);
    public final List f1 = new ArrayList();
    public final List g1 = new ArrayList();

    public class a implements h.a {
        public final IXoneObject a;
        public final String b;
        public final String c;

        public a(IXoneObject iXoneObject, String str, String str2) {
            this.a = iXoneObject;
            this.b = str;
            this.c = str2;
        }

        @Override
        public void a(Exception exc) {
            EditViewHyper.this.b(exc);
        }

        @Override
        public void b() {
            fa.g.a(this);
        }

        @Override
        public void c() {
            EditViewHyper.this.a0(true, Utils.r4(this.b));
        }

        @Override
        public void d() {
            xoneApp.Z0().K2(EditViewHyper.this);
            new j(EditViewHyper.this, this.a, this.b, new CharSequence[]{this.c}, false, null).run();
        }
    }

    public class b implements Runnable {
        public b() {
        }

        @Override
        public void run() {
            try {
                IXoneCollection dataCollection = EditViewHyper.this.getDataCollection();
                if (dataCollection == null) {
                    throw new NullPointerException("doContinueAfterConfigurationChange(): Cannot obtain data collection");
                }
                va.d viewLayout = dataCollection.getViewLayout();
                if (viewLayout == null) {
                    throw new NullPointerException("View layout data not found for collection " + dataCollection.getName());
                }
                viewLayout.n();
                va.d d = viewLayout.d(1);
                EditViewHyper.this.B5(d);
                d.r(EditViewHyper.this.getDataObject());
                ?? r0 = EditViewHyper.this;
                r0.runOnUiThread(new c());
            } catch (InterruptedException unused) {
                Utils.l("XOneAndroidFramework", "InterruptedException happened while executing orientation change. Ignoring.");
            } catch (Exception e) {
                EditViewHyper.this.b(e);
            }
        }
    }

    public class c implements Runnable {
        public c() {
        }

        @Override
        public void run() {
            try {
                EditViewHyper.this.a7();
            } catch (Exception e) {
                EditViewHyper.this.b(e);
            }
        }
    }

    public static class d implements ViewTreeObserver.OnGlobalLayoutListener {
        public final EditViewHyper l;
        public final Configuration m;
        public final View n;
        public final ViewTreeObserver o;

        public d(EditViewHyper editViewHyper, Configuration configuration, View view, ViewTreeObserver viewTreeObserver) {
            this.l = editViewHyper;
            this.m = configuration;
            this.n = view;
            this.o = viewTreeObserver;
        }

        @Override
        public void onGlobalLayout() {
            this.o.removeOnGlobalLayoutListener(this);
            int width = this.n.getWidth();
            int height = this.n.getHeight();
            if (this.l.V3()) {
                height = this.l.K2().y;
            }
            if (width > 0) {
                this.l.m5(width);
            }
            if (height > 0) {
                this.l.l5(height);
            }
            this.l.z8(this.m);
            this.l.I(null);
        }
    }

    public static String C7(String str) {
        return TextUtils.isEmpty(str) ? str : str.startsWith("##FRAME##") ? str.substring(9) : str.startsWith("##ITEM##") ? str.substring(8) : str;
    }

    public static IXoneCollection I7(Intent intent) {
        IXoneApp c1;
        String stringExtra = intent.getStringExtra("contentName");
        if (stringExtra != null) {
            IXoneObject k1 = xoneApp.Z0().k1(Integer.valueOf(intent.getIntExtra("parentID", 0)));
            if (k1 == null) {
                return null;
            }
            return k1.Contents(stringExtra);
        }
        String stringExtra2 = intent.getStringExtra("collname");
        if (stringExtra2 == null || (c1 = xoneApp.c1()) == null) {
            return null;
        }
        return c1.GetCollection(stringExtra2);
    }

    private int J7() {
        return this.Z0;
    }

    private int K7() {
        return this.a1;
    }

    public static boolean P7(boolean z, Set set) {
        if (z) {
            return set == null || set.isEmpty();
        }
        return false;
    }

    public static void S6(Uri uri) {
        if (uri != null && TextUtils.equals(uri.getScheme(), "file")) {
            String path = uri.getPath();
            if (TextUtils.isEmpty(path)) {
                return;
            }
            File file = new File(path);
            if (file.exists()) {
                file.delete();
            }
        }
    }

    public static boolean S7(Set set) {
        return (set == null || set.isEmpty()) ? false : true;
    }

    public static void e6(K k, int i, int i2, X7.a aVar, int i3) {
        float f = i;
        k.setShadowLayer(f, f, f, i2);
        k.setBackgroundDrawable(aVar);
        k.setTextColor(i3);
    }

    public static void h6(DialogInterface dialogInterface, int i) {
        dialogInterface.dismiss();
        mainEntry S = xoneApp.Z0().S();
        if (S == null) {
            return;
        }
        S.E0(true);
    }

    public static File q2(Uri uri) {
        xoneApp Z0 = xoneApp.Z0();
        return u.c(Z0, uri, new File(Z0.getFilesPath()), false, "attach_");
    }

    public static void r6(DialogInterface dialogInterface) {
        dialogInterface.dismiss();
        mainEntry S = xoneApp.Z0().S();
        if (S == null) {
            return;
        }
        S.E0(true);
    }

    public static void t6(WeakReference weakReference, Set set, boolean z) {
        EditViewHyper editViewHyper = (EditViewHyper) weakReference.get();
        if (editViewHyper == null || editViewHyper.c()) {
            return;
        }
        if (Utils.c3()) {
            StringBuilder sb2 = new StringBuilder();
            if (set == null || set.isEmpty()) {
                sb2.append("[Global window refresh]");
            } else {
                sb2.append("Fields: ");
                Iterator it = set.iterator();
                while (it.hasNext()) {
                    sb2.append((String) it.next());
                    sb2.append(", ");
                }
            }
            String sb3 = sb2.toString();
            if (sb3.endsWith(", ")) {
                sb3 = sb3.substring(0, sb3.length() - 2);
            }
            Utils.l("XOneFrameworkRefresh", sb3);
            AbstractC0757l.c(sb3);
        }
        editViewHyper.o7(z, set);
    }

    public static ViewGroup.MarginLayoutParams u7(View view) {
        if (view == null) {
            return null;
        }
        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
        if (layoutParams instanceof ViewGroup.MarginLayoutParams) {
            return (ViewGroup.MarginLayoutParams) layoutParams;
        }
        return null;
    }

    public void A(int i) {
        IXoneCollection ownerCollection;
        List<Wa.a> eventCallback;
        String str = i != 0 ? i != 1 ? i != 2 ? "unknown" : "settling" : "dragging" : "idle";
        IXoneObject dataObject = getDataObject();
        if (dataObject == null || (ownerCollection = dataObject.getOwnerCollection()) == null || (eventCallback = ownerCollection.getEventCallback("ondrawerstatechanged")) == null) {
            return;
        }
        new EventCallbackTask.b().b(this).e(dataObject).h(this.e1).g(eventCallback).c(new Object[]{new C0789a("e", new EventOnDrawerStateChanged(dataObject.getOwnerApp(), dataObject, ownerCollection, str))}).a().runSeriallyAsyncTask();
    }

    public final List A7(List list) {
        List list2;
        List list3;
        List list4 = this.G0;
        if ((list4 != null && !list4.isEmpty()) || (((list2 = this.H0) != null && !list2.isEmpty()) || ((list3 = this.I0) != null && !list3.isEmpty()))) {
            list = list.subList(0, list.size());
            List list5 = this.G0;
            if (list5 != null) {
                list.removeAll(list5);
            }
            List list6 = this.H0;
            if (list6 != null) {
                list.removeAll(list6);
            }
            List list7 = this.I0;
            if (list7 != null) {
                list.removeAll(list7);
            }
        }
        return list;
    }

    public final void k8(Bundle bundle) {
        boolean z = true;
        Thread.currentThread().setName("EditViewCreationThread");
        try {
            IXoneApp D2 = XoneBaseActivity.D2();
            if (D2 == null) {
                return;
            }
            E8(D2);
            if (!o8(bundle)) {
                if (getIntent().getBooleanExtra("pushobject", false)) {
                    Integer valueOf = Integer.valueOf(getIntent().getIntExtra("parentID", 0));
                    b5(XoneBaseActivity.C2().k1(valueOf));
                    IXoneObject dataObject = getDataObject();
                    if (dataObject == null) {
                        throw new NullPointerException("Error in beginEditViewCreation(), data object is null");
                    }
                    this.x = dataObject.getOwnerCollection();
                    dataObject.putVariables("NEW", 0);
                    XoneBaseActivity.C2().p2(valueOf);
                } else {
                    String stringExtra = getIntent().getStringExtra("contentName");
                    if (TextUtils.isEmpty(stringExtra)) {
                        String stringExtra2 = getIntent().getStringExtra("collname");
                        if (TextUtils.isEmpty(stringExtra2)) {
                            throw new NullPointerException("Empty collection name");
                        }
                        IXoneCollection GetCollection = D2.GetCollection(stringExtra2);
                        this.x = GetCollection;
                        if (GetCollection == null) {
                            throw new NullPointerException("Collection " + stringExtra2 + " not found");
                        }
                    } else {
                        IXoneObject k1 = XoneBaseActivity.C2().k1(Integer.valueOf(getIntent().getIntExtra("parentID", 0)));
                        if (k1 == null) {
                            throw new NullPointerException("Parent object not found");
                        }
                        IXoneCollection Contents = k1.Contents(stringExtra);
                        this.x = Contents;
                        if (Contents == null) {
                            throw new NullPointerException("Content collection not found");
                        }
                    }
                    U1(this.x.CollPropertyValue("load-imgbk"));
                    if (getIntent().getBooleanExtra("newobject", false)) {
                        while (D2.IsScriptExecute()) {
                            try {
                                try {
                                    Thread.sleep(100L);
                                } catch (Exception e) {
                                    InterfaceC1046q0 error = D2.getError();
                                    if (error == null || error.getNumber() != -8100) {
                                        this.K = true;
                                        AbstractC0515a.b(this.e1, "Error", e, D2);
                                    } else {
                                        k(12);
                                    }
                                    this.S = false;
                                    return;
                                }
                            } catch (Throwable th) {
                                this.S = false;
                                throw th;
                            }
                        }
                        if (t.l(this.x.CollPropertyValue("navigationbutton"), false)) {
                            this.x.StartBrowse();
                            if (this.x.getCurrentItem() != null) {
                                String GetObjectIdString = this.x.getCurrentItem().GetObjectIdString();
                                this.x.EndBrowse();
                                IXoneObject iXoneObject = this.x.get(GetObjectIdString);
                                b5(iXoneObject);
                                if (iXoneObject != null) {
                                    iXoneObject.putVariables("NEW", 0);
                                }
                            } else {
                                this.x.EndBrowse();
                                this.S = true;
                                b5(this.x.CreateObject());
                                this.x.AddItem(getDataObject());
                                IXoneObject dataObject2 = getDataObject();
                                if (dataObject2 == null) {
                                    throw new NullPointerException("Error in beginEditViewCreation(), data object is null");
                                }
                                dataObject2.putVariables("NEW", 1);
                            }
                        } else {
                            this.S = true;
                            b5(this.x.CreateObject());
                            this.x.AddItem(getDataObject());
                            IXoneObject dataObject3 = getDataObject();
                            if (dataObject3 == null) {
                                throw new NullPointerException("Error in beginEditViewCreation(), data object is null");
                            }
                            dataObject3.putVariables("NEW", 1);
                            final XoneDataObject xoneDataObject = (XoneDataObject) getDataObject().getOwnerApp().PopValue();
                            if (xoneDataObject != null) {
                                this.e1.post(new Runnable() {
                                    @Override
                                    public final void run() {
                                        EditViewHyper.this.h8(xoneDataObject);
                                    }
                                });
                            }
                        }
                        this.S = false;
                    } else {
                        String stringExtra3 = getIntent().getStringExtra(DatabaseFilesHelper.ID_COLUMN);
                        int intExtra = getIntent().getIntExtra("index", -1);
                        if (intExtra >= 0) {
                            b5(this.x.get(intExtra));
                        } else if (!TextUtils.isEmpty(stringExtra3)) {
                            b5(this.x.get(stringExtra3));
                        }
                        if (getDataObject() == null) {
                            this.z = getIntent().getIntExtra("orphanObjectHashCode", -1);
                            b5(xoneApp.Z0().k1(Integer.valueOf(this.z)));
                        }
                        if (getDataObject() == null) {
                            b(C0738c.d("No data object found"));
                        }
                        getDataObject().putVariables("NEW", 0);
                    }
                }
            }
            IXoneObject dataObject4 = getDataObject();
            if (dataObject4 == null) {
                throw new NullPointerException("Error in beginEditViewCreation(), data object is null");
            }
            if (t.l(dataObject4.getOwnerCollection().CollPropertyValue("show-async"), false)) {
                a2();
            }
            boolean l = t.l(this.x.CollPropertyValue("disable-keyguard"), false);
            boolean l2 = t.l(this.x.CollPropertyValue("keep-screen-on"), false);
            boolean l3 = t.l(this.x.CollPropertyValue("secure-window"), xoneApp.Z0().F1());
            this.y = 0;
            if (l) {
                this.y = 524288 | 4194304 | 2097152;
            }
            if (l2) {
                this.y |= 2097280;
            }
            if (l3) {
                this.y |= 8192;
            }
            if (this.y != 0) {
                runOnUiThread(new Runnable() {
                    @Override
                    public final void run() {
                        EditViewHyper.this.i8();
                    }
                });
            }
            getDataObject().putVariables("IDX", Integer.valueOf(getDataObject().getOwnerCollection().ObjectIndex(getDataObject())));
            this.T = getIntent().getBooleanExtra("saveandquit", false);
            c5(16777215);
            String CollPropertyValue = this.x.CollPropertyValue("editmask");
            if (t.h(CollPropertyValue)) {
                c5(getIntent().getIntExtra("mask", 16777215));
            } else {
                c5(Integer.parseInt(CollPropertyValue));
            }
            s5(this.x.GetNode("onrefresh"));
            e5(this.x.GetNode("ext-execute"));
            if (S2() != null && !S2().hasChildNodes()) {
                e5(null);
            }
            if (this.x.GetNode("ondrop") == null) {
                z = false;
            }
            f5(z);
            if (getDataObject() != null) {
                XoneBaseActivity.C2().k2(getDataObject(), H0());
            }
            XoneBaseActivity.C2().M0(this, H0());
            com.xone.android.script.events.a.a(XoneBaseActivity.C2(), getDataObject(), getDataCollection(), "coll", null);
            Y8();
            T8();
        } catch (C0738c e2) {
            AlertDialog create = XoneBaseActivity.R2(this, e2, e2.getMessage(), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i) {
                    EditViewHyper.h6(dialogInterface, i);
                }
            }).create();
            create.setOnDismissListener(new DialogInterface.OnDismissListener() {
                @Override
                public final void onDismiss(DialogInterface dialogInterface) {
                    EditViewHyper.r6(dialogInterface);
                }
            });
            create.show();
            TextView textView = (TextView) create.findViewById(R.id.message);
            if (textView != null) {
                textView.setTypeface(J2());
            }
        } catch (InterruptedException unused) {
            Utils.l("XOneAndroidFramework", "EditViewCreationThread was interrupted before finishing. Is the activity being destroyed?");
        } catch (Exception e3) {
            b(e3);
        }
    }

    public void B6() {
        int w = t.w(AbstractC0698k.s(getIntent(), "bgcolor"), -1);
        Window window = getWindow();
        if (window == null) {
            return;
        }
        try {
            window.setBackgroundDrawable(new ColorDrawable(w));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public final HorizontalScrollView B7() {
        if (this.b1 == null) {
            this.b1 = (HorizontalScrollView) t2(AbstractC0564f.P1);
        }
        return this.b1;
    }

    public boolean B8(View view, DragEvent dragEvent) {
        ViewGroup.MarginLayoutParams u7;
        ViewGroup.MarginLayoutParams u72;
        try {
            int action = dragEvent.getAction();
            if (action != 3) {
                if (action != 4) {
                    return true;
                }
                Object localState = dragEvent.getLocalState();
                if (localState instanceof View) {
                    final View view2 = (View) localState;
                    if (view2.getVisibility() != 0) {
                        view2.post(new Runnable() {
                            @Override
                            public final void run() {
                                view2.setVisibility(0);
                            }
                        });
                    }
                }
                return true;
            }
            Object localState2 = dragEvent.getLocalState();
            if (localState2 instanceof View) {
                View view3 = (View) localState2;
                if (view instanceof EditFramePage) {
                    EditFramePage editFramePage = (EditFramePage) view;
                    String dropTarget = ((EditFramePage) view3).getDropTarget();
                    if (!TextUtils.isEmpty(dropTarget)) {
                        if (String.valueOf(editFramePage.getTag()).equals("##FRAME##" + dropTarget)) {
                            ViewGroup.MarginLayoutParams u73 = u7(view3);
                            ViewGroup.MarginLayoutParams u74 = u7(editFramePage);
                            if (u73 != null && u74 != null) {
                                u73.leftMargin = u74.leftMargin;
                                u73.topMargin = u74.topMargin;
                                view3.setLayoutParams(u73);
                            }
                        }
                    }
                    if (editFramePage.f0() && (u72 = u7(view3)) != null) {
                        u72.leftMargin = ((int) dragEvent.getX()) - (view3.getWidth() / 2);
                        u72.topMargin = ((int) dragEvent.getY()) - (view3.getHeight() / 2);
                        view3.setLayoutParams(u72);
                    }
                } else if ((view instanceof com.xone.android.framework.views.a) && (u7 = u7(view3)) != null) {
                    u7.leftMargin = ((int) dragEvent.getX()) - (view3.getWidth() / 2);
                    u7.topMargin = ((int) dragEvent.getY()) - (view3.getHeight() / 2);
                    view3.setLayoutParams(u7);
                }
                view3.setVisibility(0);
            }
            CharSequence text = dragEvent.getClipData().getItemAt(0).getText();
            Object obj = "";
            if (text == null) {
                text = "";
            }
            Object tag = view.getTag();
            if (tag != null) {
                obj = tag;
            }
            r7(text.toString(), obj.toString());
            return true;
        } catch (Exception e) {
            if (c()) {
                e.printStackTrace();
            } else {
                b(e);
            }
            return true;
        }
    }

    public final void C6(Configuration configuration) {
        IXoneApp D2 = XoneBaseActivity.D2();
        if (D2 == null) {
            k(12);
            return;
        }
        String str = getResources().getConfiguration().orientation == 1 ? "vertical" : "horizontal";
        D2.SetVisualConditions(str, false);
        D2.setGlobalMacro("##CURRENT_ORIENTATION##", str);
        if (((this instanceof EditViewHyperPortrait) || (this instanceof EditViewHyperLandscape)) && !AbstractC0665a.n(this.R0, configuration)) {
            this.R0.updateFrom(configuration);
            return;
        }
        this.R0.updateFrom(configuration);
        C1066a r3 = r3();
        if (r3 != null) {
            r3.d();
        }
        t2(AbstractC0564f.N1).removeAllViews();
        W7((ViewGroup) t2(AbstractC0564f.S));
        O3();
        Z6();
    }

    public final void g8(final Bundle bundle) {
        try {
            B6();
            E6();
            this.Z0 = 100;
            this.a1 = 100;
            this.Q0 = -1;
            this.P0 = 0;
            this.M0 = 0;
            this.N0 = 0;
            this.O0 = 0;
            this.K = false;
            if (XoneBaseActivity.D2() == null) {
                k(12);
                return;
            }
            h5(new ProgressDialogC0704d(this, xoneApp.Z0().s0()));
            this.E0 = false;
            this.L = false;
            this.S = false;
            this.J = true;
            this.W0 = false;
            t5(null);
            z0(11);
            this.X = getIntent().getBooleanExtra("ispanel", false);
            U1(XoneBaseActivity.C2().t1());
            if (XoneBaseActivity.C2().u1()) {
                H5(null);
            } else {
                O3();
            }
            D6();
            Thread thread = new Thread(new Runnable() {
                @Override
                public final void run() {
                    EditViewHyper.this.k8(bundle);
                }
            });
            this.d1 = thread;
            thread.start();
        } catch (Exception e) {
            b(e);
        }
    }

    public void D(View view, float f) {
        IXoneCollection ownerCollection;
        List<Wa.a> eventCallback;
        IXoneObject dataObject = getDataObject();
        if (dataObject == null || (ownerCollection = dataObject.getOwnerCollection()) == null || (eventCallback = ownerCollection.getEventCallback("ondrawerslide")) == null || !(view instanceof C0159v)) {
            return;
        }
        new EventCallbackTask.b().b(this).e(dataObject).h(this.e1).g(eventCallback).c(new Object[]{new C0789a("e", new EventOnDrawerSlide(dataObject.getOwnerApp(), dataObject, ownerCollection, ((C0159v) view).getDrawerGroupId(), f))}).a().runSeriallyAsyncTask();
    }

    @Override
    public void D0(int i, int i2) {
        this.P = i;
        this.Q = i2;
    }

    public void D6() {
        Window window;
        String t = AbstractC0698k.t(getIntent(), "window-keyboard-behaviour", null);
        if (TextUtils.isEmpty(t) || (window = getWindow()) == null) {
            return;
        }
        t.getClass();
        switch (t) {
            case "unspecified":
                window.setSoftInputMode(0);
                break;
            case "resize":
                window.setSoftInputMode(16);
                break;
            case "pan":
                window.setSoftInputMode(32);
                break;
            case "nothing":
                window.setSoftInputMode(48);
                break;
        }
    }

    public final com.xone.android.framework.views.a D7() {
        I i;
        AppCompatButton x3 = x3();
        if (x3 == null || (i = (I) y7().findViewWithTag(Utils.G2("##GROUP##", (String) x3.getTag()))) == null) {
            return null;
        }
        return i.getPagesView();
    }

    public final void D8() {
        Method k;
        Class d2 = M.d("com.xone.android.honeywell.scanner.HoneywellScannerManager");
        if (d2 == null || (k = M.k(d2, "reclaimIfNeeded", Context.class, Boolean.TYPE)) == null) {
            return;
        }
        M.v(k, this, Boolean.valueOf(xoneApp.Z0().T1()));
    }

    public void E6() {
        String s = AbstractC0698k.s(getIntent(), "status-bar-color");
        if (TextUtils.isEmpty(s)) {
            return;
        }
        int w = t.w(s, -1);
        Window window = getWindow();
        if (window == null) {
            return;
        }
        try {
            window.setStatusBarColor(w);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public Handler E7() {
        return super.getHandler();
    }

    public final void E8(IXoneApp iXoneApp) {
        String GetCurrentVisualConditions = iXoneApp.GetCurrentVisualConditions();
        if (getResources().getBoolean(s.a)) {
            if (TextUtils.isEmpty(GetCurrentVisualConditions)) {
                iXoneApp.SetVisualConditions("horizontal", false);
                return;
            } else {
                if (GetCurrentVisualConditions.contains("horizontal")) {
                    return;
                }
                iXoneApp.SetVisualConditions("horizontal", false);
                return;
            }
        }
        if (TextUtils.isEmpty(GetCurrentVisualConditions)) {
            iXoneApp.SetVisualConditions("vertical", false);
        } else {
            if (GetCurrentVisualConditions.contains("vertical")) {
                return;
            }
            iXoneApp.SetVisualConditions("vertical", false);
        }
    }

    @Override
    public FutureC0996a F(final IXoneObject iXoneObject, final int i) {
        if (iXoneObject == null) {
            return new FutureC0996a();
        }
        IXoneCollection ownerCollection = iXoneObject.getOwnerCollection();
        if (ownerCollection == null) {
            return new FutureC0996a();
        }
        if (!e.r(getApplicationContext())) {
            return h7(iXoneObject, i);
        }
        InterfaceC1032j0 GetNode = ownerCollection.GetNode("permissions");
        if (GetNode == null) {
            return h7(iXoneObject, i);
        }
        InterfaceC1034k0<InterfaceC1032j0> childNodes = GetNode.getChildNodes();
        if (childNodes == null || childNodes.count() <= 0) {
            return h7(iXoneObject, i);
        }
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        for (InterfaceC1032j0 interfaceC1032j0 : childNodes) {
            if (interfaceC1032j0 == null) {
                throw new IllegalArgumentException("Null permission node");
            }
            linkedHashSet.addAll(e.u(this, interfaceC1032j0.w0("name")));
        }
        try {
            new h.a().d(true).e(7000).f(getString(v.b)).c(new C9.c() {
                @Override
                public final void a(Set set) {
                    EditViewHyper.this.e8(iXoneObject, i, set);
                }
            }).g(linkedHashSet).a().i(this);
        } catch (Exception e) {
            b(e);
        }
        return new FutureC0996a(iXoneObject);
    }

    @Override
    public void F1(String str, String str2, int i, String str3, int i2) {
        if (t.h(str)) {
            return;
        }
        if (Y7(str)) {
            H4(str);
            return;
        }
        HorizontalScrollView B7 = B7();
        if (B7 == null) {
            return;
        }
        int i3 = 0;
        LinearLayout linearLayout = (LinearLayout) B7.getChildAt(0);
        if (linearLayout == null) {
            return;
        }
        while (true) {
            if (i3 >= linearLayout.getChildCount()) {
                break;
            }
            Object childAt = linearLayout.getChildAt(i3);
            if (childAt instanceof K) {
                ?? r0 = (K) childAt;
                Object tag = r0.getTag();
                if ((tag instanceof String) && a8((String) tag) && str.equals(r0.getTag())) {
                    w5(r0);
                    break;
                }
            }
            i3++;
        }
        if (x3() != null) {
            N7((String) x3().getTag(), null, str2, str3);
        }
    }

    public final void F6(final K k, boolean z) {
        int forecolorDisable;
        int i;
        int backgroundColorDisable;
        int i2;
        if (k == 0) {
            return;
        }
        RoundRectShape roundRectShape = TextUtils.equals(this.F0, "bottom") ? new RoundRectShape(new float[]{0.0f, 0.0f, 0.0f, 0.0f, 8.0f, 8.0f, 8.0f, 8.0f}, null, null) : new RoundRectShape(new float[]{8.0f, 8.0f, 8.0f, 8.0f, 0.0f, 0.0f, 0.0f, 0.0f}, null, null);
        if (z) {
            forecolorDisable = k.getForecolorEnabled();
            i2 = k.getBackgroundColorEnabled();
            backgroundColorDisable = i2;
            i = 0;
        } else {
            forecolorDisable = k.getForecolorDisable();
            i = 1;
            backgroundColorDisable = k.getBackgroundColorDisable();
            i2 = -16777216;
        }
        final int i3 = forecolorDisable;
        final X7.a aVar = new X7.a(roundRectShape, i3, backgroundColorDisable, 0, 1, 1, 1);
        aVar.setPadding(0, 0, 0, 0);
        if (!Utils.s3()) {
            final int i4 = i2;
            final int i5 = i;
            runOnUiThread(new Runnable() {
                @Override
                public final void run() {
                    EditViewHyper.e6(F8.K.this, i5, i4, aVar, i3);
                }
            });
        } else {
            float f = i;
            k.setShadowLayer(f, f, f, i2);
            k.setBackgroundDrawable(aVar);
            k.setTextColor(i3);
        }
    }

    public final List F7() {
        return this.U0;
    }

    public final void F8(List list, Set set) {
        ViewPager y7 = y7();
        if (y7 == null || y7.getAdapter() == null) {
            return;
        }
        Iterator it = list.iterator();
        while (it.hasNext()) {
            String str = (String) it.next();
            String G2 = Utils.G2("##GROUP##", str);
            if (TextUtils.isEmpty(G2)) {
                Utils.l("XOneAndroidFramework", "Error refreshByLayoutItem(), view tag is null");
            } else {
                I i = (I) y7.findViewWithTag(G2);
                if (i == null) {
                    Utils.l("XOneAndroidFramework", "Error refreshByLayoutItem(), cannot find item with tag " + G2 + " on view hierarchy");
                } else {
                    i.n0(this, r3().j(str), getMaxScreenWidth() - this.O0, (getMaxScreenHeight() - this.M0) - this.P0, this.T0, set, this.Z0, this.a1);
                }
            }
        }
    }

    @Override
    public boolean G() {
        return this instanceof EditViewHyperLandscape;
    }

    public final void G6(Configuration configuration) {
        int i = configuration.orientation;
        xoneApp Z0 = xoneApp.Z0();
        int V = Z0.V();
        int l = Z0.l();
        if (i != 1) {
            if (V < l) {
                Z0.u2(l, V);
            }
        } else if (V > l) {
            Z0.u2(l, V);
        }
    }

    public final boolean[] G7() {
        return this.V0;
    }

    public final void G8(C1066a c1066a, Set set) {
        List arrayList = new ArrayList();
        Iterator it = set.iterator();
        while (it.hasNext()) {
            C1066a h = va.d.h(c1066a, (String) it.next());
            if (h != null) {
                String valueOf = String.valueOf(h.q().d());
                if (TextUtils.isEmpty(valueOf)) {
                    throw new IllegalArgumentException("Empty group id");
                }
                if (!arrayList.contains(valueOf)) {
                    arrayList.add(valueOf);
                }
            }
        }
        if (arrayList.isEmpty()) {
            return;
        }
        F8(arrayList, set);
    }

    public final void H6() {
        AlertDialog.Builder g = AbstractC0665a.g(this);
        g.setPositiveButton(AbstractC0568j.C0, new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                EditViewHyper.this.b8(dialogInterface, i);
            }
        });
        g.setNegativeButton(AbstractC0568j.R, new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                EditViewHyper.this.c8(dialogInterface, i);
            }
        });
        g.setMessage(AbstractC0568j.g0);
        g.setTitle(AbstractC0568j.h0);
        g.create().show();
    }

    public int H7() {
        return this.P0;
    }

    public void H8(String str) {
        KeyEvent.Callback findViewWithTag = t2(AbstractC0564f.S).findViewWithTag(str);
        if (findViewWithTag == null || !(findViewWithTag instanceof InterfaceC1056w)) {
            return;
        }
        ((InterfaceC1056w) findViewWithTag).t();
    }

    @Override
    public void I(Set set) {
        a0(true, set);
    }

    public void I6(Configuration configuration) {
        if (AbstractC0665a.p(this.R0, configuration)) {
            C6(configuration);
        }
    }

    public final boolean I8(Set set) {
        for (String str : this.K0.keySet()) {
            ?? r3 = (I) this.K0.get(str);
            if (r3 != 0) {
                C1066a j = r3().j(str);
                boolean S72 = S7(set);
                r3.n0(this, j, getMaxScreenWidth(), (getMaxScreenHeight() - this.M0) - this.P0, this.T0, set, this.Z0, this.a1);
                boolean v = r3().j(str).v();
                IXoneObject dataObject = getDataObject();
                if (dataObject == null) {
                    throw new NullPointerException("Error in refreshDrawerGroups(), data object is null");
                }
                IXoneCollection ownerCollection = dataObject.getOwnerCollection();
                p1(this, r3, ownerCollection.GroupPropertyValue(str, "animation-in"), ownerCollection.GroupPropertyValue(str, "animation-out"), v, r3.getVisibility(), q.p(ownerCollection.GroupPropertyValue(str, "animation-in-delay"), 600), q.p(ownerCollection.GroupPropertyValue(str, "animation-out-delay"), 600));
                if (P7(S72, set)) {
                    return true;
                }
            }
        }
        return false;
    }

    @Override
    public void J4(Set set) {
        ViewPager t2 = t2(AbstractC0564f.N1);
        Iterator it = set.iterator();
        while (it.hasNext()) {
            String str = (String) it.next();
            if (!M8(t2, str)) {
                Iterator it2 = this.J0.keySet().iterator();
                while (it2.hasNext()) {
                    if (M8((LinearLayout) this.J0.get((String) it2.next()), str)) {
                        break;
                    }
                }
            }
        }
    }

    public final void J6(String str) {
        String[] list;
        File h = AbstractC0752g.h(XoneBaseActivity.C2().T(), str);
        if (!h.exists() || (list = h.list()) == null || list.length == 0) {
            return;
        }
        for (String str2 : list) {
            File file = new File(h, str2);
            if (file.exists() && !file.delete()) {
                Utils.l("XOneAndroidFramework", "Cannot delete file " + file.getAbsolutePath());
            }
        }
    }

    public final boolean J8(Set set) {
        C0164w c0164w;
        for (String str : this.J0.keySet()) {
            LinearLayout linearLayout = (LinearLayout) this.J0.get(str);
            if (linearLayout != null && (c0164w = (C0164w) linearLayout.getChildAt(0)) != null) {
                C1066a j = r3().j(str);
                boolean S72 = S7(set);
                c0164w.Y0(this, j, getMaxScreenWidth(), (getMaxScreenHeight() - this.M0) - this.P0, this.T0, set, this.Z0, this.a1);
                boolean v = r3().j(str).v();
                IXoneObject dataObject = getDataObject();
                if (dataObject == null) {
                    throw new NullPointerException("Error in refreshFixedGroups(), data object is null");
                }
                IXoneCollection ownerCollection = dataObject.getOwnerCollection();
                p1(this, linearLayout, ownerCollection.GroupPropertyValue(str, "animation-in"), ownerCollection.GroupPropertyValue(str, "animation-out"), v, linearLayout.getVisibility(), q.p(ownerCollection.GroupPropertyValue(str, "animation-in-delay"), 600), q.p(ownerCollection.GroupPropertyValue(str, "animation-out-delay"), 600));
                if (P7(S72, set)) {
                    return true;
                }
            }
        }
        return false;
    }

    public final void K6() {
        InterfaceC1046q0 error;
        try {
            IXoneApp G0 = XoneBaseActivity.C2().G0();
            if (G0 == null || (error = G0.getError()) == null) {
                return;
            }
            error.Clear();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public final boolean K8(Set set) {
        Iterator it = this.L0.keySet().iterator();
        while (true) {
            if (!it.hasNext()) {
                return false;
            }
            String str = (String) it.next();
            ?? r4 = (C0169x) this.L0.get(str);
            if (r4 != 0) {
                C1066a j = r3().j(str);
                boolean v = j.v();
                r4.setVisibility(v ? 8 : 0);
                boolean S72 = S7(set);
                int maxScreenWidth = getMaxScreenWidth();
                int maxScreenHeight = getMaxScreenHeight();
                if (r4.m0()) {
                    r4.n0(this, j, maxScreenWidth, maxScreenHeight, this.T0, set, this.Z0, this.a1);
                } else {
                    String groupId = r4.getGroupId();
                    xoneApp C2 = XoneBaseActivity.C2();
                    int V = C2.V();
                    int l = C2.l();
                    String GroupPropertyValue = this.x.GroupPropertyValue(groupId, "width");
                    String GroupPropertyValue2 = this.x.GroupPropertyValue(groupId, "height");
                    if (TextUtils.isEmpty(GroupPropertyValue)) {
                        GroupPropertyValue = "-1";
                    }
                    if (TextUtils.isEmpty(GroupPropertyValue2)) {
                        GroupPropertyValue2 = "-1";
                    }
                    r4.h0(Utils.e1(this, GroupPropertyValue, V, maxScreenWidth, maxScreenWidth), Utils.e1(this, GroupPropertyValue2, l, maxScreenHeight, maxScreenHeight), 100, 100);
                }
                IXoneObject dataObject = getDataObject();
                if (dataObject == null) {
                    throw new NullPointerException("Error in refreshFloatGroups(), data object is null");
                }
                IXoneCollection ownerCollection = dataObject.getOwnerCollection();
                p1(this, r4, ownerCollection.GroupPropertyValue(str, "animation-in"), ownerCollection.GroupPropertyValue(str, "animation-out"), v, r4.getVisibility(), q.p(ownerCollection.GroupPropertyValue(str, "animation-in-delay"), 600), q.p(ownerCollection.GroupPropertyValue(str, "animation-out-delay"), 600));
                if (P7(S72, set)) {
                    return true;
                }
            }
        }
    }

    public void L(TabLayout.g gVar) {
        String str = (String) this.X0.get(gVar.g());
        if (TextUtils.isEmpty(str)) {
            return;
        }
        new o.a().b(this).d(getDataObject()).e(this.e1).f(str).a().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, new Void[0]);
    }

    @Override
    public void L5(boolean z, String str, int i, String str2, int i2) {
        M5(z, str, i, str2, i2, null);
    }

    public final void L6() {
        DrawerLayout drawerLayout;
        IXoneCollection dataCollection = getDataCollection();
        if (dataCollection == null || (drawerLayout = (DrawerLayout) t2(AbstractC0564f.v0)) == 0) {
            return;
        }
        R8();
        for (String str : this.H0) {
            String GroupPropertyValue = dataCollection.GroupPropertyValue(str, "drawer-orientation");
            String GroupPropertyValue2 = dataCollection.GroupPropertyValue(str, "width");
            String GroupPropertyValue3 = dataCollection.GroupPropertyValue(str, "height");
            xoneApp C2 = XoneBaseActivity.C2();
            int V = C2.V();
            int l = C2.l();
            int maxScreenWidth = getMaxScreenWidth();
            int maxScreenHeight = getMaxScreenHeight();
            int e1 = Utils.e1(this, I7.a.E(GroupPropertyValue2, "-1"), V, maxScreenWidth, maxScreenWidth);
            int e12 = Utils.e1(this, I7.a.E(GroupPropertyValue3, "-1"), l, maxScreenHeight, maxScreenHeight);
            float m = q.m(dataCollection.GroupPropertyValue(str, "touch-scroll-margin"), 10.0f);
            ?? c0159v = new C0159v(this);
            IXoneCollection iXoneCollection = dataCollection;
            c0159v.l0(this.e1, getDataObject(), G3().l().j(str), str, maxScreenWidth, maxScreenHeight, maxScreenWidth, maxScreenHeight);
            c0159v.h0(e1 - a3(), (e12 - Z2()) + this.N0, 100, 100);
            c0159v.setClickable(true);
            c0159v.setTouchScrollMargin(m);
            if (GroupPropertyValue.compareTo("left") != 0 && GroupPropertyValue.compareTo("right") != 0) {
                throw new IllegalArgumentException("createDrawerGroups(): Orientation " + GroupPropertyValue + " not supported");
            }
            DrawerLayout.f fVar = new DrawerLayout.f(e1, e12);
            if (GroupPropertyValue.compareTo("left") == 0) {
                fVar.a = 8388611;
            } else if (GroupPropertyValue.compareTo("right") == 0) {
                fVar.a = 8388613;
            }
            drawerLayout.addView(c0159v, fVar);
            c0159v.setDrawerGroupId(str);
            this.K0.put(str, c0159v);
            dataCollection = iXoneCollection;
        }
        drawerLayout.o0(this);
        drawerLayout.y(this);
    }

    public final void L7(String str) {
        N7(str, null, null, null);
    }

    public final void L8() {
        View findViewWithTag;
        ArrayList arrayList = new ArrayList();
        if (F7() == null) {
            return;
        }
        int currentItem = this.c1.getCurrentItem();
        int i = 0;
        boolean z = false;
        int i2 = 0;
        for (String str : F7()) {
            boolean a82 = a8(str);
            boolean[] G7 = G7();
            if (a82 != G7[i2]) {
                G7[i2] = a82;
                z = true;
                if (a82) {
                    if (i2 <= currentItem) {
                        currentItem++;
                    }
                } else if (i2 < currentItem) {
                    currentItem--;
                }
            }
            if (a82) {
                arrayList.add(str);
            } else if (z && (findViewWithTag = this.c1.findViewWithTag(Utils.G2("##GROUP##", str))) != null) {
                this.c1.removeView(findViewWithTag);
            }
            i2++;
        }
        if (z && (this.c1.getAdapter() instanceof C0527e)) {
            y1.a adapter = this.c1.getAdapter();
            this.c1.setAdapter((y1.a) null);
            ((C0527e) adapter).J(arrayList);
            this.c1.setAdapter(adapter);
            if (currentItem < arrayList.size() && currentItem >= 0) {
                i = currentItem;
            }
            this.c1.setCurrentItem(i);
            V8(i);
            N8();
        }
    }

    @Override
    public void M5(boolean z, String str, int i, String str2, int i2, String str3) {
        ViewPager y7;
        if (x3() == null || (y7 = y7()) == null) {
            return;
        }
        String str4 = (String) x3().getTag();
        if (((I) y7.findViewWithTag(Utils.G2("##GROUP##", str4))) == null || r3().o().indexOf(str4) < 0) {
            return;
        }
        L7(str4);
    }

    public final void M6() {
        int i;
        EditViewHyper editViewHyper = this;
        IXoneCollection dataCollection = editViewHyper.getDataCollection();
        if (dataCollection == null) {
            return;
        }
        IXoneObject dataObject = editViewHyper.getDataObject();
        ViewGroup viewGroup = (FrameLayout) editViewHyper.t2(R.id.content);
        LinearLayout linearLayout = (LinearLayout) editViewHyper.t2(AbstractC0564f.S);
        ViewPager findViewById = editViewHyper.t2(AbstractC0564f.v0).findViewById(AbstractC0564f.N1);
        ?? r1 = 0;
        editViewHyper.O0 = 0;
        editViewHyper.M0 = 0;
        editViewHyper.N0 = 0;
        if (editViewHyper.G0.isEmpty()) {
            return;
        }
        xoneApp C2 = XoneBaseActivity.C2();
        int i2 = 0;
        ?? r0 = editViewHyper;
        while (i2 < r0.G0.size()) {
            String str = (String) r0.G0.get(i2);
            if (t.h(str) || r0.G3().l().j(str) == null) {
                i = i2;
            } else {
                C0834e B0 = r0.B0();
                if (B0 != null) {
                    B0.g(str);
                }
                int V = C2.V();
                int l = C2.l();
                int e1 = Utils.e1(r0, I7.a.E(dataCollection.GroupPropertyValue(str, "height"), "-2"), l, r0.getMaxScreenHeight(), r0.getMaxScreenHeight());
                int e12 = e1 < 0 ? Utils.e1(r0, I7.a.E(dataCollection.GroupPropertyValue(str, "min-height"), "-2"), l, r0.getMaxScreenHeight(), r0.getMaxScreenHeight()) : e1;
                int e13 = Utils.e1(r0, I7.a.E(dataCollection.GroupPropertyValue(str, "width"), "-2"), V, r0.getMaxScreenWidth(), r0.getMaxScreenWidth());
                boolean l2 = t.l(dataCollection.GroupPropertyValue(str, "below-drawer"), r1);
                String GroupPropertyValue = dataCollection.GroupPropertyValue(str, "orientation");
                if (TextUtils.isEmpty(GroupPropertyValue)) {
                    GroupPropertyValue = "top";
                }
                int i3 = i2;
                LinearLayout linearLayout2 = new LinearLayout(r0);
                linearLayout2.setPadding(r1, r1, r1, r1);
                r0.J0.put(str, linearLayout2);
                FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(Utils.W2(e13, r0.Z0), Utils.W2(e1, r0.a1));
                AbstractC0399a.a(layoutParams, GroupPropertyValue, r1);
                layoutParams.setMargins(r1, r1, r1, r1);
                (l2 ? r0.w7() : viewGroup).addView(linearLayout2, layoutParams);
                C0164w c0164w = new C0164w(r0);
                linearLayout2.addView(c0164w, new FrameLayout.LayoutParams(-2, -2));
                int maxScreenWidth = e13 > 0 ? e13 : r0.getMaxScreenWidth();
                if (e1 <= 0) {
                    e1 = r0.getMaxScreenHeight();
                }
                int i4 = e1;
                if (dataObject == null) {
                    throw new NullPointerException("Error in createFixedGroup(), data object is null");
                }
                c0164w.R0(r0.e1, str, r0.G3().l().j(str), dataObject, 0, maxScreenWidth, i4, true, 100, 100);
                c0164w.setTag(Utils.G2("##GROUP##", str));
                if (GroupPropertyValue.equals("bottom") || GroupPropertyValue.equals("top")) {
                    if (l2) {
                        r0.N0 += e12 >= 0 ? e12 : c0164w.getHeight();
                    }
                    r0.M0 += e12 >= 0 ? e12 : c0164w.getHeight();
                }
                if (GroupPropertyValue.equals("left") || GroupPropertyValue.equals("right")) {
                    r0.O0 += e13 >= 0 ? e13 : c0164w.getWidth();
                }
                boolean v = r0.G3().l().j(str).v();
                IXoneCollection ownerCollection = dataObject.getOwnerCollection();
                String GroupPropertyValue2 = ownerCollection.GroupPropertyValue(str, "animation-in");
                String GroupPropertyValue3 = ownerCollection.GroupPropertyValue(str, "animation-out");
                int p = q.p(ownerCollection.GroupPropertyValue(str, "animation-in-delay"), 600);
                int p2 = q.p(ownerCollection.GroupPropertyValue(str, "animation-out-delay"), 600);
                int visibility = c0164w.getVisibility();
                String str2 = GroupPropertyValue;
                i = i3;
                r0.p1(this, linearLayout2, GroupPropertyValue2, GroupPropertyValue3, v, visibility, p, p2);
                t7((ViewGroup.MarginLayoutParams) (l2 ? findViewById.getLayoutParams() : linearLayout.getLayoutParams()), str2, v, e13, e12);
            }
            i2 = i + 1;
            r1 = 0;
            r0 = this;
        }
    }

    public void M7(String str, String str2) {
        N7(str, str2, null, null);
    }

    public final boolean M8(View view, String str) {
        if (view == null) {
            return false;
        }
        KeyEvent.Callback findViewWithTag = view.findViewWithTag(str);
        if (!(findViewWithTag instanceof InterfaceC1028h0)) {
            return false;
        }
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            throw new NullPointerException("Error in refreshNormalItem(), dataObject == null");
        }
        ((InterfaceC1028h0) findViewWithTag).c(dataObject, str);
        return true;
    }

    public final void N6() {
        IXoneCollection dataCollection = getDataCollection();
        if (dataCollection == null) {
            return;
        }
        xoneApp C2 = XoneBaseActivity.C2();
        int V = C2.V();
        int l = C2.l();
        int maxScreenWidth = getMaxScreenWidth();
        int maxScreenHeight = getMaxScreenHeight();
        IXoneObject dataObject = getDataObject();
        C1066a l2 = G3().l();
        S8();
        for (String str : this.I0) {
            String GroupPropertyValue = dataCollection.GroupPropertyValue(str, "width");
            String GroupPropertyValue2 = dataCollection.GroupPropertyValue(str, "height");
            if (TextUtils.isEmpty(GroupPropertyValue)) {
                GroupPropertyValue = "-1";
            }
            if (TextUtils.isEmpty(GroupPropertyValue2)) {
                GroupPropertyValue2 = "-1";
            }
            int e1 = Utils.e1(this, GroupPropertyValue, V, maxScreenWidth, maxScreenWidth);
            int e12 = Utils.e1(this, GroupPropertyValue2, l, maxScreenHeight, maxScreenHeight);
            String GroupPropertyValue3 = dataCollection.GroupPropertyValue(str, "left");
            String GroupPropertyValue4 = dataCollection.GroupPropertyValue(str, "top");
            if (TextUtils.isEmpty(GroupPropertyValue3)) {
                GroupPropertyValue3 = "0";
            }
            if (TextUtils.isEmpty(GroupPropertyValue4)) {
                GroupPropertyValue4 = "0";
            }
            int e13 = Utils.e1(this, GroupPropertyValue3, V, maxScreenWidth, maxScreenWidth);
            int e14 = Utils.e1(this, GroupPropertyValue4, l, maxScreenHeight, maxScreenHeight);
            boolean g = q.g(dataCollection.GroupPropertyValue(str, "float-over-drawer"), false);
            C1066a j = l2.j(str);
            boolean v = j.v();
            ?? c0169x = new C0169x(this);
            IXoneCollection iXoneCollection = dataCollection;
            int i = V;
            int i2 = l;
            C1066a c1066a = l2;
            c0169x.l0(this.e1, dataObject, j, str, maxScreenWidth, maxScreenHeight, maxScreenWidth, maxScreenHeight);
            c0169x.setFloatOverDrawer(g);
            c0169x.setClickable(true);
            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(Utils.W2(e1, this.Z0), Utils.W2(e12, this.a1));
            layoutParams.setMargins(e13, e14, 0, 0);
            c0169x.setLayoutParams(layoutParams);
            c0169x.setVisibility(v ? 8 : 0);
            c0169x.r0();
            this.L0.put(str, c0169x);
            if (!v) {
                c0169x.h0(e1, e12, 100, 100);
            }
            l = i2;
            V = i;
            l2 = c1066a;
            dataCollection = iXoneCollection;
        }
    }

    public void N7(final String str, final String str2, final String str3, final String str4) {
        if (Utils.s3()) {
            f7(str, str2, str3, str4);
        } else {
            runOnUiThread(new Runnable() {
                @Override
                public final void run() {
                    EditViewHyper.this.f8(str, str2, str3, str4);
                }
            });
        }
    }

    public final void N8() {
        AppCompatButton x3 = x3();
        LinearLayout linearLayout = (LinearLayout) t2(AbstractC0564f.O1);
        int childCount = linearLayout.getChildCount();
        K k = null;
        boolean z = false;
        for (int i = 0; i < childCount; i++) {
            ?? r5 = (K) linearLayout.getChildAt(i);
            String str = (String) r5.getTag();
            String GroupPropertyValue = this.x.GroupPropertyValue(str, "name");
            String GroupPropertyValue2 = this.x.GroupPropertyValue(str, "onlostfocus");
            String GroupPropertyValue3 = this.x.GroupPropertyValue(str, "onfocus");
            IXoneObject dataObject = getDataObject();
            if (dataObject == null) {
                throw new NullPointerException("Error in refreshOldTabs(), dataObject == null");
            }
            r5.b(dataObject, str, GroupPropertyValue, i, GroupPropertyValue2, GroupPropertyValue3);
            if (Z7(str)) {
                if (x3() != null && x3() == r5) {
                    if (k != null) {
                        w5(k);
                    } else {
                        z = true;
                    }
                }
                r5.setVisibility(8);
            } else {
                if (z) {
                    w5(r5);
                    z = false;
                } else {
                    k = r5;
                }
                r5.setVisibility(0);
                if (x3 != null) {
                    F6(r5, str.equals(x3.getTag()));
                }
            }
        }
    }

    public final void O6() {
        IXoneObject dataObject = getDataObject();
        IXoneCollection dataCollection = getDataCollection();
        if (dataObject == null || dataCollection == null) {
            return;
        }
        LinearLayout linearLayout = (LinearLayout) t2(AbstractC0564f.O1);
        ViewPager y7 = y7();
        this.c1 = y7;
        y7.removeAllViews();
        C1066a l = G3().l();
        ArrayList arrayList = new ArrayList();
        List A7 = A7(l.o());
        this.U0 = A7;
        this.V0 = new boolean[A7.size()];
        for (int i = 0; i < this.U0.size(); i++) {
            this.V0[i] = a8((String) this.U0.get(i));
            if (this.V0[i]) {
                arrayList.add((String) this.U0.get(i));
            }
            if (x3() == null && this.V0[i]) {
                w5((K) linearLayout.getChildAt(i));
            }
        }
        boolean l2 = t.l(dataCollection.CollPropertyValue("cache-groups"), false);
        int maxScreenWidth = getMaxScreenWidth();
        int maxScreenHeight = getMaxScreenHeight();
        C0527e c0527e = new C0527e(this.e1, dataObject, l, arrayList, l2, maxScreenWidth, maxScreenHeight, maxScreenWidth, maxScreenHeight, this.Z0, this.a1);
        ViewPager viewPager = this.c1;
        if (viewPager instanceof EditGroupViewPager) {
            viewPager.setAdapter((y1.a) null);
            ((EditGroupViewPager) this.c1).setGroupSwipe(t.l(dataCollection.CollPropertyValue("group-swipe"), true));
        }
        this.c1.setAdapter(c0527e);
        this.c1.setOffscreenPageLimit(q.p(dataCollection.CollPropertyValue("page-limit-off"), 10));
        this.c1.setBackgroundColor(0);
        this.c1.setOnPageChangeListener(this);
        this.c1.setImportantForAccessibility(2);
    }

    public final void O7(IXoneApp iXoneApp, Throwable th) {
        if (iXoneApp == null) {
            th.printStackTrace();
            return;
        }
        if (iXoneApp.getError() == null) {
            AbstractC0515a.b(this.e1, "", th, iXoneApp);
            return;
        }
        String description = iXoneApp.getError().getDescription();
        if (!t.h(description)) {
            if (description.contains("##EXIT##")) {
                K6();
                k(F0());
            } else if (description.contains("##EXITAPP##")) {
                K6();
                if (description.contains("##STARTREPLICA##")) {
                    z();
                }
                XoneBaseActivity.C2().A(true);
                k(14);
            } else if (description.contains("##LOGIN_START##")) {
                K6();
                IXoneObject dataObject = getDataObject();
                if (dataObject == null) {
                    throw new NullPointerException("Error in handleOnOptionsMenuClosedErrors(), dataObject == null");
                }
                fb.o.b(dataObject, description, this);
            } else {
                AbstractC0515a.b(this.e1, "", null, iXoneApp);
            }
        }
        iXoneApp.getError().Clear();
    }

    public final void O8() {
        Message obtainMessage = this.e1.obtainMessage();
        obtainMessage.arg1 = 2008;
        obtainMessage.arg2 = 9;
        this.e1.sendMessageDelayed(obtainMessage, 100L);
    }

    public final void P6(IXoneCollection iXoneCollection) {
        int i;
        TabLayout t2 = t2(AbstractC0564f.M1);
        TabLayout tabLayout = t2 instanceof ViewStub ? (TabLayout) ((ViewStub) t2).inflate() : t2;
        tabLayout.setupWithViewPager(y7());
        tabLayout.h(this);
        String u1 = XoneBaseActivity.u1(iXoneCollection, "tab-mode", "fixed");
        u1.getClass();
        if (u1.equals("scrollable")) {
            i = 0;
        } else {
            if (!u1.equals("fixed")) {
                throw new IllegalArgumentException("Invalid tab mode");
            }
            i = 1;
        }
        tabLayout.setTabMode(i);
        tabLayout.setImportantForAccessibility(2);
        String u12 = XoneBaseActivity.u1(iXoneCollection, "selected-tab-indicator-color", xoneApp.Z0().j0());
        if (!TextUtils.isEmpty(u12)) {
            String[] split = u12.split(",");
            if (split.length > 0) {
                tabLayout.setSelectedTabIndicatorColor(t.w(split[0], -16711936));
            }
        }
        this.P0 = (int) TypedValue.applyDimension(1, 48.0f, getResources().getDisplayMetrics());
        B7().setVisibility(8);
    }

    public final boolean P8(Set set) {
        for (EditFramePage editFramePage : B2()) {
            boolean S72 = S7(set);
            Set set2 = set;
            editFramePage.L0(100, set2, true, 100, 100, false);
            if (P7(S72, set2)) {
                return true;
            }
            set = set2;
        }
        return false;
    }

    @Override
    public void Q() {
        k(10);
    }

    public final void Q6() {
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            return;
        }
        IXoneCollection ownerCollection = dataObject.getOwnerCollection();
        boolean l = t.l(ownerCollection.CollPropertyValue("notab"), false);
        HorizontalScrollView B7 = B7();
        LinearLayout linearLayout = (LinearLayout) t2(AbstractC0564f.O1);
        linearLayout.removeAllViews();
        B7.setImportantForAccessibility(2);
        linearLayout.setImportantForAccessibility(2);
        Q8(ownerCollection, linearLayout, B7);
        List o = r3().o();
        this.X0 = new ArrayList();
        for (int i = 0; i < o.size(); i++) {
            String str = (String) o.get(i);
            if (!this.G0.contains(str) && !this.H0.contains(str) && !this.I0.contains(str)) {
                String GroupPropertyValue = ownerCollection.GroupPropertyValue(str, "name");
                String GroupPropertyValue2 = ownerCollection.GroupPropertyValue(str, "onlostfocus");
                String GroupPropertyValue3 = ownerCollection.GroupPropertyValue(str, "onfocus");
                this.X0.add(GroupPropertyValue2);
                ?? k = new K(this);
                k.b(dataObject, str, GroupPropertyValue, i, GroupPropertyValue2, GroupPropertyValue3);
                FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(Utils.W2(Utils.d1(this, XoneBaseActivity.C1(ownerCollection, str, "tab-width", "33%"), getMaxScreenWidth()), this.Z0), -1);
                layoutParams.setMargins(0, 0, 0, 0);
                layoutParams.gravity = 48;
                linearLayout.addView((View) k, layoutParams);
                F6(k, false);
                if (l) {
                    linearLayout.setVisibility(8);
                }
                View view = linearLayout.getParent() != null ? (View) linearLayout.getParent() : null;
                if (view != null) {
                    if (l) {
                        view.setVisibility(8);
                        this.P0 = 0;
                    } else {
                        view.setVisibility(0);
                    }
                }
            }
        }
        if (l) {
            return;
        }
        R6(ownerCollection);
    }

    public final boolean Q7() {
        return Utils.H(M2(), 8);
    }

    public final void Q8(IXoneCollection iXoneCollection, LinearLayout linearLayout, HorizontalScrollView horizontalScrollView) {
        this.P0 = Utils.d1(this, XoneBaseActivity.u1(iXoneCollection, "tab-height", "50"), getMaxScreenHeight());
        ViewGroup.LayoutParams layoutParams = linearLayout.getLayoutParams();
        if (layoutParams == null) {
            layoutParams = new FrameLayout.LayoutParams(-1, this.P0);
        } else {
            layoutParams.height = this.P0;
        }
        linearLayout.setLayoutParams(layoutParams);
        ViewGroup.LayoutParams layoutParams2 = horizontalScrollView.getLayoutParams();
        if (layoutParams2 == null) {
            layoutParams2 = new FrameLayout.LayoutParams(-1, this.P0);
        } else {
            layoutParams2.height = this.P0;
        }
        horizontalScrollView.setLayoutParams(layoutParams2);
    }

    public final void R6(IXoneCollection iXoneCollection) {
        String CollPropertyValue = iXoneCollection.CollPropertyValue("tab-theme");
        if (TextUtils.isEmpty(CollPropertyValue)) {
            CollPropertyValue = iXoneCollection.CollPropertyValue("group-theme");
        }
        if (!TextUtils.isEmpty(CollPropertyValue) && CollPropertyValue.compareTo("material") == 0) {
            P6(iXoneCollection);
        }
    }

    public final boolean R7() {
        return M2() == 2;
    }

    public final void R8() {
        DrawerLayout t2 = t2(AbstractC0564f.v0);
        if (this.K0.isEmpty()) {
            return;
        }
        Iterator it = this.K0.entrySet().iterator();
        while (it.hasNext()) {
            t2.removeView((C0159v) ((Map.Entry) it.next()).getValue());
        }
        this.K0.clear();
    }

    public final void S8() {
        if (this.L0.isEmpty()) {
            return;
        }
        Iterator it = this.L0.entrySet().iterator();
        while (it.hasNext()) {
            ((C0169x) ((Map.Entry) it.next()).getValue()).t0();
        }
        this.L0.clear();
    }

    public boolean T6() {
        List<Wa.a> eventCallback;
        IXoneObject dataObject = getDataObject();
        if (dataObject == null || (eventCallback = this.x.getEventCallback("onafteredit")) == null) {
            return false;
        }
        new EventCallbackTask.b().b(this).e(dataObject).h(this.e1).g(eventCallback).c(new Object[]{new C0789a("e", new EventOnAfterEdit(dataObject.getOwnerApp(), dataObject, this.x))}).a().runSeriallyAsyncTask();
        return true;
    }

    public final boolean T7() {
        return Utils.H(M2(), 64);
    }

    public final void T8() {
        mainEntry S = XoneBaseActivity.C2().S();
        if (S == null) {
            return;
        }
        S.u0();
    }

    public void U6() {
        IXoneObject dataObject = getDataObject();
        if (dataObject == null || dataObject.GetNode("after-edit") == null) {
            return;
        }
        new o.a().b(this).d(dataObject).e(this.e1).f("after-edit").a().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, new Void[0]);
    }

    public final boolean U7() {
        return this.X || S2() != null || Q7() || T7();
    }

    public final void U8() {
        Iterator it = this.g1.iterator();
        while (it.hasNext()) {
            this.f1.add(C0874b.u((C0670e) it.next()));
        }
    }

    public void j8(Configuration configuration) {
        xoneApp Z0 = xoneApp.Z0();
        try {
            if (configuration != null) {
                G6(configuration);
            } else {
                Utils.l("XOneAndroidFramework", "EditViewHyper.doAfterOnResume(): configuration == null, not changing base resolution values");
            }
            if (Z0.R1()) {
                k(14);
                return;
            }
            if (c()) {
                Utils.l("XOneAndroidFramework", "EditViewHyper.doAfterOnResume(): Activity is destroyed");
                return;
            }
            if (!this.X) {
                Z0.K2(this);
            }
            Z0.y2(this);
            D8();
            if (this.R0 == null) {
                Utils.l("XOneAndroidFramework", "EditViewHyper.doAfterOnResume(): oldConfig == null");
                return;
            }
            if (this.S0 == null) {
                Utils.l("XOneAndroidFramework", "EditViewHyper.doAfterOnResume(): pausedConfig == null");
                return;
            }
            if (c()) {
                Utils.l("XOneAndroidFramework", "EditViewHyper.doAfterOnResume(): Activity is destroyed");
                return;
            }
            int i = this.R0.orientation;
            Configuration configuration2 = this.S0;
            if (i != configuration2.orientation) {
                I6(configuration2);
            }
            if (c()) {
                Utils.l("XOneAndroidFramework", "EditViewHyper.doAfterOnResume(): Activity is destroyed");
            } else {
                l7();
            }
        } catch (Exception e) {
            b(e);
        }
    }

    public final void V7() {
        C0670e x1;
        InterfaceC1032j0 GetNode = this.x.GetNode("maintenance");
        if (GetNode == null) {
            return;
        }
        InterfaceC1034k0 childNodes = GetNode.getChildNodes();
        for (int i = 0; i < childNodes.count(); i++) {
            InterfaceC1032j0 interfaceC1032j0 = childNodes.get(i);
            if (TextUtils.equals("action", interfaceC1032j0.getName()) && !TextUtils.equals("replica", AbstractC0734d.a(interfaceC1032j0, "name")) && (x1 = xoneApp.Z0().x1(interfaceC1032j0, this.x)) != null) {
                this.g1.add(x1);
            }
        }
    }

    public final void V8(int i) {
        ViewGroup viewGroup = (ViewGroup) t2(AbstractC0564f.O1);
        boolean[] G7 = G7();
        int i2 = 0;
        for (int i3 = 0; i3 < G7.length; i3++) {
            if (G7[i3]) {
                if (i2 == i) {
                    w5((K) viewGroup.getChildAt(i3));
                    return;
                }
                i2++;
            }
        }
    }

    public final void W6(IXoneObject iXoneObject, String str, String str2) {
        new fa.h(new a(iXoneObject, str, z4(iXoneObject, str, str2))).runSeriallyAsyncTask();
    }

    public final void W7(ViewGroup viewGroup) {
        for (LinearLayout linearLayout : this.J0.values()) {
            try {
                linearLayout.removeAllViews();
                if (viewGroup != null) {
                    viewGroup.removeView(linearLayout);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        this.J0.clear();
    }

    public final void W8(int i) {
        d9(true);
        ViewPager t2 = t2(AbstractC0564f.N1);
        C0527e c0527e = t2.getAdapter() instanceof C0527e ? (C0527e) t2.getAdapter() : null;
        String Q2 = i >= 0 ? c0527e != null ? Utils.Q2("##GROUP##", c0527e.F(i)) : Utils.Q2("##GROUP##", (String) t2.getChildAt(i).getTag()) : null;
        if (!TextUtils.isEmpty(Q2)) {
            C0834e B0 = B0();
            if (B0 != null) {
                B0.i(Q2);
            }
            HorizontalScrollView B7 = B7();
            ?? r1 = (K) B7.findViewWithTag(Q2);
            w5(r1);
            B7.smoothScrollTo((int) r1.getX(), (int) r1.getY());
        }
        N8();
        final y1.a adapter = t2.getAdapter();
        if (adapter == null) {
            return;
        }
        if (Utils.s3()) {
            adapter.notifyDataSetChanged();
        } else {
            runOnUiThread(new Runnable() {
                @Override
                public final void run() {
                    adapter.notifyDataSetChanged();
                }
            });
        }
    }

    public boolean X6() {
        List<Wa.a> eventCallback;
        IXoneObject dataObject = getDataObject();
        if (dataObject == null || (eventCallback = this.x.getEventCallback("onbeforeedit")) == null) {
            return false;
        }
        this.S = true;
        z0(10);
        try {
            Object[] objArr = {new C0789a("e", new EventOnBeforeEdit(dataObject.getOwnerApp(), dataObject, this.x))};
            final m mVar = new m(this);
            new EventCallbackTask.b().b(this).e(dataObject).h(this.e1).g(eventCallback).c(objArr).i(new OnEventFinishedCallback() {
                @Override
                public final void onEventFinished(List list) {
                    EditViewHyper.this.d8(mVar, list);
                }
            }).a().runSeriallyAsyncTask();
            return true;
        } finally {
            this.S = false;
        }
    }

    public final boolean X7(int i, int i2, Intent intent) {
        InterfaceC1018c0 interfaceC1018c0;
        Map map = this.D0;
        if (map == null || map.isEmpty() || (interfaceC1018c0 = (InterfaceC1018c0) this.D0.get(Integer.valueOf(i))) == null) {
            return false;
        }
        interfaceC1018c0.onActivityResult(i2, intent);
        return true;
    }

    public void X8() {
        Message obtainMessage = this.e1.obtainMessage();
        obtainMessage.what = 409;
        this.e1.sendMessage(obtainMessage);
    }

    public void Y6() {
        if (XoneBaseActivity.D2() == null) {
            Utils.l("XOneAndroidFramework", "Error, appData is not loaded yet");
            return;
        }
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            throw new NullPointerException("Error, no data object found");
        }
        if (dataObject.getOwnerCollection().GetNode("before-edit") == null) {
            this.J = true;
            new m(this).c();
            return;
        }
        this.S = true;
        z0(10);
        try {
            new o.a().b(this).d(dataObject).e(this.e1).f("before-edit").g(new o.b() {
                @Override
                public final void a(Exception exc) {
                    EditViewHyper.this.v8(exc);
                }
            }).a().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, new Void[0]);
        } finally {
            this.S = false;
        }
    }

    public final boolean Y7(String str) {
        return this.K0.containsKey(str);
    }

    public final void Y8() {
        Message obtainMessage = this.e1.obtainMessage();
        obtainMessage.what = 402;
        this.e1.sendMessage(obtainMessage);
    }

    @Override
    public int Z2() {
        return this.M0;
    }

    @Override
    public synchronized boolean Z4(String str, boolean z) {
        View findViewWithTag;
        try {
            Iterator it = this.J0.keySet().iterator();
            while (it.hasNext()) {
                LinearLayout linearLayout = (LinearLayout) this.J0.get((String) it.next());
                if (linearLayout != null && (findViewWithTag = linearLayout.findViewWithTag(str)) != null && findViewWithTag.isFocusable()) {
                    findViewWithTag.requestFocus();
                    return true;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            ViewPager y7 = y7();
            this.c1 = y7;
            if (y7 != null) {
                final View findViewWithTag2 = y7.findViewWithTag(str);
                if (findViewWithTag2 instanceof XOneEditText) {
                    findViewWithTag2 = ((XOneEditText) findViewWithTag2).getRealTextView();
                }
                if (findViewWithTag2 != null) {
                    findViewWithTag2.post(new RunnableC0508z0(findViewWithTag2));
                    if (z && (findViewWithTag2 instanceof EditText)) {
                        final InputMethodManager inputMethodManager = (InputMethodManager) getApplicationContext().getSystemService("input_method");
                        findViewWithTag2.post(new Runnable() {
                            @Override
                            public final void run() {
                                inputMethodManager.showSoftInput(findViewWithTag2, 2);
                            }
                        });
                    }
                    return true;
                }
            }
            return false;
        } catch (Exception e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public void Z6() {
        m7();
        AsyncTask.SERIAL_EXECUTOR.execute(new b());
    }

    public final boolean Z7(String str) {
        return r3().j(str).v();
    }

    public final void Z8() {
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            throw new NullPointerException("Error in sendFailFileMsg(), data object is null");
        }
        String FieldPropertyValue = dataObject.FieldPropertyValue(p3(), "file-msgfail");
        if (TextUtils.isEmpty(FieldPropertyValue)) {
            FieldPropertyValue = getString(AbstractC0568j.A);
        }
        F5(-1, AbstractC0568j.q, FieldPropertyValue);
    }

    @Override
    public void a0(final boolean z, final Set set) {
        if (Utils.s3()) {
            o7(z, set);
        } else {
            final WeakReference weakReference = new WeakReference(this);
            runOnUiThread(new Runnable() {
                @Override
                public final void run() {
                    EditViewHyper.t6(weakReference, set, z);
                }
            });
        }
    }

    @Override
    public int a3() {
        return this.O0;
    }

    public void a7() {
        b7();
        c9();
        N8();
        O3();
    }

    public final boolean a8(String str) {
        return !r3().j(str).v();
    }

    public void a9(boolean z) {
        this.E0 = z;
    }

    public final void b7() {
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            return;
        }
        String CollPropertyValue = dataObject.getOwnerCollection().CollPropertyValue("tab-orientation");
        this.F0 = CollPropertyValue;
        if (TextUtils.isEmpty(CollPropertyValue)) {
            this.F0 = "top";
        }
        if (TextUtils.equals(this.F0, "bottom")) {
            q8();
        }
        s8();
        r8();
        t8();
        Q6();
        M6();
        O6();
        L6();
        N6();
    }

    public final void b8(DialogInterface dialogInterface, int i) {
        d7(33);
    }

    public void b9(int i, int i2) {
        View t2 = t2(AbstractC0564f.y0);
        ImageView imageView = t2 instanceof ViewStub ? (ImageView) ((ViewStub) t2).inflate() : (ImageView) t2;
        if (imageView == null) {
            return;
        }
        if (i2 == 0) {
            if (i == 0) {
                imageView.setBackgroundResource(AbstractC0563e.d);
            } else {
                imageView.setBackgroundResource(AbstractC0563e.c);
            }
        }
        imageView.setVisibility(i2);
    }

    public final boolean c7() {
        if (l3() == null) {
            return false;
        }
        try {
            IXoneObject dataObject = getDataObject();
            try {
                if (dataObject == null) {
                    throw new NullPointerException("Error in doCustomRefreshNode(), data object is null");
                }
                RunnableC1097a.h(this, dataObject, this.e1, "onrefresh", 0, true, null, null).start();
                return true;
            } catch (Exception e) {
                e = e;
                b(e);
                return false;
            }
        } catch (Exception e2) {
            e = e2;
        }
    }

    public final void c8(DialogInterface dialogInterface, int i) {
        k(F0());
    }

    public final void c9() {
        L5(false, null, -1, null, -1);
    }

    public void d7(int i) {
        Thread thread;
        if (t.h("ext-execute") || ((thread = this.Y0) != null && thread.isAlive())) {
            return;
        }
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            throw new NullPointerException("Error in doExtExecute(), data object is null");
        }
        Thread h = RunnableC1097a.h(this, dataObject, this.e1, "ext-execute", i, false, null, null);
        this.Y0 = h;
        h.start();
    }

    public final void d8(m mVar, List list) {
        this.J = true;
        mVar.c();
    }

    public final void d9(boolean z) {
        ViewPager y7 = y7();
        if (y7 == null) {
            return;
        }
        for (int i = 0; i < y7.getChildCount(); i++) {
            Object childAt = y7.getChildAt(i);
            if (childAt != null) {
                if (childAt instanceof I) {
                    ((I) childAt).getPagesView().A0(z);
                } else if (childAt instanceof FrameLayout) {
                    Object childAt2 = ((FrameLayout) childAt).getChildAt(0);
                    if (childAt2 instanceof com.xone.android.framework.views.a) {
                        ((com.xone.android.framework.views.a) childAt2).A0(z);
                    }
                }
            }
        }
    }

    @Override
    public FutureC0996a e(IXoneObject iXoneObject) {
        return F(iXoneObject, 0);
    }

    public final void e7(int i, Intent intent) {
        C0679n F3 = F3();
        if (F3 == null) {
            return;
        }
        Class a2 = F3.a();
        ValueCallback b2 = F3.b();
        if (b2 == null) {
            return;
        }
        if (intent == null || i != -1) {
            b2.onReceiveValue(null);
            return;
        }
        Uri data = intent.getData();
        if (data == null) {
            b2.onReceiveValue(null);
            return;
        }
        if (a2 == null) {
            Utils.l("XOneAndroidFramework", "Error in doFileChooserResult(), parameter type is null. Ignoring result");
            return;
        }
        if (a2 == Uri[].class) {
            b2.onReceiveValue(new Uri[]{data});
            return;
        }
        if (a2 == Uri.class) {
            b2.onReceiveValue(data);
            return;
        }
        Utils.l("XOneAndroidFramework", "Error in doFileChooserResult(), parameter type is of an unknown type (" + a2.getName() + "). Ignoring result");
    }

    public final void e8(IXoneObject iXoneObject, int i, Set set) {
        h7(iXoneObject, i);
    }

    public final void e9(Intent intent) {
        File file;
        Uri data = intent.getData();
        if (data == null) {
            throw new NullPointerException("Cannot obtain attachment data from intent");
        }
        if (TextUtils.equals(data.getScheme(), "content")) {
            file = q2(data);
        } else {
            String path = data.getPath();
            if (TextUtils.isEmpty(path)) {
                throw new NullPointerException("Cannot obtain attachment uri path from intent");
            }
            file = new File(path);
        }
        if (file.exists()) {
            IXoneObject dataObject = getDataObject();
            if (dataObject == null) {
                throw new NullPointerException("Error in updateAttachmentProperty(), data object is null");
            }
            long t = q.t(dataObject.FieldPropertyValue(p3(), "file-maxsize"), 0L);
            if (t > 0 && file.isFile() && file.length() > t) {
                String FieldPropertyValue = dataObject.FieldPropertyValue(p3(), "file-msgfail");
                if (TextUtils.isEmpty(FieldPropertyValue)) {
                    FieldPropertyValue = getString(AbstractC0568j.A);
                }
                F5(-1, AbstractC0568j.q, FieldPropertyValue);
                return;
            }
            String name = file.getName();
            File l0 = XoneBaseActivity.C2().l0(name);
            Utils.Z(file, l0);
            if (t.l(dataObject.FieldPropertyValue(p3(), "embed"), false)) {
                name = AbstractC0689b.k(l0);
            }
            N(dataObject, p3(), name);
            View u3 = u3();
            if (u3 instanceof TextView) {
                SpannableString spannableString = new SpannableString(name);
                spannableString.setSpan(new UnderlineSpan(), 0, spannableString.length(), 0);
                ((TextView) u3).setText(spannableString);
                ImageView imageView = (ImageView) Utils.S2(u3, AbstractC0564f.x);
                if (imageView != null) {
                    if (TextUtils.isEmpty(name)) {
                        imageView.setVisibility(8);
                    } else {
                        imageView.setVisibility(0);
                    }
                }
            }
        }
    }

    @Override
    public boolean f() {
        return this.W0;
    }

    public void f7(String str, String str2, String str3, String str4) {
        char c2;
        ViewPager.k kVar;
        boolean z;
        if (TextUtils.isEmpty(str)) {
            return;
        }
        L8();
        int z7 = z7(str);
        ViewPager t2 = t2(AbstractC0564f.N1);
        if (!TextUtils.isEmpty(str3) && !TextUtils.isEmpty(str4)) {
            switch (str3.hashCode()) {
                case -1846700154:
                    if (str3.equals("##ROTATE_DOWN##")) {
                        c2 = '\t';
                        break;
                    }
                    c2 = 65535;
                    break;
                case -1704207297:
                    if (str3.equals("##ROTATE_UP##")) {
                        c2 = '\n';
                        break;
                    }
                    c2 = 65535;
                    break;
                case -1532175962:
                    if (str3.equals("##TABLET##")) {
                        c2 = '\f';
                        break;
                    }
                    c2 = 65535;
                    break;
                case -1395282136:
                    if (str3.equals("##ACCORDION##")) {
                        c2 = 0;
                        break;
                    }
                    c2 = 65535;
                    break;
                case -1054894666:
                    if (str3.equals("##FLIP_HORIZONTAL##")) {
                        c2 = 6;
                        break;
                    }
                    c2 = 65535;
                    break;
                case -483239050:
                    if (str3.equals("##BACKGROUND_TO_FOREGROUND##")) {
                        c2 = 1;
                        break;
                    }
                    c2 = 65535;
                    break;
                case -463381143:
                    if (str3.equals("##BOOK##")) {
                        c2 = 14;
                        break;
                    }
                    c2 = 65535;
                    break;
                case -392085599:
                    if (str3.equals("##DRAW_FROM_BACK##")) {
                        c2 = 5;
                        break;
                    }
                    c2 = 65535;
                    break;
                case -119866888:
                    if (str3.equals("##NONE##")) {
                        c2 = 16;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 10029539:
                    if (str3.equals("##DEPTH##")) {
                        c2 = 4;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 232671713:
                    if (str3.equals("##DEFAULT##")) {
                        c2 = 15;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 305021622:
                    if (str3.equals("##FOREGROUND_TO_BACKGROUND##")) {
                        c2 = '\b';
                        break;
                    }
                    c2 = 65535;
                    break;
                case 694390676:
                    if (str3.equals("##ZOOM_OUT_SLIDE##")) {
                        c2 = '\r';
                        break;
                    }
                    c2 = 65535;
                    break;
                case 728929711:
                    if (str3.equals("##CUBE_IN##")) {
                        c2 = 2;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 852763752:
                    if (str3.equals("##STACK##")) {
                        c2 = 11;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 1127781348:
                    if (str3.equals("##CUBE_OUT##")) {
                        c2 = 3;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 1391119624:
                    if (str3.equals("##FLIP_VERTICAL##")) {
                        c2 = 7;
                        break;
                    }
                    c2 = 65535;
                    break;
                default:
                    c2 = 65535;
                    break;
            }
            switch (c2) {
                case 0:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.a(view, f);
                        }
                    };
                    z = false;
                    break;
                case 1:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.b(view, f);
                        }
                    };
                    z = false;
                    break;
                case 2:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.d(view, f);
                        }
                    };
                    z = false;
                    break;
                case 3:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.e(view, f);
                        }
                    };
                    z = false;
                    break;
                case 4:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.f(view, f);
                        }
                    };
                    z = false;
                    break;
                case 5:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.g(view, f);
                        }
                    };
                    z = false;
                    break;
                case 6:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.h(view, f);
                        }
                    };
                    z = false;
                    break;
                case org.mozilla.javascript.Context.FEATURE_DYNAMIC_SCOPE:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.i(view, f);
                        }
                    };
                    z = false;
                    break;
                case '\b':
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.j(view, f);
                        }
                    };
                    z = false;
                    break;
                case org.mozilla.javascript.Context.FEATURE_STRICT_EVAL:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.l(view, f);
                        }
                    };
                    z = false;
                    break;
                case org.mozilla.javascript.Context.FEATURE_LOCATION_INFORMATION_IN_ERROR:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.m(view, f);
                        }
                    };
                    z = false;
                    break;
                case org.mozilla.javascript.Context.FEATURE_STRICT_MODE:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.n(view, f);
                        }
                    };
                    z = false;
                    break;
                case org.mozilla.javascript.Context.FEATURE_WARNING_AS_ERROR:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.o(view, f);
                        }
                    };
                    z = false;
                    break;
                case '\r':
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.p(view, f);
                        }
                    };
                    z = false;
                    break;
                case org.mozilla.javascript.Context.FEATURE_V8_EXTENSIONS:
                    kVar = new ViewPager.k() {
                        public final void a(View view, float f) {
                            E8.a.c(view, f);
                        }
                    };
                    z = true;
                    break;
                default:
                    kVar = null;
                    z = false;
                    break;
            }
            if (kVar != null) {
                t2.g0(z, kVar);
            }
        }
        if (TextUtils.equals(str3, "##NONE##")) {
            t2.d0(z7, false);
        } else {
            t2.setCurrentItem(z7);
        }
        W8(z7);
        y1.a adapter = t2.getAdapter();
        if (adapter == null) {
            throw new NullPointerException("Cannot obtain PagerAdapter");
        }
        Object p = z7 >= 0 ? adapter.p(t2, z7) : null;
        if (!TextUtils.isEmpty(str2) && (p instanceof I)) {
            com.xone.android.framework.views.a pagesView = ((I) p).getPagesView();
            try {
                pagesView.setIsMoving(true);
                C1066a h = va.d.h(pagesView.getDataLayout(), str2);
                if (h == null) {
                    pagesView.setIsMoving(false);
                    return;
                }
                int k = va.d.k(pagesView.getDataLayout(), h);
                if (k >= 0) {
                    p8(pagesView, k);
                } else {
                    Utils.l("XOneAndroidFramework", " +++ Layout: Index not found for prop: " + str2);
                }
                pagesView.setIsMoving(false);
            } catch (Throwable th) {
                pagesView.setIsMoving(false);
                throw th;
            }
        }
    }

    public final void f8(String str, String str2, String str3, String str4) {
        try {
            f7(str, str2, str3, str4);
        } catch (Exception e) {
            b(e);
        }
    }

    public final void f9(android.content.Intent r15) {
        throw new UnsupportedOperationException("Method not decompiled: com.xone.android.framework.activities.EditViewHyper.f9(android.content.Intent):void");
    }

    public final void g7() {
        if (x3() == null) {
            return;
        }
        String onFocus = x3().getOnFocus();
        if (TextUtils.isEmpty(onFocus)) {
            return;
        }
        new o.a().b(this).d(getDataObject()).e(this.e1).f(onFocus).a().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, new Void[0]);
    }

    public void g9(String str, int i) {
        KeyEvent.Callback findViewWithTag = t2(AbstractC0564f.S).findViewWithTag(str);
        if (findViewWithTag == null || !(findViewWithTag instanceof InterfaceC1056w)) {
            return;
        }
        ((InterfaceC1056w) findViewWithTag).d(i, false);
    }

    @ScriptAllowed
    public String getCurrentGroup() {
        return x7(this.c1.getCurrentItem());
    }

    @Override
    public Handler getHandler() {
        return this.e1;
    }

    @Override
    public void h(boolean z) {
        this.T0 = z;
    }

    public FutureC0996a h7(IXoneObject iXoneObject, int i) {
        IXoneCollection ownerCollection = iXoneObject.getOwnerCollection();
        if (ownerCollection == null) {
            return new FutureC0996a();
        }
        Intent y3 = XoneBaseActivity.y3(ownerCollection);
        y3.putExtra("collname", ownerCollection.getName());
        y3.putExtra("saveandquit", true);
        int ObjectIndex = ownerCollection.ObjectIndex(iXoneObject);
        y3.putExtra("index", ObjectIndex);
        if (ObjectIndex == -1) {
            int hashCode = iXoneObject.hashCode();
            y3.putExtra("orphanObjectHashCode", hashCode);
            xoneApp.Z0().k2(iXoneObject, Integer.valueOf(hashCode));
        }
        if (ownerCollection.getOwnerObject() != null) {
            y3.putExtra("pushobject", true);
            Integer valueOf = Integer.valueOf(XoneBaseActivity.C2().D1().nextInt());
            y3.putExtra("parentID", valueOf);
            XoneBaseActivity.C2().k2(iXoneObject, valueOf);
        }
        XoneBaseActivity.P1(y3, ownerCollection);
        if (i == 1) {
            startActivity(y3);
        } else if (i == 2) {
            startActivityForResult(y3, 503);
        } else {
            startActivityForResult(y3, 503);
        }
        return new FutureC0996a(iXoneObject);
    }

    public final void h8(XoneDataObject xoneDataObject) {
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            return;
        }
        IXoneApp ownerApp = dataObject.getOwnerApp();
        if (!ownerApp.getPushExit()) {
            e(xoneDataObject);
            return;
        }
        F(xoneDataObject, 1);
        ownerApp.setPushExit(false);
        k(F0());
    }

    public void h9(Uri uri, String str) {
        long W2;
        int X2;
        int V2;
        int U2;
        AssetFileDescriptor assetFileDescriptor;
        if (n3() == null) {
            return;
        }
        final IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            throw new NullPointerException("Error in updatePhotoProperty(), data object is null");
        }
        File n3 = n3();
        if (n3.exists() && n3.isFile()) {
            new fa.h(new C0586c(this, dataObject, str, n3, false)).d();
            return;
        }
        if (TextUtils.isEmpty(str)) {
            W2 = W2();
            X2 = X2();
            V2 = V2();
            U2 = U2();
        } else {
            W2 = q.t(dataObject.FieldPropertyValue(str, "file-maxsize"), 0L);
            X2 = q.p(dataObject.FieldPropertyValue(str, "file-maxwidth"), -1);
            V2 = q.p(dataObject.FieldPropertyValue(str, "file-maxheight"), -1);
            U2 = q.p(dataObject.FieldPropertyValue(str, "file-quality"), 90);
        }
        String str2 = "ph_" + UUID.randomUUID().toString() + ".jpg";
        final File l0 = XoneBaseActivity.C2().l0(str2);
        ContentResolver contentResolver = getContentResolver();
        FileInputStream fileInputStream = null;
        if (uri == null) {
            Utils.N(null);
            Utils.M(null);
            return;
        }
        try {
            assetFileDescriptor = contentResolver.openAssetFileDescriptor(uri, "r");
            if (assetFileDescriptor == null) {
                Utils.N(null);
                Utils.M(assetFileDescriptor);
                return;
            }
            try {
                FileInputStream createInputStream = assetFileDescriptor.createInputStream();
                try {
                    Utils.c0(createInputStream, n3);
                    Utils.N(createInputStream);
                    Utils.M(assetFileDescriptor);
                    if (X2 > 0 || V2 > 0) {
                        if (X2 > 0 && V2 > 0) {
                            r.U(n3, l0, X2, V2, U2);
                        } else if (X2 > 0) {
                            V2 = r.S(n3, l0, X2, U2);
                        } else {
                            X2 = r.M(n3, l0, V2, U2);
                        }
                    } else if (W2 > 0) {
                        r.O(n3, l0, W2);
                    } else {
                        Utils.Z(n3, l0);
                    }
                    if (X2 <= 0 || V2 <= 0) {
                        ImageDrawing.copyExifMetadata(n3, l0);
                    } else {
                        ImageDrawing.copyExifMetadataWithNewSizeTags(n3, l0, X2, V2);
                    }
                    if (XoneBaseActivity.s1(dataObject, str, "embed", false)) {
                        str2 = AbstractC0689b.k(l0);
                    }
                    if (!TextUtils.isEmpty(str)) {
                        G1(dataObject, str, str2, false);
                    }
                    final Object F2 = F2();
                    if (F2 != null) {
                        AsyncTask.SERIAL_EXECUTOR.execute(new Runnable() {
                            @Override
                            public final void run() {
                                EditViewHyper.this.n8(F2, dataObject, l0);
                            }
                        });
                    }
                    try {
                        if (TextUtils.equals(uri.getScheme(), "file")) {
                            S6(uri);
                        } else {
                            contentResolver.delete(uri, null, null);
                        }
                    } catch (Exception e) {
                        J3(e, "delete_from_content_provider", uri);
                    }
                } catch (Throwable th) {
                    th = th;
                    fileInputStream = createInputStream;
                    Utils.N(fileInputStream);
                    Utils.M(assetFileDescriptor);
                    throw th;
                }
            } catch (Throwable th2) {
                th = th2;
            }
        } catch (Throwable th3) {
            th = th3;
            assetFileDescriptor = null;
        }
    }

    public void i7() {
        try {
            b7();
            c9();
            N8();
            g7();
            V7();
            U8();
            O3();
            X8();
        } catch (Exception e) {
            J(e, new DialogInterfaceOnClickListenerC0471n0(this));
        }
    }

    public final void i8() {
        try {
            getWindow().addFlags(this.y);
        } catch (Exception e) {
            b(e);
        }
    }

    public final void i9() {
        File q = XoneSignActivity.q(getApplicationContext());
        if (q.exists()) {
            String str = "img_" + UUID.randomUUID().toString() + ".jpg";
            IXoneObject dataObject = getDataObject();
            if (dataObject == null) {
                throw new NullPointerException("Error in updateSignProperty(), data object is null");
            }
            long t = q.t(dataObject.FieldPropertyValue(p3(), "file-maxsize"), 0L);
            if (t > 0 && q.isFile() && q.length() > t) {
                Z8();
                return;
            }
            File file = null;
            try {
                file = XoneBaseActivity.C2().l0(str);
                Utils.Z(q, file);
            } catch (Exception e) {
                AbstractC0515a.b(this.e1, "Sign Error", e, XoneBaseActivity.D2());
            }
            if (!q.delete()) {
                throw new IOException("updateSignProperty(): Cannot delete " + q.getAbsolutePath());
            }
            if (t.l(dataObject.FieldPropertyValue(p3(), "embed"), false)) {
                if (file == null) {
                    throw new NullPointerException("Empty target file for embed property " + p3());
                }
                str = AbstractC0689b.k(file);
            }
            xoneApp.Z0().K2(this);
            G1(dataObject, p3(), str, true);
        }
    }

    public void j7() {
        if (x3() != null && w3() != null && !x3().equals(w3())) {
            String onLostFocus = x3().getOnLostFocus();
            if (!TextUtils.isEmpty(onLostFocus)) {
                new o.a().b(this).d(getDataObject()).e(this.e1).f(onLostFocus).a().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, new Void[0]);
            }
        }
        w5(w3());
    }

    public void j9(Uri uri, String str) {
        Throwable th;
        AssetFileDescriptor assetFileDescriptor;
        if (n3() == null) {
            return;
        }
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            throw new NullPointerException("Error in updateVideoProperty(), data object is null");
        }
        File n3 = n3();
        if (n3.exists() && n3.isFile()) {
            new fa.h(new C0586c(this, dataObject, str, n3, true)).d();
            return;
        }
        long t = !TextUtils.isEmpty(str) ? q.t(dataObject.FieldPropertyValue(str, "file-maxsize"), 0L) : 0L;
        String str2 = "vd_" + UUID.randomUUID().toString() + ".3gp";
        File l0 = XoneBaseActivity.C2().l0(str2);
        ContentResolver contentResolver = getContentResolver();
        FileInputStream fileInputStream = null;
        if (uri == null) {
            Utils.N(null);
            Utils.M(null);
            return;
        }
        try {
            assetFileDescriptor = contentResolver.openAssetFileDescriptor(uri, "r");
            if (assetFileDescriptor == null) {
                Utils.N(null);
                Utils.M(assetFileDescriptor);
                return;
            }
            try {
                FileInputStream createInputStream = assetFileDescriptor.createInputStream();
                try {
                    if (t > 0) {
                        r.Q(createInputStream, l0, t);
                    } else {
                        Utils.c0(createInputStream, l0);
                    }
                    Utils.N(createInputStream);
                    Utils.M(assetFileDescriptor);
                    if (XoneBaseActivity.s1(dataObject, str, "embed", false)) {
                        str2 = AbstractC0689b.k(l0);
                    }
                    if (!TextUtils.isEmpty(str)) {
                        G1(dataObject, str, str2, false);
                    }
                    Object F2 = F2();
                    if (F2 != null) {
                        R3(F2, dataObject, l0.getName());
                    }
                    try {
                        if (TextUtils.equals(uri.getScheme(), "file")) {
                            S6(uri);
                        } else {
                            contentResolver.delete(uri, null, null);
                        }
                    } catch (Exception e) {
                        J3(e, "delete_from_content_provider", uri);
                    }
                } catch (Throwable th2) {
                    th = th2;
                    fileInputStream = createInputStream;
                    Utils.N(fileInputStream);
                    Utils.M(assetFileDescriptor);
                    throw th;
                }
            } catch (Throwable th3) {
                th = th3;
            }
        } catch (Throwable th4) {
            th = th4;
            assetFileDescriptor = null;
        }
    }

    @Override
    public void k(int i) {
        if (i != -255) {
            setResult(i);
        }
        for (int i2 = 0; this.S && i2 < 100; i2++) {
            try {
                Thread.sleep(100L);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        finish();
    }

    public final boolean k7() {
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            return true;
        }
        List<Wa.a> eventCallback = this.x.getEventCallback("onback");
        InterfaceC1032j0 GetNode = dataObject.GetNode("onback");
        if (eventCallback == null && GetNode == null) {
            return false;
        }
        new fa.h(new d8.e(this, dataObject, this.x, eventCallback)).d();
        return true;
    }

    public final void l7() {
        IXoneCollection ownerCollection;
        List<Wa.a> eventCallback;
        IXoneObject dataObject = getDataObject();
        if (dataObject == null || (ownerCollection = dataObject.getOwnerCollection()) == null || (eventCallback = ownerCollection.getEventCallback("onresumeedit")) == null) {
            return;
        }
        new EventCallbackTask.b().b(this).e(dataObject).h(this.e1).g(eventCallback).c(new Object[]{new C0789a("e", new EventOnResumeEdit(dataObject.getOwnerApp(), dataObject, ownerCollection))}).a().runSeriallyAsyncTask();
    }

    public void m(TabLayout.g gVar) {
    }

    public final void m7() {
        IXoneObject dataObject = getDataObject();
        if (dataObject == null || dataObject.getOwnerCollection() == null || dataObject.getOwnerCollection().GetNode("onscreenorientation") == null) {
            return;
        }
        new o.a().b(this).d(getDataObject()).e(this.e1).f("onscreenorientation").a().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, new Void[0]);
    }

    public final boolean m8(Object obj, MenuItem menuItem) {
        try {
            int itemId = menuItem.getItemId();
            CharSequence title = menuItem.getTitle();
            String charSequence = title == null ? "" : title.toString();
            IXoneObject dataObject = getDataObject();
            if (dataObject == null) {
                return false;
            }
            new EventCallbackTask.b().b(this).e(dataObject).h(getHandler()).f(new Wa.a(Wa.b.Javascript, obj, null, "onItemClicked", null, false)).c(new Object[]{Integer.valueOf(itemId), charSequence}).a().runSeriallyAsyncTask();
            return false;
        } catch (Exception e) {
            b(e);
            return false;
        }
    }

    public final void n7(String str) {
        if (TextUtils.isEmpty(str)) {
            return;
        }
        for (String str2 : str.split(",")) {
            if (!t.h(str2)) {
                String trim = str2.toLowerCase().trim();
                if (trim.startsWith("executenode")) {
                    z0(10);
                    int indexOf = str2.indexOf("(");
                    int lastIndexOf = str2.lastIndexOf(")");
                    if (indexOf <= 10 || indexOf >= lastIndexOf) {
                        return;
                    }
                    String substring = str2.substring(indexOf + 1, lastIndexOf);
                    if (t.h(substring)) {
                        return;
                    }
                    new o.a().b(this).d(getDataObject()).e(this.e1).f(substring).a().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, new Void[0]);
                    return;
                }
                if (trim.startsWith("refresh")) {
                    a0(true, null);
                }
            }
        }
    }

    public void o7(boolean z, Set set) {
        Throwable th;
        Exception exc;
        Handler handler = getHandler();
        if (handler == null) {
            return;
        }
        try {
            Configuration configuration = getResources().getConfiguration();
            if (configuration != null) {
                try {
                    G6(configuration);
                } catch (Exception e) {
                    exc = e;
                    b(C0738c.c(getDataObject(), exc));
                    h(false);
                    a9(false);
                    return;
                } catch (Throwable th2) {
                    th = th2;
                    h(false);
                    a9(false);
                    throw th;
                }
            } else {
                Utils.l("XOneAndroidFramework", "EditViewHyper.doRefreshInternal(): configuration == null, not changing base resolution values");
            }
            if (z && handler.hasMessages(2015)) {
                h(false);
                a9(false);
                return;
            }
            if (!z && handler.hasMessages(2008)) {
                h(false);
                a9(false);
                return;
            }
            if (z && c7()) {
                h(false);
                a9(false);
                return;
            }
            a9(true);
            if (J8(set)) {
                h(false);
                a9(false);
                return;
            }
            if (I8(set)) {
                h(false);
                a9(false);
                return;
            }
            if (K8(set)) {
                h(false);
                a9(false);
                return;
            }
            if (P8(set)) {
                h(false);
                a9(false);
                return;
            }
            String str = x3() != null ? (String) x3().getTag() : "1";
            N8();
            C1066a r3 = r3();
            if (r3 == null) {
                h(false);
                a9(false);
                return;
            }
            if (set != null && !set.isEmpty()) {
                G8(r3, set);
                h(false);
                a9(false);
                return;
            }
            ViewPager y7 = y7();
            this.c1 = y7;
            if (y7 == null) {
                h(false);
                a9(false);
                return;
            }
            y1.a adapter = y7.getAdapter();
            if (adapter == null) {
                h(false);
                a9(false);
                return;
            }
            L8();
            if (adapter.l() == 0) {
                Utils.l("XOneAndroidFramework", "EditViewHyper.doRefreshInternal() has been invoked, but adapter has no groups. Ignoring");
                h(false);
                a9(false);
                return;
            }
            ViewPager viewPager = this.c1;
            Object p = adapter.p(viewPager, viewPager.getCurrentItem());
            if (p instanceof I) {
                try {
                    try {
                        ((I) p).n0(this, r3.j(str), getMaxScreenWidth(), (getMaxScreenHeight() - Z2()) - H7(), this.T0, set, J7(), K7());
                    } catch (Exception e2) {
                        e = e2;
                        exc = e;
                        b(C0738c.c(getDataObject(), exc));
                        h(false);
                        a9(false);
                        return;
                    }
                } catch (Throwable th3) {
                    th = th3;
                    th = th;
                    h(false);
                    a9(false);
                    throw th;
                }
            }
            h(false);
            a9(false);
        } catch (Exception e3) {
            e = e3;
        } catch (Throwable th4) {
            th = th4;
            th = th;
            h(false);
            a9(false);
            throw th;
        }
    }

    public final boolean o8(Bundle bundle) {
        IXoneApp D2;
        if (bundle == null || (D2 = XoneBaseActivity.D2()) == null) {
            return false;
        }
        this.P = bundle.getInt("scrollX");
        this.Q = bundle.getInt("scrollY");
        this.R = bundle.getString("group");
        int i = bundle.getInt("index");
        r(bundle.getString("propselected"));
        t5((File) bundle.getSerializable("photopath"));
        String string = bundle.getString("collname");
        if (string == null) {
            return false;
        }
        try {
            IXoneCollection GetCollection = D2.GetCollection(string);
            this.x = GetCollection;
            if (i < 0) {
                return false;
            }
            b5(GetCollection.get(i));
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

    @Override
    public void onActivityResult(int i, int i2, Intent intent) {
        String str = "";
        super.onActivityResult(i, i2, intent);
        B4("onActivityResult");
        try {
            if (X7(i, i2, intent)) {
                return;
            }
            if (i == 508) {
                if (i2 == -1) {
                    h9(AbstractC0698k.e(intent), p3());
                    return;
                } else {
                    if (i2 != 0 || E2() == null) {
                        return;
                    }
                    AsyncTask.SERIAL_EXECUTOR.execute(new Runnable() {
                        @Override
                        public final void run() {
                            EditViewHyper.this.w8();
                        }
                    });
                    return;
                }
            }
            if (i == 512) {
                if (i2 != -1 || intent == null) {
                    return;
                }
                e9(intent);
                return;
            }
            if (i == 515) {
                if (i2 == -1) {
                    f9(intent);
                    return;
                } else {
                    this.l0 = null;
                    this.m0 = null;
                    return;
                }
            }
            if (i == 8008) {
                if (i2 == -1) {
                    String t = AbstractC0698k.t(intent, "command", "");
                    if (!TextUtils.isEmpty(t)) {
                        str = t;
                    }
                    if (str.hashCode() == -910970024 && str.equals("delete_from_content_provider")) {
                        Uri uri = (Uri) intent.getParcelableExtra("uri");
                        if (uri != null) {
                            getContentResolver().delete(uri, null, null);
                            return;
                        }
                        return;
                    }
                    Utils.l("XOneAndroidFramework", "Unknown command: " + str);
                    return;
                }
                return;
            }
            if (i == 12666) {
                e7(i2, intent);
                return;
            }
            switch (i) {
                case 503:
                    String p3 = p3();
                    IXoneObject dataObject = getDataObject();
                    if (dataObject != null) {
                        if (!TextUtils.isEmpty(p3)) {
                            n7(dataObject.FieldPropertyValue(p3, "postonchange"));
                            if (!c()) {
                                String x1 = XoneBaseActivity.x1(dataObject, p3, "onchange", null);
                                if (!TextUtils.isEmpty(x1) && x1.toLowerCase().startsWith("refresh")) {
                                    a0(true, null);
                                    break;
                                }
                            } else {
                                Utils.l("XOneAndroidFramework", "EditViewHyper.onActivityResult(): Activity is destroyed");
                                break;
                            }
                        } else {
                            break;
                        }
                    } else {
                        Utils.l("XOneAndroidFramework", "EditViewHyper.onActivityResult(): Data object is null");
                        break;
                    }
                    break;
                case 504:
                    if (i2 != -1) {
                        if (i2 == 0 && E2() != null) {
                            AsyncTask.SERIAL_EXECUTOR.execute(new Runnable() {
                                @Override
                                public final void run() {
                                    EditViewHyper.this.w8();
                                }
                            });
                            break;
                        }
                    } else {
                        j9(AbstractC0698k.e(intent), p3());
                        break;
                    }
                    break;
                case 505:
                    i9();
                    break;
                case 506:
                    q7(i2, intent);
                    break;
            }
        } catch (Exception e) {
            b(e);
        }
    }

    public void onConfigurationChanged(Configuration configuration) {
        super/*androidx.activity.ComponentActivity*/.onConfigurationChanged(configuration);
        B4("onConfigurationChanged");
        try {
            d9(false);
            View findViewById = findViewById(R.id.content);
            ViewTreeObserver viewTreeObserver = findViewById.getViewTreeObserver();
            viewTreeObserver.addOnGlobalLayoutListener(new d(this, configuration, findViewById, viewTreeObserver));
        } catch (Exception e) {
            b(e);
        }
    }

    @Override
    public void onCreate(final Bundle bundle) {
        NfcAdapter defaultAdapter;
        requestWindowFeature(1);
        super.onCreate(bundle);
        B4("onCreate");
        try {
            IXoneCollection I72 = I7(getIntent());
            if (AbstractC0665a.c()) {
                if (I72 == null) {
                    Utils.l("XOneAndroidFramework", "EditView onCreate(), cannot get parent collection while trying to enable/disable hardware acceleration. Enabling by default");
                    AbstractC0665a.d(this);
                    return;
                } else if (t.l(I72.CollPropertyValue("hardware-accelerated"), true)) {
                    AbstractC0665a.d(this);
                }
            }
            if (I72 != null && t.l(I72.CollPropertyValue("disable-nfc"), false) && (defaultAdapter = NfcAdapter.getDefaultAdapter(this)) != null) {
                defaultAdapter.enableReaderMode(this, new NfcAdapter.ReaderCallback() {
                    @Override
                    public final void onTagDiscovered(Tag tag) {
                        Utils.l("XOneAndroidFramework", "Empty onTagDiscovered() invoked");
                    }
                }, 3, null);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        setContentView(AbstractC0565g.f);
        this.R0 = new Configuration();
        this.S0 = new Configuration();
        this.R0.updateFrom(getResources().getConfiguration());
        this.S0.updateFrom(this.R0);
        boolean c2 = AbstractC0698k.c(getIntent(), "fullscreen", false);
        boolean c3 = AbstractC0698k.c(getIntent(), "ignore-safe-area", false);
        if (c2) {
            a4(c3);
        } else if (c3) {
            s2();
        }
        a6(new n8.m() {
            @Override
            public final void a() {
                EditViewHyper.this.g8(bundle);
            }
        }, 0L);
        getOnBackPressedDispatcher().h(new L0(new K0() {
            @Override
            public final void a() {
                EditViewHyper.this.u8();
            }
        }));
    }

    public boolean onCreateOptionsMenu(Menu menu) {
        super/*android.app.Activity*/.onCreateOptionsMenu(menu);
        B4("onCreateOptionsMenu");
        getMenuInflater().inflate(AbstractC0566h.a, menu);
        MenuItem item = menu.getItem(0);
        if (item != null) {
            if (Q7()) {
                item.setIcon(R.drawable.ic_menu_close_clear_cancel);
                item.setVisible(true);
            } else {
                item.setVisible(false);
            }
        }
        if (T7()) {
            menu.add(0, AbstractC0566h.c, 0, AbstractC0568j.f0).setIcon(R.drawable.ic_menu_save);
        }
        if (S2() != null) {
            String w0 = S2().w0("title");
            if (t.h(w0)) {
                w0 = getString(AbstractC0568j.i0);
            }
            menu.add(0, AbstractC0566h.d, 0, w0).setIcon(R.drawable.ic_menu_upload);
        }
        return true;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        B4("onDestroy");
        try {
            Thread thread = this.d1;
            if (thread != null && thread.isAlive()) {
                this.d1.interrupt();
                Thread.sleep(2000L);
            }
            this.e1.removeCallbacksAndMessages(null);
            this.e1 = null;
            if (XoneBaseActivity.C2().g() != null && XoneBaseActivity.C2().g().equals(this)) {
                XoneBaseActivity.C2().K2(null);
            }
            XoneBaseActivity.L4(this.c1);
            E2.c t = E2.c.t();
            Iterator it = this.f1.iterator();
            while (it.hasNext()) {
                t.d((String) it.next());
            }
            this.f1.clear();
            IXoneObject dataObject = getDataObject();
            if (dataObject != null) {
                J6(dataObject.getOwnerCollection().getName());
            }
            XoneBaseActivity.C2().p2(H0());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void onDrawerClosed(View view) {
        IXoneCollection ownerCollection;
        List<Wa.a> eventCallback;
        IXoneObject dataObject = getDataObject();
        if (dataObject == null || (ownerCollection = dataObject.getOwnerCollection()) == null || (eventCallback = ownerCollection.getEventCallback("ondrawerclosed")) == null || !(view instanceof C0159v)) {
            return;
        }
        new EventCallbackTask.b().b(this).e(dataObject).h(this.e1).g(eventCallback).c(new Object[]{new C0789a("e", new EventOnDrawerClosed(dataObject.getOwnerApp(), dataObject, ownerCollection, ((C0159v) view).getDrawerGroupId()))}).a().runSeriallyAsyncTask();
    }

    public void onDrawerOpened(View view) {
        IXoneCollection ownerCollection;
        List<Wa.a> eventCallback;
        IXoneObject dataObject = getDataObject();
        if (dataObject == null || (ownerCollection = dataObject.getOwnerCollection()) == null || (eventCallback = ownerCollection.getEventCallback("ondraweropened")) == null || !(view instanceof C0159v)) {
            return;
        }
        new EventCallbackTask.b().b(this).e(dataObject).h(this.e1).g(eventCallback).c(new Object[]{new C0789a("e", new EventOnDrawerOpened(dataObject.getOwnerApp(), dataObject, ownerCollection, ((C0159v) view).getDrawerGroupId()))}).a().runSeriallyAsyncTask();
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        this.Q0 = menuItem.getItemId();
        return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
    }

    public void onOptionsMenuClosed(Menu menu) {
        super/*android.app.Activity*/.onOptionsMenuClosed(menu);
        IXoneApp D2 = XoneBaseActivity.D2();
        if (D2 == null) {
            return;
        }
        try {
            try {
                int i = this.Q0;
                if (i == AbstractC0564f.W0) {
                    IXoneObject dataObject = getDataObject();
                    if (dataObject == null) {
                        throw new NullPointerException("Error in onOptionsMenuClosed(), data object is null");
                    }
                    if (t.l(dataObject.getOwnerCollection().CollPropertyValue("check-dirty-object"), false)) {
                        Y5();
                        if (getDataObject().getDirty()) {
                            H6();
                            return;
                        }
                    }
                    k(F0());
                } else if (i == AbstractC0566h.c) {
                    if (getDataObject() != null && Y5()) {
                        z0(10);
                        if (S2() != null) {
                            d7(9);
                        } else {
                            d7(33);
                        }
                    }
                } else if (i == AbstractC0566h.d && getDataObject() != null) {
                    try {
                        if (Y5()) {
                            z0(10);
                            if (t.l(S2().w0("manualmode"), false)) {
                                d7(64);
                            } else if (t.l(S2().w0("beforesave"), false)) {
                                d7(65);
                            } else {
                                d7(66);
                            }
                        }
                    } catch (Exception e) {
                        O7(D2, e);
                    }
                }
            } catch (Exception e2) {
                b(e2);
            }
        } finally {
            this.Q0 = -1;
        }
    }

    public void onPageScrollStateChanged(int i) {
        C0834e B0 = B0();
        if (B0 != null) {
            if (i == 1) {
                B0.f();
            } else if (i == 0) {
                B0.e();
            }
        }
    }

    public void onPageScrolled(int i, float f, int i2) {
        f.b(this, i, f, i2);
    }

    public void onPageSelected(int i) {
        try {
            W8(i);
            g7();
        } catch (Exception e) {
            b(e);
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        B4("onPause");
        this.W0 = true;
    }

    public void onRestoreInstanceState(Bundle bundle) {
        B4("onRestoreInstanceState");
        super/*android.app.Activity*/.onRestoreInstanceState(bundle);
    }

    @Override
    public void onResume() {
        super.onResume();
        B4("onResume");
        this.W0 = false;
        XoneBaseActivity.C2().K2(this);
        final Configuration configuration = getResources().getConfiguration();
        G6(configuration);
        a6(new n8.m() {
            @Override
            public final void a() {
                EditViewHyper.this.j8(configuration);
            }
        }, 0L);
    }

    public void onSaveInstanceState(Bundle bundle) {
        B4("onSaveInstanceState");
        if (x3() != null) {
            bundle.putString("group", (String) x3().getTag());
        } else {
            String str = this.R;
            if (str != null) {
                bundle.putString("group", str);
            }
        }
        IXoneObject dataObject = getDataObject();
        if (dataObject != null) {
            bundle.putInt("index", dataObject.getOwnerCollection().ObjectIndex(dataObject));
            bundle.putString("collname", dataObject.getOwnerCollection().getName());
        }
        String p3 = p3();
        if (p3 != null) {
            bundle.putString("propselected", p3);
        }
        if (n3() != null) {
            bundle.putSerializable("photopath", n3());
        }
        bundle.putInt("scrollX", this.P);
        bundle.putInt("scrollY", this.Q);
        super/*androidx.activity.ComponentActivity*/.onSaveInstanceState(bundle);
    }

    @Override
    public void onStart() {
        super.onStart();
        B4("onStart");
        if (this.X) {
            O8();
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        B4("onStop");
        try {
            d9(false);
        } catch (Exception e) {
            b(e);
        }
    }

    public void onUserInteraction() {
        super/*android.app.Activity*/.onUserInteraction();
        if (xoneApp.Z0().p1()) {
            xoneApp.Z0().L2(Calendar.getInstance());
        }
    }

    public void onUserLeaveHint() {
        super/*android.app.Activity*/.onUserLeaveHint();
        B4("onUserLeaveHint");
    }

    public void p7() {
        this.J0.clear();
        this.G0.clear();
        R8();
        new m(this).c();
    }

    public void p8(com.xone.android.framework.views.a aVar, int i) {
        aVar.setCurrentItem(i);
        y1.a adapter = aVar.getAdapter();
        if (adapter == null) {
            throw new NullPointerException("Cannot obtain PagerAdapter");
        }
        ((EditFramePage) adapter.p(aVar, i)).A0();
    }

    @Override
    public void q(InterfaceC1018c0 interfaceC1018c0) {
        if (this.D0 == null) {
            this.D0 = new HashMap();
        }
        this.D0.put(Integer.valueOf(interfaceC1018c0.getRequestCode()), interfaceC1018c0);
    }

    @Override
    public void q0(int i, CharSequence charSequence, CharSequence charSequence2) {
        if (!AbstractC0515a.c(i)) {
            G5(i, charSequence, charSequence2);
            return;
        }
        if (i == -666) {
            a0(true, null);
            return;
        }
        if (TextUtils.isEmpty(charSequence2)) {
            G5(i, charSequence, "NO DESCRIPTION");
            return;
        }
        String charSequence3 = charSequence2.toString();
        if (charSequence3.contains("##EXIT##") || charSequence3.contains("##END##")) {
            K6();
            k(F0());
            return;
        }
        if (charSequence3.contains("##EXITAPP##")) {
            K6();
            if (charSequence3.contains("##STARTREPLICA##")) {
                z();
            }
            XoneBaseActivity.C2().A(true);
            k(14);
            return;
        }
        if (!charSequence3.contains("##LOGIN_START##")) {
            G5(i, charSequence, charSequence2);
            return;
        }
        K6();
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            throw new NullPointerException("Error in HandleErrors(), dataObject == null");
        }
        fb.o.b(dataObject, charSequence3, this);
    }

    @Override
    public void q1(IXoneObject iXoneObject, String str, String str2) {
        String str3;
        if (TextUtils.isEmpty(str)) {
            return;
        }
        if ("frame".equals(str2)) {
            str3 = "##FRAME##" + str;
        } else {
            str3 = str;
        }
        String b3 = "frame".equals(str2) ? b3(iXoneObject, str) : iXoneObject.FieldPropertyValue(str3, "group");
        if (TextUtils.isEmpty(b3) || r3().o().indexOf(b3) < 0) {
            return;
        }
        M7(b3, str);
    }

    public final void q7(int i, Intent intent) {
        IXoneApp D2 = XoneBaseActivity.D2();
        if (D2 == null || i != -1 || intent == null) {
            return;
        }
        KeyEvent.Callback u3 = u3();
        if (u3 instanceof InterfaceC1056w) {
            ((InterfaceC1056w) u3).K(intent);
            return;
        }
        String stringExtra = intent.getStringExtra(DatabaseFilesHelper.ID_COLUMN);
        String p3 = p3();
        if (TextUtils.isEmpty(stringExtra) || TextUtils.isEmpty(p3)) {
            return;
        }
        IXoneObject dataObject = getDataObject();
        if (dataObject == null) {
            throw new NullPointerException("Error in doResultMapColl(), data object is null");
        }
        String FieldPropertyValue = dataObject.FieldPropertyValue(p3, "linkedfield");
        String FieldPropertyValue2 = dataObject.FieldPropertyValue(p3, "linkedto");
        if (t.h(FieldPropertyValue) || t.h(FieldPropertyValue2)) {
            return;
        }
        if (t.l(D2.GetCollection(dataObject.FieldPropertyValue(FieldPropertyValue2, "mapcol")).CollPropertyValue("stringkey"), false)) {
            H1(dataObject, FieldPropertyValue2, new Object[]{stringExtra});
        } else {
            H1(dataObject, FieldPropertyValue2, new Object[]{Integer.valueOf(stringExtra)});
        }
    }

    public final void q8() {
        HorizontalScrollView B7 = B7();
        if (B7 == null) {
            return;
        }
        ViewParent parent = B7.getParent();
        if (parent instanceof ViewGroup) {
            ViewGroup viewGroup = (ViewGroup) parent;
            int indexOfChild = viewGroup.indexOfChild(B7);
            int childCount = viewGroup.getChildCount();
            if (indexOfChild >= 0 && childCount > 0 && indexOfChild != childCount - 1) {
                viewGroup.removeView(B7);
                viewGroup.addView(B7);
            }
        }
    }

    public void r7(String str, String str2) {
        if (M3() && !TextUtils.isEmpty(str)) {
            String C7 = C7(str);
            String C72 = C7(str2);
            this.x.setVariables("drag_object", C7);
            this.x.setVariables("drop_object", C72);
            IXoneObject dataObject = getDataObject();
            if (dataObject == null) {
                throw new NullPointerException("Error in executeDragNode(), data object is null");
            }
            RunnableC1097a.h(this, dataObject, this.e1, "ondrop", 0, false, new Object[]{C7, C72}, null).start();
        }
    }

    public final void r8() {
        IXoneCollection dataCollection = getDataCollection();
        if (dataCollection == null) {
            return;
        }
        List<String> o = r3().o();
        this.H0.clear();
        for (String str : o) {
            if (!TextUtils.isEmpty(dataCollection.GroupPropertyValue(str, "drawer-orientation"))) {
                this.H0.add(str);
            }
        }
    }

    @Override
    @ScriptAllowed
    public int relayout() {
        if (Utils.s3()) {
            p7();
            return 0;
        }
        runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                EditViewHyper.this.p7();
            }
        });
        return 0;
    }

    public CoordinatorLayout s7() {
        ViewPager t2 = t2(AbstractC0564f.N1);
        return t2.getChildAt(t2.getCurrentItem());
    }

    public final void s8() {
        IXoneCollection dataCollection = getDataCollection();
        if (dataCollection == null) {
            return;
        }
        String CollPropertyValue = dataCollection.CollPropertyValue("fixed-group");
        this.G0.clear();
        W7(null);
        if (!t.h(CollPropertyValue) && G3().l().j(CollPropertyValue) != null) {
            this.G0.add(CollPropertyValue);
            return;
        }
        for (String str : r3().o()) {
            if (t.l(dataCollection.GroupPropertyValue(str, "fixed"), false)) {
                this.G0.add(str);
            }
        }
    }

    @ScriptAllowed
    public PopupObject showPopup(Object... objArr) {
        int i;
        Utils.g("ShowPopup", objArr, 1);
        C0932x0 c0932x0 = (C0932x0) objArr[0];
        String E = k.E(c0932x0, "anchorName", "");
        String E2 = k.E(c0932x0, "gravity", "right");
        if (TextUtils.isEmpty(E)) {
            throw new IllegalArgumentException("ShowPopup(): Empty property name argument");
        }
        C0893d0 u = k.u(c0932x0, "data", null);
        final IXoneObject i2 = k.i(c0932x0, "dataObject");
        int g = k.g(c0932x0, "backgroundColor", 0);
        if ((u == null || u.isEmpty()) && i2 == null) {
            throw new IllegalArgumentException("ShowPopup(): Empty data argument");
        }
        final Object z = k.z(c0932x0, "onItemClicked", null);
        if (z == null && i2 == null) {
            throw new IllegalArgumentException("ShowPopup(): Empty onItemClicked callback argument");
        }
        final View j = j(E);
        if (j == null) {
            throw new IllegalArgumentException("ShowPopup(): Anchor view " + E + " not found");
        }
        E2.getClass();
        if (E2.equals("left")) {
            i = 48;
        } else {
            E2.equals("right");
            i = 5;
        }
        Context context = j.getContext();
        if (i2 != null) {
            EditFramePage editFramePage = (EditFramePage) fa.j.o(new Callable() {
                @Override
                public final Object call() {
                    EditFramePage l82;
                    l82 = EditViewHyper.this.l8(i2);
                    return l82;
                }
            });
            final PopupWindow popupWindow = new PopupWindow(context);
            popupWindow.setBackgroundDrawable(new ColorDrawable(g));
            popupWindow.setFocusable(true);
            popupWindow.setAnimationStyle(-1);
            popupWindow.setContentView(editFramePage);
            fa.j.m(new Runnable() {
                @Override
                public final void run() {
                    popupWindow.showAsDropDown(j, 0, 0, 17);
                }
            });
            R1(i2, popupWindow);
            return new PopupObject(popupWindow, j);
        }
        P p = new P(context, j);
        p.c(i);
        Menu b2 = p.b();
        int size = u.size();
        for (int i3 = 0; i3 < size; i3++) {
            C0932x0 c0932x02 = (C0932x0) u.get(i3);
            if (c0932x02 == null) {
                throw new IllegalArgumentException("ShowPopup(): Empty data item in data argument");
            }
            b2.add(0, k.o(c0932x02, XoneNFCRuntime.TAG_ID_FIELD, 0), 0, k.E(c0932x02, "title", ""));
        }
        p.d(new P.c() {
            public final boolean onMenuItemClick(MenuItem menuItem) {
                boolean m82;
                m82 = EditViewHyper.this.m8(z, menuItem);
                return m82;
            }
        });
        fa.j.m(new b8.M(p));
        return new PopupObject(p);
    }

    public final void t7(ViewGroup.MarginLayoutParams marginLayoutParams, String str, boolean z, int i, int i2) {
        str.getClass();
        switch (str) {
            case "bottom":
                if (z) {
                    i2 = 0;
                }
                marginLayoutParams.bottomMargin = i2;
                break;
            case "top":
                if (z) {
                    i2 = 0;
                }
                marginLayoutParams.topMargin = i2;
                break;
            case "left":
                if (z) {
                    i = 0;
                }
                marginLayoutParams.leftMargin = i;
                break;
            case "right":
                if (z) {
                    i = 0;
                }
                marginLayoutParams.rightMargin = i;
                break;
        }
    }

    public final void t8() {
        IXoneCollection dataCollection = getDataCollection();
        if (dataCollection == null) {
            return;
        }
        List<String> o = r3().o();
        this.I0.clear();
        for (String str : o) {
            String GroupPropertyValue = dataCollection.GroupPropertyValue(str, "floating");
            if (!TextUtils.isEmpty(GroupPropertyValue) && q.g(GroupPropertyValue, false)) {
                this.I0.add(str);
            }
        }
    }

    @Override
    @ScriptAllowed
    public String toString() {
        StringBuilder sb2 = new StringBuilder();
        sb2.append("XOne edit window object.");
        IXoneObject dataObject = getDataObject();
        if (dataObject != null) {
            sb2.append("\nData object: ");
            sb2.append(dataObject);
        }
        IXoneCollection dataCollection = getDataCollection();
        if (dataCollection != null) {
            sb2.append("\nData collection: ");
            sb2.append(dataCollection);
        }
        return sb2.toString();
    }

    public final void u8() {
        WebView webView;
        B4("onBackEvent");
        if (this.S) {
            return;
        }
        com.xone.android.framework.views.a D7 = D7();
        if (D7 != null && (webView = D7.getWebView()) != null && webView.canGoBack()) {
            D7.N0();
            return;
        }
        if (XoneBaseActivity.D2() == null || k7()) {
            return;
        }
        if (U7()) {
            openOptionsMenu();
            return;
        }
        if (R7()) {
            return;
        }
        if (!this.X) {
            k(-255);
            return;
        }
        mainEntry S = XoneBaseActivity.C2().S();
        if (S != null) {
            S.openOptionsMenu();
        }
    }

    public void v(TabLayout.g gVar) {
    }

    public final EditFramePage l8(IXoneObject iXoneObject) {
        if (iXoneObject == null) {
            throw new IllegalArgumentException("Data object cannot be null");
        }
        IXoneCollection ownerCollection = iXoneObject.getOwnerCollection();
        EditFramePage editFramePage = new EditFramePage(this);
        va.d viewLayout = ownerCollection.getViewLayout();
        if (viewLayout == null) {
            throw new IllegalStateException("Cannot obtain view layout for content " + ownerCollection.getName());
        }
        va.d d2 = viewLayout.d(1);
        List o = d2.l().o();
        if (o.isEmpty()) {
            throw new IllegalArgumentException("Error, content " + ownerCollection.getName() + " does not have visible properties");
        }
        C1066a f = va.d.f(d2.l().j((String) o.get(0)));
        try {
            editFramePage.d0(f, new D8.c(this, iXoneObject), iXoneObject, f.v(), -2, -2, getMaxScreenWidth(), getMaxScreenHeight(), 1, 100, 100);
            editFramePage.M();
            return editFramePage;
        } catch (Exception e) {
            throw AbstractC0751f.e(e);
        }
    }

    public final void v8(Exception exc) {
        if (exc != null) {
            exc.printStackTrace();
        } else {
            if (c()) {
                return;
            }
            this.J = true;
            new m(this).c();
        }
    }

    @Override
    public boolean w() {
        return this.E0;
    }

    public FrameLayout w7() {
        DrawerLayout t2 = t2(AbstractC0564f.v0);
        View view = (ViewPager) t2.findViewById(AbstractC0564f.N1);
        FrameLayout frameLayout = (FrameLayout) t2.findViewById(AbstractC0564f.n0);
        if (frameLayout != null) {
            return frameLayout;
        }
        FrameLayout frameLayout2 = new FrameLayout(this);
        frameLayout2.setId(AbstractC0564f.n0);
        t2.removeView(view);
        frameLayout2.addView(view, -1, -1);
        t2.addView(frameLayout2);
        return frameLayout2;
    }

    public final void w8() {
        try {
            Object E2 = E2();
            if (E2 == null) {
                return;
            }
            R3(E2, G2(), new Object[0]);
        } catch (Exception e) {
            b(e);
        }
    }

    @Override
    public boolean x() {
        return this instanceof EditViewHyperPortrait;
    }

    public final String x7(int i) {
        C1066a r3 = r3();
        int i2 = 0;
        for (int i3 = 0; i3 < this.U0.size(); i3++) {
            try {
                C1066a j = r3.j((String) this.U0.get(i3));
                if (!j.v()) {
                    if (i == i2) {
                        return j.q().f();
                    }
                    i2++;
                }
            } catch (InterruptedException e) {
                throw AbstractC0751f.e(e);
            }
        }
        return "";
    }

    public final void n8(Object obj, IXoneObject iXoneObject, File file) {
        try {
            R3(obj, iXoneObject, file.getName());
        } catch (Exception e) {
            b(e);
        }
    }

    public final ViewPager y7() {
        if (this.c1 == null) {
            this.c1 = t2(AbstractC0564f.N1);
        }
        return this.c1;
    }

    public void y8(DialogInterface dialogInterface, int i) {
        if (c()) {
            return;
        }
        finish();
    }

    @Override
    public void z() {
        Utils.k4(getApplicationContext(), "EditViewHyper", null, null);
    }

    public final int z7(String str) {
        C1066a r3 = r3();
        if (this.U0 == null) {
            return -1;
        }
        int i = 0;
        for (int i2 = 0; i2 < this.U0.size(); i2++) {
            C1066a j = r3.j((String) this.U0.get(i2));
            if (!j.v()) {
                if (str.equals(j.q().f())) {
                    return i;
                }
                i++;
            }
        }
        return -1;
    }

    public void z8(Configuration configuration) {
        this.S0.updateFrom(configuration);
        if (!f() || u()) {
            I6(configuration);
        }
    }
}