package com.seewo.ota.activity;

import android.app.Activity;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import com.seewo.libvui.h.e;
import com.seewo.ota.R;
import com.seewo.ota.update.device.ui.DeviceUpdateDialog;
import com.seewo.ota.view.LoadingDialog;
import java.util.List;

/* JADX INFO: compiled from: DialogTestActivity.kt */
/* JADX INFO: loaded from: classes.dex */
@f.i
public final class DialogTestActivity extends Activity {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public RecyclerView f1917b;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private final List<f2> f1918f;

    /* JADX INFO: compiled from: DialogTestActivity.kt */
    public final class a extends RecyclerView.d0 {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public a(DialogTestActivity dialogTestActivity, View view) {
            super(view);
            f.z.d.k.e(view, "itemView");
        }
    }

    /* JADX INFO: compiled from: DialogTestActivity.kt */
    public static final class b extends RecyclerView.h<a> {
        b() {
        }

        @Override // androidx.recyclerview.widget.RecyclerView.h
        /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
        public void onBindViewHolder(a aVar, int i2) {
            f.z.d.k.e(aVar, "holder");
            f2 f2Var = DialogTestActivity.this.b().get(i2);
            aVar.itemView.setOnClickListener(f2Var.a());
            View view = aVar.itemView;
            f.z.d.k.d(view, "holder.itemView");
            if (view instanceof Button) {
                ((Button) view).setText(f2Var.b());
            }
        }

        @Override // androidx.recyclerview.widget.RecyclerView.h
        /* JADX INFO: renamed from: b, reason: merged with bridge method [inline-methods] */
        public a onCreateViewHolder(ViewGroup viewGroup, int i2) {
            f.z.d.k.e(viewGroup, "p0");
            return new a(DialogTestActivity.this, new Button(viewGroup.getContext()));
        }

        @Override // androidx.recyclerview.widget.RecyclerView.h
        public int getItemCount() {
            return DialogTestActivity.this.b().size();
        }
    }

    public DialogTestActivity() {
        String simpleName = LoadingDialog.class.getSimpleName();
        f.z.d.k.d(simpleName, "LoadingDialog::class.java.simpleName");
        String simpleName2 = com.seewo.ota.view.i.class.getSimpleName();
        f.z.d.k.d(simpleName2, "UpdateWaitingDialog::class.java.simpleName");
        String simpleName3 = DeviceUpdateDialog.class.getSimpleName();
        f.z.d.k.d(simpleName3, "DeviceUpdateDialog::class.java.simpleName");
        this.f1918f = f.u.k.f(new f2("UpdateConfirmDialog", new View.OnClickListener() { // from class: com.seewo.ota.activity.o
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                DialogTestActivity.l(this.f2082b, view);
            }
        }), new f2(simpleName, new View.OnClickListener() { // from class: com.seewo.ota.activity.t
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                DialogTestActivity.n(this.f2092b, view);
            }
        }), new f2(simpleName2, new View.OnClickListener() { // from class: com.seewo.ota.activity.q
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                DialogTestActivity.o(this.f2086b, view);
            }
        }), new f2(simpleName3, new View.OnClickListener() { // from class: com.seewo.ota.activity.l
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                DialogTestActivity.p(this.f2047b, view);
            }
        }), new f2("update tips dialog", new View.OnClickListener() { // from class: com.seewo.ota.activity.m
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                DialogTestActivity.q(this.f2052b, view);
            }
        }), new f2("scheduler ota dialog", new View.OnClickListener() { // from class: com.seewo.ota.activity.r
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                DialogTestActivity.t(this.f2089b, view);
            }
        }));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void l(DialogTestActivity dialogTestActivity, View view) {
        f.z.d.k.e(dialogTestActivity, "this$0");
        com.seewo.ota.update.device.ui.s sVar = new com.seewo.ota.update.device.ui.s(dialogTestActivity);
        sVar.n(R.string.update_confirm_dialog_title);
        sVar.k(R.string.update_confirm_dialog_message);
        sVar.m(new DialogInterface.OnClickListener() { // from class: com.seewo.ota.activity.n
            @Override // android.content.DialogInterface.OnClickListener
            public final void onClick(DialogInterface dialogInterface, int i2) {
                DialogTestActivity.m(dialogInterface, i2);
            }
        });
        sVar.show();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void m(DialogInterface dialogInterface, int i2) {
        if (i2 == -1) {
            Log.i("DeviceUpdateManager", "confirm update device");
        } else {
            Log.i("DeviceUpdateManager", "cancel update device");
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void n(DialogTestActivity dialogTestActivity, View view) {
        f.z.d.k.e(dialogTestActivity, "this$0");
        LoadingDialog loadingDialog = new LoadingDialog(dialogTestActivity);
        loadingDialog.f(10);
        loadingDialog.show();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void o(DialogTestActivity dialogTestActivity, View view) {
        f.z.d.k.e(dialogTestActivity, "this$0");
        new com.seewo.ota.view.i(dialogTestActivity).show();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void p(DialogTestActivity dialogTestActivity, View view) {
        f.z.d.k.e(dialogTestActivity, "this$0");
        new DeviceUpdateDialog(dialogTestActivity).show();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void q(DialogTestActivity dialogTestActivity, View view) {
        f.z.d.k.e(dialogTestActivity, "this$0");
        e.a aVar = new e.a(dialogTestActivity);
        aVar.z("system update");
        aVar.o("system update is available, do you want to update now?");
        aVar.p(R.string.btn_cancel, new DialogInterface.OnClickListener() { // from class: com.seewo.ota.activity.s
            @Override // android.content.DialogInterface.OnClickListener
            public final void onClick(DialogInterface dialogInterface, int i2) {
                DialogTestActivity.r(dialogInterface, i2);
            }
        });
        aVar.w(R.string.btn_ok, new DialogInterface.OnClickListener() { // from class: com.seewo.ota.activity.p
            @Override // android.content.DialogInterface.OnClickListener
            public final void onClick(DialogInterface dialogInterface, int i2) {
                DialogTestActivity.s(dialogInterface, i2);
            }
        });
        aVar.a().show();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void r(DialogInterface dialogInterface, int i2) {
        dialogInterface.dismiss();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void s(DialogInterface dialogInterface, int i2) {
        dialogInterface.dismiss();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void t(DialogTestActivity dialogTestActivity, View view) {
        f.z.d.k.e(dialogTestActivity, "this$0");
        SchedulerOTADialog schedulerOTADialog = new SchedulerOTADialog(dialogTestActivity);
        schedulerOTADialog.show();
        schedulerOTADialog.y();
    }

    public final RecyclerView a() {
        RecyclerView recyclerView = this.f1917b;
        if (recyclerView != null) {
            return recyclerView;
        }
        f.z.d.k.p("content");
        throw null;
    }

    public final List<f2> b() {
        return this.f1918f;
    }

    @Override // android.app.Activity
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_dialog_test);
        View viewFindViewById = findViewById(R.id.content);
        f.z.d.k.d(viewFindViewById, "findViewById(R.id.content)");
        u((RecyclerView) viewFindViewById);
        a().setLayoutManager(new StaggeredGridLayoutManager(6, 1));
        a().setAdapter(new b());
    }

    public final void u(RecyclerView recyclerView) {
        f.z.d.k.e(recyclerView, "<set-?>");
        this.f1917b = recyclerView;
    }
}
