导航菜单

页面标题

页面副标题

Rilo v2.0.21 - ReferralDetailActivity.java 源代码

正在查看: Rilo v2.0.21 应用的 ReferralDetailActivity.java JAVA 源代码文件

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


package app.callpe.ui.misc;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import androidx.activity.ComponentActivity;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import app.callpe.common.utils.Helper;
import app.callpe.data.model.User;
import app.callpe.databinding.ActivityReferralDetailBinding;
import app.callpe.ui.home.AccountViewModel;
import dagger.hilt.android.AndroidEntryPoint;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Job;
import timber.log.Timber;

@Metadata(d1 = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0007\u0018\u0000 \u00152\u00020\u0001:\u0001\u0015B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u000b\u001a\u00020\fH\u0002J\b\u0010\r\u001a\u00020\u000eH\u0002J\u0012\u0010\u000f\u001a\u00020\u000e2\b\u0010\u0010\u001a\u0004\u0018\u00010\u0011H\u0014J\u0010\u0010\u0012\u001a\u00020\u000e2\u0006\u0010\u0013\u001a\u00020\u0014H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082.¢\u0006\u0002\n\u0000R\u001b\u0010\u0005\u001a\u00020\u00068BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\t\u0010\n\u001a\u0004\b\u0007\u0010\b¨\u0006\u0016"}, d2 = {"Lapp/callpe/ui/misc/ReferralDetailActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "()V", "binding", "Lapp/callpe/databinding/ActivityReferralDetailBinding;", "viewModel", "Lapp/callpe/ui/home/AccountViewModel;", "getViewModel", "()Lapp/callpe/ui/home/AccountViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "observeEvent", "Lkotlinx/coroutines/Job;", "onClick", "", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "setReferralCode", "user", "Lapp/callpe/data/model/User;", "Companion", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class ReferralDetailActivity extends Hilt_ReferralDetailActivity {

    public static final Companion INSTANCE = new Companion(null);
    private ActivityReferralDetailBinding binding;

    private final Lazy viewModel;

    public static final void onClick$lambda$3(View view) {
    }

    public ReferralDetailActivity() {
        final ComponentActivity componentActivity = (ComponentActivity) this;
        final Function0 function0 = null;
        this.viewModel = new ViewModelLazy(Reflection.getOrCreateKotlinClass(AccountViewModel.class), new Function0<ViewModelStore>() {
            {
                super(0);
            }

            public final ViewModelStore m1953invoke() {
                return componentActivity.getViewModelStore();
            }
        }, new Function0<ViewModelProvider.Factory>() {
            {
                super(0);
            }

            public final ViewModelProvider.Factory m1952invoke() {
                return componentActivity.getDefaultViewModelProviderFactory();
            }
        }, new Function0<CreationExtras>() {
            {
                super(0);
            }

            public final CreationExtras m1954invoke() {
                CreationExtras creationExtras;
                Function0 function02 = function0;
                return (function02 == null || (creationExtras = (CreationExtras) function02.invoke()) == null) ? componentActivity.getDefaultViewModelCreationExtras() : creationExtras;
            }
        });
    }

    public final AccountViewModel getViewModel() {
        return (AccountViewModel) this.viewModel.getValue();
    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityReferralDetailBinding inflate = ActivityReferralDetailBinding.inflate(getLayoutInflater());
        Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
        this.binding = inflate;
        if (inflate == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            inflate = null;
        }
        setContentView((View) inflate.getRoot());
        AccountViewModel.getUserDetails$default(getViewModel(), false, false, 3, null);
        observeEvent();
        onClick();
    }

    private final Job observeEvent() {
        return BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new ReferralDetailActivity$observeEvent$1(this, null), 3, (Object) null);
    }

    public final void setReferralCode(User user) {
        String referralCode = user.getReferralCode();
        if (referralCode != null) {
            ActivityReferralDetailBinding activityReferralDetailBinding = this.binding;
            if (activityReferralDetailBinding == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityReferralDetailBinding = null;
            }
            activityReferralDetailBinding.inviteCode.setText(referralCode);
        }
    }

    private final void onClick() {
        final String string = getString(2131951678);
        Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.app_url)");
        ActivityReferralDetailBinding activityReferralDetailBinding = this.binding;
        ActivityReferralDetailBinding activityReferralDetailBinding2 = null;
        if (activityReferralDetailBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityReferralDetailBinding = null;
        }
        activityReferralDetailBinding.copyRefferalCode.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ReferralDetailActivity.onClick$lambda$1(ReferralDetailActivity.this, view);
            }
        });
        ActivityReferralDetailBinding activityReferralDetailBinding3 = this.binding;
        if (activityReferralDetailBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityReferralDetailBinding3 = null;
        }
        activityReferralDetailBinding3.copyAppLink.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ReferralDetailActivity.onClick$lambda$2(ReferralDetailActivity.this, string, view);
            }
        });
        ActivityReferralDetailBinding activityReferralDetailBinding4 = this.binding;
        if (activityReferralDetailBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityReferralDetailBinding4 = null;
        }
        activityReferralDetailBinding4.shareOnWhatsApp.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ReferralDetailActivity.onClick$lambda$3(view);
            }
        });
        ActivityReferralDetailBinding activityReferralDetailBinding5 = this.binding;
        if (activityReferralDetailBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityReferralDetailBinding2 = activityReferralDetailBinding5;
        }
        activityReferralDetailBinding2.backBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ReferralDetailActivity.onClick$lambda$4(ReferralDetailActivity.this, view);
            }
        });
    }

    public static final void onClick$lambda$1(ReferralDetailActivity referralDetailActivity, View view) {
        Intrinsics.checkNotNullParameter(referralDetailActivity, "this$0");
        Context context = (Context) referralDetailActivity;
        ActivityReferralDetailBinding activityReferralDetailBinding = referralDetailActivity.binding;
        if (activityReferralDetailBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityReferralDetailBinding = null;
        }
        String obj = activityReferralDetailBinding.inviteCode.getText().toString();
        if (obj == null) {
            obj = "";
        }
        Helper.copyToClipboard(context, obj);
    }

    public static final void onClick$lambda$2(ReferralDetailActivity referralDetailActivity, String str, View view) {
        Intrinsics.checkNotNullParameter(referralDetailActivity, "this$0");
        Intrinsics.checkNotNullParameter(str, "$appLink");
        Helper.copyToClipboard((Context) referralDetailActivity, str);
    }

    public static final void onClick$lambda$4(ReferralDetailActivity referralDetailActivity, View view) {
        Intrinsics.checkNotNullParameter(referralDetailActivity, "this$0");
        referralDetailActivity.finish();
    }

    @Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0016\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bJ\u0016\u0010\t\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b¨\u0006\n"}, d2 = {"Lapp/callpe/ui/misc/ReferralDetailActivity$Companion;", "", "()V", "openWhatsApp", "", "context", "Landroid/content/Context;", "rawRef", "", "shareText", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }

        public final void openWhatsApp(Context context, String rawRef) {
            Intrinsics.checkNotNullParameter(context, "context");
            Intrinsics.checkNotNullParameter(rawRef, "rawRef");
            try {
                String string = context.getString(2131951676);
                Intrinsics.checkNotNullExpressionValue(string, "context.getString(R.string.app_package)");
                String string2 = context.getString(2131951681);
                Intrinsics.checkNotNullExpressionValue(string2, "context.getString(R.string.application_name)");
                String str = "Install " + string2 + " and you can video call with beautiful girls.\n\n " + ("https://play.google.com/store/apps/details?id=" + string + "&referrer=usercode%3D" + rawRef);
                Intent intent = new Intent();
                intent.setAction("android.intent.action.SEND");
                intent.putExtra("android.intent.extra.TEXT", str);
                intent.setType("text/plain");
                intent.setPackage("com.whatsapp");
                context.startActivity(intent);
            } catch (Exception unused) {
                Toast.makeText(context, "WhatsApp is not installed on your device", 0).show();
            }
        }

        public final void shareText(Context context, String rawRef) {
            Intrinsics.checkNotNullParameter(context, "context");
            Intrinsics.checkNotNullParameter(rawRef, "rawRef");
            try {
                String string = context.getString(2131951676);
                Intrinsics.checkNotNullExpressionValue(string, "context.getString(R.string.app_package)");
                String string2 = context.getString(2131951681);
                Intrinsics.checkNotNullExpressionValue(string2, "context.getString(R.string.application_name)");
                String str = "Install " + string2 + ".\n\n " + ("https://play.google.com/store/apps/details?id=" + string + "&referrer=usercode%3D" + rawRef);
                Intent intent = new Intent("android.intent.action.SEND");
                intent.setType("text/plain");
                intent.putExtra("android.intent.extra.TEXT", str);
                context.startActivity(Intent.createChooser(intent, "Share via"));
            } catch (Exception e) {
                Timber.e(e);
            }
        }
    }
}