导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui.activity;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.ImageView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mifeng.ui.R;
import com.r.b.m;
import com.r.b.u0;
import com.r.n.g;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.a.j;
import com.showself.domain.PhotoInfo;
import com.showself.domain.UserPageInfo;
import com.showself.ui.PhotoScrollActivity;
import com.showself.ui.takepicture.TakePictureActivity;
import com.showself.utils.Utils;
import com.showself.utils.g0;
import com.showself.utils.v;
import com.showself.view.ImmersiveStatusBar;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.cocos2dx.lib.GameControllerDelegate;

public class MyPhotoActivity extends com.showself.ui.c implements View.OnClickListener, g0 {
    private ImageView a;
    private SmartRefreshLayout b;
    private RecyclerView c;
    private ImmersiveStatusBar d;

    private u0 f2992e;

    private List<PhotoInfo> f2993f;

    private List<PhotoInfo> f2994g;

    private UserPageInfo f2995h;

    private com.r.a.a f2996i;

    private e f2997j;

    private int f2998k = 0;
    private int l = 20;
    private boolean m = false;
    private boolean n = false;
    private Handler o = new a();

    class a extends Handler {
        a() {
        }

        @Override
        public void handleMessage(Message message) {
            if (MyPhotoActivity.this.o == null) {
                return;
            }
            MyPhotoActivity.this.refresh(Integer.valueOf(message.what), message.obj, Integer.valueOf(message.arg1));
        }
    }

    class b implements com.scwang.smartrefresh.layout.c.b {
        b() {
        }

        @Override
        public void g(j jVar) {
            if (!MyPhotoActivity.this.m) {
                MyPhotoActivity.this.b.r();
                return;
            }
            MyPhotoActivity.this.f2998k += MyPhotoActivity.this.l;
            MyPhotoActivity.this.I(0);
        }
    }

    class c implements m.c {
        c() {
        }

        @Override
        public void y(Object obj, int i2) {
            if (Utils.o0()) {
                return;
            }
            if (((PhotoInfo) obj).getUid() == -100) {
                if (com.showself.utils.d1.a.c.a()) {
                    MyPhotoActivity.this.K();
                    return;
                } else {
                    Utils.Z0(MyPhotoActivity.this, "没有SD卡");
                    return;
                }
            }
            g j2 = g.j();
            com.r.n.d c = com.r.n.d.c();
            c.e("Me");
            c.f("UserAvatar");
            c.d("AvatarList");
            c.h(com.r.n.e.Click);
            j2.u(c.b());
            Intent intent = new Intent();
            intent.setClass(MyPhotoActivity.this, PhotoScrollActivity.class);
            intent.putExtra("index", i2 - 1);
            intent.putExtra("phototype", 1);
            intent.putExtra("relation", MyPhotoActivity.this.f2995h.getRelation());
            intent.putExtra("fnickname", MyPhotoActivity.this.f2995h.getUsername());
            intent.putExtra("fuid", MyPhotoActivity.this.f2995h.getUid());
            intent.putExtra("favatar", MyPhotoActivity.this.f2995h.getAvatar());
            intent.putExtra("gender", MyPhotoActivity.this.f2995h.getGender());
            intent.putExtra("currentType", 1);
            MyPhotoActivity.this.startActivityForResult(intent, 11);
        }
    }

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

        @Override
        public void a() {
            MyPhotoActivity.this.startActivity(new Intent((Context) MyPhotoActivity.this, (Class<?>) TakePictureActivity.class));
        }

        @Override
        public void b(String str) {
            new com.r.a.c(MyPhotoActivity.this).d(str);
        }
    }

    private class e extends BroadcastReceiver {

        class a implements Runnable {
            a() {
            }

            @Override
            public void run() {
                MyPhotoActivity.this.f2998k = 0;
                MyPhotoActivity.this.I(0);
                MyPhotoActivity.this.b.C();
            }
        }

        private e() {
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            if ("com.showself.updata".equals(intent.getAction())) {
                new Handler().postDelayed(new a(), 500L);
            }
        }

        e(MyPhotoActivity myPhotoActivity, a aVar) {
            this();
        }
    }

    public void I(int i2) {
        if (this.n) {
            return;
        }
        this.n = true;
        HashMap hashMap = new HashMap();
        hashMap.put("fuid", Integer.valueOf(this.f2995h.getUid()));
        hashMap.put("startindex", Integer.valueOf(this.f2998k));
        hashMap.put("recordnum", Integer.valueOf(this.l));
        hashMap.put("type", Integer.valueOf(i2));
        hashMap.put("gender", 0);
        addTask(new com.showself.service.f(GameControllerDelegate.BUTTON_DPAD_DOWN, hashMap), this, this.o);
    }

    private void J() {
        g j2 = g.j();
        com.r.n.d c2 = com.r.n.d.c();
        c2.e("Me");
        c2.f("UserAvatar");
        c2.d("AvatarList");
        c2.h(com.r.n.e.View);
        j2.u(c2.b());
        this.f2993f = new ArrayList();
        this.f2994g = new ArrayList();
        this.f2995h = (UserPageInfo) getIntent().getExtras().getSerializable("pageInfo");
        this.a = (ImageView) findViewById(R.id.iv_photo_back);
        this.b = (SmartRefreshLayout) findViewById(R.id.my_photo_refresh);
        this.c = findViewById(R.id.photo_recycler);
        this.d = (ImmersiveStatusBar) findViewById(2131298726);
        this.a.setOnClickListener(this);
        this.b.E(false);
        this.b.D(true);
        this.b.G(new b());
        GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);
        gridLayoutManager.setOrientation(1);
        this.c.setLayoutManager(gridLayoutManager);
        u0 u0Var = new u0(this, this.f2994g, this);
        this.f2992e = u0Var;
        u0Var.g(new c());
        this.c.setAdapter(this.f2992e);
    }

    public void K() {
        if (this.f2996i == null) {
            this.f2996i = new com.r.a.a(this);
        }
        this.f2996i.c(new String[]{"android.permission.CAMERA", "android.permission.WRITE_EXTERNAL_STORAGE"}, new d());
    }

    @Override
    public void init() {
        this.f2998k = 0;
        I(0);
    }

    @Override
    public void m(View view, Object obj, int i2) {
    }

    @Override
    protected void onActivityResult(int i2, int i3, Intent intent) {
        super.onActivityResult(i2, i3, intent);
        if (!(i3 == 212 && i2 == 11) && i3 == -1 && i2 == 11) {
            try {
                Uri data = intent.getData();
                if (data == null) {
                    Utils.Y0(this, R.string.network_get_photo_fail);
                    return;
                }
                File a2 = v.a(this, v.g(data, this), -1);
                HashMap hashMap = new HashMap();
                hashMap.put("aid", 0);
                hashMap.put("imagePath", a2.getPath());
                addTask(new com.showself.service.f(GameControllerDelegate.BUTTON_B, hashMap), this, this.o);
                Utils.U0(this);
            } catch (Exception unused) {
            }
        }
    }

    @Override
    public void onClick(View view) {
        if (view.getId() != 2131297332) {
            return;
        }
        finish();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_my_photo);
        com.showself.utils.u0.q(this, null);
        J();
        com.showself.utils.u0.i(this, this.d, 2131099661, true);
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("com.showself.updata");
        intentFilter.addAction("com.showself.video_error");
        e eVar = new e(this, null);
        this.f2997j = eVar;
        registerReceiver(eVar, intentFilter);
        init();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        e eVar = this.f2997j;
        if (eVar != null) {
            unregisterReceiver(eVar);
        }
    }

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

    @Override
    public void q(View view, Object obj, int i2, int i3) {
    }

    @Override
    public void refresh(Object... objArr) {
        this.b.n();
        Utils.n(null);
        this.n = false;
        int intValue = ((Integer) objArr[0]).intValue();
        HashMap hashMap = (HashMap) objArr[1];
        if (hashMap != null) {
            int intValue2 = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
            String str = (String) hashMap.get(com.showself.net.e.o1);
            if (intValue != 1011) {
                return;
            }
            if (intValue2 == com.showself.net.e.m1) {
                List list = (List) hashMap.get("album");
                if (list != null) {
                    if (this.f2998k == 0) {
                        this.f2994g.clear();
                        this.f2993f.clear();
                        PhotoInfo photoInfo = new PhotoInfo();
                        photoInfo.setUid(-100);
                        this.f2994g.add(photoInfo);
                    }
                    if (list.size() <= 0 || list.size() != this.l) {
                        this.m = false;
                    } else {
                        this.m = true;
                    }
                    this.f2994g.addAll(list);
                    this.f2993f.addAll(list);
                    com.showself.ui.f.b(this.f2993f);
                }
            } else {
                Utils.Z0(this, str);
            }
            this.f2992e.notifyDataSetChanged();
        }
    }
}