导航菜单

页面标题

页面副标题

OLX India v19.42.007 - O2OChatActivity.java 源代码

正在查看: OLX India v19.42.007 应用的 O2OChatActivity.java JAVA 源代码文件

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


package com.naspers.ragnarok.ui.activity;

import android.os.Bundle;
import android.widget.TextView;
import com.naspers.ragnarok.common.a;
import com.naspers.ragnarok.data.R;
import com.naspers.ragnarok.databinding.o1;
import com.naspers.ragnarok.domain.constant.Constants;
import com.naspers.ragnarok.domain.entity.chat.ChatAd;
import com.naspers.ragnarok.domain.entity.message.MessageCTA;
import com.naspers.ragnarok.domain.entity.message.MessageCTAAction;
import com.naspers.ragnarok.domain.entity.recommendedprice.ChatAdWithRecommendPrice;
import com.naspers.ragnarok.domain.o2oChat.O2OPresenter;
import com.naspers.ragnarok.e;
import com.naspers.ragnarok.universal.ui.ui.util.common.f;
import com.naspers.ragnarok.universal.ui.ui.util.imageLoader.c;
import com.naspers.ragnarok.universal.ui.ui.widget.message.MessageCTAViewGroup;
import com.naspers.ragnarok.universal.ui.ui.widget.message.b;
import java.util.Arrays;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.internal.StringCompanionObject;

@Metadata
public class O2OChatActivity extends com.naspers.ragnarok.universal.ui.ui.base.a {
    private c R;
    public O2OPresenter S;
    private ChatAdWithRecommendPrice T;
    private com.naspers.ragnarok.common.util.a U;

    public static final class a implements b {

        public class C0016a {
            public static final int[] $EnumSwitchMapping$0;

            static {
                int[] iArr = new int[MessageCTAAction.values().length];
                try {
                    iArr[MessageCTAAction.SETUP_MEETING.ordinal()] = 1;
                } catch (NoSuchFieldError unused) {
                }
                try {
                    iArr[MessageCTAAction.REQUEST_CALL.ordinal()] = 2;
                } catch (NoSuchFieldError unused2) {
                }
                $EnumSwitchMapping$0 = iArr;
            }
        }

        a() {
        }

        @Override
        public void e(MessageCTA messageCTA) {
            int i = C0016a.$EnumSwitchMapping$0[messageCTA.getAction().ordinal()];
            if (i == 1) {
                O2OChatActivity.this.p2().trackO2OHeaderTabCTA("book appoitnment");
                O2OChatActivity o2OChatActivity = O2OChatActivity.this;
                o2OChatActivity.q2(o2OChatActivity.T.getChatAd());
            } else {
                if (i != 2) {
                    return;
                }
                O2OChatActivity.this.p2().trackO2OHeaderTabCTA("get_callback");
                O2OChatActivity o2OChatActivity2 = O2OChatActivity.this;
                o2OChatActivity2.r2(o2OChatActivity2.T.getChatAd(), O2OChatActivity.this.p2().getRecommendedPrice());
            }
        }
    }

    private final List o2() {
        return CollectionsKt.g(new MessageCTA[]{new MessageCTA(getResources().getString(R.string.ragnarok_continue_booking), MessageCTAAction.SETUP_MEETING, false, 0, 0, 0, 60, null), new MessageCTA(getResources().getString(R.string.ragnarok_get_callback), MessageCTAAction.REQUEST_CALL, false, 0, 0, 0, 60, null)});
    }

    private final void s2() {
        MessageCTAViewGroup messageCTAViewGroup = ((o1) this.Q).F;
        messageCTAViewGroup.c(o2());
        messageCTAViewGroup.g(true);
        messageCTAViewGroup.b(new a());
    }

    private final void u2() {
        ((o1) this.Q).A.E.setText(this.T.getChatAd().getTitle());
        ((o1) this.Q).A.G.setText((this.T.getRecommendPrice().getCurrency().getSymbol() + Constants.SPACE_STRING + this.T.getRecommendPrice().getMin()) + " - " + (this.T.getRecommendPrice().getCurrency().getSymbol() + Constants.SPACE_STRING + this.T.getRecommendPrice().getMax()) + "*");
        ((o1) this.Q).G.C.setText(getResources().getString(R.string.ragnarok_olx_offer));
        TextView textView = ((o1) this.Q).G.D;
        com.naspers.ragnarok.common.util.a aVar = this.U;
        if (aVar == null) {
            aVar = null;
        }
        textView.setText(aVar.f(System.currentTimeMillis()));
        TextView textView2 = ((o1) this.Q).B.C;
        StringCompanionObject stringCompanionObject = StringCompanionObject.a;
        textView2.setText(String.format(getString(R.string.ragnarok_hi_label), Arrays.copyOf(new Object[]{com.naspers.ragnarok.core.util.naspers.a.h(com.naspers.ragnarok.common.a.C.a().C().i().e())}, 1)));
        TextView textView3 = ((o1) this.Q).B.D;
        com.naspers.ragnarok.common.util.a aVar2 = this.U;
        textView3.setText((aVar2 != null ? aVar2 : null).f(System.currentTimeMillis()));
        ((o1) this.Q).G.B.setVisibility(0);
    }

    @Override
    protected int k2() {
        return e.ragnarok_o2o_chat;
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        a.a aVar = com.naspers.ragnarok.common.a.C;
        this.R = aVar.a().w().h0();
        this.U = aVar.a().w().h();
        t2(aVar.a().w().F());
        ChatAdWithRecommendPrice chatAdWithRecommendPrice = p2().getChatAdWithRecommendPrice();
        this.T = chatAdWithRecommendPrice;
        if (chatAdWithRecommendPrice == null || chatAdWithRecommendPrice.getRecommendPrice() == null || !p2().shouldShowO2OBanner()) {
            finish();
            return;
        }
        v2();
        w2();
        u2();
        s2();
    }

    public boolean onSupportNavigateUp() {
        onBackPressed();
        return true;
    }

    public final O2OPresenter p2() {
        O2OPresenter o2OPresenter = this.S;
        if (o2OPresenter != null) {
            return o2OPresenter;
        }
        return null;
    }

    public void q2(ChatAd chatAd) {
    }

    public void r2(ChatAd chatAd, String str) {
    }

    public final void t2(O2OPresenter o2OPresenter) {
        this.S = o2OPresenter;
    }

    protected final void v2() {
        ((o1) this.Q).H.setNavigationIcon(R.drawable.ragnarok_back_arrow);
        ((o1) this.Q).H.setContentInsetStartWithNavigation(0);
        ((o1) this.Q).H.setContentInsetsRelative(0, 0);
        setSupportActionBar(((o1) this.Q).H);
        getSupportActionBar().w(true);
        getSupportActionBar().B(true);
        getSupportActionBar().E("");
        ((o1) this.Q).H.setElevation(getResources().getDimensionPixelSize(com.naspers.ragnarok.b.default_elevation));
    }

    protected final void w2() {
        c cVar = this.R;
        if (cVar != null) {
            f.g(cVar, ((o1) this.Q).C, this.T.getChatAd());
        }
        c cVar2 = this.R;
        if (cVar2 != null) {
            f.l(cVar2, ((o1) this.Q).D, com.naspers.ragnarok.common.a.C.a().C().i());
        }
    }
}