正在查看: Hopscotch v9.7.2 应用的 MomentDetailActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Hopscotch v9.7.2 应用的 MomentDetailActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package in.hopscotch.android.activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;
import androidx.core.graphics.drawable.a;
import androidx.recyclerview.widget.GridLayoutManager;
import in.hopscotch.android.api.model.MomentsPhotos;
import in.hopscotch.android.api.response.ActionResponse;
import in.hopscotch.android.api.response.MomentPhotoDetailResponse;
import in.hopscotch.android.attribution.AttributionData;
import in.hopscotch.android.attribution.OrderAttributionHelper;
import in.hopscotch.android.databinding.kc;
import in.hopscotch.android.databinding.sc;
import in.hopscotch.android.listener.k;
import in.hopscotch.android.model.UserStatus;
import in.hopscotch.android.util.k1;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
public class MomentDetailActivity extends in.hopscotch.android.activity.base.a implements k.a, View.OnClickListener {
private static final int REPORT_ACTIVITY_REQUEST_CODE = 10;
private static final String TAG = "MomentDetailActivity";
private Drawable backArrow;
private String deepLinkPhotoId;
private boolean heartIconStatusChange;
private boolean heartStatus;
private boolean isFromSpecialPage;
private in.hopscotch.android.listener.k itemScrollListener;
private AttributionData localAttributionData;
private in.hopscotch.android.adapter.u mAdapter;
private sc mBinding;
private in.hopscotch.android.viewmodel.moments.g momentDetailViewModel;
private MomentsPhotos momentPhotoDetails;
private int SPAN_SIZE = 2;
private int clickedItemPosition = -1;
public class a extends GridLayoutManager.c {
public a() {
}
public final int f(int i) {
MomentDetailActivity momentDetailActivity = MomentDetailActivity.this;
int m = momentDetailActivity.mAdapter.m(i);
momentDetailActivity.getClass();
return m != 3 ? 2 : 1;
}
}
@Override
public final void B0() {
}
public final void O() {
}
public final void a0(int i) {
}
@Override
public final void b0() {
}
public final void c1(ActionResponse actionResponse) {
HashMap hashMap = new HashMap();
hashMap.put("from_screen", getString(2132018728));
in.hopscotch.android.viewmodel.moments.g gVar = this.momentDetailViewModel;
if (gVar != null) {
if (gVar.E() != -1) {
hashMap.put("photo_id", Integer.valueOf(this.momentDetailViewModel.E()));
}
if (!TextUtils.isEmpty(this.momentDetailViewModel.F())) {
hashMap.put("photo_source", this.momentDetailViewModel.F());
}
if (!TextUtils.isEmpty(this.momentDetailViewModel.a0())) {
hashMap.put("photo_status", this.momentDetailViewModel.a0());
}
if (this.momentDetailViewModel.w() != 0) {
hashMap.put("uploaded_date", new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH).format(new Date(this.momentDetailViewModel.w())));
}
com.google.android.gms.internal.icing.v1.f("photo_deleted", hashMap, false, true);
}
Intent intent = new Intent();
intent.putExtra("DELETE_RESPONSE", actionResponse);
setResult(-1, intent);
finish();
}
public final void d1() {
kc kcVar;
in.hopscotch.android.adapter.u uVar = this.mAdapter;
if (uVar == null || (kcVar = uVar.f) == null) {
return;
}
kcVar.e.setClickable(false);
uVar.f.d.setClickable(false);
}
public final void e1(boolean z) {
in.hopscotch.android.adapter.u uVar = this.mAdapter;
if (uVar != null) {
kc kcVar = uVar.f;
if (kcVar != null) {
kcVar.e.setClickable(true);
uVar.f.d.setClickable(true);
}
this.heartStatus = z;
this.heartIconStatusChange = true;
}
}
public final void f0() {
}
public final void f1() {
if (this.mAdapter == null) {
this.mAdapter = new in.hopscotch.android.adapter.u(this, this.momentDetailViewModel, this);
in.hopscotch.android.viewmodel.moments.g gVar = this.momentDetailViewModel;
if (gVar != null && gVar.b0() != null) {
this.mBinding.g.setBackgroundColor(androidx.core.content.a.b(this, 2131100828));
}
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, this.SPAN_SIZE);
this.mBinding.g.setLayoutManager(gridLayoutManager);
this.mBinding.g.setAdapter(this.mAdapter);
in.hopscotch.android.listener.k kVar = new in.hopscotch.android.listener.k(this);
this.itemScrollListener = kVar;
this.mBinding.g.m(kVar);
this.mBinding.g0(this.momentDetailViewModel);
gridLayoutManager.x = new a();
}
MomentsPhotos momentsPhotos = this.momentPhotoDetails;
if (momentsPhotos == null || momentsPhotos.statusMessage == null) {
return;
}
if (momentsPhotos.status.equalsIgnoreCase("REJECTED")) {
this.mBinding.d.setVisibility(0);
} else if (this.momentPhotoDetails.status.equalsIgnoreCase("PENDING")) {
this.mBinding.d.setVisibility(0);
} else {
this.mBinding.d.setVisibility(8);
}
}
public final void g1() {
Intent intent = new Intent((Context) this, (Class<?>) MomentsCustomerLikeActivity.class);
intent.putExtra("MOMENT_PHOTO_ID", this.momentDetailViewModel.E());
startActivity(intent);
}
public final void h0(boolean z) {
}
public final void h1(boolean z) {
in.hopscotch.android.adapter.u uVar = this.mAdapter;
if (uVar != null) {
uVar.S(z);
}
}
public final void i1() {
in.hopscotch.android.adapter.u uVar = this.mAdapter;
if (uVar != null) {
uVar.R(false);
}
}
public final void j1() {
in.hopscotch.android.adapter.u uVar = this.mAdapter;
if (uVar != null) {
uVar.T();
}
}
public final void k0(int i, int i2) {
boolean z = i > 0;
this.mBinding.f.setBackgroundColor(Color.argb(z ? 255 : 0, 255, 255, 255));
try {
if (z) {
this.backArrow.setColorFilter(getResources().getColor(2131100826), PorterDuff.Mode.SRC_ATOP);
} else {
this.backArrow.clearColorFilter();
}
getSupportActionBar().B(this.backArrow);
} catch (Exception e) {
in.hopscotch.android.util.g.b(e);
}
}
public final void k1() {
in.hopscotch.android.adapter.u uVar = this.mAdapter;
if (uVar != null) {
uVar.U();
}
}
public final void l1() {
Intent intent = new Intent((Context) this, (Class<?>) MomentReportActivity.class);
intent.putExtra("REPORT_IMAGE_URL", this.momentDetailViewModel.L());
intent.putExtra("REPORT_IMAGE_SOURCE", this.momentDetailViewModel.F());
intent.putExtra("REPORT_IMAGE_STATUS", this.momentDetailViewModel.a0());
intent.putExtra("MOMENT_PHOTO_ID", this.momentDetailViewModel.E());
startActivityForResult(intent, 10);
}
public final void m1(MomentPhotoDetailResponse momentPhotoDetailResponse) {
String stringExtra;
String stringExtra2;
int i;
f1();
in.hopscotch.android.adapter.u uVar = this.mAdapter;
uVar.q(uVar.Q() != 5 ? 2 : 1);
this.mAdapter.Y(this.momentDetailViewModel.Y());
this.mAdapter.V();
this.mAdapter.W();
this.mAdapter.q(1);
if (momentPhotoDetailResponse != null) {
if (getIntent().getBooleanExtra("MOMENT_DETAIL", false)) {
stringExtra = getString(2132018054);
stringExtra2 = getIntent().getStringExtra("FROM_SCREEN");
getIntent().getIntExtra("custom_tile_id", -1);
i = getIntent().getIntExtra("position", -1);
if (i == 0) {
i = 1;
}
} else {
stringExtra = getIntent().getStringExtra("from_location");
stringExtra2 = getIntent().getStringExtra("FROM_SCREEN");
int i2 = this.clickedItemPosition;
i = i2 != -1 ? i2 + 1 : -1;
}
int i3 = momentPhotoDetailResponse.id;
String str = momentPhotoDetailResponse.source;
String str2 = momentPhotoDetailResponse.uploaderId;
boolean z = momentPhotoDetailResponse.isPopular;
HashMap hashMap = new HashMap();
if (!TextUtils.isEmpty(stringExtra2)) {
hashMap.put("from_screen", stringExtra2);
}
if (!TextUtils.isEmpty(stringExtra)) {
hashMap.put("from_location", stringExtra);
}
if (i != -1) {
if (i == 0) {
i = 1;
}
hashMap.put("position", Integer.valueOf(i));
}
if (i3 != -1) {
hashMap.put("photo_id", Integer.valueOf(i3));
}
if (!TextUtils.isEmpty(str)) {
hashMap.put("photo_source", str);
}
if (!TextUtils.isEmpty(str2)) {
hashMap.put("photo_from", str2);
}
hashMap.put("photo_type", z ? "Popular" : "Recent");
if (in.hopscotch.android.util.a1.a()) {
in.hopscotch.android.analytics.a.d().a("First screen");
}
in.hopscotch.android.analytics.c.m().B("Photo details");
in.hopscotch.android.analytics.c.m().getClass();
in.hopscotch.android.analytics.c.I("photo_viewed", hashMap, true, true);
}
}
public final void n1() {
in.hopscotch.android.adapter.u uVar = this.mAdapter;
if (uVar != null) {
uVar.X();
}
}
@Override
public final void onActivityResult(int i, int i2, Intent intent) {
in.hopscotch.android.viewmodel.moments.g gVar;
if (i == 10 && i2 == -1) {
setResult(-1, intent);
finish();
}
if (i == 2044 && UserStatus.getInstance().getLoginStatus() && (gVar = this.momentDetailViewModel) != null) {
gVar.o0();
}
}
public final void onBackPressed() {
boolean z;
Intent intent = new Intent();
if (this.clickedItemPosition != -1 && (z = this.heartIconStatusChange)) {
intent.putExtra("HEART_ICON_STATUS_CHANGE", z);
intent.putExtra("position", this.clickedItemPosition);
intent.putExtra("HEART_STATUS", this.heartStatus);
setResult(-1, intent);
}
finish();
}
@Override
public void onClick(View view) {
in.hopscotch.android.viewmodel.moments.g gVar;
if (view.getId() != 2131363471 || (gVar = this.momentDetailViewModel) == null || TextUtils.isEmpty(gVar.Z())) {
return;
}
in.hopscotch.android.viewmodel.moments.g gVar2 = this.momentDetailViewModel;
gVar2.n0(gVar2.E());
this.l = this.momentDetailViewModel.Z() + "\n" + in.hopscotch.android.util.a1.k("moment/" + this.momentDetailViewModel.E(), "moment_shared", true);
this.j = getString(2132019119);
this.m = this.momentDetailViewModel.L();
a1();
}
@Override
public final void onCreate(Bundle bundle) {
MomentsPhotos momentsPhotos;
super.onCreate(bundle);
this.localAttributionData = OrderAttributionHelper.getInstance().getCurrentAttributionData();
this.mBinding = (sc) androidx.databinding.g.h(this, 2131558888);
this.momentDetailViewModel = new in.hopscotch.android.viewmodel.moments.g(this);
if (getIntent() != null) {
this.momentPhotoDetails = (MomentsPhotos) getIntent().getSerializableExtra("MOMENT_PHOTO_DETAILS");
this.deepLinkPhotoId = getIntent().getStringExtra("photo_id");
if (getIntent().hasExtra("MOMENT_DETAIL_FROM_SPL_PAGE")) {
this.isFromSpecialPage = getIntent().getBooleanExtra("MOMENT_DETAIL_FROM_SPL_PAGE", false);
}
in.hopscotch.android.viewmodel.moments.g gVar = this.momentDetailViewModel;
if (gVar == null || (momentsPhotos = this.momentPhotoDetails) == null) {
String str = this.deepLinkPhotoId;
if (str != null) {
gVar.X(Integer.parseInt(str));
this.momentDetailViewModel.s0(this.momentPhotoDetails);
}
} else {
gVar.X(momentsPhotos.id);
this.momentDetailViewModel.s0(this.momentPhotoDetails);
int intExtra = getIntent().getIntExtra("CLICKED_ITEM_POSITION", -1);
this.clickedItemPosition = intExtra;
this.momentDetailViewModel.r0(intExtra);
}
}
setSupportActionBar(this.mBinding.f);
if (getSupportActionBar() != null) {
getSupportActionBar().t(true);
getSupportActionBar().x(false);
getSupportActionBar().C(true);
this.mBinding.f.setBackgroundColor(Color.argb(0, 255, 255, 255));
try {
Drawable h = androidx.core.graphics.drawable.a.h(getResources().getDrawable(2131231388).mutate());
this.backArrow = h;
a.a.g(h, getResources().getColor(2131100828));
getSupportActionBar().B(this.backArrow);
} catch (Exception e) {
in.hopscotch.android.util.g.b(e);
}
}
if (this.deepLinkPhotoId == null) {
f1();
}
}
@Override
public final void onDestroy() {
this.mBinding.g.r0(this.itemScrollListener);
super.onDestroy();
}
public final boolean onOptionsItemSelected(MenuItem menuItem) {
if (menuItem.getItemId() != 16908332) {
return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
}
if (this.deepLinkPhotoId != null && !this.isFromSpecialPage) {
startActivity(in.hopscotch.android.application.a0.d(this, getResources().getString(2132018145), getResources().getString(2132018144), true));
finish();
}
onBackPressed();
return true;
}
@Override
public final void onResume() {
in.hopscotch.android.util.k1.a(this, getWindow(), k1.a.STATUS_BAR_BLACK);
super.onResume();
OrderAttributionHelper.getInstance().setCurrentOrderAttributionData(this.localAttributionData);
}
}