正在查看: Rilo v2.0.21 应用的 SearchUserActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Rilo v2.0.21 应用的 SearchUserActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.callpe.ui.user;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.fragment.app.FragmentActivity;
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.extensions.ActivityExtKt;
import app.callpe.data.model.User;
import app.callpe.databinding.ActivitySearchUserBinding;
import app.callpe.ui.home.StreamerDetailActivity;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import dagger.hilt.android.AndroidEntryPoint;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Job;
@Metadata(d1 = {"\u00006\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\u0000\b\u0007\u0018\u00002\u00020\u0001B\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\u0015"}, d2 = {"Lapp/callpe/ui/user/SearchUserActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "()V", "binding", "Lapp/callpe/databinding/ActivitySearchUserBinding;", "viewModel", "Lapp/callpe/ui/user/UserViewModel;", "getViewModel", "()Lapp/callpe/ui/user/UserViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "observeEvent", "Lkotlinx/coroutines/Job;", "onClick", "", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "showUserData", "user", "Lapp/callpe/data/model/User;", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class SearchUserActivity extends Hilt_SearchUserActivity {
private ActivitySearchUserBinding binding;
private final Lazy viewModel;
public SearchUserActivity() {
final ComponentActivity componentActivity = (ComponentActivity) this;
final Function0 function0 = null;
this.viewModel = new ViewModelLazy(Reflection.getOrCreateKotlinClass(UserViewModel.class), new Function0<ViewModelStore>() {
{
super(0);
}
public final ViewModelStore m2277invoke() {
return componentActivity.getViewModelStore();
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
public final ViewModelProvider.Factory m2276invoke() {
return componentActivity.getDefaultViewModelProviderFactory();
}
}, new Function0<CreationExtras>() {
{
super(0);
}
public final CreationExtras m2278invoke() {
CreationExtras creationExtras;
Function0 function02 = function0;
return (function02 == null || (creationExtras = (CreationExtras) function02.invoke()) == null) ? componentActivity.getDefaultViewModelCreationExtras() : creationExtras;
}
});
}
public final UserViewModel getViewModel() {
return (UserViewModel) this.viewModel.getValue();
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivitySearchUserBinding inflate = ActivitySearchUserBinding.inflate(getLayoutInflater());
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
this.binding = inflate;
if (inflate == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
inflate = null;
}
setContentView(inflate.getRoot());
observeEvent();
onClick();
}
private final void onClick() {
ActivitySearchUserBinding activitySearchUserBinding = this.binding;
if (activitySearchUserBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activitySearchUserBinding = null;
}
activitySearchUserBinding.btnS.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchUserActivity.onClick$lambda$0(SearchUserActivity.this, view);
}
});
}
public static final void onClick$lambda$0(SearchUserActivity searchUserActivity, View view) {
Intrinsics.checkNotNullParameter(searchUserActivity, "this$0");
try {
ActivitySearchUserBinding activitySearchUserBinding = searchUserActivity.binding;
ActivitySearchUserBinding activitySearchUserBinding2 = null;
if (activitySearchUserBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activitySearchUserBinding = null;
}
if (String.valueOf(activitySearchUserBinding.userId.getText()).length() == 0) {
ActivityExtKt.toast((Activity) searchUserActivity, "Search id required");
return;
}
ActivitySearchUserBinding activitySearchUserBinding3 = searchUserActivity.binding;
if (activitySearchUserBinding3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activitySearchUserBinding3 = null;
}
searchUserActivity.getViewModel().getSearchedUserInfo(Long.parseLong(String.valueOf(activitySearchUserBinding3.userId.getText())));
ActivitySearchUserBinding activitySearchUserBinding4 = searchUserActivity.binding;
if (activitySearchUserBinding4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activitySearchUserBinding2 = activitySearchUserBinding4;
}
activitySearchUserBinding2.progressBar2.setVisibility(0);
} catch (Exception e) {
ActivityExtKt.toast((Activity) searchUserActivity, "Error: " + e);
}
}
private final Job observeEvent() {
return BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new SearchUserActivity$observeEvent$1(this, null), 3, (Object) null);
}
public final void showUserData(final User user) {
String string;
ActivitySearchUserBinding activitySearchUserBinding = this.binding;
ActivitySearchUserBinding activitySearchUserBinding2 = null;
if (activitySearchUserBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activitySearchUserBinding = null;
}
TextView textView = activitySearchUserBinding.streamer;
if (user.getStreamer()) {
RequestBuilder load = Glide.with((FragmentActivity) this).load(user.getProfile());
ActivitySearchUserBinding activitySearchUserBinding3 = this.binding;
if (activitySearchUserBinding3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activitySearchUserBinding3 = null;
}
load.into(activitySearchUserBinding3.avatar);
string = getString(2131953093);
} else {
RequestBuilder load2 = Glide.with((FragmentActivity) this).load(user.getAvatar());
ActivitySearchUserBinding activitySearchUserBinding4 = this.binding;
if (activitySearchUserBinding4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activitySearchUserBinding4 = null;
}
load2.into(activitySearchUserBinding4.avatar);
string = getString(2131952360);
}
textView.setText(string);
ActivitySearchUserBinding activitySearchUserBinding5 = this.binding;
if (activitySearchUserBinding5 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activitySearchUserBinding5 = null;
}
activitySearchUserBinding5.userName.setText(user.getName());
ActivitySearchUserBinding activitySearchUserBinding6 = this.binding;
if (activitySearchUserBinding6 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activitySearchUserBinding6 = null;
}
activitySearchUserBinding6.searchedUserResultView.setVisibility(0);
ActivitySearchUserBinding activitySearchUserBinding7 = this.binding;
if (activitySearchUserBinding7 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activitySearchUserBinding7 = null;
}
activitySearchUserBinding7.progressBar2.setVisibility(8);
ActivitySearchUserBinding activitySearchUserBinding8 = this.binding;
if (activitySearchUserBinding8 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activitySearchUserBinding2 = activitySearchUserBinding8;
}
activitySearchUserBinding2.searchedUserResultView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchUserActivity.showUserData$lambda$1(User.this, this, view);
}
});
}
public static final void showUserData$lambda$1(User user, SearchUserActivity searchUserActivity, View view) {
Intrinsics.checkNotNullParameter(user, "$user");
Intrinsics.checkNotNullParameter(searchUserActivity, "this$0");
if (user.getStreamer()) {
Intent intent = new Intent((Context) searchUserActivity, (Class<?>) StreamerDetailActivity.class);
intent.putExtra("id", user.getId());
searchUserActivity.startActivity(intent);
} else {
Intent intent2 = new Intent((Context) searchUserActivity, (Class<?>) UserDetailsActivity.class);
intent2.putExtra("userId", user.getId());
searchUserActivity.startActivity(intent2);
}
}
}