导航菜单

页面标题

页面副标题

Chaupal v3.2 - d1.java 源代码

正在查看: Chaupal v3.2 应用的 d1.java JAVA 源代码文件

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


package com.yupptv.ott.fragments;

import android.R;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.textfield.TextInputLayout;
import com.yupptv.ott.OTTApplication;
import com.yupptv.ott.models.ItemImage;
import com.yupptv.ottsdk.OttSDK;
import com.yupptv.ottsdk.managers.User.UserManager;
import com.yupptv.ottsdk.model.Error;
import com.yupptv.ottsdk.model.user.PublishedQuestions;
import com.yupptv.ottsdk.model.user.Questions;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;

public class d1 extends l implements AdapterView.OnItemClickListener {
    private OttSDK A;
    private Resources B;
    private LinearLayout C;
    private TextInputLayout D;
    private TextInputLayout E;
    private AutoCompleteTextView F;
    private AutoCompleteTextView G;
    private TextView H;
    private RecyclerView I;
    private h J;
    private List<String> L;
    private List<Questions> O;
    private Activity y;
    private oc.k z;
    private int K = -1;
    private List<String> M = new ArrayList();
    private List<Integer> N = new ArrayList();
    private boolean P = false;
    private boolean Q = false;
    private int R = 0;

    class a implements UserManager.UserCallback<JSONArray> {
        a() {
        }

        @Override
        public void onSuccess(JSONArray jSONArray) {
            d1.this.b0(false);
            if (jSONArray.length() == 0) {
                d1.this.T(true, "You didn't asked any questions yet.", "", null);
                return;
            }
            d1 d1Var = d1.this;
            d1Var.L = d1Var.z0(jSONArray);
            if (d1.this.L.size() <= 0) {
                d1.this.T(true, "You didn't asked any questions yet.", "", null);
                return;
            }
            d1.this.F.setText(((String) d1.this.L.get(0)).trim());
            d1.this.F.setAdapter(new ArrayAdapter((Context) d1.this.getActivity(), R.layout.simple_dropdown_item_1line, d1.this.L));
            d1 d1Var2 = d1.this;
            d1Var2.w0(((String) d1Var2.L.get(0)).trim());
        }

        @Override
        public void onFailure(Error error) {
            d1.this.b0(false);
            d1.this.T(true, error.getMessage(), "", null);
        }
    }

    class b implements UserManager.UserCallback<JSONArray> {
        final String a;

        b(String str) {
            this.a = str;
        }

        @Override
        public void onSuccess(JSONArray jSONArray) {
            d1.this.b0(false);
            if (jSONArray.length() == 0) {
                d1.this.T(true, "You didn't asked any questions yet.", "", null);
                return;
            }
            for (int i = 0; i < jSONArray.length(); i++) {
                try {
                    JSONArray jSONArray2 = jSONArray.getJSONArray(i);
                    if (jSONArray2.get(0).toString().trim().length() > 0) {
                        d1.this.M.add(jSONArray2.get(0).toString().trim());
                        d1.this.N.add((Integer) jSONArray2.get(1));
                    }
                } catch (JSONException unused) {
                }
            }
            if (d1.this.M.size() <= 0 || d1.this.N.size() <= 0) {
                d1.this.T(true, "You didn't asked any questions yet.", "", null);
                return;
            }
            d1.this.G.setText(((String) d1.this.M.get(0)).trim());
            d1.this.G.setAdapter(new ArrayAdapter((Context) d1.this.getActivity(), R.layout.simple_dropdown_item_1line, d1.this.M));
            d1 d1Var = d1.this;
            d1Var.y0(((Integer) d1Var.N.get(0)).toString(), this.a);
        }

        @Override
        public void onFailure(Error error) {
            d1.this.b0(false);
            d1.this.T(true, error.getMessage(), "", null);
        }
    }

    class c implements UserManager.UserCallback<PublishedQuestions> {
        c() {
        }

        @Override
        public void onSuccess(PublishedQuestions publishedQuestions) {
            d1.this.b0(false);
            a aVar = null;
            if (publishedQuestions.getQuestions() != null && publishedQuestions.getQuestions().size() == 0) {
                d1.this.T(true, "You didn't asked any questions yet.", "", null);
                return;
            }
            d1.this.C.setVisibility(0);
            d1.this.H.setText("Chapter Name " + publishedQuestions.getChapterName());
            if (d1.this.O != null) {
                d1.this.O.clear();
            }
            d1.this.O = publishedQuestions.getQuestions();
            d1 d1Var = d1.this;
            d1Var.J = new h(d1Var, aVar);
            d1.this.I.setAdapter(d1.this.J);
        }

        @Override
        public void onFailure(Error error) {
            d1.this.b0(false);
            d1.this.C.setVisibility(8);
            d1.this.T(true, error.getMessage(), "", null);
        }
    }

    class d implements View.OnClickListener {
        d() {
        }

        @Override
        public void onClick(View view) {
            d1.this.P = true;
            d1.this.Q = false;
            if (d1.this.F.isPopupShowing()) {
                d1.this.F.dismissDropDown();
            } else {
                d1.this.F.showDropDown();
            }
        }
    }

    class e implements View.OnClickListener {
        e() {
        }

        @Override
        public void onClick(View view) {
            d1.this.P = true;
            d1.this.Q = false;
            d1.this.A0(view);
            if (d1.this.F.isPopupShowing()) {
                d1.this.F.dismissDropDown();
            } else {
                d1.this.F.showDropDown();
            }
        }
    }

    class f implements View.OnClickListener {
        f() {
        }

        @Override
        public void onClick(View view) {
            d1.this.P = false;
            d1.this.Q = true;
            if (d1.this.G.isPopupShowing()) {
                d1.this.G.dismissDropDown();
            } else {
                d1.this.G.showDropDown();
            }
        }
    }

    class g implements View.OnClickListener {
        g() {
        }

        @Override
        public void onClick(View view) {
            d1.this.P = false;
            d1.this.Q = true;
            d1.this.A0(view);
            if (d1.this.G.isPopupShowing()) {
                d1.this.G.dismissDropDown();
            } else {
                d1.this.G.showDropDown();
            }
        }
    }

    private class h extends RecyclerView.Adapter<a> {

        public class a extends RecyclerView.c0 {
            private TextView a;
            private TextView b;
            private TextView c;
            private LinearLayout d;
            private LinearLayout e;
            private ImageView f;
            private RecyclerView g;
            private bc.s h;
            private List<sc.f> i;
            ArrayList<ItemImage> j;
            private boolean k;
            public String l;

            class ViewOnClickListenerC0056a implements View.OnClickListener {
                final h a;

                ViewOnClickListenerC0056a(h hVar) {
                    this.a = hVar;
                }

                @Override
                public void onClick(View view) {
                    if (a.this.k) {
                        a.this.k = false;
                        a.this.f.setImageDrawable(d1.this.getResources().getDrawable(2131231595));
                        a.this.g.setVisibility(8);
                    } else {
                        a.this.k = true;
                        a.this.f.setImageDrawable(d1.this.getResources().getDrawable(2131231970));
                        a.this.g.setVisibility(0);
                    }
                }
            }

            public a(View view) {
                super(view);
                this.i = new ArrayList();
                this.j = new ArrayList<>();
                this.k = false;
                this.l = "https://s-media-cache-ak0.pinimg.com/736x/7f/47/e4/7f47e4e3f9f3755fcd6012dfe6a7dc12.jpg";
                this.a = (TextView) view.findViewById(2131429287);
                this.b = (TextView) view.findViewById(2131427939);
                ImageView imageView = (ImageView) view.findViewById(2131428048);
                this.f = imageView;
                imageView.setOnClickListener(new ViewOnClickListenerC0056a(h.this));
                this.d = (LinearLayout) view.findViewById(2131427502);
                this.e = (LinearLayout) view.findViewById(2131427545);
                this.c = (TextView) view.findViewById(2131427501);
                RecyclerView findViewById = view.findViewById(2131428427);
                this.g = findViewById;
                findViewById.setVisibility(8);
                this.g.setLayoutManager(new LinearLayoutManager(q4.t.m()));
                this.g.setItemAnimator(new androidx.recyclerview.widget.e());
            }
        }

        private h() {
        }

        public void onBindViewHolder(a aVar, int i) {
            if (((Questions) d1.this.O.get(i)).getQuestion().trim().length() > 0) {
                aVar.a.setText(((Questions) d1.this.O.get(i)).getQuestion());
            } else {
                aVar.a.setText("(No Question)");
                if (((Questions) d1.this.O.get(i)).getHasAttachment().booleanValue()) {
                    aVar.f.setImageDrawable(d1.this.getResources().getDrawable(2131231970));
                    aVar.g.setVisibility(0);
                }
            }
            if (((Questions) d1.this.O.get(i)).getHasAttachment().booleanValue()) {
                aVar.f.setVisibility(0);
            } else {
                aVar.f.setVisibility(8);
            }
            aVar.b.setText(hd.j.c(((Questions) d1.this.O.get(i)).getPostedTime().longValue()));
            String[] split = ((Questions) d1.this.O.get(i)).getAttachmentPath().split(";");
            aVar.j.clear();
            for (int i2 = 0; i2 < split.length; i2++) {
                ItemImage itemImage = new ItemImage(1, split[i2], split[i2]);
                itemImage.b(i2);
                itemImage.d(1);
                itemImage.c(0);
                aVar.j.add(itemImage);
            }
            aVar.i.add(new sc.f(0, "User ", aVar.j));
            aVar.h = new bc.s(d1.this.getActivity(), aVar.i, 3, aVar.i.size());
            aVar.g.setAdapter(aVar.h);
        }

        public a onCreateViewHolder(ViewGroup viewGroup, int i) {
            View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(2131624400, viewGroup, false);
            inflate.setFocusableInTouchMode(false);
            inflate.setFocusable(false);
            return new a(inflate);
        }

        public int getItemCount() {
            return d1.this.O.size();
        }

        h(d1 d1Var, a aVar) {
            this();
        }
    }

    public void A0(View view) {
        ((InputMethodManager) getActivity().getSystemService("input_method")).hideSoftInputFromWindow(view.getApplicationWindowToken(), 0);
    }

    public void w0(String str) {
        if (this.A == null) {
            this.A = OttSDK.getNewInstance(getActivity(), hd.e.z);
        }
        b0(true);
        List<String> list = this.M;
        if (list != null) {
            list.clear();
        }
        List<Integer> list2 = this.N;
        if (list2 != null) {
            list2.clear();
        }
        this.A.getUserManager().getGenreContent("epg", str, new b(str));
    }

    private void x0() {
        if (this.A == null) {
            this.A = OttSDK.getNewInstance(getActivity(), hd.e.z);
        }
        List<String> list = this.L;
        if (list != null) {
            list.clear();
        }
        b0(true);
        this.A.getUserManager().getGenres(new a());
    }

    public void y0(String str, String str2) {
        if (this.A == null) {
            this.A = OttSDK.getNewInstance(getActivity(), hd.e.z);
        }
        b0(true);
        this.A.getUserManager().getMyQuestions("epg", str, str2, new c());
    }

    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        this.y = getActivity();
        this.A = hd.a.a.b(OTTApplication.o());
        this.B = context.getResources();
        this.z = (oc.k) context;
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
    }

    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View inflate = layoutInflater.inflate(2131624141, viewGroup, false);
        K(inflate);
        this.C = (LinearLayout) inflate.findViewById(com.razorpay.checkout.wrapper.R.id.layout);
        this.D = (TextInputLayout) inflate.findViewById(2131429632);
        this.F = (AutoCompleteTextView) inflate.findViewById(2131429633);
        this.E = (TextInputLayout) inflate.findViewById(2131427750);
        this.G = (AutoCompleteTextView) inflate.findViewById(2131427751);
        this.H = (TextView) inflate.findViewById(2131427752);
        x0();
        this.F.setShowSoftInputOnFocus(false);
        this.G.setShowSoftInputOnFocus(false);
        this.D.clearFocus();
        this.E.clearFocus();
        this.D.setEndIconOnClickListener(new d());
        this.F.setOnClickListener(new e());
        this.F.setOnItemClickListener(this);
        this.E.setEndIconOnClickListener(new f());
        this.G.setOnClickListener(new g());
        this.G.setOnItemClickListener(this);
        RecyclerView findViewById = inflate.findViewById(2131429288);
        this.I = findViewById;
        findViewById.setLayoutManager(new LinearLayoutManager(getContext(), 1, false));
        this.I.setHasFixedSize(true);
        return inflate;
    }

    @Override
    public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
        if (this.P) {
            this.R = i;
            w0(this.L.get(i));
        } else if (this.Q) {
            y0(this.N.get(i).toString(), this.L.get(this.R));
        }
        this.F.setSelection(0);
        this.G.setSelection(0);
        this.D.clearFocus();
        this.E.clearFocus();
    }

    public void onResume() {
        super.onResume();
        this.z.setTitle(this.B.getString(2131952483));
        getActivity().getSupportActionBar().E();
    }

    public List<String> z0(JSONArray jSONArray) {
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < jSONArray.length(); i++) {
            try {
                if (jSONArray.getString(i).trim().length() > 0) {
                    arrayList.add(jSONArray.getString(i));
                }
            } catch (JSONException unused) {
            }
        }
        return arrayList;
    }
}