package ca.canadapost.module.findrate;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.databinding.n;
import androidx.fragment.app.k;
import ca.canadapost.module.findrate.CarbonEmissionFragment;
import dc.c0;
import dc.h0;
import dn.l;
import kotlin.Metadata;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import n8.e0;
import rm.n0;
import w8.t0;

@Metadata(d1 = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\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\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u000e\n\u0002\b\n\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u001e\u0010\u001fJ\u0012\u0010\u0005\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016J$\u0010\u000b\u001a\u00020\n2\u0006\u0010\u0007\u001a\u00020\u00062\b\u0010\t\u001a\u0004\u0018\u00010\b2\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016J\u001a\u0010\r\u001a\u00020\u00042\u0006\u0010\f\u001a\u00020\n2\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016R\"\u0010\u0015\u001a\u00020\u000e8\u0006@\u0006X\u0086.¢\u0006\u0012\n\u0004\b\u000f\u0010\u0010\u001a\u0004\b\u0011\u0010\u0012\"\u0004\b\u0013\u0010\u0014R\"\u0010\u001d\u001a\u00020\u00168\u0006@\u0006X\u0086.¢\u0006\u0012\n\u0004\b\u0017\u0010\u0018\u001a\u0004\b\u0019\u0010\u001a\"\u0004\b\u001b\u0010\u001c¨\u0006 "}, d2 = {"Lca/canadapost/module/findrate/CarbonEmissionFragment;", "Landroidx/fragment/app/f;", "Landroid/os/Bundle;", "savedInstanceState", "Lrm/n0;", "onCreate", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/view/View;", "onCreateView", "view", "onViewCreated", "Lec/g;", "p", "Lec/g;", "y", "()Lec/g;", "B", "(Lec/g;)V", "binding", "", "q", "Ljava/lang/String;", "z", "()Ljava/lang/String;", "C", "(Ljava/lang/String;)V", "emissionValue", "<init>", "()V", "findrate_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class CarbonEmissionFragment extends androidx.fragment.app.f {

    /* renamed from: p, reason: collision with root package name and from kotlin metadata */
    public ec.g binding;

    /* renamed from: q, reason: collision with root package name and from kotlin metadata */
    public String emissionValue;

    /* loaded from: classes4.dex */
    static final class a extends v implements l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ k f9141p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(k kVar) {
            super(1);
            this.f9141p = kVar;
        }

        public final void a(Toolbar setNavigationIcon) {
            t.g(setNavigationIcon, "$this$setNavigationIcon");
            setNavigationIcon.setNavigationIcon(c0.f15968a);
            setNavigationIcon.setNavigationContentDescription(this.f9141p.getString(h0.I0));
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Toolbar) obj);
            return n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void A(CarbonEmissionFragment this$0, View view) {
        t.g(this$0, "this$0");
        e0.a aVar = e0.f29852a;
        k requireActivity = this$0.requireActivity();
        t.f(requireActivity, "requireActivity(...)");
        String string = this$0.getString(h0.f16070c);
        t.f(string, "getString(...)");
        aVar.a(requireActivity, string);
    }

    public final void B(ec.g gVar) {
        t.g(gVar, "<set-?>");
        this.binding = gVar;
    }

    public final void C(String str) {
        t.g(str, "<set-?>");
        this.emissionValue = str;
    }

    @Override // androidx.fragment.app.f
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        Bundle arguments = getArguments();
        String string = arguments != null ? arguments.getString("ARG_EMISSION_KEY") : null;
        if (string == null) {
            string = "0.00";
        }
        C(string);
    }

    @Override // androidx.fragment.app.f
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        t.g(inflater, "inflater");
        n h10 = androidx.databinding.f.h(inflater, dc.e0.f16040e, container, false);
        t.f(h10, "inflate(...)");
        B((ec.g) h10);
        y().O(getViewLifecycleOwner());
        View x10 = y().x();
        t.f(x10, "getRoot(...)");
        return x10;
    }

    @Override // androidx.fragment.app.f
    public void onViewCreated(View view, Bundle bundle) {
        t.g(view, "view");
        k activity = getActivity();
        if (activity != null) {
            activity.setTitle(activity.getString(h0.f16073d));
            FindRateActivity findRateActivity = (FindRateActivity) activity;
            findRateActivity.q0(c0.f15969b, new a(activity));
            Toolbar m02 = findRateActivity.m0();
            if (m02 != null) {
                m02.setNavigationContentDescription(activity.getString(h0.J0));
            }
        }
        TextView textView = y().A;
        int i10 = h0.f16076e;
        String z10 = z();
        Context requireContext = requireContext();
        t.f(requireContext, "requireContext(...)");
        textView.setText(getString(i10, t0.a(z10, requireContext)));
        TextView textView2 = y().A;
        int i11 = h0.f16097l;
        String z11 = z();
        Context requireContext2 = requireContext();
        t.f(requireContext2, "requireContext(...)");
        textView2.setContentDescription(getString(i11, t0.a(z11, requireContext2)));
        y().B.setOnClickListener(new View.OnClickListener() { // from class: dc.b
            @Override // android.view.View.OnClickListener
            public final void onClick(View view2) {
                CarbonEmissionFragment.A(CarbonEmissionFragment.this, view2);
            }
        });
        super.onViewCreated(view, bundle);
    }

    public final ec.g y() {
        ec.g gVar = this.binding;
        if (gVar != null) {
            return gVar;
        }
        t.y("binding");
        return null;
    }

    public final String z() {
        String str = this.emissionValue;
        if (str != null) {
            return str;
        }
        t.y("emissionValue");
        return null;
    }
}
