导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui;

import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.ImageLoader;
import com.mifeng.ui.R;
import com.r.b.l0;
import com.showself.domain.LoginResultInfo;
import com.showself.domain.TaskInfo;
import com.showself.domain.UserPageInfo;
import com.showself.utils.Utils;
import com.showself.utils.r;
import com.showself.utils.r0;
import com.showself.utils.t;
import com.showself.utils.v;
import com.showself.view.q;
import com.showself.view.u;
import com.xiaomi.mipush.sdk.Constants;
import com.zego.zegoavkit2.ZegoConstants;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.cocos2dx.lib.GameControllerDelegate;

public class ProfileActivity extends com.showself.ui.c {
    private TextView A;
    private TextView B;
    private TextView C;
    private TextView G;
    private TextView H;
    private TextView I;
    private TextView J;
    private TextView K;
    private TextView L;
    private ImageView M;
    private ImageView N;
    private ImageView O;
    private ImageView P;
    private ImageView Q;
    private ImageView R;
    private ImageView S;
    private ImageView T;
    private ImageView U;
    private ImageView V;
    private LoginResultInfo X;
    private Bundle Y;
    private i Z;
    private Button a;
    private UserPageInfo a0;
    TextView b;
    private String b0;
    ImageView c;
    private int c0;
    Button d;
    private String d0;

    TextView f2789e;
    private String e0;

    private File f2790f;
    private String f0;

    private RelativeLayout f2791g;
    ImageLoader g0;

    private RelativeLayout f2792h;

    private RelativeLayout f2793i;

    private TextView f2794j;
    private String j0;

    private TextView f2795k;
    private int k0;
    private TextView l;
    private ImageView m;
    private com.showself.provider.f m0;
    private ImageView n;
    private RelativeLayout n0;
    private ImageView o;
    private LinearLayout o0;
    private ImageView p;
    private ImageView p0;
    private RelativeLayout q;
    private UserPageInfo q0;
    private RelativeLayout r;
    private RelativeLayout s;
    private RelativeLayout t;
    private boolean t0;
    private RelativeLayout u;
    private q u0;
    private RelativeLayout v;
    private Dialog v0;
    private RelativeLayout w;
    private com.r.a.a w0;
    private RelativeLayout x;
    private RelativeLayout y;
    private TextView z;
    private boolean W = false;
    private int h0 = 0;
    private int i0 = 0;
    private Handler l0 = new a();
    private ImageLoader.ImageListener r0 = new b();
    private int s0 = 100;

    class a extends Handler {
        a() {
        }

        @Override
        public void handleMessage(Message message) {
            int i2 = message.what;
            if (i2 == 1) {
                ProfileActivity.this.m.setVisibility(0);
                ProfileActivity.this.n.setVisibility(0);
                ProfileActivity.this.p.setVisibility(0);
                ProfileActivity.this.M.setVisibility(0);
                ProfileActivity.this.N.setVisibility(0);
                ProfileActivity.this.O.setVisibility(0);
                ProfileActivity.this.P.setVisibility(0);
                ProfileActivity.this.Q.setVisibility(0);
                ProfileActivity.this.R.setVisibility(0);
                ProfileActivity.this.S.setVisibility(0);
                ProfileActivity.this.T.setVisibility(0);
                ProfileActivity.this.U.setVisibility(0);
                ProfileActivity.this.V.setVisibility(0);
                ProfileActivity.this.d.setVisibility(0);
                ProfileActivity.this.p0.setVisibility(0);
                return;
            }
            if (i2 != 2) {
                return;
            }
            ProfileActivity.this.m.setVisibility(8);
            ProfileActivity.this.n.setVisibility(8);
            ProfileActivity.this.p.setVisibility(8);
            ProfileActivity.this.M.setVisibility(8);
            ProfileActivity.this.N.setVisibility(8);
            ProfileActivity.this.O.setVisibility(8);
            ProfileActivity.this.P.setVisibility(8);
            ProfileActivity.this.Q.setVisibility(8);
            ProfileActivity.this.R.setVisibility(8);
            ProfileActivity.this.S.setVisibility(8);
            ProfileActivity.this.T.setVisibility(8);
            ProfileActivity.this.U.setVisibility(8);
            ProfileActivity.this.V.setVisibility(8);
            ProfileActivity.this.d.setVisibility(8);
            ProfileActivity.this.p0.setVisibility(8);
        }
    }

    class b implements ImageLoader.ImageListener {
        b() {
        }

        public void onErrorResponse(VolleyError volleyError) {
        }

        public void onResponse(ImageLoader.ImageContainer imageContainer, boolean z) {
            ProfileActivity.this.c.setImageBitmap(Utils.J0(imageContainer.getBitmap(), 0.0f));
        }
    }

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

        @Override
        public void a(File file) {
            ProfileActivity.this.f2790f = file;
            ProfileActivity.this.c0();
        }
    }

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

        @Override
        public void a(File file) {
            ProfileActivity.this.f2790f = file;
            ProfileActivity.this.c0();
        }
    }

    class e implements View.OnClickListener {
        final Dialog a;

        e(ProfileActivity profileActivity, Dialog dialog) {
            this.a = dialog;
        }

        @Override
        public void onClick(View view) {
            this.a.cancel();
        }
    }

    class f implements DialogInterface.OnCancelListener {
        StringBuilder a = new StringBuilder();
        final ArrayList b;

        f(ArrayList arrayList) {
            this.b = arrayList;
        }

        @Override
        public void onCancel(DialogInterface dialogInterface) {
            for (int i2 = 0; i2 < this.b.size(); i2++) {
                if (((TaskInfo) this.b.get(i2)).isClick) {
                    this.a.append(((TaskInfo) this.b.get(i2)).title);
                    this.a.append(ZegoConstants.ZegoVideoDataAuxPublishingStream);
                }
            }
            ProfileActivity.this.s0 = 3;
            ProfileActivity.this.q0.setInterest(this.a.toString());
            ProfileActivity.this.m0("interest", this.a.toString());
        }
    }

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

        @Override
        public void a() {
            Utils.e1(ProfileActivity.this, 14);
        }

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

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

        @Override
        public void a() {
            Utils.f1(ProfileActivity.this, 15);
        }

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

    private class i implements View.OnClickListener {
        private i() {
        }

        @Override
        public void onClick(View view) {
            int id = view.getId();
            switch (id) {
                case R.id.btn_cancel:
                    ProfileActivity.this.v0.dismiss();
                    break;
                case R.id.btn_nav_left:
                    ProfileActivity.this.finish();
                    break;
                case R.id.btn_one:
                    ProfileActivity.this.i0();
                    ProfileActivity.this.v0.dismiss();
                    break;
                case R.id.btn_two:
                    ProfileActivity.this.h0();
                    ProfileActivity.this.v0.dismiss();
                    break;
                case R.id.ll_profile_item_shuoshuo:
                    if (ProfileActivity.this.W) {
                        Intent intent = new Intent();
                        intent.setClass(ProfileActivity.this, EditActivity.class);
                        Bundle bundle = new Bundle();
                        bundle.putString("title", ProfileActivity.this.getString(R.string.mine_signature));
                        bundle.putString("context", ProfileActivity.this.a0.getIntro());
                        bundle.putInt("editnum", 50);
                        intent.putExtras(bundle);
                        ProfileActivity.this.startActivityForResult(intent, 2);
                        break;
                    }
                    break;
                default:
                    switch (id) {
                        case R.id.btn_profile_change_auth_avatar:
                            ProfileActivity.this.d0();
                            break;
                        case R.id.btn_profile_feman:
                            ProfileActivity.this.s0 = 17;
                            ProfileActivity.this.k0 = 2;
                            ProfileActivity.this.m0("gender", "2");
                            break;
                        case R.id.btn_profile_man:
                            ProfileActivity.this.s0 = 17;
                            ProfileActivity.this.k0 = 1;
                            ProfileActivity.this.m0("gender", "1");
                            break;
                        default:
                            switch (id) {
                                case R.id.rl_profile_item_blood:
                                    if (ProfileActivity.this.W) {
                                        Intent intent2 = new Intent();
                                        intent2.setClass(ProfileActivity.this, ProfileSelectActivity.class);
                                        Bundle bundle2 = new Bundle();
                                        bundle2.putString("title", ProfileActivity.this.getString(R.string.blood));
                                        intent2.putExtras(bundle2);
                                        ProfileActivity.this.startActivityForResult(intent2, 10);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_city:
                                    if (ProfileActivity.this.W) {
                                        Intent intent3 = new Intent();
                                        intent3.setClass(ProfileActivity.this, ProfileSelectActivity.class);
                                        Bundle bundle3 = new Bundle();
                                        bundle3.putString("title", ProfileActivity.this.getString(R.string.shengzhixiashi));
                                        intent3.putExtras(bundle3);
                                        ProfileActivity.this.startActivityForResult(intent3, 13);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_company:
                                    if (ProfileActivity.this.W) {
                                        Intent intent4 = new Intent();
                                        intent4.setClass(ProfileActivity.this, EditActivity.class);
                                        Bundle bundle4 = new Bundle();
                                        bundle4.putString("title", ProfileActivity.this.getString(R.string.company));
                                        bundle4.putString("context", ProfileActivity.this.a0.getCompany());
                                        bundle4.putInt("editnum", 20);
                                        intent4.putExtras(bundle4);
                                        ProfileActivity.this.startActivityForResult(intent4, 5);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_hight:
                                    if (ProfileActivity.this.W) {
                                        Intent intent5 = new Intent();
                                        intent5.setClass(ProfileActivity.this, ProfileSelectActivity.class);
                                        Bundle bundle5 = new Bundle();
                                        bundle5.putString("title", ProfileActivity.this.getString(R.string.stature));
                                        intent5.putExtras(bundle5);
                                        ProfileActivity.this.startActivityForResult(intent5, 8);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_hobby:
                                    if (ProfileActivity.this.W && !ProfileActivity.this.t0) {
                                        ProfileActivity.this.t0 = true;
                                        Utils.U0(ProfileActivity.this);
                                        com.showself.service.f fVar = new com.showself.service.f(10091, new HashMap());
                                        ?? r0 = ProfileActivity.this;
                                        r0.addTask(fVar, r0);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_job:
                                    if (ProfileActivity.this.W) {
                                        Intent intent6 = new Intent();
                                        intent6.setClass(ProfileActivity.this, EditActivity.class);
                                        Bundle bundle6 = new Bundle();
                                        bundle6.putString("title", ProfileActivity.this.getString(R.string.profession));
                                        bundle6.putString("context", ProfileActivity.this.a0.getOccupation());
                                        bundle6.putInt("editnum", 20);
                                        intent6.putExtras(bundle6);
                                        ProfileActivity.this.startActivityForResult(intent6, 4);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_marry:
                                    if (ProfileActivity.this.W) {
                                        Intent intent7 = new Intent();
                                        intent7.setClass(ProfileActivity.this, ProfileSelectActivity.class);
                                        Bundle bundle7 = new Bundle();
                                        bundle7.putString("title", ProfileActivity.this.getString(R.string.marry_status));
                                        intent7.putExtras(bundle7);
                                        ProfileActivity.this.startActivityForResult(intent7, 7);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_money:
                                    if (ProfileActivity.this.W) {
                                        Intent intent8 = new Intent();
                                        intent8.setClass(ProfileActivity.this, ProfileSelectActivity.class);
                                        Bundle bundle8 = new Bundle();
                                        bundle8.putString("title", ProfileActivity.this.getString(R.string.monthly_pay));
                                        intent8.putExtras(bundle8);
                                        ProfileActivity.this.startActivityForResult(intent8, 11);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_nickname:
                                    if (ProfileActivity.this.W) {
                                        Intent intent9 = new Intent();
                                        intent9.setClass(ProfileActivity.this, EditActivity.class);
                                        Bundle bundle9 = new Bundle();
                                        bundle9.putString("title", ProfileActivity.this.getString(R.string.nickname));
                                        bundle9.putString("context", ProfileActivity.this.a0.getUsername());
                                        bundle9.putInt("editnum", 20);
                                        intent9.putExtras(bundle9);
                                        ProfileActivity.this.startActivityForResult(intent9, 1);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_sanwei:
                                    if (ProfileActivity.this.W) {
                                        Intent intent10 = new Intent();
                                        intent10.setClass(ProfileActivity.this, ProfileSelectActivity.class);
                                        Bundle bundle10 = new Bundle();
                                        bundle10.putString("title", ProfileActivity.this.getString(R.string.xiongwei));
                                        intent10.putExtras(bundle10);
                                        ProfileActivity.this.startActivityForResult(intent10, 12);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_school:
                                    if (ProfileActivity.this.W) {
                                        Intent intent11 = new Intent();
                                        intent11.setClass(ProfileActivity.this, EditActivity.class);
                                        Bundle bundle11 = new Bundle();
                                        bundle11.putString("title", ProfileActivity.this.getString(R.string.school));
                                        bundle11.putString("context", ProfileActivity.this.a0.getSchool());
                                        bundle11.putInt("editnum", 20);
                                        intent11.putExtras(bundle11);
                                        ProfileActivity.this.startActivityForResult(intent11, 6);
                                        break;
                                    }
                                    break;
                                case R.id.rl_profile_item_showself_id:
                                    if (ProfileActivity.this.W) {
                                        if (ProfileActivity.this.a0.getIsGender() != 1) {
                                            ProfileActivity.this.e0();
                                            break;
                                        } else {
                                            Utils.Z0(ProfileActivity.this, "性别只能修改一次");
                                            break;
                                        }
                                    }
                                    break;
                                case R.id.rl_profile_item_weight:
                                    if (ProfileActivity.this.W) {
                                        Intent intent12 = new Intent();
                                        intent12.setClass(ProfileActivity.this, ProfileSelectActivity.class);
                                        Bundle bundle12 = new Bundle();
                                        bundle12.putString("title", ProfileActivity.this.getString(R.string.weight));
                                        intent12.putExtras(bundle12);
                                        ProfileActivity.this.startActivityForResult(intent12, 9);
                                        break;
                                    }
                                    break;
                            }
                    }
            }
        }

        i(ProfileActivity profileActivity, a aVar) {
            this();
        }
    }

    private void b0() {
        Utils.Q0(this, getString(R.string.prompt), getString(R.string.auth_photo_alert), null, 0, getString(R.string.know), getResources().getColor(2131099758), null, true);
    }

    public void c0() {
        if (this.t0 || !this.W) {
            return;
        }
        if (this.c0 < 12) {
            Utils.Z0(this, getString(R.string.error_input_age));
            return;
        }
        if (this.f2790f != null) {
            this.t0 = true;
            HashMap hashMap = new HashMap();
            hashMap.put("imagePath", this.f2790f.getPath());
            addTask(new com.showself.service.f(GameControllerDelegate.BUTTON_DPAD_RIGHT, hashMap), this);
            Utils.U0(this);
        }
    }

    public void d0() {
        this.v0 = new Dialog(this, 2131755755);
        View inflate = LayoutInflater.from(this).inflate(R.layout.card_dialog, (ViewGroup) null);
        TextView textView = (TextView) inflate.findViewById(R.id.btn_one);
        TextView textView2 = (TextView) inflate.findViewById(R.id.btn_two);
        TextView textView3 = (TextView) inflate.findViewById(R.id.btn_cancel);
        this.v0.setContentView(inflate);
        this.v0.getWindow().setLayout(-1, -2);
        this.v0.getWindow().setGravity(80);
        this.v0.getWindow().setWindowAnimations(2131755745);
        this.v0.setCanceledOnTouchOutside(true);
        this.v0.show();
        textView.setOnClickListener(this.Z);
        textView2.setOnClickListener(this.Z);
        textView3.setOnClickListener(this.Z);
    }

    public void e0() {
        this.u0 = new q();
        this.u0.k(this, new u(this, this.a0.getGender(), this.Z).a(), 1.0f, 80, -1, -2, 0);
    }

    private void f0(int i2) {
        if (this.t0) {
            return;
        }
        this.t0 = true;
        HashMap hashMap = new HashMap();
        hashMap.put("fuid", Integer.valueOf(i2));
        hashMap.put("type", 2);
        addTask(new com.showself.service.f(1004, hashMap), this);
    }

    private List<String> g0(UserPageInfo userPageInfo) {
        ArrayList arrayList = new ArrayList();
        if (userPageInfo.getIsRedPerson() == 103) {
            arrayList.add(this.m0.r(130, 0, 0, "103"));
        } else if (userPageInfo.getIsRedPerson() == 104) {
            arrayList.add(this.m0.r(130, 0, 0, "104"));
        } else if (userPageInfo.getApprove() == 1) {
            arrayList.add(this.j0);
        }
        int i2 = this.i0;
        if (i2 != 0) {
            arrayList.add(this.m0.k(i2, 0));
        }
        if (userPageInfo.getSmall_medals() != null && userPageInfo.getSmall_medals().size() > 0) {
            arrayList.addAll(userPageInfo.getSmall_medals());
        }
        return arrayList;
    }

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

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

    private void j0() {
        this.b0 = this.a0.getUsername();
        this.e0 = this.a0.getIntro();
        this.c0 = Utils.q(this.a0.getBirthday());
        this.d0 = Utils.w(this.a0.getBirthday());
        this.X.setUserName(this.b0);
        r0.b(this, this.X);
    }

    private void k0(ArrayList<String> arrayList) {
        if (arrayList == null || arrayList.isEmpty()) {
            Utils.Z0(this, getString(R.string.get_hobby_fail));
            return;
        }
        Dialog dialog = new Dialog(this, 2131755755);
        View inflate = View.inflate(this, R.layout.hobby_dialog, null);
        ((TextView) inflate.findViewById(R.id.tv_nav_title)).setText(getString(R.string.interest_hobby));
        ListView listView = (ListView) inflate.findViewById(R.id.lv_hobby);
        inflate.findViewById(R.id.btn_nav_left).setOnClickListener(new e(this, dialog));
        ArrayList arrayList2 = new ArrayList();
        for (int i2 = 0; i2 < arrayList.size(); i2++) {
            TaskInfo taskInfo = new TaskInfo();
            taskInfo.title = arrayList.get(i2);
            if (this.a0.getInterest().contains(arrayList.get(i2))) {
                taskInfo.isClick = true;
            }
            arrayList2.add(taskInfo);
        }
        listView.setAdapter((ListAdapter) new l0(arrayList2, this));
        inflate.setMinimumWidth((int) (dialog.getWindow().getWindowManager().getDefaultDisplay().getWidth() * 0.8f));
        dialog.setContentView(inflate);
        dialog.show();
        dialog.setOnCancelListener(new f(arrayList2));
    }

    private void l0() {
        Button button = (Button) findViewById(R.id.btn_profile_user_age_sex);
        button.setVisibility(0);
        if (this.a0.getGender() == 2) {
            button.setBackgroundResource(R.drawable.female_age);
        } else {
            button.setBackgroundResource(R.drawable.male_age);
        }
    }

    private void n0() {
        UserPageInfo userPageInfo;
        int i2 = this.s0;
        if (i2 == 100 || (userPageInfo = this.q0) == null) {
            return;
        }
        switch (i2) {
            case 1:
                this.f2794j.setText(userPageInfo.getUsername());
                this.f2789e.setText(this.q0.getUsername());
                this.a0.setUsername(this.q0.getUsername());
                r0.c1(this, this.a0.getUid(), this.a0.getAvatar(), this.q0.getUsername(), this.a0.getExp_url());
                break;
            case 2:
                this.l.setText(t.b().a(this.q0.getIntro()));
                this.a0.setIntro(this.q0.getIntro());
                break;
            case 3:
                this.H.setText(userPageInfo.getInterest());
                this.a0.setInterest(this.q0.getInterest());
                break;
            case 4:
                this.I.setText(userPageInfo.getOccupation());
                this.a0.setOccupation(this.q0.getOccupation());
                break;
            case 5:
                this.J.setText(userPageInfo.getCompany());
                this.a0.setCompany(this.q0.getCompany());
                break;
            case 6:
                this.L.setText(userPageInfo.getSchool());
                this.a0.setSchool(this.q0.getSchool());
                break;
            case 7:
                this.z.setText(userPageInfo.getAffectivestatus());
                this.a0.setAffectivestatus(this.q0.getAffectivestatus());
                break;
            case 8:
                this.A.setText(this.q0.getHeight() + "cm");
                this.a0.setHeight(this.q0.getHeight());
                break;
            case 9:
                this.B.setText(this.q0.getWeight() + "kg");
                this.a0.setWeight(this.q0.getWeight());
                break;
            case 10:
                this.G.setText(userPageInfo.getBloodtype());
                this.a0.setBloodtype(this.q0.getBloodtype());
                break;
            case 11:
                this.K.setText(userPageInfo.getSalary());
                this.a0.setSalary(this.q0.getSalary());
                break;
            case 12:
                this.C.setText(userPageInfo.getMeasurements());
                this.a0.setMeasurements(this.q0.getMeasurements());
                break;
            case 13:
                String G0 = Utils.G0(userPageInfo.getLocation());
                if (G0 == null) {
                    this.f2795k.setText(this.a0.getLocation_full_str());
                } else {
                    this.f2795k.setText(G0);
                }
                this.a0.setLocation(this.q0.getLocation());
                l0();
                break;
            case 16:
                this.a0.setBirthday(userPageInfo.getBirthday());
                l0();
                break;
            case 17:
                if (this.k0 == 2) {
                    this.o.setBackgroundResource(R.drawable.female_age);
                } else {
                    this.o.setBackgroundResource(R.drawable.male_age);
                }
                this.a0.setGender(this.k0);
                l0();
                break;
        }
    }

    @Override
    public void finish() {
        if (this.W && this.X.getUserId() == this.a0.getUid()) {
            Intent intent = new Intent();
            intent.putExtra("nickname", this.b0);
            intent.putExtra("age", this.c0);
            intent.putExtra("star", this.d0);
            intent.putExtra("intro", this.e0);
            intent.putExtra("avatarurl", this.f0);
            this.a0.setUsername(this.b0);
            this.a0.setAge(this.c0);
            this.a0.setIntro(this.e0);
            this.a0.setAvatar(this.f0);
            intent.putExtra("pageInfo", this.a0);
            setResult(-1, intent);
        }
        this.q0 = null;
        super.finish();
    }

    @Override
    public void init() {
        this.q0 = new UserPageInfo();
        this.m0 = com.showself.provider.f.h();
        this.f0 = this.a0.getAvatar();
        this.c0 = Utils.q(this.a0.getBirthday());
        TextView textView = (TextView) findViewById(R.id.tv_nav_title);
        this.b = textView;
        textView.setText(getString(R.string.profile));
        Button button = (Button) findViewById(R.id.btn_nav_left);
        this.a = button;
        button.setOnClickListener(this.Z);
        ImageView imageView = (ImageView) findViewById(R.id.iv_profile_user_avator);
        this.c = imageView;
        this.g0.displayImage(this.f0, imageView, this.r0);
        TextView textView2 = (TextView) findViewById(R.id.tv_profile_user_nickname);
        this.f2789e = textView2;
        textView2.setSelected(true);
        String username = this.a0.getUsername();
        this.b0 = username;
        this.f2789e.setText(username);
        l0();
        List<String> g0 = g0(this.a0);
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.ll_profile_user_medals);
        linearLayout.removeAllViews();
        if (g0 == null || g0.size() <= 0) {
            linearLayout.setVisibility(4);
        } else {
            int b2 = r.b(getBaseContext(), 20.0f);
            for (int i2 = 0; i2 < g0.size(); i2++) {
                ImageView imageView2 = new ImageView(getBaseContext());
                linearLayout.addView(imageView2, b2, b2);
                this.g0.displayImage(g0.get(i2), imageView2);
            }
            linearLayout.setVisibility(0);
        }
        Button button2 = (Button) findViewById(R.id.btn_profile_change_auth_avatar);
        this.d = button2;
        button2.setVisibility(8);
        this.f2791g = (RelativeLayout) findViewById(R.id.rl_profile_item_nickname);
        TextView textView3 = (TextView) findViewById(R.id.tv_profile_item_nickname);
        this.f2794j = textView3;
        textView3.setText(this.a0.getUsername());
        ImageView imageView3 = (ImageView) findViewById(R.id.iv_profile_item_nickname);
        this.m = imageView3;
        imageView3.setVisibility(8);
        this.f2791g.setOnClickListener(this.Z);
        this.f2792h = (RelativeLayout) findViewById(R.id.rl_profile_item_city);
        this.f2795k = (TextView) findViewById(R.id.tv_profile_item_city);
        String G0 = Utils.G0(this.a0.getLocation());
        if (G0 == null) {
            this.f2795k.setText(this.a0.getLocation_full_str());
        } else {
            this.f2795k.setText(G0);
        }
        ImageView imageView4 = (ImageView) findViewById(R.id.iv_profile_item_city);
        this.n = imageView4;
        imageView4.setVisibility(8);
        this.f2792h.setOnClickListener(this.Z);
        this.n0 = (RelativeLayout) findViewById(R.id.ll_profile_item_shuoshuo);
        this.l = (TextView) findViewById(R.id.tv_profile_item_shuoshuo);
        this.e0 = this.a0.getIntro();
        this.l.setText(t.b().a(this.e0));
        ImageView imageView5 = (ImageView) findViewById(R.id.iv_profile_item_shuoshuo);
        this.p = imageView5;
        imageView5.setVisibility(8);
        this.n0.setOnClickListener(this.Z);
        RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.rl_profile_item_showself_id);
        this.f2793i = relativeLayout;
        relativeLayout.setOnClickListener(this.Z);
        this.o = (ImageView) findViewById(R.id.tv_profile_item_showself_id);
        if (this.a0.getGender() == 2) {
            this.o.setBackgroundResource(R.drawable.female_age);
        } else {
            this.o.setBackgroundResource(R.drawable.male_age);
        }
        ImageView imageView6 = (ImageView) findViewById(R.id.iv_profile_item_showself_id);
        this.p0 = imageView6;
        imageView6.setVisibility(4);
        this.q = (RelativeLayout) findViewById(R.id.rl_profile_item_marry);
        TextView textView4 = (TextView) findViewById(R.id.tv_profile_item_marry);
        this.z = textView4;
        textView4.setText(this.a0.getAffectivestatus());
        ImageView imageView7 = (ImageView) findViewById(R.id.iv_profile_item_marry);
        this.M = imageView7;
        imageView7.setVisibility(8);
        this.q.setOnClickListener(this.Z);
        this.r = (RelativeLayout) findViewById(R.id.rl_profile_item_hight);
        this.A = (TextView) findViewById(R.id.tv_profile_hight);
        if (this.a0.getHeight() == 0) {
            this.A.setText("");
        } else {
            this.A.setText(this.a0.getHeight() + "cm");
        }
        ImageView imageView8 = (ImageView) findViewById(R.id.iv_profile_item_hight);
        this.N = imageView8;
        imageView8.setVisibility(8);
        this.r.setOnClickListener(this.Z);
        this.s = (RelativeLayout) findViewById(R.id.rl_profile_item_weight);
        this.B = (TextView) findViewById(R.id.tv_profile_item_weight);
        if (this.a0.getWeight() == 0) {
            this.B.setText("");
        } else {
            this.B.setText(this.a0.getWeight() + "kg");
        }
        ImageView imageView9 = (ImageView) findViewById(R.id.iv_profile_item_weight);
        this.O = imageView9;
        imageView9.setVisibility(8);
        this.s.setOnClickListener(this.Z);
        this.t = (RelativeLayout) findViewById(R.id.rl_profile_item_sanwei);
        TextView textView5 = (TextView) findViewById(R.id.tv_profile_item_sanwei);
        this.C = textView5;
        textView5.setText(this.a0.getMeasurements());
        ImageView imageView10 = (ImageView) findViewById(R.id.iv_profile_item_sanwei);
        this.P = imageView10;
        imageView10.setVisibility(8);
        this.t.setOnClickListener(this.Z);
        this.u = (RelativeLayout) findViewById(R.id.rl_profile_item_blood);
        TextView textView6 = (TextView) findViewById(R.id.tv_profile_item_blood);
        this.G = textView6;
        textView6.setText(this.a0.getBloodtype());
        ImageView imageView11 = (ImageView) findViewById(R.id.iv_profile_item_blood);
        this.Q = imageView11;
        imageView11.setVisibility(8);
        this.u.setOnClickListener(this.Z);
        this.o0 = (LinearLayout) findViewById(R.id.rl_profile_item_hobby);
        TextView textView7 = (TextView) findViewById(R.id.tv_profile_item_hobby);
        this.H = textView7;
        textView7.setText(this.a0.getInterest());
        ImageView imageView12 = (ImageView) findViewById(R.id.iv_profile_item_hobby);
        this.R = imageView12;
        imageView12.setVisibility(8);
        this.o0.setOnClickListener(this.Z);
        this.v = (RelativeLayout) findViewById(R.id.rl_profile_item_job);
        TextView textView8 = (TextView) findViewById(R.id.tv_profile_item_job);
        this.I = textView8;
        textView8.setText(this.a0.getOccupation());
        ImageView imageView13 = (ImageView) findViewById(R.id.iv_profile_item_job);
        this.S = imageView13;
        imageView13.setVisibility(8);
        this.v.setOnClickListener(this.Z);
        this.w = (RelativeLayout) findViewById(R.id.rl_profile_item_company);
        TextView textView9 = (TextView) findViewById(R.id.tv_profile_item_company);
        this.J = textView9;
        textView9.setText(this.a0.getCompany());
        ImageView imageView14 = (ImageView) findViewById(R.id.iv_profile_item_company);
        this.T = imageView14;
        imageView14.setVisibility(8);
        this.w.setOnClickListener(this.Z);
        this.x = (RelativeLayout) findViewById(R.id.rl_profile_item_money);
        TextView textView10 = (TextView) findViewById(R.id.tv_profile_item_money);
        this.K = textView10;
        textView10.setText(this.a0.getSalary());
        ImageView imageView15 = (ImageView) findViewById(R.id.iv_profile_item_money);
        this.U = imageView15;
        imageView15.setVisibility(8);
        this.x.setOnClickListener(this.Z);
        this.y = (RelativeLayout) findViewById(R.id.rl_profile_item_school);
        TextView textView11 = (TextView) findViewById(R.id.tv_profile_item_school);
        this.L = textView11;
        textView11.setText(this.a0.getSchool());
        ImageView imageView16 = (ImageView) findViewById(R.id.iv_profile_item_school);
        this.V = imageView16;
        imageView16.setVisibility(8);
        this.y.setOnClickListener(this.Z);
        if (this.X.getUserId() != this.a0.getUid()) {
            this.W = false;
            this.l0.sendEmptyMessage(2);
        } else {
            this.W = true;
            this.d.setOnClickListener(this.Z);
            this.l0.sendEmptyMessage(1);
        }
    }

    public void m0(Object... objArr) {
        if (this.t0 || !this.W) {
            return;
        }
        if (this.c0 < 12) {
            Utils.Z0(this, getString(R.string.error_input_age));
            return;
        }
        this.t0 = true;
        String str = (String) objArr[0];
        String str2 = (String) objArr[1];
        HashMap hashMap = new HashMap();
        hashMap.put("field", str);
        hashMap.put(str, str2);
        addTask(new com.showself.service.f(20031, hashMap), getApplicationContext());
    }

    @Override
    protected void onActivityResult(int i2, int i3, Intent intent) {
        Bundle bundle;
        String str;
        super.onActivityResult(i2, i3, intent);
        String str2 = null;
        if (i2 == 15 || i2 == 14) {
            bundle = null;
        } else {
            if (intent == null) {
                return;
            }
            bundle = intent.getExtras();
            if (bundle == null && i2 != 111) {
                return;
            }
        }
        if (i3 == -1 && i2 == 1) {
            this.s0 = 1;
            String string = bundle.getString("edit");
            this.q0.setUsername(string);
            str = String.valueOf(string);
            str2 = "username";
        } else {
            str = null;
        }
        if (i3 == -1 && i2 == 2) {
            this.s0 = 2;
            String string2 = bundle.getString("edit");
            this.q0.setIntro(string2);
            str = String.valueOf(string2);
            str2 = "intro";
        }
        if (i3 == -1 && i2 == 20) {
            this.s0 = 20;
            String string3 = bundle.getString("edit");
            this.q0.setWelcome(string3);
            str = String.valueOf(string3);
            str2 = "address";
        }
        if (i3 == -1 && i2 == 4) {
            this.s0 = 4;
            String string4 = bundle.getString("edit");
            this.q0.setOccupation(string4);
            str = String.valueOf(string4);
            str2 = "occupation";
        }
        if (i3 == -1 && i2 == 5) {
            this.s0 = 5;
            this.q0.setCompany(bundle.getString("edit"));
            str = String.valueOf(bundle.getString("edit"));
            str2 = "company";
        }
        if (i3 == -1 && i2 == 6) {
            this.s0 = 6;
            this.q0.setSchool(bundle.getString("edit"));
            str = String.valueOf(bundle.getString("edit"));
            str2 = "graduateschool";
        }
        if (i3 == -1 && i2 == 7) {
            this.s0 = 7;
            this.q0.setAffectivestatus(bundle.getString("context"));
            str = String.valueOf(bundle.getString("context"));
            str2 = "affectivestatus";
        }
        if (i3 == -1 && i2 == 8) {
            this.s0 = 8;
            int parseInt = Integer.parseInt(bundle.getString("context").substring(0, bundle.getString("context").length() - 2));
            this.q0.setHeight(parseInt);
            str = String.valueOf(parseInt);
            str2 = "height";
        }
        if (i3 == -1 && i2 == 9) {
            this.s0 = 9;
            int parseInt2 = Integer.parseInt(bundle.getString("context").substring(0, bundle.getString("context").length() - 2));
            this.q0.setWeight(parseInt2);
            str = String.valueOf(parseInt2);
            str2 = "weight";
        }
        if (i3 == -1 && i2 == 10) {
            this.s0 = 10;
            this.q0.setBloodtype(bundle.getString("context"));
            str = String.valueOf(bundle.getString("context"));
            str2 = "bloodtype";
        }
        if (i3 == -1 && i2 == 11) {
            this.s0 = 11;
            this.q0.setSalary(bundle.getString("context"));
            str = String.valueOf(bundle.getString("context"));
            str2 = "salary";
        }
        if (i3 == -1 && i2 == 12) {
            this.s0 = 12;
            this.q0.setMeasurements(bundle.getString("context"));
            str = String.valueOf(bundle.getString("context"));
            str2 = "measurements";
        }
        if (i3 == -1 && i2 == 13) {
            this.s0 = 13;
            String str3 = bundle.getInt("pid") + Constants.ACCEPT_TIME_SEPARATOR_SERVER + bundle.getInt("cid") + Constants.ACCEPT_TIME_SEPARATOR_SERVER + bundle.getInt("zid");
            this.q0.setLocation(str3);
            str = String.valueOf(str3);
            str2 = "location";
        }
        if (i3 == -1 && i2 == 14) {
            Uri data = intent.getData();
            if (data == null) {
                Utils.Z0(getApplicationContext(), getString(R.string.network_get_photo_fail));
                return;
            }
            Utils.N0(this, v.h(this, data), new c());
        }
        if (i3 == -1 && i2 == 15) {
            Utils.N0(this, v.a, new d());
        }
        if (i3 == -1 && i2 == 111) {
            try {
                this.f2790f = v.a(this, Utils.C() + "/myPhoto/croptemp", -1);
                c0();
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
        if (i2 == 14 || i2 == 15 || i2 == 111 || str2 == null || str == null) {
            return;
        }
        m0(str2, str);
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.profile_tab);
        this.Z = new i(this, null);
        this.X = r0.y(this);
        this.g0 = ImageLoader.getInstance(getApplicationContext());
        Bundle extras = getIntent().getExtras();
        this.Y = extras;
        this.h0 = extras.getInt("id");
        this.j0 = this.Y.getString("v_url");
        getWindowManager().getDefaultDisplay().getMetrics(new DisplayMetrics());
        f0(this.h0);
    }

    @Override
    protected void onDestroy() {
        com.showself.service.g.i(this);
        super.onDestroy();
    }

    public boolean onKeyDown(int i2, KeyEvent keyEvent) {
        if (keyEvent.getAction() == 0 && i2 == 4) {
            finish();
        }
        return super/*android.app.Activity*/.onKeyDown(i2, keyEvent);
    }

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

    @Override
    public void refresh(Object... objArr) {
        this.t0 = false;
        Utils.n(this);
        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 != 1004) {
                if (intValue == 1005) {
                    if (intValue2 == com.showself.net.e.m1) {
                        b0();
                    } else {
                        Utils.Z0(this, getString(R.string.upload_fail) + str);
                    }
                    v.e();
                    return;
                }
                if (intValue == 1013) {
                    if (intValue2 == com.showself.net.e.m1) {
                        this.c.setImageBitmap(Utils.J0(BitmapFactory.decodeFile(this.f2790f.getPath()), 0.0f));
                        String str2 = (String) hashMap.get("avatar");
                        if (!TextUtils.isEmpty(str2)) {
                            this.f0 = str2;
                            this.a0.setAvatar(str2);
                            this.X.setAvatar(this.f0);
                        }
                        j0();
                        Utils.Z0(this, str);
                    } else {
                        Utils.Z0(this, getString(R.string.change_fail) + str);
                        this.f2794j.setText(this.b0);
                        this.f2789e.setText(this.b0);
                    }
                    v.e();
                    return;
                }
                if (intValue != 10091) {
                    if (intValue != 20031) {
                        return;
                    }
                    if (intValue2 == com.showself.net.e.m1) {
                        n0();
                        j0();
                        Utils.Z0(this, str);
                    } else {
                        Utils.Z0(this, getString(R.string.change_fail) + str);
                        this.f2794j.setText(this.b0);
                        this.f2789e.setText(this.b0);
                    }
                    q qVar = this.u0;
                    if (qVar != null) {
                        qVar.b();
                        return;
                    }
                    return;
                }
                if (intValue2 == com.showself.net.e.m1) {
                    k0((ArrayList) hashMap.get("hobby"));
                } else {
                    Utils.Z0(this, str);
                }
            }
            if (intValue2 != com.showself.net.e.m1) {
                Utils.Z0(this, str);
                return;
            }
            if (((UserPageInfo) hashMap.get("user")) != null) {
                this.a0 = (UserPageInfo) hashMap.get("user");
                this.i0 = ((Integer) hashMap.get("vip_status")).intValue();
            }
            init();
        }
    }
}