酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319

以下内容为反编译后的 m.java 源代码,内容仅作参考


package com.kugou.android.userCenter.guesthead;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.kugou.android.app.flexowebview.KGFelxoWebFragment;
import com.kugou.android.app.flexowebview.KugouWebUtils;
import com.kugou.android.lite.R;
import com.kugou.android.userCenter.newest.entity.d;
import com.kugou.common.userCenter.GuestUserInfoEntity;
import com.kugou.common.utils.br;
import com.kugou.framework.service.util.BackgroundServiceUtil;
import java.util.ArrayList;
import java.util.Locale;

public class m extends com.kugou.android.userCenter.guesthead.a {
    private int f;
    private View g;
    private View h;
    private LinearLayout i;
    private View j;
    private LinearLayout k;
    private final d l;
    private GuestUserInfoEntity m;
    private a n;
    private d.a.InterfaceC0776a o;
    private d.a.InterfaceC0776a p;
    private TextView q;

    public interface a {
        void a(boolean z);
    }

    public m(Context context, long j) {
        super(context, R.layout.al4, j);
        this.f = 1;
        this.o = new d.a.InterfaceC0776a() {
            @Override
            public void a() {
                if (m.this.m == null) {
                    return;
                }
                Bundle bundle = new Bundle();
                bundle.putString("web_url", "http://m.kugou.com/webapp/kg/apply.html");
                com.kugou.common.base.g.a((Class<? extends Fragment>) KGFelxoWebFragment.class, bundle);
                BackgroundServiceUtil.trace(new com.kugou.common.statistics.song.a.a(m.this.f44203a, com.kugou.framework.statistics.easytrace.a.amt).setSvar1(com.kugou.common.environment.a.Y() == m.this.m.getUserid() ? "主态" : "客态").setSvar2(m.this.m.getUserid() + ""));
            }
        };
        this.p = new d.a.InterfaceC0776a() {
            @Override
            public void a() {
                String bu = com.kugou.common.q.b.a().bu();
                Context context2 = m.this.f44203a;
                if (TextUtils.isEmpty(bu)) {
                    bu = "http://www2.kugou.kugou.com/apps/studentAccount/html/upload.html";
                }
                KugouWebUtils.a(context2, "在校学生认证", bu);
                if (m.this.m == null || m.this.m.getUserid() == com.kugou.common.environment.a.Y()) {
                    return;
                }
                BackgroundServiceUtil.trace(new com.kugou.common.statistics.song.a.a(m.this.f44203a, com.kugou.framework.statistics.easytrace.a.amw).setSvar1("客态"));
            }
        };
        this.l = new d();
        this.g = this.f44204b.getChildAt(0);
        this.h = this.f44204b.findViewById(R.id.fg0);
        this.q = (TextView) this.f44204b.findViewById(R.id.fg4);
        this.i = (LinearLayout) this.f44204b.findViewById(R.id.fg1);
        this.j = this.f44204b.findViewById(R.id.fg2);
        this.k = (LinearLayout) this.f44204b.findViewById(R.id.fg3);
    }

    @Override
    public void h() {
        if (this.i != null) {
            for (int i = 0; i < this.i.getChildCount(); i++) {
                View childAt = this.i.getChildAt(i);
                if (childAt instanceof TextView) {
                    ((TextView) childAt).setTextColor(com.kugou.common.skinpro.d.b.a().a(com.kugou.common.skinpro.shadowframe.c.SECONDARY_TEXT));
                }
            }
        }
    }

    private void d() {
        if (this.l.k != null && this.l.k.size() > 0) {
            this.i.removeAllViews();
            this.k.removeAllViews();
            boolean z = false;
            for (int i = 0; i < this.l.k.size(); i++) {
                final d.a aVar = this.l.k.get(i);
                TextView textView = new TextView(this.f44203a);
                textView.setText(aVar.f44975c);
                textView.setTextColor(com.kugou.common.skinpro.d.b.a().a(com.kugou.common.skinpro.shadowframe.c.SECONDARY_TEXT));
                textView.setTextSize(1, 13.0f);
                LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
                layoutParams.topMargin = br.a(this.f44203a, 5.0f);
                textView.setLayoutParams(layoutParams);
                if (aVar.f44974b > 0) {
                    Drawable drawable = this.f44203a.getResources().getDrawable(aVar.f44974b);
                    drawable.setBounds(0, 0, br.a(this.f44203a, 18.0f), br.a(this.f44203a, 18.0f));
                    textView.setCompoundDrawables(drawable, null, null, null);
                    textView.setCompoundDrawablePadding(br.a(this.f44203a, 7.0f));
                }
                if (aVar.f44976d) {
                    if (aVar.f44973a != null) {
                        textView.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                aVar.f44973a.a();
                            }
                        });
                    }
                    this.i.addView(textView);
                    z = true;
                } else {
                    this.k.addView(textView);
                }
            }
            if (z) {
                this.h.setVisibility(0);
                this.i.setVisibility(0);
                this.g.setVisibility(0);
                a aVar2 = this.n;
                if (aVar2 != null) {
                    aVar2.a(false);
                }
            } else {
                this.h.setVisibility(8);
                this.i.setVisibility(8);
                a aVar3 = this.n;
                if (aVar3 != null) {
                    aVar3.a(true);
                }
            }
        } else {
            a aVar4 = this.n;
            if (aVar4 != null) {
                aVar4.a(true);
            }
            this.g.setVisibility(8);
        }
        GuestUserInfoEntity guestUserInfoEntity = this.m;
        if (guestUserInfoEntity == null || TextUtils.isEmpty(guestUserInfoEntity.getTalentTitle())) {
            this.q.setVisibility(8);
            return;
        }
        this.g.setVisibility(0);
        this.q.setVisibility(0);
        this.h.setVisibility(0);
        this.q.setText(this.m.getTalentTitle());
    }

    public void a(long j) {
        d();
    }

    public void a(GuestUserInfoEntity guestUserInfoEntity) {
        if (guestUserInfoEntity == null) {
            return;
        }
        this.m = guestUserInfoEntity;
        boolean z = guestUserInfoEntity.K() == 1;
        boolean z2 = guestUserInfoEntity.y() == 1;
        boolean z3 = guestUserInfoEntity.b() == 2;
        boolean e2 = guestUserInfoEntity.e();
        ArrayList arrayList = new ArrayList();
        if (z2 || z || e2) {
            d.a aVar = new d.a();
            aVar.f44975c = guestUserInfoEntity.D();
            String D = guestUserInfoEntity.D();
            if (z) {
                aVar.f44974b = R.drawable.b81;
                if (TextUtils.isEmpty(D)) {
                    aVar.f44975c = "腾讯音乐人";
                }
                this.f = 2;
            } else if (z2) {
                aVar.f44974b = R.drawable.b7z;
                if (TextUtils.isEmpty(D)) {
                    aVar.f44975c = "酷狗音乐人";
                }
                this.f = 3;
            } else if (e2) {
                aVar.f44974b = R.drawable.b80;
                this.f = 6;
                if (TextUtils.isEmpty(D)) {
                    aVar.f44975c = br.W() ? "酷狗超人" : "酷狗达人";
                }
            }
            arrayList.add(aVar);
        }
        if (guestUserInfoEntity.L() == 3) {
            d.a aVar2 = new d.a();
            aVar2.f44974b = R.drawable.b80;
            if (z2 || z || e2) {
                aVar2.f44975c = "酷狗号";
            } else {
                this.f = 4;
                aVar2.f44975c = "酷狗号" + guestUserInfoEntity.D();
            }
            aVar2.a(this.o);
        } else if (guestUserInfoEntity.L() == 1) {
            d.a aVar3 = new d.a();
            if (!z2 && !z && !e2) {
                this.f = 4;
            }
            aVar3.f44975c = "酷狗号";
            aVar3.a(this.o);
            aVar3.f44976d = false;
        }
        if (z3) {
            d.a aVar4 = new d.a();
            aVar4.f44974b = R.drawable.b83;
            if (this.f == 1) {
                this.f = 5;
            }
            if (!TextUtils.isEmpty(guestUserInfoEntity.c())) {
                aVar4.f44975c = String.format(Locale.getDefault(), "已认证:%s学生", guestUserInfoEntity.c());
                aVar4.a(this.p);
            } else {
                aVar4.f44975c = "";
            }
            arrayList.add(aVar4);
        }
        this.l.k = arrayList;
        d();
    }

    public void a(a aVar) {
        this.n = aVar;
    }
}