正在查看: OLX India v19.42.007 应用的 ItemDetailsActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: OLX India v19.42.007 应用的 ItemDetailsActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.olxgroup.panamera.app.buyers.adDetails.activities;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import com.google.gson.Gson;
import com.naspers.ragnarok.domain.constant.Constants;
import com.olxgroup.panamera.app.buyers.adDetails.fragments.MyItemDetailsFragment;
import com.olxgroup.panamera.app.buyers.adDetails.fragments.MyItemDetailsFragmentV2;
import com.olxgroup.panamera.app.buyers.adDetails.fragments.OtherItemDetailsFragment;
import com.olxgroup.panamera.app.buyers.adDetails.fragments.OtherItemDetailsFragmentV2;
import com.olxgroup.panamera.app.buyers.c2b.entities.AdItemDetailBundle;
import com.olxgroup.panamera.app.common.infra.m2;
import com.olxgroup.panamera.app.common.utils.m0;
import com.olxgroup.panamera.app.common.viewModels.h;
import com.olxgroup.panamera.domain.buyers.addetails.repository.ADPTrackingService;
import com.olxgroup.panamera.domain.buyers.common.entity.AdWidget;
import com.olxgroup.panamera.domain.buyers.common.entity.ad.AdItem;
import com.olxgroup.panamera.domain.common.tracking.repository.TrackingContextRepository;
import com.olxgroup.panamera.domain.users.profile.tracking.ProfileTrackingService;
import olx.com.delorean.domain.repository.DeeplinkExternalService;
import olx.com.delorean.domain.tracking.BrowseMode;
import olx.com.delorean.domain.utils.TextUtils;
public class ItemDetailsActivity extends m {
private Boolean A0;
private String B0;
private String C0;
private boolean D0;
private String E0;
private Boolean F0;
protected Fragment i0;
protected com.olxgroup.panamera.app.buyers.adDetails.viewModels.w j0;
protected com.olxgroup.panamera.app.buyers.c2b.viewModel.d k0;
Gson l0;
ADPTrackingService m0;
ProfileTrackingService n0;
TrackingContextRepository o0;
DeeplinkExternalService p0;
private boolean q0;
private boolean r0;
private AdItem s0;
private AdItemDetailBundle t0;
private String u0 = "";
private int v0 = -1;
private AdWidget w0;
private String x0;
private String y0;
private BrowseMode z0;
public ItemDetailsActivity() {
Boolean bool = Boolean.FALSE;
this.A0 = bool;
this.C0 = "";
this.D0 = false;
this.F0 = bool;
}
public void E3(AdItem adItem) {
if (adItem != null) {
z3(adItem);
}
}
public void F3(h.b bVar) {
if (bVar instanceof h.b.C0265b) {
m0.a(ItemDetailsActivity.class.getName(), ((h.b.C0265b) bVar).b().getMessage());
finish();
}
}
private void I3() {
this.j0.d1().observe(this, new Observer() {
public final void onChanged(Object obj) {
ItemDetailsActivity.this.E3((AdItem) obj);
}
});
}
private void J3() {
this.j0.v0().observe(this, new Observer() {
public final void onChanged(Object obj) {
ItemDetailsActivity.this.F3((h.b) obj);
}
});
}
private void M3() {
Intent intent = new Intent();
intent.putExtra("wishlist_updated", this.k0.C0());
setResult(-1, intent);
}
private void N3() {
AdItem adItem = this.s0;
if (adItem == null || adItem.getInspectionInfo() == null || !this.s0.getInspectionInfo().isPending()) {
return;
}
this.m0.trackItemDetailConsent("inspection_details_to_ad_tap_back", this.s0.getId(), this.s0.getCategoryId(), this.n0.getProfileOrigin(), this.q0 ? "inspection_details_to_new_ad" : "inspection_details_to_existing_ad");
}
private Fragment v3(AdItem adItem) {
return this.j0.b2(this.s0.getCategoryId()) ? adItem.isMyAd(com.olxgroup.panamera.app.common.helpers.l.z0()) ? MyItemDetailsFragmentV2.R8(this.q0, this.r0) : new OtherItemDetailsFragmentV2() : adItem.isMyAd(com.olxgroup.panamera.app.common.helpers.l.z0()) ? MyItemDetailsFragment.M7(this.q0) : new OtherItemDetailsFragment();
}
private void z3(AdItem adItem) {
AdWidget adWidget = this.w0;
if (adWidget != null) {
adItem.setFeedVersion(adWidget.getFeedVersion());
adItem.setSpell(this.w0.getSpell());
} else {
AdItem adItem2 = this.s0;
if (adItem2 != null) {
adItem.setFeedVersion(adItem2.getFeedVersion());
adItem.setSpell(this.s0.getSpell());
}
}
if (this.j0.d2(adItem)) {
if (this.j0.R1(adItem)) {
adItem.initializeGalleryImageListWithSequencingExp();
} else {
adItem.initilizeGalleryImagesWithoutExp();
}
}
L3(adItem);
this.D0 = true;
G3();
findViewById(com.olx.southasia.i.loading).setVisibility(8);
}
public boolean A3() {
AdWidget adWidget = this.w0;
if (adWidget != null) {
return adWidget.isSuggested();
}
return false;
}
public boolean B3() {
return this.j0.Q1(this.s0);
}
public Boolean C3() {
return this.F0;
}
public void G3() {
Fragment v3 = v3(this.s0);
this.i0 = v3;
v3.setArguments(getIntent().getExtras());
V2(this.i0);
}
public void K3() {
AdItem adItem = this.s0;
if (adItem != null && this.j0.b2(adItem.getCategoryId())) {
if (this.j0.d2(this.s0)) {
ADPTrackingService aDPTrackingService = this.m0;
AdItem adItem2 = this.s0;
aDPTrackingService.viewItemInspected(adItem2, com.olxgroup.panamera.app.common.utils.social.a.a(adItem2.getUserId()), "feedVersion", t3(), A3());
} else {
ADPTrackingService aDPTrackingService2 = this.m0;
AdItem adItem3 = this.s0;
aDPTrackingService2.viewItemNonInspected(adItem3, com.olxgroup.panamera.app.common.utils.social.a.a(adItem3.getUserId()), "feedVersion", t3(), A3());
}
if (this.s0.getUser() != null && this.j0.a2(this.s0)) {
this.m0.viewItemB2C(Constants.ExtraValues.ADPV, "feedVersion", t3());
}
}
this.j0.V1(com.olxgroup.panamera.app.common.helpers.l.z0());
}
public void L3(AdItem adItem) {
com.olxgroup.panamera.app.buyers.common.a.a.b(adItem);
this.s0 = adItem;
}
@Override
protected int N2() {
return com.olx.southasia.e.background_white;
}
protected void attachBaseContext(Context context) {
if (m2.a.s1().b()) {
context = com.olxgroup.panamera.app.common.utils.locale.d.h().w(context);
}
super.attachBaseContext(context);
}
@Override
protected void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
if (com.olxgroup.panamera.app.common.activities.c.p2(i) && i2 == -1) {
G3();
}
Fragment fragment = this.i0;
if (fragment == null || !fragment.isAdded()) {
return;
}
this.i0.onActivityResult(i, i2, intent);
}
@Override
public void onBackPressed() {
String categoryId;
M3();
finish();
AdItem adItem = this.s0;
if (adItem == null || adItem.getCategoryId() == null) {
AdWidget adWidget = this.w0;
categoryId = (adWidget == null || adWidget.getCategoryId() == null) ? "" : this.w0.getCategoryId();
} else {
categoryId = this.s0.getCategoryId();
}
if (this.A0.booleanValue() && this.j0.Y1(categoryId)) {
this.m0.trackREBackButton(categoryId);
startActivity(olx.com.delorean.a.a0(categoryId, "back_button"));
}
q2();
K3();
N3();
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
a3();
q2();
M2().setBackgroundResource(com.olx.southasia.g.action_bar_background_gradient);
n3(false);
h3(com.olx.southasia.g.ic_back_white);
this.q0 = getIntent().getBooleanExtra("new_ad", false);
this.r0 = getIntent().getBooleanExtra("ad_preview", false);
this.u0 = getIntent().getStringExtra("home_carousel");
this.E0 = getIntent().getStringExtra("widget_type");
this.v0 = getIntent().getIntExtra("position", -1);
this.j0 = (com.olxgroup.panamera.app.buyers.adDetails.viewModels.w) new ViewModelProvider(this).get(com.olxgroup.panamera.app.buyers.adDetails.viewModels.w.class);
this.k0 = (com.olxgroup.panamera.app.buyers.c2b.viewModel.d) new ViewModelProvider(this).get(com.olxgroup.panamera.app.buyers.c2b.viewModel.d.class);
if (bundle == null || !bundle.containsKey(Constants.ExtraKeys.ITEM_DETAILS_AD_EXTRA)) {
if (getIntent().hasExtra("adWidgetExtra")) {
AdWidget adWidget = (AdWidget) this.l0.fromJson(getIntent().getStringExtra("adWidgetExtra"), AdWidget.class);
this.w0 = adWidget;
this.x0 = adWidget.getId();
this.y0 = this.w0.getLocation();
this.B0 = this.w0.getCategoryId();
} else if (getIntent().hasExtra(Constants.ExtraKeys.ITEM_DETAILS_AD_EXTRA)) {
AdItem serializableExtra = getIntent().getSerializableExtra(Constants.ExtraKeys.ITEM_DETAILS_AD_EXTRA);
this.s0 = serializableExtra;
this.x0 = serializableExtra.getId();
this.y0 = this.s0.getLocationString();
this.B0 = this.s0.getCategoryId();
}
if (getIntent().hasExtra("browse_mode")) {
this.z0 = getIntent().getSerializableExtra("browse_mode");
}
if (getIntent().hasExtra("shouldLandToListing")) {
this.A0 = (Boolean) getIntent().getSerializableExtra("shouldLandToListing");
}
if (getIntent().hasExtra(Constants.Intent.Extra.SELECT_FROM)) {
this.C0 = (String) getIntent().getSerializableExtra(Constants.Intent.Extra.SELECT_FROM);
}
if (getIntent().hasExtra(Constants.ExtraKeys.FLOW_TYPE)) {
this.F0 = (Boolean) getIntent().getSerializableExtra(Constants.ExtraKeys.FLOW_TYPE);
}
if (getIntent().hasExtra(Constants.Intent.Extra.C2B_AD_ITEM_DETAIL)) {
this.t0 = (AdItemDetailBundle) getIntent().getParcelableExtra(Constants.Intent.Extra.C2B_AD_ITEM_DETAIL);
}
} else {
if (getIntent().hasExtra("adWidgetExtra")) {
this.w0 = (AdWidget) this.l0.fromJson(getIntent().getStringExtra("adWidgetExtra"), AdWidget.class);
}
AdItem serializable = bundle.getSerializable(Constants.ExtraKeys.ITEM_DETAILS_AD_EXTRA);
this.s0 = serializable;
this.x0 = serializable.getId();
this.y0 = bundle.getString("location");
if (bundle.containsKey("browse_mode")) {
this.z0 = bundle.getSerializable("browse_mode");
}
if (bundle.containsKey("shouldLandToListing")) {
this.A0 = (Boolean) bundle.getSerializable("shouldLandToListing");
}
if (bundle.containsKey(Constants.Intent.Extra.C2B_AD_ITEM_DETAIL)) {
this.t0 = (AdItemDetailBundle) getIntent().getParcelableExtra(Constants.Intent.Extra.C2B_AD_ITEM_DETAIL);
}
}
AdItemDetailBundle adItemDetailBundle = this.t0;
if (adItemDetailBundle != null) {
this.k0.F0(adItemDetailBundle);
}
findViewById(com.olx.southasia.i.loading).setVisibility(0);
J3();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
if (!this.D0) {
String str = this.x0;
if (str != null) {
this.j0.T1(str, B3());
}
I3();
}
this.o0.setOriginC2bFlow(Constants.ExtraValues.ADPV);
}
@Override
public void onSaveInstanceState(Bundle bundle) {
AdItem adItem = this.s0;
if (adItem != null) {
bundle.putSerializable(Constants.ExtraKeys.ITEM_DETAILS_AD_EXTRA, adItem);
bundle.putSerializable("location", this.y0);
}
BrowseMode browseMode = this.z0;
if (browseMode != null) {
bundle.putSerializable("browse_mode", browseMode);
}
bundle.putSerializable("shouldLandToListing", this.A0);
super.onSaveInstanceState(bundle);
}
@Override
protected void onStop() {
super.onStop();
}
public String q3() {
String str = this.u0;
return str == null ? "" : str;
}
public AdItem r3() {
return this.s0;
}
public AdWidget s3() {
return this.w0;
}
public BrowseMode t3() {
return this.z0;
}
public int u3() {
return this.v0;
}
public String w3() {
return C3().booleanValue() ? "paid_clm" : "adpage";
}
public String x3() {
if (!TextUtils.isEmpty(this.y0)) {
return this.y0;
}
if (s3() != null) {
this.y0 = s3().getLocation();
} else {
this.y0 = r3().getLocationString();
}
return this.y0;
}
public String y3() {
String str = this.E0;
return str == null ? "" : str;
}
}