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

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


package com.kugou.android.app.flexowebview.c;

import android.content.Context;
import android.graphics.Paint;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kugou.android.common.delegate.DelegateFragment;
import com.kugou.android.lite.R;
import com.kugou.common.utils.cj;
import java.util.ArrayList;
import java.util.List;

public class b {

    private LinearLayout f9338a;

    private String[] f9339b = {"唱片店", "演出"};

    private List<TextView> f9340c = new ArrayList();

    private DelegateFragment f9341d;

    private com.kugou.common.web.b f9342e;

    public b(DelegateFragment delegateFragment, com.kugou.common.web.b bVar) {
        this.f9341d = delegateFragment;
        this.f9342e = bVar;
    }

    public void a(boolean z) {
        View findViewById;
        if (this.f9338a == null && z && (findViewById = this.f9341d.findViewById(R.id.cwt)) != null && (findViewById instanceof RelativeLayout)) {
            a((RelativeLayout) findViewById);
        }
        LinearLayout linearLayout = this.f9338a;
        if (linearLayout != null) {
            if (z) {
                linearLayout.setVisibility(0);
                this.f9341d.getTitleDelegate().w(false);
            } else {
                linearLayout.setVisibility(8);
                this.f9341d.getTitleDelegate().w(true);
            }
        }
    }

    public void a(RelativeLayout relativeLayout) {
        Context context = relativeLayout.getContext();
        this.f9338a = new LinearLayout(context);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, (int) this.f9341d.getResources().getDimension(R.dimen.i4));
        layoutParams.addRule(13);
        this.f9338a.setLayoutParams(layoutParams);
        this.f9338a.setGravity(17);
        relativeLayout.addView(this.f9338a);
        int b2 = cj.b(context, 30.0f);
        Paint paint = new Paint();
        paint.setTextSize(cj.a(context, 17.0f));
        final int i = 0;
        while (true) {
            String[] strArr = this.f9339b;
            if (i >= strArr.length) {
                return;
            }
            String str = strArr[i];
            int measureText = (int) paint.measureText((CharSequence) str, 0, str.length());
            TextView textView = new TextView(context);
            textView.setText(str);
            textView.setTextSize(15.0f);
            textView.setTextColor(-1);
            textView.setGravity(17);
            LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(measureText + b2, -1);
            layoutParams2.gravity = 17;
            textView.setLayoutParams(layoutParams2);
            this.f9338a.addView(textView);
            this.f9340c.add(textView);
            textView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    b.this.a(i);
                }
            });
            i++;
        }
    }

    public void a(int i) {
        if (i < 0 || i > 1) {
            return;
        }
        if (this.f9340c != null) {
            for (int i2 = 0; i2 < this.f9340c.size(); i2++) {
                TextView textView = this.f9340c.get(i2);
                if (i2 == i) {
                    textView.setTextColor(-1);
                    textView.setTextSize(17.0f);
                } else {
                    textView.setTextColor(-1711276033);
                    textView.setTextSize(15.0f);
                }
            }
        }
        com.kugou.common.web.b bVar = this.f9342e;
        if (bVar != null) {
            if (i == 0) {
                this.f9342e.loadUrl(com.kugou.common.config.c.a().b(com.kugou.android.app.a.a.bs));
            } else {
                bVar.loadUrl("http://h5.kugou.com/apps/perform/dist/index.html");
            }
        }
    }
}