导航菜单

页面标题

页面副标题

Hopscotch v9.7.2 - MomentReportActivity.java 源代码

正在查看: Hopscotch v9.7.2 应用的 MomentReportActivity.java JAVA 源代码文件

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


package in.hopscotch.android.activity;

import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.MenuItem;
import android.widget.TextView;
import androidx.appcompat.app.k;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import in.hopscotch.android.api.ApiParam;
import in.hopscotch.android.api.factory.MomentsApiFactory;
import in.hopscotch.android.api.response.ActionResponse;
import in.hopscotch.android.databinding.uc;
import in.hopscotch.android.model.UserStatus;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class MomentReportActivity extends androidx.appcompat.app.i implements in.hopscotch.android.interfaces.j {
    public static final int i = 0;
    private String imageSource;
    private String imageStatus;
    private int momentPhotoId;
    private uc momentReportActivityBinding;
    private in.hopscotch.android.interfaces.j momentReportListeners;
    private in.hopscotch.android.viewmodel.moments.k momentReportViewModel;
    private List<String> optionIndexes = new ArrayList();
    private List<String> optionsList = new ArrayList();
    private int preSelectedPosition = -1;
    private String reportedImageUrl;

    static {
        k.c cVar = androidx.appcompat.app.k.a;
        androidx.appcompat.widget.j1.b();
    }

    public static void R0(MomentReportActivity momentReportActivity, Dialog dialog, int i2) {
        momentReportActivity.preSelectedPosition = i2;
        momentReportActivity.momentReportActivityBinding.i.setText(momentReportActivity.optionsList.get(i2));
        dialog.dismiss();
    }

    public final void E(Map<String, String> map) {
        this.optionIndexes = new ArrayList(map.keySet());
        Iterator<String> it = map.keySet().iterator();
        while (it.hasNext()) {
            this.optionsList.add(map.get(it.next()));
        }
    }

    public final void G0() {
        Dialog dialog = new Dialog(this);
        dialog.requestWindowFeature(1);
        dialog.setContentView(2131558971);
        RecyclerView findViewById = dialog.findViewById(2131363838);
        ((TextView) dialog.findViewById(2131362547)).setText(getString(2132018750));
        List<String> list = this.optionsList;
        if (list != null) {
            in.hopscotch.android.adapter.b0 b0Var = new in.hopscotch.android.adapter.b0(list, this.preSelectedPosition);
            findViewById.setAdapter(b0Var);
            findViewById.setHasFixedSize(true);
            findViewById.setLayoutManager(new LinearLayoutManager(this, 1, false));
            b0Var.p();
        }
        ((TextView) dialog.findViewById(2131363837)).setOnClickListener(new com.google.android.material.datepicker.m(dialog, 3));
        findViewById.l(new in.hopscotch.android.listener.j(this, new androidx.media3.exoplayer.trackselection.i(this, dialog)));
        dialog.setCanceledOnTouchOutside(false);
        dialog.show();
    }

    public final void h() {
        List<String> list;
        if (TextUtils.isEmpty(this.momentReportActivityBinding.f.getText()) && !UserStatus.getInstance().getLoginStatus()) {
            in.hopscotch.android.components.toast.a.d(getApplicationContext(), 2, getString(2132017897));
            return;
        }
        if (TextUtils.isEmpty(this.momentReportActivityBinding.e.getText()) && !UserStatus.getInstance().getLoginStatus()) {
            in.hopscotch.android.components.toast.a.d(getApplicationContext(), 2, getString(2132017895));
            return;
        }
        if (TextUtils.isEmpty(this.momentReportActivityBinding.i.getText())) {
            in.hopscotch.android.components.toast.a.d(getApplicationContext(), 2, getString(2132018750));
            return;
        }
        if (this.momentPhotoId == -1 || (list = this.optionIndexes) == null) {
            return;
        }
        int size = list.size();
        int i2 = this.preSelectedPosition;
        if (size <= i2 || this.optionIndexes.get(i2) == null) {
            return;
        }
        in.hopscotch.android.viewmodel.moments.k kVar = this.momentReportViewModel;
        int i3 = this.momentPhotoId;
        String obj = this.momentReportActivityBinding.f.getText().toString();
        String obj2 = this.momentReportActivityBinding.e.getText().toString();
        String str = this.optionIndexes.get(this.preSelectedPosition);
        String obj3 = this.momentReportActivityBinding.d.getText().toString();
        kVar.getClass();
        HashMap hashMap = new HashMap();
        if (UserStatus.getInstance().getLoginStatus()) {
            obj = UserStatus.getInstance().getUserName();
            if (obj.contains(".")) {
                obj = obj.replace(".", " ");
            }
        }
        hashMap.put("name", obj);
        if (UserStatus.getInstance().getLoginStatus()) {
            obj2 = UserStatus.getInstance().getUserEmail();
        }
        hashMap.put("email", obj2);
        hashMap.put(ApiParam.MomentUploadParam.OPTION_SELECTED, str);
        hashMap.put(ApiParam.MomentUploadParam.COMMENTS, obj3);
        MomentsApiFactory.getInstance().reportPhoto(i3, hashMap, new in.hopscotch.android.viewmodel.moments.j(kVar));
    }

    public final void m0(ActionResponse actionResponse) {
        String obj;
        int i2 = this.momentPhotoId;
        String str = this.imageSource;
        String str2 = this.imageStatus;
        String str3 = this.optionsList.get(this.preSelectedPosition);
        if (UserStatus.getInstance().getLoginStatus()) {
            this.momentReportViewModel.getClass();
            obj = UserStatus.getInstance().getUserEmail();
        } else {
            obj = this.momentReportActivityBinding.e.getText().toString();
        }
        HashMap hashMap = new HashMap();
        hashMap.put("from_screen", getString(2132018728));
        hashMap.put("photo_id", Integer.valueOf(i2));
        hashMap.put("photo_source", str);
        hashMap.put("photo_status", str2);
        hashMap.put("reason", str3);
        hashMap.put("reported_by", obj);
        in.hopscotch.android.analytics.c.m().getClass();
        in.hopscotch.android.analytics.c.I("photo_reported", hashMap, false, true);
        Intent intent = new Intent();
        intent.putExtra("REPORT_RESPONSE", actionResponse);
        setResult(-1, intent);
        finish();
    }

    public final void onCreate(Bundle bundle) {
        super/*androidx.fragment.app.n*/.onCreate(bundle);
        in.hopscotch.android.util.e0.b().h();
        com.google.firebase.crashlytics.c.a().d("ACTIVITY_NAME", getClass().getName());
        this.momentReportActivityBinding = (uc) androidx.databinding.g.h(this, 2131558889);
        if (getIntent() != null) {
            this.reportedImageUrl = getIntent().getStringExtra("REPORT_IMAGE_URL");
            this.imageSource = getIntent().getStringExtra("REPORT_IMAGE_SOURCE");
            this.imageStatus = getIntent().getStringExtra("REPORT_IMAGE_STATUS");
            this.momentPhotoId = getIntent().getIntExtra("MOMENT_PHOTO_ID", -1);
        }
        setSupportActionBar(this.momentReportActivityBinding.j);
        this.momentReportListeners = this;
        in.hopscotch.android.viewmodel.moments.k kVar = new in.hopscotch.android.viewmodel.moments.k(this, this.reportedImageUrl, this.momentReportListeners);
        this.momentReportViewModel = kVar;
        this.momentReportActivityBinding.g0(kVar);
        in.hopscotch.android.viewmodel.moments.k kVar2 = this.momentReportViewModel;
        kVar2.getClass();
        MomentsApiFactory.getInstance().getReportOptions(new in.hopscotch.android.viewmodel.moments.i(kVar2));
        if (getSupportActionBar() != null) {
            getSupportActionBar().F(getString(2132018928));
        }
        this.momentReportActivityBinding.j.setTitleTextColor(androidx.core.content.a.b(this, in.hopscotch.android.components.m.blackish_gray));
        this.momentReportActivityBinding.j.setBackgroundColor(androidx.core.content.a.b(this, 2131100774));
        this.momentReportActivityBinding.j.setNavigationIcon(in.hopscotch.android.components.o.ic_close);
        in.hopscotch.android.analytics.c.m().B("Moment report");
    }

    public final boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() == 16908332) {
            finish();
        }
        return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
    }
}