导航菜单

页面标题

页面副标题

Uptodown App Store v6.80 - UserDevicesActivity.java 源代码

正在查看: Uptodown App Store v6.80 应用的 UserDevicesActivity.java JAVA 源代码文件

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


package com.uptodown.activities;

import N1.k;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import c2.V0;
import com.uptodown.UptodownApp;
import com.uptodown.activities.UserDevicesActivity;
import com.uptodown.activities.a0;
import kotlin.jvm.internal.AbstractC1009g;
import u2.H;

public final class UserDevicesActivity extends AbstractC0740a {
    public static final a M = new a(null);
    private final R2.g J = R2.h.a(new d3.a() {
        @Override
        public final Object invoke() {
            c2.V0 h32;
            h32 = UserDevicesActivity.h3(UserDevicesActivity.this);
            return h32;
        }
    });
    private final R2.g K = new ViewModelLazy(kotlin.jvm.internal.D.b(a0.class), new d(this), new c(this), new e(null, this));
    private final ActivityResultLauncher L;

    public static final class a {
        public a(AbstractC1009g abstractC1009g) {
            this();
        }

        private a() {
        }
    }

    static final class b extends kotlin.coroutines.jvm.internal.l implements d3.p {
        int a;

        static final class a implements r3.f {
            final UserDevicesActivity a;

            public static final class C0186a implements f2.K {
                final UserDevicesActivity a;
                final u2.H b;

                C0186a(UserDevicesActivity userDevicesActivity, u2.H h) {
                    this.a = userDevicesActivity;
                    this.b = h;
                }

                @Override
                public void a(int i) {
                    UserDevicesActivity userDevicesActivity = this.a;
                    Object obj = ((a0.a) ((H.c) this.b).a()).b().get(i);
                    kotlin.jvm.internal.m.d(obj, "get(...)");
                    userDevicesActivity.m3((g2.T) obj);
                }
            }

            a(UserDevicesActivity userDevicesActivity) {
                this.a = userDevicesActivity;
            }

            public final Object emit(u2.H h, V2.d dVar) {
                if (kotlin.jvm.internal.m.a(h, H.a.a)) {
                    this.a.i3().b.setVisibility(0);
                    this.a.i3().c.setVisibility(8);
                } else if (h instanceof H.c) {
                    H.c cVar = (H.c) h;
                    this.a.n3(((a0.a) cVar.a()).a());
                    if (((a0.a) cVar.a()).b().isEmpty()) {
                        this.a.i3().f.setVisibility(8);
                    } else {
                        this.a.i3().d.setAdapter(new M1.P(((a0.a) cVar.a()).b(), new C0186a(this.a, h)));
                    }
                    this.a.i3().b.setVisibility(8);
                    this.a.i3().c.setVisibility(0);
                } else if (!kotlin.jvm.internal.m.a(h, H.b.a)) {
                    throw new R2.k();
                }
                return R2.s.a;
            }
        }

        b(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return UserDevicesActivity.this.new b(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c = W2.b.c();
            int i = this.a;
            if (i == 0) {
                R2.n.b(obj);
                r3.I c4 = UserDevicesActivity.this.j3().c();
                a aVar = new a(UserDevicesActivity.this);
                this.a = 1;
                if (c4.collect(aVar, this) == c) {
                    return c;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object invoke(o3.J j, V2.d dVar) {
            return ((b) create(j, dVar)).invokeSuspend(R2.s.a);
        }
    }

    public static final class c extends kotlin.jvm.internal.n implements d3.a {
        final ComponentActivity a;

        public c(ComponentActivity componentActivity) {
            super(0);
            this.a = componentActivity;
        }

        @Override
        public final ViewModelProvider.Factory invoke() {
            return this.a.getDefaultViewModelProviderFactory();
        }
    }

    public static final class d extends kotlin.jvm.internal.n implements d3.a {
        final ComponentActivity a;

        public d(ComponentActivity componentActivity) {
            super(0);
            this.a = componentActivity;
        }

        @Override
        public final ViewModelStore invoke() {
            return this.a.getViewModelStore();
        }
    }

    public static final class e extends kotlin.jvm.internal.n implements d3.a {
        final d3.a a;
        final ComponentActivity b;

        public e(d3.a aVar, ComponentActivity componentActivity) {
            super(0);
            this.a = aVar;
            this.b = componentActivity;
        }

        @Override
        public final CreationExtras invoke() {
            CreationExtras creationExtras;
            d3.a aVar = this.a;
            return (aVar == null || (creationExtras = (CreationExtras) aVar.invoke()) == null) ? this.b.getDefaultViewModelCreationExtras() : creationExtras;
        }
    }

    public UserDevicesActivity() {
        ActivityResultLauncher registerForActivityResult = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            public final void onActivityResult(Object obj) {
                UserDevicesActivity.p3(UserDevicesActivity.this, (ActivityResult) obj);
            }
        });
        kotlin.jvm.internal.m.d(registerForActivityResult, "registerForActivityResult(...)");
        this.L = registerForActivityResult;
    }

    public static final V0 h3(UserDevicesActivity userDevicesActivity) {
        return V0.c(userDevicesActivity.getLayoutInflater());
    }

    private final void k3() {
        Drawable drawable = ContextCompat.getDrawable(this, N1.e.c);
        if (drawable != null) {
            i3().e.setNavigationIcon(drawable);
            i3().e.setNavigationContentDescription(getString(2131951721));
        }
        i3().e.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                UserDevicesActivity.l3(UserDevicesActivity.this, view);
            }
        });
        TextView textView = i3().h;
        k.a aVar = N1.k.g;
        textView.setTypeface(aVar.w());
        i3().g.setTypeface(aVar.x());
        i3().f.setTypeface(aVar.x());
        i3().d.setLayoutManager(new LinearLayoutManager(this, 1, false));
        i3().d.setItemAnimator(new DefaultItemAnimator());
        int dimension = (int) getResources().getDimension(2131166020);
        i3().d.addItemDecoration(new w2.l(dimension, dimension));
    }

    public static final void l3(UserDevicesActivity userDevicesActivity, View view) {
        userDevicesActivity.getOnBackPressedDispatcher().onBackPressed();
    }

    public final void m3(g2.T t) {
        Intent intent = new Intent((Context) this, (Class<?>) UserDeviceDetailsActivity.class);
        intent.putExtra("user_device", t);
        this.L.launch(intent, UptodownApp.F.b(this));
    }

    public final void n3(final g2.T t) {
        TextView textView = i3().i.f;
        k.a aVar = N1.k.g;
        textView.setTypeface(aVar.w());
        i3().i.e.setTypeface(aVar.x());
        i3().i.f.setText(t.g());
        i3().i.e.setText(new u2.p().m(t.e()));
        i3().i.getRoot().setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                UserDevicesActivity.o3(UserDevicesActivity.this, t, view);
            }
        });
    }

    public static final void o3(UserDevicesActivity userDevicesActivity, g2.T t, View view) {
        userDevicesActivity.m3(t);
    }

    public static final void p3(UserDevicesActivity userDevicesActivity, ActivityResult activityResult) {
        int resultCode = activityResult.getResultCode();
        if (resultCode == 3 || resultCode == 4) {
            userDevicesActivity.j3().b(userDevicesActivity);
        } else {
            if (resultCode != 5) {
                return;
            }
            userDevicesActivity.setResult(5);
            userDevicesActivity.getOnBackPressedDispatcher().onBackPressed();
        }
    }

    public final V0 i3() {
        return (V0) this.J.getValue();
    }

    public final a0 j3() {
        return (a0) this.K.getValue();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(i3().getRoot());
        k3();
        o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), (o3.L) null, new b(null), 2, (Object) null);
        j3().b(this);
    }
}