导航菜单

页面标题

页面副标题

95爱播免登录版 v3.1.9 - PhotoScrollActivity.java 源代码

正在查看: 95爱播免登录版 v3.1.9 应用的 PhotoScrollActivity.java JAVA 源代码文件

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


package com.showself.ui;

import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.viewpager.widget.ViewPager;
import com.android.volley.toolbox.ImageLoader;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.mifeng.ui.R;
import com.r.b.d1;
import com.showself.domain.LoginResultInfo;
import com.showself.domain.PhotoInfo;
import com.showself.domain.ShareData;
import com.showself.ui.photo.PhotoCommentsActivity;
import com.showself.utils.Utils;
import com.showself.utils.d1.a.a;
import com.showself.utils.k0;
import com.showself.utils.l;
import com.showself.utils.p;
import com.showself.utils.r0;
import com.showself.utils.u0;
import com.showself.utils.zoom.graphics.FastBitmapDrawable;
import com.showself.view.ImmersiveStatusBar;
import com.tencent.connect.common.Constants;
import com.tencent.smtt.sdk.TbsListener;
import com.tencent.smtt.sdk.TbsMediaPlayer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import org.apache.commons.httpclient.cookie.CookieSpec;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class PhotoScrollActivity extends com.showself.ui.c implements a.InterfaceC0093a {
    public static int g0 = 0;
    private static int h0 = 1;
    private int A;
    private String B;
    private String H;
    private int I;
    private int J;
    private boolean K;
    private boolean L;
    private com.showself.provider.f M;
    private k0 N;
    private LoginResultInfo O;
    private View P;
    private View Q;
    private SeekBar R;
    private TextView S;
    private TextView T;
    private ImageView U;
    private ProgressBar V;
    private h X;
    private com.showself.utils.d1.a.a Y;
    private int Z;
    private Button a;
    private TextView b;
    private com.r.a.a b0;
    public ImageView c;
    private boolean c0;
    private ViewPager d;
    PhotoInfo d0;

    private d1 f2775e;
    private RelativeLayout l;
    private ImageView m;
    private RelativeLayout n;
    private RelativeLayout o;
    private RelativeLayout p;
    private RelativeLayout q;
    private RelativeLayout r;
    private RelativeLayout s;
    private RelativeLayout t;
    private RelativeLayout u;
    private RelativeLayout v;
    private TextView w;
    private TextView x;
    private ImmersiveStatusBar y;

    public List<PhotoInfo> f2776f = new ArrayList();

    private String f2777g = "";

    private String f2778h = "praisephoto";

    private String f2779i = "deleteimage";

    private String f2780j = "download";

    private String f2781k = "download_act";
    private boolean z = false;
    private int C = 0;
    private int G = 0;
    private int W = -1;
    private Handler a0 = new a();
    private View.OnClickListener e0 = new c();
    private com.r.h.a.a f0 = new g();

    class a extends Handler {
        a() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what != 100) {
                return;
            }
            if (PhotoScrollActivity.this.W == PhotoScrollActivity.g0) {
                PhotoScrollActivity.this.R.setProgress(PhotoScrollActivity.this.Y.a());
            }
            Message obtainMessage = obtainMessage();
            obtainMessage.what = 100;
            obtainMessage.arg1 = PhotoScrollActivity.this.Y.a();
            sendMessageDelayed(obtainMessage, 500L);
        }
    }

    class b implements Runnable {
        b() {
        }

        @Override
        public void run() {
            PhotoScrollActivity.this.u0();
        }
    }

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

        @Override
        public void onClick(View view) {
            switch (view.getId()) {
                case R.id.btn_nav_left:
                    Intent intent = new Intent();
                    intent.putExtra("relation", PhotoScrollActivity.this.G);
                    PhotoScrollActivity.this.setResult(TbsListener.ErrorCode.COPY_FAIL, intent);
                    PhotoScrollActivity.this.finish();
                    break;
                case R.id.fl_down:
                    PhotoScrollActivity.this.m0();
                    break;
                case R.id.fl_photoscroll_chat:
                    PhotoScrollActivity.this.c0();
                    break;
                case R.id.fl_photoscroll_chat1:
                    PhotoScrollActivity.this.c0();
                    break;
                case R.id.fl_photoscroll_comment:
                    PhotoScrollActivity.this.d0();
                    break;
                case R.id.fl_photoscroll_delete:
                    PhotoScrollActivity.this.k0();
                    break;
                case R.id.fl_photoscroll_gift:
                    PhotoScrollActivity.this.h0();
                    break;
                case R.id.fl_photoscroll_praise:
                    PhotoScrollActivity.this.l0();
                    break;
                case R.id.fl_photoscroll_share:
                    PhotoScrollActivity.this.s0();
                    break;
                case R.id.layout_card:
                    Intent intent2 = new Intent(PhotoScrollActivity.this.getApplicationContext(), (Class<?>) CardActivity.class);
                    if (PhotoScrollActivity.this.A == 0) {
                        intent2.putExtra("id", PhotoScrollActivity.this.d0.getUid());
                    } else {
                        intent2.putExtra("id", PhotoScrollActivity.this.A);
                    }
                    PhotoScrollActivity.this.startActivity(intent2);
                    break;
                case R.id.player:
                    if (!PhotoScrollActivity.this.U.isSelected()) {
                        if (PhotoScrollActivity.this.K) {
                            PhotoScrollActivity.this.Y.g();
                            Message obtainMessage = PhotoScrollActivity.this.a0.obtainMessage();
                            obtainMessage.what = 100;
                            obtainMessage.arg1 = PhotoScrollActivity.this.Y.a();
                            PhotoScrollActivity.this.a0.sendMessage(obtainMessage);
                        } else {
                            PhotoScrollActivity.this.sendBroadcast(new Intent("com.showself.reset_play_state"));
                            PhotoScrollActivity.this.W = PhotoScrollActivity.g0;
                            PhotoScrollActivity.this.Q.setEnabled(false);
                            PhotoScrollActivity.this.U.setVisibility(8);
                            PhotoScrollActivity.this.V.setVisibility(0);
                            PhotoScrollActivity.this.a0.removeMessages(100);
                            PhotoScrollActivity.this.L = false;
                            PhotoScrollActivity.this.K = false;
                            PhotoScrollActivity.this.Y.e(PhotoScrollActivity.this.d0.getAudio_url(), PhotoScrollActivity.this);
                            PhotoScrollActivity.this.Y.f(PhotoScrollActivity.this);
                            r0.D0(PhotoScrollActivity.this.d0.getAudio_url(), PhotoScrollActivity.this.getApplicationContext());
                            r0.E0(PhotoScrollActivity.this.d0.getUid(), PhotoScrollActivity.this.getApplicationContext());
                            PhotoScrollActivity.this.d0.getPid();
                        }
                        PhotoScrollActivity.this.U.setSelected(!PhotoScrollActivity.this.U.isSelected());
                        break;
                    } else {
                        PhotoScrollActivity.this.j0();
                        break;
                    }
            }
        }
    }

    class d implements l {
        d() {
        }

        @Override
        public void a(boolean z) {
            if (z && PhotoScrollActivity.h0 == 1) {
                int unused = PhotoScrollActivity.h0 = 0;
                PhotoScrollActivity.this.e0();
            }
        }
    }

    class e implements View.OnTouchListener {
        e(PhotoScrollActivity photoScrollActivity) {
        }

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            return true;
        }
    }

    class f implements com.r.a.b {
        f() {
        }

        @Override
        public void a() {
            PhotoScrollActivity.this.f0();
        }

        @Override
        public void b(String str) {
        }
    }

    class g implements com.r.h.a.a {
        g() {
        }

        @Override
        public void a() {
            Utils.n(PhotoScrollActivity.this);
            Toast.makeText(PhotoScrollActivity.this.getApplicationContext(), PhotoScrollActivity.this.getString(R.string.download_fail), 0).show();
        }

        @Override
        public void b() {
            Utils.U0(PhotoScrollActivity.this);
        }

        @Override
        public void c() {
            Utils.n(PhotoScrollActivity.this);
            Toast.makeText(PhotoScrollActivity.this.getApplicationContext(), PhotoScrollActivity.this.getString(R.string.download_succ), 0).show();
            HashMap hashMap = new HashMap();
            hashMap.put("pid", Integer.valueOf(PhotoScrollActivity.this.d0.getPid()));
            hashMap.put("type", PhotoScrollActivity.this.f2777g);
            com.showself.service.f fVar = new com.showself.service.f(10021, hashMap);
            ?? r0 = PhotoScrollActivity.this;
            r0.addTask(fVar, r0);
        }
    }

    private class h extends BroadcastReceiver {
        private h() {
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if ("com.showself.pause_play".equals(action)) {
                PhotoScrollActivity.this.j0();
            } else if ("com.showself.stop_play".equals(action)) {
                PhotoScrollActivity.this.t0();
            } else if ("com.showself.reset_play_state".equals(action)) {
                PhotoScrollActivity.this.n0();
            }
        }

        h(PhotoScrollActivity photoScrollActivity, a aVar) {
            this();
        }
    }

    private class i implements View.OnClickListener {
        private Dialog a;

        public i(Dialog dialog) {
            this.a = dialog;
        }

        @Override
        public void onClick(View view) {
            this.a.cancel();
            int id = view.getId();
            if (id == 2131296418) {
                this.a.dismiss();
            }
            switch (id) {
                case R.id.share_qq:
                    PhotoScrollActivity.this.q0(1);
                    break;
                case R.id.share_qzone:
                    PhotoScrollActivity.this.q0(11);
                    break;
                case R.id.share_weibo:
                    PhotoScrollActivity.this.q0(3);
                    break;
                case R.id.share_wx:
                    PhotoScrollActivity.this.q0(2);
                    break;
                case R.id.share_wxf:
                    PhotoScrollActivity.this.q0(22);
                    break;
            }
        }
    }

    private void b0() {
        this.b.setText((g0 + 1) + CookieSpec.PATH_DELIM + this.f2776f.size());
    }

    public void c0() {
        com.r.n.g j2 = com.r.n.g.j();
        com.r.n.d c2 = com.r.n.d.c();
        c2.e("Me");
        c2.f("UserAvatar");
        c2.d("PrivateChat");
        c2.h(com.r.n.e.Click);
        j2.u(c2.b());
        PhotoInfo photoInfo = this.f2776f.get(g0);
        if (this.C == 3) {
            this.I = photoInfo.getGender();
            this.H = photoInfo.getNickName();
        }
        d.c.a.P(this, photoInfo.getUid() == 0 ? this.A : photoInfo.getUid(), TextUtils.isEmpty(photoInfo.getAvatar()) ? this.B : photoInfo.getAvatar(), this.H, this.I);
    }

    public void d0() {
        com.r.n.g j2 = com.r.n.g.j();
        com.r.n.d c2 = com.r.n.d.c();
        c2.e("Me");
        c2.f("UserAvatar");
        c2.d("");
        c2.h(com.r.n.e.Click);
        j2.u(c2.b());
        this.d0 = this.f2776f.get(g0);
        Intent intent = new Intent((Context) this, (Class<?>) PhotoCommentsActivity.class);
        intent.putExtra("pid", this.d0.getPid());
        intent.putExtra("fuid", this.d0.getUid());
        String str = this.H;
        if (str != null) {
            intent.putExtra("fnickname", str);
        } else {
            intent.putExtra("fnickname", this.d0.getNickName());
        }
        intent.putExtra("imageurl", this.d0.getBigUrl());
        startActivityForResult(intent, 101);
    }

    public void e0() {
        if (this.z) {
            return;
        }
        if (this.C == 4 && this.f2776f.size() == this.Z) {
            Utils.Z0(this, getString(R.string.album_at_lease1) + this.Z + getString(R.string.max_upload_photo));
            h0 = 1;
            return;
        }
        this.z = true;
        int size = this.f2776f.size();
        if (size == 0) {
            finish();
            h0 = 1;
            return;
        }
        int i2 = g0;
        if (i2 > size - 1) {
            finish();
            h0 = 1;
            return;
        }
        PhotoInfo photoInfo = this.f2776f.get(i2);
        HashMap hashMap = new HashMap();
        hashMap.put("pid", Integer.valueOf(photoInfo.getPid()));
        if (this.C == 4) {
            this.f2777g = "delete_act_image";
            hashMap.put("type", "delete_act_image");
        } else {
            String str = this.f2779i;
            this.f2777g = str;
            hashMap.put("type", str);
        }
        addTask(new com.showself.service.f(10021, hashMap), this);
        Utils.U0(this);
    }

    public void f0() {
        this.z = true;
        int i2 = this.C;
        if (i2 == 4 || i2 == 5) {
            this.f2777g = this.f2781k;
        } else {
            this.f2777g = this.f2780j;
        }
        this.d0 = this.f2776f.get(g0);
        int i3 = this.C;
        if (i3 != 4 && i3 != 1 && this.M.l(this.O.getUserId()) != 2) {
            if (this.M.l(this.O.getUserId()) == 1) {
                Utils.b1(this, this.M.r(108, 0, this.O.getGender(), this.N.v() + ""), getString(R.string.happy_upgrad), getString(R.string.turn_down));
                return;
            }
            return;
        }
        if (this.M.t(Constants.VIA_SHARE_TYPE_INFO, this.O.getUserId(), this.A)) {
            ImageView imageView = this.c;
            if (imageView == null) {
                this.f0.a();
                return;
            } else {
                Drawable drawable = imageView.getDrawable();
                com.r.h.a.b.e().d(getApplicationContext(), this.d0.getBigUrl(), drawable instanceof FastBitmapDrawable ? ((FastBitmapDrawable) drawable).getBitmap() : null, this.f0);
                return;
            }
        }
        Utils.b1(this, this.M.r(113, this.I, this.O.getGender(), this.N.v() + ""), getString(R.string.happy_upgrad), getString(R.string.turn_down));
    }

    private ShareData g0() {
        Random random = new Random();
        String L = r0.L();
        if (TextUtils.isEmpty(L)) {
            return null;
        }
        try {
            JSONArray jSONArray = new JSONArray(L);
            JSONObject optJSONObject = jSONArray.optJSONObject(random.nextInt(jSONArray.length()));
            ShareData shareData = new ShareData();
            shareData.content = optJSONObject.optString(PushConstants.CONTENT).replace("{nickname}", this.H);
            shareData.title = optJSONObject.optString("title").replace("{nickname}", this.H);
            shareData.url = optJSONObject.optString("url") + "?source=" + this.O.getShowid();
            shareData.image = this.f2776f.get(g0).getBigUrl();
            return shareData;
        } catch (JSONException e2) {
            e2.printStackTrace();
            return null;
        }
    }

    public void h0() {
        int i2 = this.A;
        if (i2 == 0) {
            i2 = this.d0.getUid();
        }
        d.c.a.Q(this, i2, this.B, this.H, this.I, 2);
    }

    private void i0() {
        p.c("打印currentPhotoType", this.C + "");
        int i2 = this.C;
        if (i2 == 1) {
            this.l.setVisibility(0);
            this.l.setClickable(false);
            this.m.setBackgroundResource(R.drawable.praise_photo_disable_button_image);
            this.n.setVisibility(0);
            this.o.setVisibility(0);
            this.p.setVisibility(8);
            this.q.setVisibility(8);
            this.s.setVisibility(0);
            this.r.setVisibility(8);
            this.v.setVisibility(8);
            this.t.setVisibility(8);
            this.u.setVisibility(0);
        } else if (i2 == 2) {
            this.l.setVisibility(0);
            this.n.setVisibility(0);
            this.o.setVisibility(0);
            this.p.setVisibility(0);
            this.q.setVisibility(0);
            this.s.setVisibility(8);
            this.r.setVisibility(0);
            this.v.setVisibility(8);
            this.t.setVisibility(8);
            this.u.setVisibility(8);
            p0();
        } else if (i2 == 4) {
            this.l.setVisibility(8);
            this.n.setVisibility(8);
            this.o.setVisibility(0);
            this.p.setVisibility(8);
            this.q.setVisibility(8);
            this.s.setVisibility(0);
            this.r.setVisibility(8);
            this.v.setVisibility(8);
            this.t.setVisibility(8);
        } else if (i2 != 5) {
            this.l.setVisibility(0);
            this.n.setVisibility(0);
            this.o.setVisibility(8);
            this.p.setVisibility(0);
            this.q.setVisibility(0);
            this.s.setVisibility(8);
            this.r.setVisibility(0);
            this.v.setVisibility(8);
            this.t.setVisibility(8);
            this.u.setVisibility(8);
            findViewById(R.id.layout_card).setVisibility(0);
            findViewById(R.id.layout_card).setOnClickListener(this.e0);
            p0();
        } else {
            this.l.setVisibility(8);
            this.n.setVisibility(8);
            this.o.setVisibility(0);
            this.p.setVisibility(0);
            this.q.setVisibility(0);
            this.s.setVisibility(8);
            this.r.setVisibility(8);
            this.u.setVisibility(0);
            this.v.setVisibility(0);
            this.t.setVisibility(8);
            findViewById(R.id.layout_card).setVisibility(0);
            findViewById(R.id.layout_card).setOnClickListener(this.e0);
        }
        this.P = findViewById(R.id.layout_player);
        this.Q = findViewById(R.id.player);
        this.T = (TextView) findViewById(R.id.tv_time);
        this.U = (ImageView) findViewById(R.id.iv_player);
        SeekBar seekBar = (SeekBar) findViewById(R.id.seekbar);
        this.R = seekBar;
        seekBar.setOnTouchListener(new e(this));
        this.S = (TextView) findViewById(R.id.tv_desc);
        this.V = (ProgressBar) findViewById(R.id.pb);
        this.Q.setOnClickListener(this.e0);
        this.P.setOnClickListener(this.e0);
    }

    public void j0() {
        this.Y.d();
        this.a0.removeMessages(100);
        this.U.setSelected(false);
    }

    public void l0() {
        if (this.z) {
            return;
        }
        this.z = true;
        com.r.n.g j2 = com.r.n.g.j();
        com.r.n.d c2 = com.r.n.d.c();
        c2.e("Me");
        c2.f("UserAvatar");
        c2.d("");
        c2.h(com.r.n.e.Click);
        j2.u(c2.b());
        this.f2777g = this.f2778h;
        this.d0 = this.f2776f.get(g0);
        HashMap hashMap = new HashMap();
        hashMap.put("pid", Integer.valueOf(this.d0.getPid()));
        hashMap.put("type", this.f2777g);
        addTask(new com.showself.service.f(10021, hashMap), this);
        Utils.U0(this);
    }

    public void m0() {
        if (this.b0 == null) {
            this.b0 = new com.r.a.a(this);
        }
        this.b0.c(new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, new f());
    }

    public void n0() {
        if (this.c0) {
            this.a0.removeMessages(100);
            this.K = false;
            this.L = false;
            this.R.setProgress(0);
            this.U.setSelected(false);
            this.W = -1;
        }
    }

    private void p0() {
        if (this.f2776f.size() == 0) {
            return;
        }
        PhotoInfo photoInfo = this.f2776f.get(g0);
        this.d0 = photoInfo;
        if (photoInfo != null && photoInfo.getActionid() != 0) {
            this.l.setEnabled(false);
            this.m.setBackgroundResource(R.drawable.praise_photo_disable_button_image);
        } else if (this.C != 1) {
            this.l.setEnabled(true);
            this.m.setBackgroundResource(R.drawable.praise_photo_button_image);
        }
    }

    public void q0(int i2) {
        com.showself.ui.h.d.c.f(i2, 100003, this, g0(), new com.showself.ui.h.b.c(this));
    }

    private void r0() {
        Dialog dialog = new Dialog(this, 2131755755);
        i iVar = new i(dialog);
        View inflate = View.inflate(this, R.layout.share_layout, null);
        inflate.findViewById(R.id.share_wxf).setOnClickListener(iVar);
        inflate.findViewById(R.id.share_wx).setOnClickListener(iVar);
        inflate.findViewById(R.id.share_weibo).setOnClickListener(iVar);
        inflate.findViewById(R.id.share_qzone).setOnClickListener(iVar);
        inflate.findViewById(R.id.bt_cancle).setOnClickListener(iVar);
        inflate.findViewById(R.id.share_qq).setOnClickListener(iVar);
        dialog.setContentView(inflate);
        dialog.getWindow().setLayout(-1, -2);
        dialog.getWindow().setGravity(80);
        dialog.getWindow().setWindowAnimations(2131755745);
        dialog.setCanceledOnTouchOutside(true);
        dialog.show();
    }

    public void s0() {
        r0();
    }

    public void t0() {
        this.a0.removeMessages(100);
        this.K = false;
        this.Y.h();
        this.L = false;
        SeekBar seekBar = this.R;
        if (seekBar != null) {
            seekBar.setProgress(0);
        }
        ImageView imageView = this.U;
        if (imageView != null) {
            imageView.setSelected(false);
        }
        this.W = -1;
    }

    @Override
    public void a(Exception exc) {
        p.c("onPlayError", exc.getMessage());
    }

    @Override
    public void addTask(com.showself.service.f fVar, Context context) {
        super.addTask(fVar, context);
    }

    @Override
    public void f() {
        this.K = false;
        this.R.setProgress(0);
        this.a0.removeMessages(100);
        this.U.setSelected(false);
        this.W = -1;
    }

    @Override
    public void finish() {
        t0();
        sendBroadcast(new Intent("com.showself.reset_play_state"));
        super.finish();
    }

    @Override
    public void init() {
        this.a = (Button) findViewById(R.id.btn_nav_left);
        this.b = (TextView) findViewById(R.id.tv_nav_title);
        this.a.setOnClickListener(this.e0);
        this.l = (RelativeLayout) findViewById(R.id.fl_photoscroll_praise);
        this.m = (ImageView) findViewById(R.id.iv_photoscroll_praise);
        this.n = (RelativeLayout) findViewById(R.id.fl_photoscroll_comment);
        this.o = (RelativeLayout) findViewById(R.id.fl_photoscroll_share);
        this.p = (RelativeLayout) findViewById(R.id.fl_photoscroll_gift);
        this.q = (RelativeLayout) findViewById(R.id.fl_photoscroll_gift_weight);
        this.r = (RelativeLayout) findViewById(R.id.fl_photoscroll_chat);
        this.s = (RelativeLayout) findViewById(R.id.fl_photoscroll_delete);
        this.t = (RelativeLayout) findViewById(R.id.fl_photoscroll_mores);
        this.u = (RelativeLayout) findViewById(R.id.fl_down);
        this.w = (TextView) findViewById(R.id.tv_photoscroll_praise_number);
        this.x = (TextView) findViewById(R.id.tv_photoscroll_comment_number);
        this.v = (RelativeLayout) findViewById(R.id.fl_photoscroll_chat1);
        this.y = (ImmersiveStatusBar) findViewById(2131298726);
        this.l.setOnClickListener(this.e0);
        this.n.setOnClickListener(this.e0);
        this.o.setOnClickListener(this.e0);
        this.p.setOnClickListener(this.e0);
        this.r.setOnClickListener(this.e0);
        this.v.setOnClickListener(this.e0);
        this.s.setOnClickListener(this.e0);
        this.t.setOnClickListener(this.e0);
        this.u.setOnClickListener(this.e0);
        if (com.showself.ui.f.a() != null) {
            this.f2776f.addAll(com.showself.ui.f.a());
        } else {
            finish();
        }
        b0();
        Bundle bundle = new Bundle();
        bundle.putInt("photoType", this.C);
        bundle.putInt("fuid", this.A);
        bundle.putInt("gender", this.I);
        this.d = findViewById(R.id.vp_photo_scroll);
        d1 d1Var = new d1(getSupportFragmentManager(), this.f2776f, bundle);
        this.f2775e = d1Var;
        this.d.setAdapter(d1Var);
        this.d.setCurrentItem(g0);
        this.d.setOffscreenPageLimit(1);
    }

    public void k0() {
        Utils.Q0(this, getString(R.string.prompt), getString(R.string.delete_pic_prompt), getString(R.string.negative), getResources().getColor(2131099757), getString(R.string.positive), getResources().getColor(2131099758), new d(), true);
    }

    @Override
    public void l() {
        if (this.W == g0) {
            this.K = true;
        }
        this.L = true;
        this.Q.setEnabled(true);
        this.V.setVisibility(8);
        this.U.setVisibility(0);
        if (this.c0) {
            return;
        }
        this.Y.g();
        if (this.W == g0) {
            this.U.setSelected(true);
        }
        Message obtainMessage = this.a0.obtainMessage();
        obtainMessage.what = 100;
        obtainMessage.arg1 = this.Y.a();
        this.a0.sendMessage(obtainMessage);
    }

    public void o0() {
        View findViewById = findViewById(R.id.photoscorll_navigation);
        if (findViewById.getVisibility() == 0) {
            findViewById.setVisibility(8);
            findViewById(R.id.layout_bottom).setVisibility(8);
        } else {
            findViewById.setVisibility(0);
            findViewById(R.id.layout_bottom).setVisibility(0);
        }
    }

    @Override
    protected void onActivityResult(int i2, int i3, Intent intent) {
        super.onActivityResult(i2, i3, intent);
        com.showself.ui.h.d.c.d(i2, i3, intent);
        if (i3 == 202 && i2 == 101) {
            int intExtra = intent != null ? intent.getIntExtra("commentNum", 0) : 0;
            if (intExtra <= 0) {
                this.x.setVisibility(8);
                this.d0.setCommentNum(0);
            } else {
                this.x.setVisibility(0);
                this.x.setText(String.valueOf(intExtra));
                this.d0.setCommentNum(intExtra);
            }
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.photoscroll_act);
        u0.q(this, null);
        this.X = new h(this, null);
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("com.showself.pause_play");
        intentFilter.addAction("com.showself.stop_play");
        intentFilter.addAction("com.showself.reset_play_state");
        registerReceiver(this.X, intentFilter);
        Bundle extras = getIntent().getExtras();
        if (!extras.isEmpty()) {
            if (extras.containsKey("index")) {
                g0 = extras.getInt("index");
            } else {
                g0 = 0;
            }
            if (extras.containsKey("phototype")) {
                this.C = extras.getInt("phototype");
            } else {
                this.C = 3;
            }
            if (extras.containsKey("relation")) {
                this.G = extras.getInt("relation");
            }
            if (extras.containsKey("fnickname")) {
                this.H = extras.getString("fnickname");
            }
            if (extras.containsKey("fuid")) {
                this.A = extras.getInt("fuid");
            }
            if (extras.containsKey("favatar")) {
                this.B = extras.getString("favatar");
            }
            if (extras.containsKey("gender")) {
                this.I = extras.getInt("gender");
            }
            if (extras.containsKey("currentType")) {
                extras.getInt("currentType");
            }
            if (extras.containsKey("min_photo")) {
                this.Z = extras.getInt("min_photo");
            }
            if (extras.containsKey("pid")) {
                PhotoInfo photoInfo = new PhotoInfo();
                photoInfo.setActionid(Integer.parseInt(extras.getString("actionid")));
                photoInfo.setAvatar(Utils.f(extras.getString("favatar")));
                photoInfo.setBigUrl(Utils.f(extras.getString("bigurl")));
                photoInfo.setCommentNum(Integer.parseInt(extras.getString("praisenum")));
                photoInfo.setNickName(extras.getString("fnickname"));
                photoInfo.setAudio_url(Utils.f(extras.getString("audio_url")));
                if (extras.containsKey("duration")) {
                    photoInfo.setDuration(Integer.parseInt(extras.getString("duration")));
                }
                photoInfo.setNote(extras.getString("note"));
                photoInfo.setPid(Integer.parseInt(extras.getString("pid")));
                photoInfo.setPraiseNum(Integer.parseInt(extras.getString("praisenum")));
                photoInfo.setUid(Integer.parseInt(extras.getString("fuid")));
                photoInfo.setUrl(Utils.f(extras.getString("url")));
                ArrayList arrayList = new ArrayList();
                arrayList.add(photoInfo);
                com.showself.ui.f.b(arrayList);
            }
        }
        this.M = com.showself.provider.f.h();
        this.O = r0.y(this);
        this.N = k0.k();
        this.Y = com.showself.utils.d1.a.a.b();
        init();
        i0();
        if (this.f2776f.size() > 0) {
            this.d0 = this.f2776f.get(g0);
        }
        v0();
        ImageLoader.getInstance(getApplicationContext());
        this.a0.postDelayed(new b(), 1000L);
        u0.i(this, this.y, R.color.navigationbar_bg, true);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        unregisterReceiver(this.X);
        List<PhotoInfo> list = this.f2776f;
        if (list != null) {
            list.clear();
        }
        this.f2776f = null;
        t0();
        r0.D0("", this);
        r0.E0(0, this);
        Handler handler = this.a0;
        if (handler != null) {
            handler.removeCallbacksAndMessages(null);
        }
    }

    public boolean onKeyDown(int i2, KeyEvent keyEvent) {
        if (keyEvent.getAction() == 0 && i2 == 4) {
            Intent intent = new Intent();
            intent.putExtra("relation", this.G);
            setResult(TbsListener.ErrorCode.COPY_FAIL, intent);
        }
        return super/*android.app.Activity*/.onKeyDown(i2, keyEvent);
    }

    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        com.showself.ui.h.d.c.e(intent);
    }

    @Override
    protected void onPause() {
        super.onPause();
        this.c0 = true;
    }

    @Override
    public void onRequestPermissionsResult(int i2, String[] strArr, int[] iArr) {
        super.onRequestPermissionsResult(i2, strArr, iArr);
        if (this.b0.e(i2, strArr, iArr)) {
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        this.N = k0.k();
        this.c0 = false;
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    @Override
    public void refresh(Object... objArr) {
        this.z = false;
        Utils.n(this);
        com.showself.service.g.i(this);
        int intValue = ((Integer) objArr[0]).intValue();
        HashMap hashMap = (HashMap) objArr[1];
        if (hashMap != null) {
            if (intValue != 10021) {
                if (intValue != 10052) {
                    return;
                }
                int intValue2 = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
                if (intValue2 != 0 && intValue2 != -770) {
                    Utils.Z0(this, (String) hashMap.get(com.showself.net.e.o1));
                    return;
                }
                if (this.J == 1) {
                    this.G = 2;
                } else {
                    this.G = 0;
                }
                Utils.Z0(this, (String) hashMap.get(com.showself.net.e.o1));
                sendBroadcast(new Intent("com.showself.updata"));
                return;
            }
            if (((Integer) hashMap.get(com.showself.net.e.n1)).intValue() == 0) {
                String str = "已赞!";
                if (this.f2777g.equals(this.f2778h)) {
                    int e2 = ShowSelfApp.e("18");
                    if (e2 != 0) {
                        str = "已赞!" + e2;
                    }
                    Utils.Z0(this, str);
                    PhotoInfo photoInfo = this.f2776f.get(g0);
                    this.d0 = photoInfo;
                    photoInfo.setActionid(1);
                    PhotoInfo photoInfo2 = this.d0;
                    photoInfo2.setPraiseNum(photoInfo2.getPraiseNum() + 1);
                    v0();
                    w0();
                } else if (this.f2777g.equals(this.f2779i) || this.f2777g.equals("delete_act_image")) {
                    int size = g0 == this.f2776f.size() - 1 ? this.f2776f.size() - 2 : -1;
                    this.f2776f.remove(g0);
                    if (this.f2776f.size() > 0) {
                        com.showself.ui.f.b(this.f2776f);
                        Intent intent = getIntent();
                        if (size != -1) {
                            intent.putExtra("index", size);
                        } else {
                            intent.putExtra("index", g0);
                        }
                        startActivity(intent);
                    }
                    sendBroadcast(new Intent("com.showself.updata"));
                    sendBroadcast(new Intent("com.showself.updata.activity").putExtra("type", TbsMediaPlayer.TbsMediaPlayerListener.MEDIA_INFO_BAD_INTERLEAVING).putExtra("index", g0));
                    h0 = 1;
                    Utils.Z0(this, (String) hashMap.get(com.showself.net.e.o1));
                    finish();
                } else {
                    this.f2777g.equals(this.f2780j);
                }
            } else {
                Utils.Z0(this, (String) hashMap.get(com.showself.net.e.o1));
            }
            h0 = 1;
        }
    }

    public void u0() {
        if (this.f2776f == null) {
            Utils.Z0(getApplicationContext(), "图片信息已失效,请重新进入");
            finish();
        }
        PhotoInfo photoInfo = this.f2776f.get(g0);
        if (TextUtils.isEmpty(photoInfo.getAudio_url()) && TextUtils.isEmpty(photoInfo.getNote())) {
            this.P.setVisibility(8);
            return;
        }
        this.Q.setEnabled(true);
        this.P.setVisibility(0);
        if (TextUtils.isEmpty(photoInfo.getAudio_url())) {
            this.Q.setVisibility(8);
            this.R.setVisibility(8);
        } else {
            this.Q.setVisibility(0);
            this.R.setVisibility(0);
        }
        if (TextUtils.isEmpty(photoInfo.getNote())) {
            ((View) this.S.getParent()).setVisibility(8);
        } else {
            ((View) this.S.getParent()).setVisibility(0);
            this.S.setText(photoInfo.getNote());
        }
        this.T.setText(photoInfo.getDuration() + "\"");
        this.R.setProgress(0);
        this.R.setMax(photoInfo.getDuration() * 1000);
        this.U.setVisibility(0);
        this.V.setVisibility(8);
        if (this.W != g0) {
            this.K = false;
            this.U.setSelected(false);
            return;
        }
        this.K = true;
        if (!this.L) {
            this.U.setVisibility(8);
            this.V.setVisibility(0);
            this.Q.setEnabled(false);
        } else if (this.Y.c()) {
            this.U.setSelected(true);
        } else {
            this.U.setSelected(false);
        }
    }

    public void v0() {
        PhotoInfo photoInfo = this.f2776f.get(g0);
        this.d0 = photoInfo;
        int praiseNum = photoInfo.getPraiseNum();
        int commentNum = this.d0.getCommentNum();
        if (praiseNum > 0) {
            this.w.setVisibility(0);
            this.w.setText(String.valueOf(praiseNum));
        } else {
            this.w.setVisibility(8);
        }
        if (commentNum <= 0) {
            this.x.setVisibility(8);
        } else {
            this.x.setVisibility(0);
            this.x.setText(String.valueOf(commentNum));
        }
    }

    public void w0() {
        b0();
        p0();
    }
}