正在查看: Biko v2.0.23 应用的 ReportStreamerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Biko v2.0.23 应用的 ReportStreamerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.callpe.ui.user;
import android.content.Context;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.Toast;
import androidx.activity.ComponentActivity;
import androidx.core.content.ContextCompat;
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.databinding.ActivityReportStreamerBinding;
import com.asynctaskcoffee.audiorecorder.R;
import com.google.android.material.card.MaterialCardView;
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 kotlin.text.StringsKt;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Job;
@Metadata(d1 = {"\u0000B\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0007\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0019\u001a\u00020\u001aH\u0002J\b\u0010\u001b\u001a\u00020\u001aH\u0002J\b\u0010\u001c\u001a\u00020\u001dH\u0002J\b\u0010\u001e\u001a\u00020\u001aH\u0002J\u0012\u0010\u001f\u001a\u00020\u001a2\b\u0010 \u001a\u0004\u0018\u00010!H\u0014J\b\u0010\"\u001a\u00020\u001aH\u0002J\b\u0010#\u001a\u00020\u001aH\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082.¢\u0006\u0002\n\u0000R\u001a\u0010\u0005\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0005\u0010\u0007\"\u0004\b\b\u0010\tR\u001a\u0010\n\u001a\u00020\u000bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\f\u0010\r\"\u0004\b\u000e\u0010\u000fR\u001a\u0010\u0010\u001a\u00020\u000bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0011\u0010\r\"\u0004\b\u0012\u0010\u000fR\u001b\u0010\u0013\u001a\u00020\u00148BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0017\u0010\u0018\u001a\u0004\b\u0015\u0010\u0016¨\u0006$"}, d2 = {"Lapp/callpe/ui/user/ReportStreamerActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "()V", "binding", "Lapp/callpe/databinding/ActivityReportStreamerBinding;", "isBackgroundColorUpdated", "", "()Z", "setBackgroundColorUpdated", "(Z)V", "selectedIssue", "", "getSelectedIssue", "()Ljava/lang/String;", "setSelectedIssue", "(Ljava/lang/String;)V", "selectedSection", "getSelectedSection", "setSelectedSection", "viewModel", "Lapp/callpe/ui/user/UserViewModel;", "getViewModel", "()Lapp/callpe/ui/user/UserViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "listener", "", "observeEditText", "observeEvent", "Lkotlinx/coroutines/Job;", "onClicks", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "setSpinner", "setUpUI", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class ReportStreamerActivity extends Hilt_ReportStreamerActivity {
private ActivityReportStreamerBinding binding;
private boolean isBackgroundColorUpdated;
private final Lazy viewModel;
private String selectedSection = "";
private String selectedIssue = "";
public ReportStreamerActivity() {
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 m2273invoke() {
return componentActivity.getViewModelStore();
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
public final ViewModelProvider.Factory m2272invoke() {
return componentActivity.getDefaultViewModelProviderFactory();
}
}, new Function0<CreationExtras>() {
{
super(0);
}
public final CreationExtras m2274invoke() {
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();
}
public final String getSelectedSection() {
return this.selectedSection;
}
public final void setSelectedSection(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
this.selectedSection = str;
}
public final String getSelectedIssue() {
return this.selectedIssue;
}
public final void setSelectedIssue(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
this.selectedIssue = str;
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityReportStreamerBinding inflate = ActivityReportStreamerBinding.inflate(getLayoutInflater());
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
this.binding = inflate;
if (inflate == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
inflate = null;
}
setContentView(inflate.getRoot());
setUpUI();
observeEvent();
onClicks();
}
private final void setUpUI() {
ActivityReportStreamerBinding activityReportStreamerBinding = this.binding;
ActivityReportStreamerBinding activityReportStreamerBinding2 = null;
if (activityReportStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding = null;
}
View view = activityReportStreamerBinding.oldReportParent;
Intrinsics.checkNotNullExpressionValue(view, "binding.oldReportParent");
view.setVisibility(8);
ActivityReportStreamerBinding activityReportStreamerBinding3 = this.binding;
if (activityReportStreamerBinding3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding3 = null;
}
View view2 = activityReportStreamerBinding3.newReportParent;
Intrinsics.checkNotNullExpressionValue(view2, "binding.newReportParent");
view2.setVisibility(0);
ActivityReportStreamerBinding activityReportStreamerBinding4 = this.binding;
if (activityReportStreamerBinding4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activityReportStreamerBinding2 = activityReportStreamerBinding4;
}
activityReportStreamerBinding2.submitNewBtn.setEnabled(false);
observeEditText();
}
private final void listener() {
ActivityReportStreamerBinding activityReportStreamerBinding = this.binding;
if (activityReportStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding = null;
}
activityReportStreamerBinding.otherDetailsText.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
String str;
ReportStreamerActivity reportStreamerActivity = ReportStreamerActivity.this;
if (s == null || (str = s.toString()) == null) {
str = "";
}
reportStreamerActivity.setSelectedIssue(str);
}
});
}
private final Job observeEvent() {
return BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new ReportStreamerActivity$observeEvent$1(this, null), 3, (Object) null);
}
private final void onClicks() {
ActivityReportStreamerBinding activityReportStreamerBinding = this.binding;
ActivityReportStreamerBinding activityReportStreamerBinding2 = null;
if (activityReportStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding = null;
}
activityReportStreamerBinding.submitBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ReportStreamerActivity.onClicks$lambda$0(ReportStreamerActivity.this, view);
}
});
ActivityReportStreamerBinding activityReportStreamerBinding3 = this.binding;
if (activityReportStreamerBinding3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding3 = null;
}
activityReportStreamerBinding3.submitNewBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ReportStreamerActivity.onClicks$lambda$1(ReportStreamerActivity.this, view);
}
});
ActivityReportStreamerBinding activityReportStreamerBinding4 = this.binding;
if (activityReportStreamerBinding4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activityReportStreamerBinding2 = activityReportStreamerBinding4;
}
activityReportStreamerBinding2.close.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ReportStreamerActivity.onClicks$lambda$2(ReportStreamerActivity.this, view);
}
});
}
public static final void onClicks$lambda$0(ReportStreamerActivity reportStreamerActivity, View view) {
Intrinsics.checkNotNullParameter(reportStreamerActivity, "this$0");
long longExtra = reportStreamerActivity.getIntent().getLongExtra("streamerId", 0L);
if (reportStreamerActivity.selectedIssue.length() > 100) {
Toast.makeText((Context) reportStreamerActivity, "Max word limit is 100.", 0).show();
} else {
reportStreamerActivity.getViewModel().sendReport(longExtra, reportStreamerActivity.selectedSection, reportStreamerActivity.selectedIssue);
}
}
public static final void onClicks$lambda$1(ReportStreamerActivity reportStreamerActivity, View view) {
Intrinsics.checkNotNullParameter(reportStreamerActivity, "this$0");
long longExtra = reportStreamerActivity.getIntent().getLongExtra("streamerId", 0L);
ActivityReportStreamerBinding activityReportStreamerBinding = reportStreamerActivity.binding;
if (activityReportStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding = null;
}
reportStreamerActivity.getViewModel().sendReport(longExtra, null, String.valueOf(activityReportStreamerBinding.reportText.getText()));
}
public static final void onClicks$lambda$2(ReportStreamerActivity reportStreamerActivity, View view) {
Intrinsics.checkNotNullParameter(reportStreamerActivity, "this$0");
reportStreamerActivity.finish();
}
public final boolean getIsBackgroundColorUpdated() {
return this.isBackgroundColorUpdated;
}
public final void setBackgroundColorUpdated(boolean z) {
this.isBackgroundColorUpdated = z;
}
private final void observeEditText() {
ActivityReportStreamerBinding activityReportStreamerBinding = this.binding;
if (activityReportStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding = null;
}
activityReportStreamerBinding.reportText.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
ActivityReportStreamerBinding activityReportStreamerBinding2;
ActivityReportStreamerBinding activityReportStreamerBinding3;
ActivityReportStreamerBinding activityReportStreamerBinding4;
ActivityReportStreamerBinding activityReportStreamerBinding5;
ActivityReportStreamerBinding activityReportStreamerBinding6;
ActivityReportStreamerBinding activityReportStreamerBinding7;
ActivityReportStreamerBinding activityReportStreamerBinding8;
activityReportStreamerBinding2 = ReportStreamerActivity.this.binding;
ActivityReportStreamerBinding activityReportStreamerBinding9 = null;
if (activityReportStreamerBinding2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding2 = null;
}
Editable text = activityReportStreamerBinding2.reportText.getText();
String valueOf = String.valueOf(text != null ? StringsKt.trim(text) : null);
String str = valueOf.length() + " / 2000 (Min: 100)";
activityReportStreamerBinding3 = ReportStreamerActivity.this.binding;
if (activityReportStreamerBinding3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding3 = null;
}
activityReportStreamerBinding3.reportTextCount.setText(str);
activityReportStreamerBinding4 = ReportStreamerActivity.this.binding;
if (activityReportStreamerBinding4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding4 = null;
}
MaterialCardView materialCardView = activityReportStreamerBinding4.submitNewBtn;
int length = valueOf.length();
materialCardView.setEnabled(100 <= length && length < 2000);
int length2 = valueOf.length();
if (100 <= length2 && length2 < 2000) {
if (ReportStreamerActivity.this.getIsBackgroundColorUpdated()) {
return;
}
activityReportStreamerBinding7 = ReportStreamerActivity.this.binding;
if (activityReportStreamerBinding7 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding7 = null;
}
activityReportStreamerBinding7.submitNewBtn.setCardBackgroundColor(ContextCompat.getColor((Context) ReportStreamerActivity.this, 2131099815));
activityReportStreamerBinding8 = ReportStreamerActivity.this.binding;
if (activityReportStreamerBinding8 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activityReportStreamerBinding9 = activityReportStreamerBinding8;
}
activityReportStreamerBinding9.submitText.setTextColor(ContextCompat.getColor((Context) ReportStreamerActivity.this, 2131101146));
ReportStreamerActivity.this.setBackgroundColorUpdated(true);
return;
}
if (ReportStreamerActivity.this.getIsBackgroundColorUpdated()) {
activityReportStreamerBinding5 = ReportStreamerActivity.this.binding;
if (activityReportStreamerBinding5 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding5 = null;
}
activityReportStreamerBinding5.submitNewBtn.setCardBackgroundColor(ContextCompat.getColor((Context) ReportStreamerActivity.this, 2131100036));
activityReportStreamerBinding6 = ReportStreamerActivity.this.binding;
if (activityReportStreamerBinding6 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activityReportStreamerBinding9 = activityReportStreamerBinding6;
}
activityReportStreamerBinding9.submitText.setTextColor(ContextCompat.getColor((Context) ReportStreamerActivity.this, R.color.black_50));
ReportStreamerActivity.this.setBackgroundColorUpdated(false);
}
}
});
}
private final void setSpinner() {
final String[] stringArray = getResources().getStringArray(2130903049);
Intrinsics.checkNotNullExpressionValue(stringArray, "resources.getStringArray(R.array.report_section)");
final String[] stringArray2 = getResources().getStringArray(2130903048);
Intrinsics.checkNotNullExpressionValue(stringArray2, "resources.getStringArray(R.array.report_issue)");
ActivityReportStreamerBinding activityReportStreamerBinding = this.binding;
ActivityReportStreamerBinding activityReportStreamerBinding2 = null;
if (activityReportStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityReportStreamerBinding = null;
}
Spinner spinner = activityReportStreamerBinding.spinner1;
Intrinsics.checkNotNullExpressionValue(spinner, "binding.spinner1");
Context context = (Context) this;
spinner.setAdapter((SpinnerAdapter) new ArrayAdapter(context, 2131558645, stringArray));
ActivityReportStreamerBinding activityReportStreamerBinding3 = this.binding;
if (activityReportStreamerBinding3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activityReportStreamerBinding2 = activityReportStreamerBinding3;
}
Spinner spinner2 = activityReportStreamerBinding2.spinner2;
Intrinsics.checkNotNullExpressionValue(spinner2, "binding.spinner2");
spinner2.setAdapter((SpinnerAdapter) new ArrayAdapter(context, 2131558645, stringArray2));
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onNothingSelected(AdapterView<?> parent) {
Intrinsics.checkNotNullParameter(parent, "parent");
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Intrinsics.checkNotNullParameter(parent, "parent");
ReportStreamerActivity.this.setSelectedSection(stringArray[position].toString());
}
});
spinner2.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
private boolean otherSelected;
@Override
public void onNothingSelected(AdapterView<?> parent) {
Intrinsics.checkNotNullParameter(parent, "parent");
}
public final boolean getOtherSelected() {
return this.otherSelected;
}
public final void setOtherSelected(boolean z) {
this.otherSelected = z;
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
ActivityReportStreamerBinding activityReportStreamerBinding4;
ActivityReportStreamerBinding activityReportStreamerBinding5;
Intrinsics.checkNotNullParameter(parent, "parent");
ActivityReportStreamerBinding activityReportStreamerBinding6 = null;
if (Intrinsics.areEqual(stringArray2[position], "Other")) {
activityReportStreamerBinding5 = this.binding;
if (activityReportStreamerBinding5 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activityReportStreamerBinding6 = activityReportStreamerBinding5;
}
activityReportStreamerBinding6.otherDetails.setVisibility(0);
Toast.makeText((Context) this, "Describe your issue briefly.", 0).show();
return;
}
activityReportStreamerBinding4 = this.binding;
if (activityReportStreamerBinding4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activityReportStreamerBinding6 = activityReportStreamerBinding4;
}
activityReportStreamerBinding6.otherDetails.setVisibility(8);
this.setSelectedIssue(stringArray2[position].toString());
}
});
}
}