Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 ComplaintFragment.java 源代码,内容仅作参考
package by.kufar.complaint.ui;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ViewAnimator;
import androidx.core.content.ContextCompat;
import androidx.core.os.BundleKt;
import androidx.core.view.ViewGroupKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import by.kufar.complaint.R$color;
import by.kufar.complaint.R$id;
import by.kufar.complaint.R$layout;
import by.kufar.complaint.R$string;
import by.kufar.complaint.ui.ComplaintVM;
import by.kufar.complaint.ui.reasons.ReasonActivity;
import by.kufar.core.android.fragment.BaseFragment;
import by.kufar.re.ui.widget.InputView;
import by.kufar.re.ui.widget.button.ProgressButton;
import by.kufar.re.ui.widget.dialog.AlertKufarDialogFragment;
import by.kufar.re.ui.widget.error.ErrorView;
import by.kufar.re.ui.widget.select.SelectView;
import by.kufar.re.ui.widget.webview.WebViewActivity;
import com.google.android.material.snackbar.Snackbar;
import d80.u;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.o0;
import kotlin.reflect.KProperty;
import t4.a;
@Metadata(d1 = {"\u0000¦\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\r\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0010\t\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0007\u0018\u0000 e2\u00020\u0001:\u0001fB\u0007¢\u0006\u0004\bc\u0010dJ\b\u0010\u0003\u001a\u00020\u0002H\u0002J\u0010\u0010\u0006\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004H\u0002J\b\u0010\u0007\u001a\u00020\u0002H\u0002J\b\u0010\b\u001a\u00020\u0002H\u0002J\u0012\u0010\u000b\u001a\u00020\u00022\b\u0010\n\u001a\u0004\u0018\u00010\tH\u0002J\b\u0010\f\u001a\u00020\u0002H\u0002J\b\u0010\u000e\u001a\u00020\rH\u0002J\u0010\u0010\u0011\u001a\u00020\u00022\u0006\u0010\u0010\u001a\u00020\u000fH\u0002J&\u0010\u0019\u001a\u0004\u0018\u00010\u00182\u0006\u0010\u0013\u001a\u00020\u00122\b\u0010\u0015\u001a\u0004\u0018\u00010\u00142\b\u0010\u0017\u001a\u0004\u0018\u00010\u0016H\u0016J\b\u0010\u001a\u001a\u00020\u0002H\u0016J\u001a\u0010\u001c\u001a\u00020\u00022\u0006\u0010\u001b\u001a\u00020\u00182\b\u0010\u0017\u001a\u0004\u0018\u00010\u0016H\u0016J\b\u0010\u001d\u001a\u00020\u0002H\u0016J\"\u0010#\u001a\u00020\u00022\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u001e2\b\u0010\"\u001a\u0004\u0018\u00010!H\u0016R\"\u0010%\u001a\u00020$8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b%\u0010&\u001a\u0004\b'\u0010(\"\u0004\b)\u0010*R\"\u0010,\u001a\u00020+8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b,\u0010-\u001a\u0004\b.\u0010/\"\u0004\b0\u00101R\"\u00103\u001a\u0002028\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b3\u00104\u001a\u0004\b5\u00106\"\u0004\b7\u00108R\u001b\u0010>\u001a\u0002098BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b:\u0010;\u001a\u0004\b<\u0010=R\u001b\u0010C\u001a\u00020?8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b@\u0010;\u001a\u0004\bA\u0010BR\u001b\u0010F\u001a\u00020?8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bD\u0010;\u001a\u0004\bE\u0010BR\u001b\u0010K\u001a\u00020G8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bH\u0010;\u001a\u0004\bI\u0010JR\u001b\u0010P\u001a\u00020L8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bM\u0010;\u001a\u0004\bN\u0010OR\u001b\u0010U\u001a\u00020Q8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bR\u0010;\u001a\u0004\bS\u0010TR\u001b\u0010Z\u001a\u00020\u000f8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bV\u0010W\u001a\u0004\bX\u0010YR\u001b\u0010_\u001a\u00020[8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\\\u0010W\u001a\u0004\b]\u0010^R\u0016\u0010a\u001a\u00020`8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\ba\u0010b¨\u0006g"}, d2 = {"Lby/kufar/complaint/ui/ComplaintFragment;", "Lby/kufar/core/android/fragment/BaseFragment;", "", "setUpViewModel", "Lby/kufar/complaint/ui/ComplaintVM$a;", "state", "setUpState", "showTicketAlreadyCreatedDialog", "setUpActions", "Lu4/a;", "reason", "openComplaintReasonChooser", "showSuccessDialog", "", "getSuccessDescription", "", "url", "openUrl", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "onInject", "view", "onViewCreated", "onStart", "", "requestCode", "resultCode", "Landroid/content/Intent;", "data", "onActivityResult", "Lcb/b;", "mediator", "Lcb/b;", "getMediator", "()Lcb/b;", "setMediator", "(Lcb/b;)V", "Landroidx/lifecycle/ViewModelProvider$Factory;", "viewModelFactory", "Landroidx/lifecycle/ViewModelProvider$Factory;", "getViewModelFactory", "()Landroidx/lifecycle/ViewModelProvider$Factory;", "setViewModelFactory", "(Landroidx/lifecycle/ViewModelProvider$Factory;)V", "Lr4/a;", "tracker", "Lr4/a;", "getTracker", "()Lr4/a;", "setTracker", "(Lr4/a;)V", "Lby/kufar/re/ui/widget/select/SelectView;", "select$delegate", "Li6/c;", "getSelect", "()Lby/kufar/re/ui/widget/select/SelectView;", "select", "Lby/kufar/re/ui/widget/InputView;", "userName$delegate", "getUserName", "()Lby/kufar/re/ui/widget/InputView;", "userName", "description$delegate", "getDescription", "description", "Lby/kufar/re/ui/widget/button/ProgressButton;", "submit$delegate", "getSubmit", "()Lby/kufar/re/ui/widget/button/ProgressButton;", "submit", "Landroid/widget/ViewAnimator;", "animator$delegate", "getAnimator", "()Landroid/widget/ViewAnimator;", "animator", "Lby/kufar/re/ui/widget/error/ErrorView;", "error$delegate", "getError", "()Lby/kufar/re/ui/widget/error/ErrorView;", "error", "adLink$delegate", "Ld80/j;", "getAdLink", "()Ljava/lang/String;", "adLink", "", "adId$delegate", "getAdId", "()J", "adId", "Lby/kufar/complaint/ui/ComplaintVM;", "viewModel", "Lby/kufar/complaint/ui/ComplaintVM;", "<init>", "()V", "Companion", "a", "feature-complaint_googleRelease"}, k = 1, mv = {1, 9, 0})
public final class ComplaintFragment extends BaseFragment {
static final KProperty<Object>[] $$delegatedProperties = {o0.i(new g0(ComplaintFragment.class, "select", "getSelect()Lby/kufar/re/ui/widget/select/SelectView;", 0)), o0.i(new g0(ComplaintFragment.class, "userName", "getUserName()Lby/kufar/re/ui/widget/InputView;", 0)), o0.i(new g0(ComplaintFragment.class, "description", "getDescription()Lby/kufar/re/ui/widget/InputView;", 0)), o0.i(new g0(ComplaintFragment.class, "submit", "getSubmit()Lby/kufar/re/ui/widget/button/ProgressButton;", 0)), o0.i(new g0(ComplaintFragment.class, "animator", "getAnimator()Landroid/widget/ViewAnimator;", 0)), o0.i(new g0(ComplaintFragment.class, "error", "getError()Lby/kufar/re/ui/widget/error/ErrorView;", 0))};
public static final Companion INSTANCE = new Companion(null);
private static final String KEY_AD_ID = "ad_id";
private static final String KEY_AD_LINK = "ad_link";
private static final int KEY_REASONS_REQUEST_CODE = 1000;
public cb.b mediator;
public r4.a tracker;
private ComplaintVM viewModel;
public ViewModelProvider.Factory viewModelFactory;
private final i6.c select = bindView(R$id.f5703h);
private final i6.c userName = bindView(R$id.f5706k);
private final i6.c description = bindView(R$id.f5699d);
private final i6.c submit = bindView(R$id.f5704i);
private final i6.c animator = bindView(R$id.f5696a);
private final i6.c error = bindView(R$id.f5700e);
private final d80.j adLink = d80.k.b(new c());
private final d80.j adId = d80.k.b(new b());
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u000e\u0010\u000fJ\u0016\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004R\u0014\u0010\b\u001a\u00020\u00028\u0002X\u0082T¢\u0006\u0006\n\u0004\b\b\u0010\tR\u0014\u0010\n\u001a\u00020\u00028\u0002X\u0082T¢\u0006\u0006\n\u0004\b\n\u0010\tR\u0014\u0010\f\u001a\u00020\u000b8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\f\u0010\r¨\u0006\u0010"}, d2 = {"Lby/kufar/complaint/ui/ComplaintFragment$a;", "", "", "adLink", "", "adId", "Landroidx/fragment/app/Fragment;", "a", "KEY_AD_ID", "Ljava/lang/String;", "KEY_AD_LINK", "", "KEY_REASONS_REQUEST_CODE", "I", "<init>", "()V", "feature-complaint_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class Companion {
public Companion() {
}
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final Fragment a(String adLink, long adId) {
kotlin.jvm.internal.s.j(adLink, "adLink");
ComplaintFragment complaintFragment = new ComplaintFragment();
complaintFragment.setArguments(BundleKt.bundleOf(u.a("ad_link", adLink), u.a("ad_id", Long.valueOf(adId))));
return complaintFragment;
}
}
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"<anonymous>", "", "invoke", "()Ljava/lang/Long;"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class b extends kotlin.jvm.internal.u implements Function0<Long> {
public b() {
super(0);
}
@Override
public final Long invoke() {
Bundle arguments = ComplaintFragment.this.getArguments();
if (arguments != null) {
return Long.valueOf(arguments.getLong("ad_id"));
}
throw new IllegalArgumentException("Ad id must be setted when start Complaint Fragment");
}
}
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u000e\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class c extends kotlin.jvm.internal.u implements Function0<String> {
public c() {
super(0);
}
@Override
public final String invoke() {
String string;
Bundle arguments = ComplaintFragment.this.getArguments();
if (arguments == null || (string = arguments.getString("ad_link")) == null) {
throw new IllegalArgumentException("Ad link must be setted when start Complaint Fragment");
}
return string;
}
}
@Metadata(d1 = {"\u0000\u001d\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\b\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u0006H\u0016¨\u0006\t"}, d2 = {"by/kufar/complaint/ui/ComplaintFragment$d", "Landroid/text/style/ClickableSpan;", "Landroid/text/TextPaint;", "ds", "", "updateDrawState", "Landroid/view/View;", "widget", "onClick", "core-android_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class d extends ClickableSpan {
public final Integer f5846b;
public final boolean f5847c;
public final ComplaintFragment f5848d;
public d(Integer num, boolean z11, ComplaintFragment complaintFragment) {
this.f5846b = num;
this.f5847c = z11;
this.f5848d = complaintFragment;
}
@Override
public void onClick(View widget) {
kotlin.jvm.internal.s.j(widget, "widget");
this.f5848d.openUrl("https://support.kufar.by/hc/ru/articles/4402930419089?utm_source=android&utm_medium=complain_sent");
}
@Override
public void updateDrawState(TextPaint ds2) {
kotlin.jvm.internal.s.j(ds2, "ds");
Integer num = this.f5846b;
if (num != null) {
ds2.setColor(num.intValue());
}
ds2.setUnderlineText(this.f5847c);
}
}
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
public static final class e implements Observer, kotlin.jvm.internal.m {
public final Function1 f5849b;
public e(Function1 function) {
kotlin.jvm.internal.s.j(function, "function");
this.f5849b = function;
}
public final boolean equals(Object obj) {
if (!(obj instanceof Observer) || !(obj instanceof kotlin.jvm.internal.m)) {
return false;
}
return kotlin.jvm.internal.s.e(getFunctionDelegate(), ((kotlin.jvm.internal.m) obj).getFunctionDelegate());
}
@Override
public final d80.f<?> getFunctionDelegate() {
return this.f5849b;
}
public final int hashCode() {
return getFunctionDelegate().hashCode();
}
@Override
public final void onChanged(Object obj) {
this.f5849b.invoke(obj);
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\n¢\u0006\u0002\b\u0004"}, d2 = {"<anonymous>", "", "it", "Landroid/view/View;", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class f extends kotlin.jvm.internal.u implements Function1<View, Unit> {
public f() {
super(1);
}
@Override
public Unit invoke(View view) {
invoke2(view);
return Unit.f82492a;
}
public final void invoke2(View it) {
kotlin.jvm.internal.s.j(it, "it");
ComplaintVM complaintVM = ComplaintFragment.this.viewModel;
if (complaintVM == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM = null;
}
complaintVM.init(ComplaintFragment.this.getAdId());
}
}
@Metadata(d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0012\u0010\u0005\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016¨\u0006\u0006"}, d2 = {"by/kufar/complaint/ui/ComplaintFragment$g", "Lh5/a;", "Landroid/text/Editable;", "s", "", "afterTextChanged", "feature-complaint_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class g extends h5.a {
public g() {
}
@Override
public void afterTextChanged(Editable s11) {
ComplaintVM complaintVM = ComplaintFragment.this.viewModel;
if (complaintVM == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM = null;
}
complaintVM.validate(ComplaintFragment.this.getUserName().getEditText().getText().toString(), ComplaintFragment.this.getDescription().getEditText().getText().toString());
}
}
@Metadata(d1 = {"\u0000\b\n\u0002\u0010\u0002\n\u0002\b\u0004\u0010\u0003\u001a\u00020\u00002\u000e\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"", "kotlin.jvm.PlatformType", "it", "a", "(Lkotlin/Unit;)V"}, k = 3, mv = {1, 9, 0})
public static final class h extends kotlin.jvm.internal.u implements Function1<Unit, Unit> {
public h() {
super(1);
}
public final void a(Unit unit) {
ComplaintFragment.this.showSuccessDialog();
}
@Override
public Unit invoke(Unit unit) {
a(unit);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0004\u001a\u00020\u00032\u000e\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"Lby/kufar/complaint/ui/ComplaintVM$a;", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/complaint/ui/ComplaintVM$a;)V"}, k = 3, mv = {1, 9, 0})
public static final class i extends kotlin.jvm.internal.u implements Function1<ComplaintVM.a, Unit> {
public i() {
super(1);
}
public final void a(ComplaintVM.a aVar) {
ComplaintFragment complaintFragment = ComplaintFragment.this;
kotlin.jvm.internal.s.g(aVar);
complaintFragment.setUpState(aVar);
}
@Override
public Unit invoke(ComplaintVM.a aVar) {
a(aVar);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\b\n\u0002\u0010\u0002\n\u0002\b\u0004\u0010\u0003\u001a\u00020\u00002\u000e\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"", "kotlin.jvm.PlatformType", "it", "a", "(Lkotlin/Unit;)V"}, k = 3, mv = {1, 9, 0})
public static final class j extends kotlin.jvm.internal.u implements Function1<Unit, Unit> {
public j() {
super(1);
}
public final void a(Unit unit) {
ComplaintFragment.this.showTicketAlreadyCreatedDialog();
}
@Override
public Unit invoke(Unit unit) {
a(unit);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0004\u001a\u00020\u00032\u000e\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"Lu4/a;", "kotlin.jvm.PlatformType", "it", "", "a", "(Lu4/a;)V"}, k = 3, mv = {1, 9, 0})
public static final class k extends kotlin.jvm.internal.u implements Function1<u4.a, Unit> {
public k() {
super(1);
}
public final void a(u4.a aVar) {
ComplaintFragment.this.getSelect().setTitle(ComplaintFragment.this.getString(R$string.f5727q));
ComplaintFragment.this.getSelect().setText(ComplaintFragment.this.getString(aVar.getTitle()));
}
@Override
public Unit invoke(u4.a aVar) {
a(aVar);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0004\u001a\u00020\u00032\u000e\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"", "kotlin.jvm.PlatformType", "it", "", "a", "(Ljava/lang/Boolean;)V"}, k = 3, mv = {1, 9, 0})
public static final class l extends kotlin.jvm.internal.u implements Function1<Boolean, Unit> {
public l() {
super(1);
}
public final void a(Boolean bool) {
ProgressButton submit = ComplaintFragment.this.getSubmit();
kotlin.jvm.internal.s.g(bool);
submit.e(bool.booleanValue());
}
@Override
public Unit invoke(Boolean bool) {
a(bool);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001e\u0010\u0003\u001a\u001a\u0012\u0006\u0012\u0004\u0018\u00010\u0001 \u0002*\f\u0012\u0006\u0012\u0004\u0018\u00010\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
public static final class m extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends Integer>, Unit> {
public m() {
super(1);
}
public final void a(by.kufar.core.android.arch.a<Integer> aVar) {
String str;
if (aVar.getHasBeenHandled()) {
return;
}
Integer a11 = aVar.a();
if (a11 != null) {
str = ComplaintFragment.this.getString(a11.intValue());
} else {
str = "";
}
kotlin.jvm.internal.s.g(str);
ComplaintFragment.this.getSelect().setError(str);
}
@Override
public Unit invoke(by.kufar.core.android.arch.a<? extends Integer> aVar) {
a(aVar);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
public static final class n extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends Integer>, Unit> {
public n() {
super(1);
}
public final void a(by.kufar.core.android.arch.a<Integer> aVar) {
Integer a11 = aVar.a();
if (a11 != null) {
Snackbar s11 = ek.b.s(ek.b.f75340a, ComplaintFragment.this.getView(), ComplaintFragment.this.getString(a11.intValue()), 0, null, 0, null, 60, null);
if (s11 != null) {
s11.W();
}
}
}
@Override
public Unit invoke(by.kufar.core.android.arch.a<? extends Integer> aVar) {
a(aVar);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\b\u0010\u0001\u001a\u0004\u0018\u00010\u00002\u0006\u0010\u0003\u001a\u00020\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Landroid/content/DialogInterface;", "dialogInterface", "Landroid/view/View;", "<anonymous parameter 1>", "", "a", "(Landroid/content/DialogInterface;Landroid/view/View;)V"}, k = 3, mv = {1, 9, 0})
public static final class o extends kotlin.jvm.internal.u implements Function2<DialogInterface, View, Unit> {
public static final o f5859d = new o();
public o() {
super(2);
}
public final void a(DialogInterface dialogInterface, View view) {
kotlin.jvm.internal.s.j(view, "<anonymous parameter 1>");
if (dialogInterface != null) {
dialogInterface.dismiss();
}
}
@Override
public Unit mo1invoke(DialogInterface dialogInterface, View view) {
a(dialogInterface, view);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\b\u0010\u0001\u001a\u0004\u0018\u00010\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Landroid/content/DialogInterface;", "it", "", "a", "(Landroid/content/DialogInterface;)V"}, k = 3, mv = {1, 9, 0})
public static final class p extends kotlin.jvm.internal.u implements Function1<DialogInterface, Unit> {
public p() {
super(1);
}
public final void a(DialogInterface dialogInterface) {
FragmentActivity activity = ComplaintFragment.this.getActivity();
if (activity != null) {
activity.finish();
}
}
@Override
public Unit invoke(DialogInterface dialogInterface) {
a(dialogInterface);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\b\u0010\u0001\u001a\u0004\u0018\u00010\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Landroid/content/DialogInterface;", "it", "", "a", "(Landroid/content/DialogInterface;)V"}, k = 3, mv = {1, 9, 0})
public static final class q extends kotlin.jvm.internal.u implements Function1<DialogInterface, Unit> {
public q() {
super(1);
}
public final void a(DialogInterface dialogInterface) {
if (dialogInterface != null) {
dialogInterface.dismiss();
}
FragmentActivity activity = ComplaintFragment.this.getActivity();
if (activity != null) {
activity.finish();
}
}
@Override
public Unit invoke(DialogInterface dialogInterface) {
a(dialogInterface);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\b\u0010\u0001\u001a\u0004\u0018\u00010\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Landroid/content/DialogInterface;", "it", "", "a", "(Landroid/content/DialogInterface;)V"}, k = 3, mv = {1, 9, 0})
public static final class r extends kotlin.jvm.internal.u implements Function1<DialogInterface, Unit> {
public r() {
super(1);
}
public final void a(DialogInterface dialogInterface) {
ComplaintFragment.this.getTracker().e();
}
@Override
public Unit invoke(DialogInterface dialogInterface) {
a(dialogInterface);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\b\u0010\u0001\u001a\u0004\u0018\u00010\u00002\u0006\u0010\u0003\u001a\u00020\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Landroid/content/DialogInterface;", "dialogInterface", "Landroid/view/View;", "<anonymous parameter 1>", "", "a", "(Landroid/content/DialogInterface;Landroid/view/View;)V"}, k = 3, mv = {1, 9, 0})
public static final class s extends kotlin.jvm.internal.u implements Function2<DialogInterface, View, Unit> {
public static final s f5863d = new s();
public s() {
super(2);
}
public final void a(DialogInterface dialogInterface, View view) {
kotlin.jvm.internal.s.j(view, "<anonymous parameter 1>");
if (dialogInterface != null) {
dialogInterface.cancel();
}
}
@Override
public Unit mo1invoke(DialogInterface dialogInterface, View view) {
a(dialogInterface, view);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\b\u0010\u0001\u001a\u0004\u0018\u00010\u00002\u0006\u0010\u0003\u001a\u00020\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Landroid/content/DialogInterface;", "<anonymous parameter 0>", "Landroid/view/View;", "<anonymous parameter 1>", "", "a", "(Landroid/content/DialogInterface;Landroid/view/View;)V"}, k = 3, mv = {1, 9, 0})
public static final class t extends kotlin.jvm.internal.u implements Function2<DialogInterface, View, Unit> {
public t() {
super(2);
}
public final void a(DialogInterface dialogInterface, View view) {
kotlin.jvm.internal.s.j(view, "<anonymous parameter 1>");
Context context = ComplaintFragment.this.getContext();
if (context == null) {
return;
}
ComplaintFragment.this.getTracker().d();
ComplaintFragment.this.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://support.kufar.by/hc/ru/requests", false, null, false, false, 60, null));
FragmentActivity activity = ComplaintFragment.this.getActivity();
if (activity != null) {
activity.finish();
}
}
@Override
public Unit mo1invoke(DialogInterface dialogInterface, View view) {
a(dialogInterface, view);
return Unit.f82492a;
}
}
public final long getAdId() {
return ((Number) this.adId.getValue()).longValue();
}
private final String getAdLink() {
return (String) this.adLink.getValue();
}
private final ViewAnimator getAnimator() {
return (ViewAnimator) this.animator.getValue(this, $$delegatedProperties[4]);
}
public final InputView getDescription() {
return (InputView) this.description.getValue(this, $$delegatedProperties[2]);
}
private final ErrorView getError() {
return (ErrorView) this.error.getValue(this, $$delegatedProperties[5]);
}
public final SelectView getSelect() {
return (SelectView) this.select.getValue(this, $$delegatedProperties[0]);
}
public final ProgressButton getSubmit() {
return (ProgressButton) this.submit.getValue(this, $$delegatedProperties[3]);
}
private final CharSequence getSuccessDescription() {
Integer num;
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(getString(R$string.G) + " ");
Context context = getContext();
if (context != null) {
num = Integer.valueOf(ContextCompat.getColor(context, R$color.f5695a));
} else {
num = null;
}
d dVar = new d(num, false, this);
int length = spannableStringBuilder.length();
spannableStringBuilder.append((CharSequence) getString(R$string.F));
spannableStringBuilder.setSpan(dVar, length, spannableStringBuilder.length(), 17);
SpannableStringBuilder append = spannableStringBuilder.append((CharSequence) (" " + getString(R$string.E)));
kotlin.jvm.internal.s.i(append, "append(...)");
return append;
}
public final InputView getUserName() {
return (InputView) this.userName.getValue(this, $$delegatedProperties[1]);
}
private final void openComplaintReasonChooser(u4.a reason) {
Context context = getContext();
if (context == null) {
return;
}
startActivityForResult(ReasonActivity.INSTANCE.a(context, reason), 1000);
}
public final void openUrl(String url) {
Context context = getContext();
if (context == null) {
return;
}
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, url, false, null, false, false, 60, null));
}
private final void setUpActions() {
getSelect().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ComplaintFragment.setUpActions$lambda$3(ComplaintFragment.this, view);
}
});
getSubmit().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ComplaintFragment.setUpActions$lambda$4(ComplaintFragment.this, view);
}
});
g gVar = new g();
getUserName().getEditText().addTextChangedListener(gVar);
getDescription().getEditText().addTextChangedListener(gVar);
getError().setOnRetryListener(new f());
}
public static final void setUpActions$lambda$3(ComplaintFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
ComplaintVM complaintVM = this$0.viewModel;
if (complaintVM == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM = null;
}
complaintVM.onReasonSelectClick();
}
public static final void setUpActions$lambda$4(ComplaintFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
a6.d.f263a.i(this$0.getView());
ComplaintVM complaintVM = this$0.viewModel;
if (complaintVM == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM = null;
}
complaintVM.sendComplaint(this$0.getAdId(), this$0.getAdLink(), this$0.getUserName().getEditText().getText().toString(), this$0.getDescription().getEditText().getText().toString());
}
public final void setUpState(ComplaintVM.a state) {
boolean z11;
boolean z12;
boolean z13;
int i11 = -1;
if (state instanceof ComplaintVM.a.C0189a) {
ViewAnimator animator = getAnimator();
int i12 = R$id.f5698c;
Iterator<View> it = ViewGroupKt.getChildren(animator).iterator();
int i13 = 0;
while (true) {
if (!it.hasNext()) {
break;
}
View next = it.next();
if (i13 < 0) {
e80.t.x();
}
if (next.getId() == i12) {
z13 = true;
} else {
z13 = false;
}
if (z13) {
i11 = i13;
break;
}
i13++;
}
if (animator.getDisplayedChild() != i11) {
if (i11 >= 0) {
animator.setDisplayedChild(i11);
} else {
throw new IllegalArgumentException("View with ID " + i12 + " not found.");
}
}
getUserName().setText(((ComplaintVM.a.C0189a) state).getUserName());
return;
}
if (state instanceof ComplaintVM.a.b) {
ViewAnimator animator2 = getAnimator();
int i14 = R$id.f5700e;
Iterator<View> it2 = ViewGroupKt.getChildren(animator2).iterator();
int i15 = 0;
while (true) {
if (!it2.hasNext()) {
break;
}
View next2 = it2.next();
if (i15 < 0) {
e80.t.x();
}
if (next2.getId() == i14) {
z12 = true;
} else {
z12 = false;
}
if (z12) {
i11 = i15;
break;
}
i15++;
}
if (animator2.getDisplayedChild() != i11) {
if (i11 >= 0) {
animator2.setDisplayedChild(i11);
} else {
throw new IllegalArgumentException("View with ID " + i14 + " not found.");
}
}
getError().setupError(((ComplaintVM.a.b) state).getError());
return;
}
if (kotlin.jvm.internal.s.e(state, ComplaintVM.a.c.f5867a)) {
ViewAnimator animator3 = getAnimator();
int i16 = R$id.f5701f;
Iterator<View> it3 = ViewGroupKt.getChildren(animator3).iterator();
int i17 = 0;
while (true) {
if (!it3.hasNext()) {
break;
}
View next3 = it3.next();
if (i17 < 0) {
e80.t.x();
}
if (next3.getId() == i16) {
z11 = true;
} else {
z11 = false;
}
if (z11) {
i11 = i17;
break;
}
i17++;
}
if (animator3.getDisplayedChild() != i11) {
if (i11 >= 0) {
animator3.setDisplayedChild(i11);
return;
}
throw new IllegalArgumentException("View with ID " + i16 + " not found.");
}
}
}
private final void setUpViewModel() {
ComplaintVM complaintVM = (ComplaintVM) new ViewModelProvider(this, getViewModelFactory()).get(ComplaintVM.class);
this.viewModel = complaintVM;
ComplaintVM complaintVM2 = null;
if (complaintVM == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM = null;
}
complaintVM.getState().observe(getViewLifecycleOwner(), new e(new i()));
ComplaintVM complaintVM3 = this.viewModel;
if (complaintVM3 == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM3 = null;
}
complaintVM3.getTicketAlreadyCreatedError().observe(getViewLifecycleOwner(), new e(new j()));
ComplaintVM complaintVM4 = this.viewModel;
if (complaintVM4 == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM4 = null;
}
complaintVM4.getSelectedReason().observe(getViewLifecycleOwner(), new e(new k()));
ComplaintVM complaintVM5 = this.viewModel;
if (complaintVM5 == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM5 = null;
}
complaintVM5.getSendComplaintProgress().observe(getViewLifecycleOwner(), new e(new l()));
ComplaintVM complaintVM6 = this.viewModel;
if (complaintVM6 == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM6 = null;
}
complaintVM6.getOpenReasonSelect().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
ComplaintFragment.setUpViewModel$lambda$0(ComplaintFragment.this, (by.kufar.core.android.arch.a) obj);
}
});
ComplaintVM complaintVM7 = this.viewModel;
if (complaintVM7 == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM7 = null;
}
complaintVM7.getSelectError().observe(getViewLifecycleOwner(), new e(new m()));
ComplaintVM complaintVM8 = this.viewModel;
if (complaintVM8 == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM8 = null;
}
complaintVM8.getSendComplaintEnabled().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
ComplaintFragment.setUpViewModel$lambda$1(ComplaintFragment.this, (Boolean) obj);
}
});
ComplaintVM complaintVM9 = this.viewModel;
if (complaintVM9 == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM9 = null;
}
complaintVM9.getSnackError().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
ComplaintFragment.setUpViewModel$lambda$2(ComplaintFragment.this, (by.kufar.core.android.arch.a) obj);
}
});
ComplaintVM complaintVM10 = this.viewModel;
if (complaintVM10 == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM10 = null;
}
complaintVM10.getSnackErrorInt().observe(getViewLifecycleOwner(), new e(new n()));
ComplaintVM complaintVM11 = this.viewModel;
if (complaintVM11 == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM11 = null;
}
complaintVM11.getShowSuccess().observe(getViewLifecycleOwner(), new e(new h()));
ComplaintVM complaintVM12 = this.viewModel;
if (complaintVM12 == null) {
kotlin.jvm.internal.s.B("viewModel");
} else {
complaintVM2 = complaintVM12;
}
complaintVM2.init(getAdId());
}
public static final void setUpViewModel$lambda$0(ComplaintFragment this$0, by.kufar.core.android.arch.a aVar) {
kotlin.jvm.internal.s.j(this$0, "this$0");
if (aVar.getHasBeenHandled()) {
return;
}
this$0.openComplaintReasonChooser((u4.a) aVar.a());
}
public static final void setUpViewModel$lambda$1(ComplaintFragment this$0, Boolean bool) {
kotlin.jvm.internal.s.j(this$0, "this$0");
ProgressButton submit = this$0.getSubmit();
kotlin.jvm.internal.s.g(bool);
submit.setEnabled(bool.booleanValue());
}
public static final void setUpViewModel$lambda$2(ComplaintFragment this$0, by.kufar.core.android.arch.a aVar) {
Snackbar t11;
kotlin.jvm.internal.s.j(this$0, "this$0");
Throwable th2 = (Throwable) aVar.a();
if (th2 != null && (t11 = ek.b.t(ek.b.f75340a, this$0.getView(), th2, 0, null, 0, null, 56, null)) != null) {
t11.W();
}
}
public final void showSuccessDialog() {
AlertKufarDialogFragment.Companion companion = AlertKufarDialogFragment.INSTANCE;
String string = getString(R$string.H);
kotlin.jvm.internal.s.i(string, "getString(...)");
CharSequence successDescription = getSuccessDescription();
String string2 = getString(R$string.K);
kotlin.jvm.internal.s.i(string2, "getString(...)");
AlertKufarDialogFragment.Companion.b(companion, string, successDescription, string2, null, false, false, 56, null).setPositiveClickListener(o.f5859d).setOnDismissListener(new p()).show(getChildFragmentManager(), (String) null);
}
public final void showTicketAlreadyCreatedDialog() {
getTracker().c();
AlertKufarDialogFragment.Companion companion = AlertKufarDialogFragment.INSTANCE;
String string = getString(R$string.f5714d);
kotlin.jvm.internal.s.i(string, "getString(...)");
String string2 = getString(R$string.f5712b);
kotlin.jvm.internal.s.i(string2, "getString(...)");
String string3 = getString(R$string.f5713c);
kotlin.jvm.internal.s.i(string3, "getString(...)");
String string4 = getString(R$string.f5711a);
kotlin.jvm.internal.s.i(string4, "getString(...)");
AlertKufarDialogFragment.Companion.b(companion, string, string2, string3, string4, false, false, 32, null).setOnDismissListener(new q()).setOnCancelListener(new r()).setNegativeListener(s.f5863d).setPositiveClickListener(new t()).show(getChildFragmentManager(), (String) null);
}
public final cb.b getMediator() {
cb.b bVar = this.mediator;
if (bVar != null) {
return bVar;
}
kotlin.jvm.internal.s.B("mediator");
return null;
}
public final r4.a getTracker() {
r4.a aVar = this.tracker;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.s.B("tracker");
return null;
}
public final ViewModelProvider.Factory getViewModelFactory() {
ViewModelProvider.Factory factory = this.viewModelFactory;
if (factory != null) {
return factory;
}
kotlin.jvm.internal.s.B("viewModelFactory");
return null;
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
u4.a b11;
super.onActivityResult(requestCode, resultCode, data);
if (resultCode != -1 || requestCode != 1000 || (b11 = ReasonActivity.INSTANCE.b(data)) == null) {
return;
}
ComplaintVM complaintVM = this.viewModel;
if (complaintVM == null) {
kotlin.jvm.internal.s.B("viewModel");
complaintVM = null;
}
complaintVM.onReasonChoosed(b11);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
kotlin.jvm.internal.s.j(inflater, "inflater");
return inflater.inflate(R$layout.f5708b, container, false);
}
@Override
public void onInject() {
super.onInject();
a.InterfaceC1731a a11 = t4.g.a();
Object obj = m5.a.d(this).get(t4.b.class);
if (obj != null) {
a11.a((t4.b) obj).a(this);
return;
}
throw new NullPointerException("null cannot be cast to non-null type by.kufar.complaint.di.ComplaintDependencies");
}
@Override
public void onStart() {
super.onStart();
getTracker().a();
getTracker().b();
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
kotlin.jvm.internal.s.j(view, "view");
super.onViewCreated(view, savedInstanceState);
setUpViewModel();
setUpActions();
}
public final void setMediator(cb.b bVar) {
kotlin.jvm.internal.s.j(bVar, "<set-?>");
this.mediator = bVar;
}
public final void setTracker(r4.a aVar) {
kotlin.jvm.internal.s.j(aVar, "<set-?>");
this.tracker = aVar;
}
public final void setViewModelFactory(ViewModelProvider.Factory factory) {
kotlin.jvm.internal.s.j(factory, "<set-?>");
this.viewModelFactory = factory;
}
}