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

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


package com.kugou.android.app.dialog.confirmdialog;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.FragmentActivity;
import android.support.v4.os.EnvironmentCompat;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.kugou.android.app.KGApplication;
import com.kugou.android.app.crossplatform.CrossPlatformStatistic;
import com.kugou.android.app.flexowebview.KGImmersionWebFragment;
import com.kugou.android.app.player.NormalPlayerFragment;
import com.kugou.android.app.player.c.d;
import com.kugou.android.app.player.dialog.SongExponentsDialog;
import com.kugou.android.audiobook.LongAudioDetailFragment;
import com.kugou.android.common.activity.AbsBaseActivity;
import com.kugou.android.common.delegate.DelegateFragment;
import com.kugou.android.common.entity.KGMusic;
import com.kugou.android.common.entity.KGSong;
import com.kugou.android.common.entity.LocalMusic;
import com.kugou.android.common.entity.s;
import com.kugou.android.lite.R;
import com.kugou.android.mymusic.localmusic.r;
import com.kugou.android.mymusic.playlist.MyCloudMusicListFragment;
import com.kugou.android.netmusic.bills.SingerDetailFragment;
import com.kugou.android.netmusic.bills.classfication.AlbumDetailFragment;
import com.kugou.android.netmusic.bills.singer.c;
import com.kugou.android.netmusic.search.SearchMainFragment;
import com.kugou.android.ugc.b.j;
import com.kugou.android.ugc.songdetail.UgcUploaderFragment;
import com.kugou.common.app.KGCommonApplication;
import com.kugou.common.base.AbsFrameworkActivity;
import com.kugou.common.base.AbsFrameworkFragment;
import com.kugou.common.filemanager.entity.KGFile;
import com.kugou.common.player.manager.Initiator;
import com.kugou.common.utils.ag;
import com.kugou.common.utils.as;
import com.kugou.common.utils.au;
import com.kugou.common.utils.bq;
import com.kugou.common.utils.br;
import com.kugou.common.utils.ca;
import com.kugou.common.widget.ViewUtils;
import com.kugou.framework.common.utils.m;
import com.kugou.framework.database.DownloadTaskDao;
import com.kugou.framework.database.KGSongDao;
import com.kugou.framework.database.LocalMusicDao;
import com.kugou.framework.database.w;
import com.kugou.framework.scan.ScanUtil;
import com.kugou.framework.service.util.BackgroundServiceUtil;
import com.kugou.framework.service.util.PlaybackServiceUtil;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class j extends com.kugou.common.dialog8.playlist.a {
    public static int d_ = 4099;

    public static int f5601e = 2000;
    private LinearLayout I;
    private boolean M;
    private DelegateFragment N;
    private final AbsBaseActivity O;
    TextView P;
    private TextView R;
    private Handler S;
    private Handler T;
    private ArrayList<s> U;
    private s V;

    ImageView f5602a;
    View aB;
    TextView aC;
    View aD;
    private boolean aE;
    private com.kugou.common.dialog8.popdialogs.a aG;
    private boolean aI;
    private ViewGroup ad;
    private rx.l ae;
    private ViewGroup af;
    private rx.l ag;
    private com.kugou.android.netmusic.bills.singer.c ah;
    private boolean ai;
    private KGFile aj;
    private LocalMusic ak;
    private View al;
    private View am;
    private TextView an;
    private TextView ao;
    private TextView ap;
    private TextView aq;
    private ViewGroup ar;
    private ViewGroup as;
    private TextView at;
    private TextView aw;
    private ViewGroup ax;
    private boolean ay;
    private ImageView az;

    ImageView f5603b;

    ImageView f5604c;
    private TextView f;
    private String g;
    String h;
    String i;
    String j;
    String k;
    String l;
    String m;
    String n;
    String o;
    String p;
    String q;
    View r;
    View s;
    boolean t;
    InputMethodManager u;
    private boolean v;
    private final int w;
    private int x;
    private final int y;
    private KGSong z;

    @Override
    protected int l_() {
        return R.layout.b2f;
    }

    @Override
    protected int onCreateLayout() {
        return R.layout.b2d;
    }

    public void a(boolean z) {
        this.ai = z;
    }

    public j(DelegateFragment delegateFragment, int i) {
        super(delegateFragment.aN_());
        this.x = 0;
        this.y = 1;
        this.z = null;
        this.f = null;
        this.I = null;
        this.g = "";
        this.M = false;
        this.N = null;
        this.o = "";
        this.v = false;
        this.t = false;
        this.mContext = delegateFragment.aN_();
        this.O = delegateFragment.aN_();
        this.N = delegateFragment;
        this.w = i;
    }

    public void c(boolean z) {
        this.v = z;
    }

    public j(DelegateFragment delegateFragment) {
        this(delegateFragment, 0);
    }

    public void b(boolean z) {
        this.M = z;
    }

    public void a(KGFile kGFile) {
        this.aj = kGFile;
        b(this.aj);
    }

    public void a(LocalMusic localMusic) {
        this.ak = localMusic;
        this.aE = true;
        this.aI = com.kugou.android.mymusic.localmusic.h.b.b();
    }

    public void e(String str) {
        this.g = str;
    }

    @Override
    protected void onCreate(Bundle bundle) {
        e();
    }

    @Override
    protected View a() {
        this.s = getLayoutInflater().inflate(R.layout.cj, (ViewGroup) null);
        this.an = (TextView) this.s.findViewById(R.id.qa);
        this.an.setGravity(8388627);
        this.an.setTypeface(null, 0);
        this.an.setSingleLine(true);
        this.aD = this.s.findViewById(R.id.cu4);
        this.aB = this.s.findViewById(R.id.cu6);
        this.aC = (TextView) this.s.findViewById(R.id.cu5);
        this.P = (TextView) this.s.findViewById(R.id.cu7);
        this.P.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (j.this.u()) {
                    j.this.r();
                } else {
                    j.this.n();
                    j.this.dismiss();
                }
            }
        });
        this.aB.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                j.this.q();
            }
        });
        getLayout().findViewById(R.id.c6s).setVisibility(8);
        return this.s;
    }

    @Override
    protected View[] b() {
        this.r = getLayoutInflater().inflate(R.layout.auz, (ViewGroup) null);
        return new View[]{this.r};
    }

    private void e() {
        i();
        if (this.aj != null) {
            l();
        } else {
            m();
        }
        if ((this.w & 4096) != 0) {
            h(true);
            d(true);
        } else {
            h(false);
            d(false);
        }
        this.am.setClickable(false);
        com.kugou.android.kuqun.f.b("zhpu_song");
        this.at.setText("专辑: 未知专辑");
        this.f5603b.setVisibility(8);
        this.T.sendEmptyMessage(0);
        as.b("zhpu_song_info", "GET_LOCAL_ALBUM");
        TextView textView = this.ao;
        String str = this.h;
        String str2 = this.l;
        textView.setText(a(str, str2.substring(0, str2.indexOf("音质")), this.m));
        this.ap.setText(b(this.j, this.i, this.n));
        if (TextUtils.isEmpty(b(this.k))) {
            this.as.setVisibility(8);
            this.aq.setVisibility(8);
        } else {
            this.as.setVisibility(0);
            this.aq.setText(b(this.k));
            this.aq.setVisibility(0);
        }
        if (this.ai) {
            this.ao.setVisibility(8);
            this.ap.setVisibility(8);
            this.aq.setVisibility(8);
        }
        if (this.ay) {
            this.as.setVisibility(8);
        }
        j();
    }

    private void j() {
        if (u()) {
            this.aD.setVisibility(0);
            this.aB.setVisibility(0);
            this.aC.setText(this.mContext.getString(R.string.ap4));
        } else {
            if (A() && !B()) {
                this.aD.setVisibility(0);
                this.aB.setVisibility(8);
                this.aC.setText(this.mContext.getString(R.string.ap8));
                return;
            }
            this.aD.setVisibility(8);
        }
    }

    private void d(int i) {
        this.S.removeMessages(10);
        this.S.obtainMessage(10, Integer.valueOf(i)).sendToTarget();
    }

    private boolean a(KGFile kGFile, String str) {
        if (TextUtils.isEmpty(kGFile.y())) {
            return true;
        }
        return !TextUtils.isEmpty(str);
    }

    private boolean b(KGFile kGFile, String str) {
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        return !str.equals(kGFile.y());
    }

    public void a(KGFile kGFile, String str, String str2, String str3) {
        if (TextUtils.isEmpty(str)) {
            d(1);
            return;
        }
        if (TextUtils.isEmpty(str2)) {
            d(2);
            return;
        }
        if (!a(kGFile, str3)) {
            d(3);
            return;
        }
        boolean b2 = b(kGFile, str3);
        if (!str.equals(kGFile.aa()) || !str2.equals(kGFile.w()) || b2) {
            LocalMusic localMusicByFileIdWithoutFile = LocalMusicDao.getLocalMusicByFileIdWithoutFile(kGFile.f());
            if (localMusicByFileIdWithoutFile != null) {
                localMusicByFileIdWithoutFile.f(false);
                localMusicByFileIdWithoutFile.g(true);
                if (b2) {
                    kGFile.n(str3);
                    localMusicByFileIdWithoutFile.n(true);
                }
                LocalMusicDao.a(localMusicByFileIdWithoutFile);
            }
            r.a(str, str2, kGFile);
            if (com.kugou.common.filemanager.service.a.b.b(kGFile)) {
                PlaybackServiceUtil.changeMusicName(kGFile.f(), kGFile.q());
                Intent intent = new Intent("com.kugou.android.song.change.name.success");
                intent.putExtra("_id", kGFile.f());
                intent.putExtra("musicname", kGFile.q());
                intent.putExtra("albumname", kGFile.y());
                intent.putExtra("is_edit_album_info", b2);
                com.kugou.common.b.a.a(intent);
                com.kugou.common.b.a.a(new Intent("com.kugou.android.scan_over"));
                this.S.sendEmptyMessage(8);
                BackgroundServiceUtil.trace(new com.kugou.common.statistics.song.a.a(KGCommonApplication.getContext(), com.kugou.framework.statistics.easytrace.a.ahn));
                return;
            }
            this.S.sendEmptyMessage(9);
            return;
        }
        this.S.sendEmptyMessage(8);
    }

    @Override
    public void addOptionRow(com.kugou.common.dialog8.i iVar) {
        super.addOptionRow(iVar);
    }

    private void i() {
        this.as = (ViewGroup) findViewById(R.id.g1g);
        this.ar = (ViewGroup) findViewById(R.id.g18);
        this.ax = (ViewGroup) findViewById(R.id.g1a);
        this.ad = (ViewGroup) findViewById(R.id.cai);
        this.ad.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Bundle bundle = new Bundle(1);
                bundle.putString(UgcUploaderFragment.f43547a, j.this.q);
                bundle.putInt("type", 1);
                j.this.N.startFragment(UgcUploaderFragment.class, bundle);
                j.this.dismiss();
            }
        });
        this.af = (ViewGroup) findViewById(R.id.ul);
        boolean z = false;
        this.af.setVisibility(0);
        this.af.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Bundle bundle = new Bundle();
                bundle.putString("web_url", "http://m.kugou.com/kuHao/copyright.html?type=1");
                bundle.putString("web_title", "版权申诉");
                j.this.N.startFragment(KGImmersionWebFragment.class, bundle);
                j.this.dismiss();
            }
        });
        this.R = (TextView) findViewById(R.id.g1_);
        this.az = (ImageView) findViewById(R.id.g1b);
        this.aw = (TextView) findViewById(R.id.g1c);
        this.f5602a = (ImageView) findViewById(R.id.x1);
        this.f5603b = (ImageView) findViewById(R.id.x2);
        this.f5604c = (ImageView) findViewById(R.id.g1f);
        this.ao = (TextView) this.r.findViewById(R.id.bzt);
        this.ap = (TextView) this.r.findViewById(R.id.bzu);
        this.aq = (TextView) this.r.findViewById(R.id.bzv);
        this.I = (LinearLayout) this.r.findViewById(R.id.bz3);
        this.f = (TextView) this.r.findViewById(R.id.bz5);
        this.al = this.r.findViewById(R.id.d9);
        View findViewById = this.r.findViewById(R.id.g1d);
        this.am = this.r.findViewById(R.id.d8);
        this.at = (TextView) this.r.findViewById(R.id.bz4);
        if (this.w == f5601e) {
            addOptionRow("举报不良内容");
        }
        b("关闭");
        iF_();
        x().setVisibility(4);
        ViewUtils.b(x(), -1, br.c(35.0f));
        a(new com.kugou.common.dialog8.d() {
            @Override
            public void onNegativeClick() {
            }

            @Override
            public void onOptionClick(com.kugou.common.dialog8.i iVar) {
                com.kugou.android.app.dialog.c.a(j.this.mContext, j.this.aj);
            }
        });
        KGFile kGFile = this.aj;
        if (kGFile != null) {
            this.o = kGFile.w();
            this.p = this.aj.q();
            this.q = this.aj.bT_();
        } else {
            this.o = this.z.bD_();
            this.p = this.z.v();
            this.q = this.z.r();
        }
        View view = this.al;
        if (!"未知歌手".equals(this.o) && !TextUtils.isEmpty(this.o)) {
            z = true;
        }
        view.setClickable(z);
        if (!TextUtils.isEmpty(this.q) && this.aj != null) {
            addOptionRow("歌曲报错/举报");
        }
        findViewById.setClickable(true);
        findViewById.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view2) {
                j.this.c();
            }
        });
        findViewById.setVisibility(8);
        DelegateFragment delegateFragment = this.N;
        this.T = new com.kugou.framework.common.utils.stacktrace.e(delegateFragment != null ? delegateFragment.getWorkLooper() : this.O.getWorkLooper()) {
            @Override
            public void handleMessage(Message message) {
                if (message.what != 0) {
                    return;
                }
                com.kugou.android.kuqun.f.b("zhpu_song_1");
                LocalMusic localMusicByFileId = LocalMusicDao.getLocalMusicByFileId(j.this.aj.f());
                if (localMusicByFileId == null) {
                    localMusicByFileId = DownloadTaskDao.b(j.this.aj.f(), j.this.aj.Q());
                }
                if (j.this.M && localMusicByFileId != null) {
                    localMusicByFileId.e(j.this.aj.y());
                    if (!TextUtils.isEmpty(j.this.aj.L())) {
                        localMusicByFileId.d(Long.parseLong(j.this.aj.L()));
                    }
                }
                j.this.U = com.kugou.android.mymusic.j.f29431d.b();
                try {
                    s a2 = w.a(Long.parseLong(j.this.aj.L()));
                    if (a2 != null && j.this.aE && !j.this.t()) {
                        j.this.aj.n(a2.c());
                    }
                    if (TextUtils.isEmpty(a2.v())) {
                        j.this.d(j.this.aj);
                    } else {
                        j.this.a(a2.v().substring(0, 4));
                        j.this.e(j.this.aj);
                    }
                    if (j.this.U != null && localMusicByFileId != null && !j.this.t()) {
                        for (int size = j.this.U.size() - 1; size >= 0; size--) {
                            if (((s) j.this.U.get(size)).h() == localMusicByFileId.t() && localMusicByFileId.t() > 0) {
                                j jVar = j.this;
                                jVar.V = (s) jVar.U.get(size);
                                j.this.V.f(a2.i());
                                Message message2 = new Message();
                                message2.what = 7;
                                message2.arg1 = 1;
                                message2.obj = j.this.V;
                                j.this.S.sendMessage(message2);
                                return;
                            }
                        }
                    }
                    if (j.this.t()) {
                        a2 = j.this.s();
                    }
                    j.this.V = a2;
                    Message message3 = new Message();
                    message3.what = 7;
                    message3.arg1 = 1;
                    message3.obj = j.this.V;
                    j.this.S.sendMessage(message3);
                } catch (Exception unused) {
                    j jVar2 = j.this;
                    jVar2.c(jVar2.aj);
                    j jVar3 = j.this;
                    jVar3.d(jVar3.aj);
                    com.kugou.android.kuqun.f.c("zhpu_song_1");
                }
            }
        };
        this.S = new com.kugou.framework.common.utils.stacktrace.e() {
            @Override
            public void handleMessage(Message message) {
                switch (message.what) {
                    case 7:
                        j.this.a((s) message.obj, message.arg1 == 1);
                        break;
                    case 8:
                        j.this.o();
                        j.this.N.a_("修改成功");
                        break;
                    case 9:
                        j.this.N.a_("文件重命名失败!");
                        break;
                    case 10:
                        int intValue = ((Integer) message.obj).intValue();
                        if (intValue != 1) {
                            if (intValue == 2) {
                                j.this.N.a_("歌手名不能为空");
                                break;
                            } else {
                                j.this.N.a_("专辑名不能为空");
                                break;
                            }
                        } else {
                            j.this.N.a_("歌曲名不能为空");
                            break;
                        }
                }
                super.handleMessage(message);
            }
        };
    }

    public void n() {
        this.aG = new com.kugou.common.dialog8.popdialogs.a(this.mContext);
        this.aG.a(true);
        this.aG.setDismissOnClickView(false);
        this.aG.setTitle("修改歌曲名称");
        this.aG.setButtonMode(2);
        this.aG.a("歌曲:", "", "歌手:", "", "专辑:", "");
        final EditText d2 = this.aG.d();
        d2.setText(this.aj.aa());
        final EditText e2 = this.aG.e();
        e2.setText(this.aj.w());
        final EditText j = this.aG.j();
        j.setText(this.aj.y());
        a(d2);
        this.aG.setOnDialogClickListener(new com.kugou.common.dialog8.e() {
            @Override
            public void onOptionClick(com.kugou.common.dialog8.i iVar) {
            }

            @Override
            public void onPositiveClick() {
                au.a().a(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            Thread.sleep(300L);
                        } catch (InterruptedException e3) {
                            as.e(e3);
                        }
                        if (j.this.aj != null) {
                            j.this.a(j.this.aj, d2.getText().toString().trim(), e2.getText().toString().trim(), j.getText().toString().trim());
                        }
                    }
                });
            }

            @Override
            public void onNegativeClick() {
                j.this.o();
            }
        });
        this.aG.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialogInterface) {
                if (Build.BRAND.equalsIgnoreCase("meizu") || j.this.t || j.this.O == null) {
                    return;
                }
                br.c((Activity) j.this.O);
            }
        });
        this.aG.setOnKeyListener(new DialogInterface.OnKeyListener() {
            @Override
            public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
                if (i != 4) {
                    return false;
                }
                j jVar = j.this;
                jVar.t = true;
                jVar.aG.dismiss();
                return true;
            }
        });
        this.aG.show();
    }

    public void o() {
        com.kugou.common.dialog8.popdialogs.a aVar = this.aG;
        if (aVar == null || !aVar.isShowing()) {
            return;
        }
        this.aG.dismiss();
    }

    public void p() {
        com.kugou.android.mymusic.localmusic.h.a.a().a(this.aj);
    }

    public void q() {
        com.kugou.common.dialog8.popdialogs.b bVar = new com.kugou.common.dialog8.popdialogs.b(this.mContext);
        bVar.setTitleVisible(false);
        bVar.setMessage(this.mContext.getString(R.string.ap6));
        bVar.setPositiveHint("我知道了");
        bVar.setButtonMode(1);
        bVar.setOnDialogClickListener(new com.kugou.common.dialog8.e() {
            @Override
            public void onNegativeClick() {
            }

            @Override
            public void onOptionClick(com.kugou.common.dialog8.i iVar) {
            }

            @Override
            public void onPositiveClick() {
            }
        });
        bVar.show();
    }

    public void r() {
        com.kugou.common.dialog8.popdialogs.b bVar = new com.kugou.common.dialog8.popdialogs.b(this.mContext);
        bVar.setTitleVisible(false);
        bVar.setMessage(this.mContext.getString(R.string.ap9));
        bVar.c(false);
        bVar.setPositiveHint("还原");
        bVar.setNegativeHint("取消");
        bVar.setOnDialogClickListener(new com.kugou.common.dialog8.e() {
            @Override
            public void onNegativeClick() {
            }

            @Override
            public void onOptionClick(com.kugou.common.dialog8.i iVar) {
            }

            @Override
            public void onPositiveClick() {
                j.this.p();
                j.this.dismiss();
            }
        });
        bVar.show();
    }

    private void a(final EditText editText) {
        editText.setFocusable(true);
        editText.requestFocus();
        this.S.postDelayed(new Runnable() {
            @Override
            public void run() {
                EditText editText2 = editText;
                editText2.setSelection(editText2.getText().toString().length());
                j.this.u = (InputMethodManager) editText.getContext().getSystemService("input_method");
                if (j.this.u != null) {
                    j.this.u.showSoftInput(editText, 0);
                }
            }
        }, 50L);
    }

    public s s() {
        s sVar = new s();
        sVar.b(this.aj.y());
        return sVar;
    }

    public boolean t() {
        LocalMusic localMusic = this.ak;
        if (localMusic != null && this.aj != null && this.aE) {
            if (localMusic.aS()) {
                return !TextUtils.isEmpty(this.aj.y());
            }
            if (r.i(String.valueOf(this.ak.t()))) {
                return !TextUtils.isEmpty(this.aj.y());
            }
        }
        return false;
    }

    public boolean u() {
        LocalMusic localMusic;
        if (!this.aE || (localMusic = this.ak) == null) {
            return false;
        }
        boolean i = r.i(localMusic);
        if ((this.aI && !i) || i) {
            return false;
        }
        int aT = this.ak.aT();
        int bm = this.ak.bm();
        return (aT == 1 && bm == 2) || ((this.ak.Q() > 0L ? 1 : (this.ak.Q() == 0L ? 0 : -1)) > 0 && !(aT == -3) && bm == 2);
    }

    private boolean A() {
        LocalMusic localMusic;
        if (!this.aE || (localMusic = this.ak) == null || localMusic.ap() == null) {
            return false;
        }
        return r.i(this.ak);
    }

    private boolean B() {
        LocalMusic localMusic;
        if (!this.aE || (localMusic = this.ak) == null) {
            return false;
        }
        return r.f(localMusic);
    }

    public void a(s sVar, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append(sVar == null);
        sb.append(" ");
        sb.append(sVar == null ? " name is null " : sVar.c());
        sb.append(" ");
        sb.append(z);
        as.b("zhpu_song", sb.toString());
        com.kugou.android.kuqun.f.c("zhpu_song");
        if (sVar == null) {
            if (z) {
                c(this.aj);
            }
            this.am.setVisibility(8);
            return;
        }
        String c2 = sVar.c();
        if (c2 == null || "未知专辑".equals(c2) || TextUtils.isEmpty(c2)) {
            c2 = "未知专辑";
        }
        if ("未知专辑".equals(c2)) {
            this.f5603b.setVisibility(8);
            this.am.setClickable(false);
            this.am.setVisibility(8);
            c2 = "专辑: 未知专辑";
        } else if (sVar.h() == 0) {
            this.am.setVisibility(0);
            this.f5603b.setVisibility(8);
            if (!TextUtils.isEmpty(sVar.c())) {
                c2 = "专辑: " + sVar.c();
            }
        } else {
            this.am.setVisibility(0);
            this.f5603b.setVisibility(0);
            this.am.setClickable(true);
            if (!TextUtils.isEmpty(sVar.c())) {
                c2 = "专辑: " + sVar.c();
            }
        }
        this.at.setText(c2);
        if (TextUtils.isEmpty(sVar.i()) && z) {
            c(this.aj);
        }
    }

    public void e(KGFile kGFile) {
        if (kGFile == null || TextUtils.isEmpty(kGFile.bT_())) {
            return;
        }
        com.kugou.android.app.player.h.k.a().a(kGFile.bT_(), kGFile.Q(), new m<com.kugou.android.app.player.c.d, Void>() {
            @Override
            public void a(com.kugou.android.app.player.c.d dVar) {
                if (dVar == null || TextUtils.isEmpty(j.this.q) || !j.this.q.equals(dVar.c()) || dVar.e() == null) {
                    return;
                }
                j.this.a(dVar.e());
            }
        });
    }

    public void d(KGFile kGFile) {
        as.b("zhpu_song_info", kGFile.toString());
        com.kugou.android.app.player.h.k.a().a(kGFile.bT_(), kGFile.Q(), new m<com.kugou.android.app.player.c.d, Void>() {
            @Override
            public void a(com.kugou.android.app.player.c.d dVar) {
                if (dVar == null || TextUtils.isEmpty(j.this.q) || !j.this.q.equals(dVar.c())) {
                    j.this.a("未知");
                    return;
                }
                j.this.a(TextUtils.isEmpty(dVar.b()) ? "未知" : dVar.b());
                if (dVar.e() != null) {
                    j.this.a(dVar.e());
                }
            }
        });
    }

    public void a(String str) {
        if ("未知".equals(str)) {
            this.ar.setVisibility(8);
        } else {
            this.ar.setVisibility(0);
            this.R.setText(String.format(getContext().getString(R.string.me), str));
        }
    }

    public void a(d.b bVar) {
        if (bVar == null || TextUtils.isEmpty(bVar.b())) {
            return;
        }
        int a2 = bVar.a();
        if (a2 == 1) {
            this.az.setImageResource(R.drawable.be2);
        } else if (a2 == 2) {
            this.az.setImageResource(R.drawable.be1);
        } else if (a2 != 3) {
            return;
        } else {
            this.az.setImageResource(R.drawable.be0);
        }
        this.aw.setText(KGApplication.getContext().getString(R.string.ayk, bVar.b()));
        this.ax.setVisibility(0);
    }

    private void l() {
        String n;
        String g;
        KGFile kGFile;
        String q = this.aj.q();
        boolean isFileLocal = ScanUtil.isFileLocal(this.aj);
        if (this.aj.f() >= 0 && isFileLocal && (kGFile = this.aj) != null && PlaybackServiceUtil.comparePlaySongAndInputSong(kGFile)) {
            q = PlaybackServiceUtil.getDisplayName();
        }
        KGFile kGFile2 = this.aj;
        if (kGFile2 != null) {
            a(kGFile2.bT_(), this.aj.w(), q, this.aj.aa());
        }
        if (PlaybackServiceUtil.comparePlaySongAndInputSong(this.aj)) {
            this.j = com.kugou.common.utils.r.a(this.mContext, PlaybackServiceUtil.getDuration() / 1000);
        } else {
            this.j = com.kugou.common.utils.r.a(this.mContext, this.aj.u() / 1000);
        }
        if (isFileLocal && ((g = bq.g((n = this.aj.n()))) == null || !g.contains("/kgmusic/.favorite/"))) {
            this.k = n;
        }
        String m = this.aj.m();
        if ("m4a".equals(m) && this.aj.A() == 9) {
            this.aj.d(com.kugou.common.entity.h.QUALITY_LOW.a());
        }
        this.l = bq.a(this.aj.s());
        if (com.kugou.framework.scan.e.e(this.aj.n())) {
            m = com.kugou.framework.scan.e.d(this.aj.n());
        } else if (TextUtils.isEmpty(m)) {
            m = c(this.aj.s());
        }
        this.h = m;
        String b2 = ca.b(this.aj.l());
        if (!TextUtils.isEmpty(b2)) {
            this.i = b2;
        } else {
            this.I.setVisibility(8);
        }
    }

    private void m() {
        KGSong kGSong;
        int i;
        int i2;
        boolean z;
        KGSong kGSong2 = this.z;
        if ((kGSong2 == null || kGSong2.i() == 0) && (kGSong = this.z) != null && PlaybackServiceUtil.comparePlaySongAndInputSong(kGSong)) {
            this.z.l(PlaybackServiceUtil.getDisplayName());
        }
        KGSong kGSong3 = this.z;
        if (kGSong3 != null) {
            a(kGSong3.r(), this.z.bD_(), this.z.v(), this.z.aa());
            if (PlaybackServiceUtil.comparePlaySongAndInputSong(this.z)) {
                this.j = com.kugou.common.utils.r.a(this.mContext, PlaybackServiceUtil.getDuration() / 1000);
            } else {
                this.j = com.kugou.common.utils.r.a(this.mContext, this.z.D() / 1000);
            }
            this.k = this.z.g();
            String B = this.z.B();
            if (TextUtils.isEmpty(B)) {
                B = c(this.z.N());
            }
            this.h = B;
            String str = "";
            KGSong kGSong4 = this.z;
            if (kGSong4 != null && kGSong4.i() != 0) {
                ArrayList<KGSong> kGSongByIdOrHash = KGSongDao.getKGSongByIdOrHash(this.z.r(), this.z.ae(), this.z.ai(), -1L);
                if (kGSongByIdOrHash != null) {
                    i = -1;
                    i2 = -1;
                    for (int i3 = 0; i3 < kGSongByIdOrHash.size(); i3++) {
                        if ((kGSongByIdOrHash.get(i3).z() == 2 || kGSongByIdOrHash.get(i3).z() == 3) && kGSongByIdOrHash.get(i3).N() > i) {
                            i = kGSongByIdOrHash.get(i3).N();
                            i2 = i3;
                        }
                    }
                } else {
                    i = -1;
                    i2 = -1;
                }
                KGSong kGSong5 = i2 != -1 ? kGSongByIdOrHash.get(i2) : null;
                String R = br.R(this.mContext);
                if (kGSong5 != null) {
                    int a2 = com.kugou.android.common.utils.e.a(kGSong5.A(), kGSong5.B());
                    if (a2 != i && a2 < i) {
                        a2 = i;
                    }
                    if (ag.v(kGSong5.g())) {
                        this.h = kGSong5.B();
                        this.l = bq.a(a2);
                        str = a(kGSong5, a2);
                        z = true;
                        if (!z) {
                            if ("wifi".equals(R)) {
                                int a3 = com.kugou.android.common.utils.e.a(com.kugou.framework.setting.a.d.a().at(), this.z);
                                this.h = br.c(a3, "mp3");
                                this.l = bq.a(a3);
                                str = a(this.z, a3);
                            } else if (EnvironmentCompat.MEDIA_UNKNOWN.equals(R) || "nonetwork".equals(R)) {
                                this.h = br.c(com.kugou.common.entity.h.QUALITY_LOW.a(), "m4a");
                                this.l = bq.a(com.kugou.common.entity.h.QUALITY_LOW.a());
                                str = a(this.z, 0);
                            } else if ("3G".equals(R) || "4G".equals(R)) {
                                int a4 = com.kugou.android.common.utils.e.a(com.kugou.framework.setting.a.d.a().as(), this.z);
                                this.h = br.c(a4, "mp3");
                                this.l = bq.a(a4);
                                str = a(this.z, a4);
                            } else if ("2G".equals(R)) {
                                int a5 = com.kugou.android.common.utils.e.a(com.kugou.framework.setting.a.d.a().ar(), this.z);
                                this.h = br.c(a5, "m4a");
                                this.l = bq.a(a5);
                                str = a(this.z, a5);
                            }
                        }
                    }
                }
                z = false;
                if (!z) {
                }
            } else {
                KGSong kGSong6 = this.z;
                if (kGSong6 != null) {
                    int a6 = com.kugou.android.common.utils.e.a(kGSong6.A(), this.z.B());
                    this.h = br.c(a6, this.z.B());
                    this.l = bq.a(a6);
                    str = a(this.z, a6);
                }
            }
            if (!TextUtils.isEmpty(str)) {
                this.i = str;
            } else {
                this.I.setVisibility(8);
            }
        }
    }

    public void c() {
        if (com.kugou.android.netmusic.musicstore.c.a(this.N.getActivity())) {
            dismiss();
            SongExponentsDialog songExponentsDialog = new SongExponentsDialog(this.N.getActivity(), Initiator.a(this.N.getPageKey()));
            songExponentsDialog.setKGFile(this.aj);
            songExponentsDialog.show();
        }
    }

    private String a(String str, String str2, String str3) {
        StringBuilder sb = new StringBuilder();
        if (!TextUtils.isEmpty(str)) {
            sb.append("格式 : ");
            sb.append(str);
        }
        if (!TextUtils.isEmpty(str2)) {
            sb.append(" / ");
            sb.append("音质 : ");
            sb.append(str2);
        }
        if (!TextUtils.isEmpty(str3)) {
            sb.append(" / ");
            sb.append("添加时间 : ");
            sb.append(str3);
        }
        return sb.toString();
    }

    private String b(String str, String str2, String str3) {
        StringBuilder sb = new StringBuilder();
        if (!TextUtils.isEmpty(str)) {
            sb.append("时长 : ");
            sb.append(str);
        }
        if (!TextUtils.isEmpty(str2)) {
            sb.append(" / ");
            sb.append("大小 : ");
            sb.append(str2);
        }
        if (!TextUtils.isEmpty(str3)) {
            sb.append(" / ");
            sb.append("播放次数 : ");
            sb.append(str3);
        }
        return sb.toString();
    }

    private String b(String str) {
        StringBuilder sb = new StringBuilder();
        if (!TextUtils.isEmpty(str)) {
            sb.append("路径 : ");
            sb.append(str);
        }
        return sb.toString();
    }

    private String c(int i) {
        return i == com.kugou.common.entity.h.QUALITY_SUPER.a() ? "flac/ape" : i == com.kugou.common.entity.h.QUALITY_LOW.a() ? "m4a" : "mp3";
    }

    private void a(final String str, final String str2, final String str3, String str4) {
        if (TextUtils.isEmpty(str2) || getContext().getString(R.string.bic).equals(str2)) {
            this.f5602a.setVisibility(8);
            this.f.setText("歌手: 未知歌手");
            this.al.setVisibility(8);
        } else {
            this.al.setVisibility(0);
            this.f.setText("歌手: " + str2);
            this.f5602a.setVisibility(0);
            this.al.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (br.a(j.this.getContext()) && br.Q(j.this.getContext())) {
                        FragmentActivity fragmentActivity = null;
                        if (j.this.O != null) {
                            fragmentActivity = j.this.O;
                        } else if (j.this.N != null) {
                            fragmentActivity = j.this.N.getActivity();
                        }
                        if (fragmentActivity != null) {
                            br.T(fragmentActivity);
                            return;
                        }
                        return;
                    }
                    if (br.Q(j.this.getContext())) {
                        if (j.this.w == j.f5601e) {
                            BackgroundServiceUtil.trace(new com.kugou.framework.statistics.easytrace.task.d(j.this.getContext(), com.kugou.framework.statistics.easytrace.a.lQ).setSource(CrossPlatformStatistic.From.PLAYER_FRAGMENT));
                        }
                        if (j.this.N == null || j.this.N.getIdentifier() == null || !j.this.N.getIdentifier().equals(str2) || !(j.this.N instanceof SingerDetailFragment)) {
                            if (j.this.N != null) {
                                if (j.this.ah != null) {
                                    j.this.ah.a();
                                }
                                j.this.ah = new com.kugou.android.netmusic.bills.singer.c();
                                j.this.ah.a(new c.a() {
                                    @Override
                                    public void a(com.kugou.android.netmusic.bills.singer.a.a aVar) {
                                        Bundle bundle = new Bundle();
                                        if (aVar != null) {
                                            bundle.putString("singer_search", aVar.f33150c);
                                            bundle.putInt("singer_id_search", aVar.f33148a);
                                        } else {
                                            bundle.putString("singer_search", str2);
                                            if (j.this.x <= 0) {
                                            }
                                            bundle.putInt("singer_id_search", j.this.x);
                                        }
                                        bundle.putParcelable("singer_info", null);
                                        if (j.this.w == j.f5601e) {
                                            j.this.d().putString(DelegateFragment.KEY_CUSTOM_IDENTIFIER, "更多/歌曲信息/歌手");
                                        } else if (!TextUtils.isEmpty(j.this.g)) {
                                            j.this.d().putString(DelegateFragment.KEY_CUSTOM_IDENTIFIER, j.this.g + "/歌曲列表/歌曲信息/歌手");
                                        } else {
                                            j.this.d().putString(DelegateFragment.KEY_CUSTOM_IDENTIFIER, "歌曲列表/歌曲信息/歌手");
                                        }
                                        if (j.this.N instanceof SearchMainFragment) {
                                            bundle.putBoolean("statis_from_search_key", true);
                                        }
                                        bundle.putBoolean(AbsFrameworkFragment.FLAG_NEW_INSTANCE, true);
                                        j.this.N.startFragment(SingerDetailFragment.class, bundle);
                                    }
                                });
                                if (j.this.aj != null) {
                                    j.this.ah.a((AbsFrameworkActivity) j.this.N.getActivity(), j.this.aj);
                                } else {
                                    j.this.ah.a((AbsFrameworkActivity) j.this.N.getActivity(), j.this.z);
                                }
                            } else if (j.this.O != null) {
                                if (j.this.ah != null) {
                                    j.this.ah.a();
                                }
                                j.this.ah = new com.kugou.android.netmusic.bills.singer.c();
                                j.this.ah.a(new c.a() {
                                    @Override
                                    public void a(com.kugou.android.netmusic.bills.singer.a.a aVar) {
                                        Intent intent = new Intent("com.kugou.android.action_singer_detail_open");
                                        if (aVar != null) {
                                            intent.putExtra("singer_search", aVar.f33150c);
                                            intent.putExtra("singer_id_search", aVar.f33148a);
                                        } else {
                                            intent.putExtra("singer_search", str2);
                                        }
                                        com.kugou.common.b.a.a(intent);
                                        j.this.O.finish();
                                    }
                                });
                                if (j.this.aj != null) {
                                    j.this.ah.a(j.this.O, j.this.aj);
                                } else {
                                    j.this.ah.a(j.this.O, j.this.z);
                                }
                            }
                        }
                        j.this.dismiss();
                        return;
                    }
                    KGApplication.showMsg(j.this.getContext().getString(R.string.av3));
                }
            });
        }
        c(str4);
        this.am.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (br.a(j.this.getContext()) && br.Q(j.this.getContext())) {
                    FragmentActivity fragmentActivity = null;
                    if (j.this.O != null) {
                        fragmentActivity = j.this.O;
                    } else if (j.this.N != null) {
                        fragmentActivity = j.this.N.getActivity();
                    }
                    if (fragmentActivity != null) {
                        br.T(fragmentActivity);
                        return;
                    }
                    return;
                }
                if (br.Q(j.this.getContext())) {
                    if (j.this.N != null) {
                        if (j.this.V == null) {
                            return;
                        }
                        if (as.f54365e) {
                            as.f("SIMON", "type:" + j.this.V.j());
                        }
                        if (j.this.V.j() == 2) {
                            Bundle bundle = new Bundle();
                            bundle.putInt("activity_index_key", 19);
                            bundle.putString("title_key", j.this.V.c());
                            bundle.putInt("list_id", (int) j.this.V.l());
                            bundle.putString("playlist_name", j.this.V.c());
                            bundle.putInt("source_type", 3);
                            bundle.putLong("list_user_id", j.this.V.k());
                            bundle.putInt("list_type", 2);
                            bundle.putBoolean("from_discovery", false);
                            j.this.N.startFragment(MyCloudMusicListFragment.class, bundle);
                        } else {
                            Bundle bundle2 = new Bundle();
                            bundle2.putInt("albumid", (int) j.this.V.h());
                            bundle2.putString("singer", j.this.V.a());
                            bundle2.putString("imageurl", br.a(j.this.getContext(), j.this.V.g(), 1, true));
                            bundle2.putString("mTitle", j.this.V.c());
                            bundle2.putString("mTitleClass", j.this.V.c());
                            bundle2.putBoolean(AlbumDetailFragment.O, true);
                            if (j.this.w == j.f5601e) {
                                j.this.d().putString(DelegateFragment.KEY_CUSTOM_IDENTIFIER, "更多/歌曲信息");
                            } else if (!TextUtils.isEmpty(j.this.g)) {
                                j.this.d().putString(DelegateFragment.KEY_CUSTOM_IDENTIFIER, j.this.g + "/歌曲列表/歌曲信息");
                            } else {
                                j.this.d().putString(DelegateFragment.KEY_CUSTOM_IDENTIFIER, "歌曲信息");
                            }
                            if (j.this.v) {
                                j.this.N.startFragment(LongAudioDetailFragment.class, bundle2);
                            } else {
                                j.this.N.startFragment(AlbumDetailFragment.class, bundle2);
                            }
                        }
                    }
                    j.this.dismiss();
                    return;
                }
                KGApplication.showMsg(j.this.getContext().getString(R.string.av3));
            }
        });
    }

    public Bundle d() {
        Bundle arguments;
        DelegateFragment delegateFragment = this.N;
        if (delegateFragment instanceof NormalPlayerFragment) {
            arguments = delegateFragment.getParentFragment() != null ? this.N.getParentFragment().getArguments() : null;
        } else {
            arguments = delegateFragment.getArguments();
        }
        return arguments == null ? new Bundle() : arguments;
    }

    private String a(KGSong kGSong, int i) {
        long C;
        int O;
        if (i == com.kugou.common.entity.h.QUALITY_SUPER.a()) {
            O = kGSong.ao();
        } else if (i == com.kugou.common.entity.h.QUALITY_HIGHEST.a()) {
            O = kGSong.ab();
        } else {
            if (i == com.kugou.common.entity.h.QUALITY_HIGH.a()) {
                C = kGSong.C();
            } else if (i == com.kugou.common.entity.h.QUALITY_LOW.a()) {
                O = kGSong.O();
            } else {
                C = kGSong.C();
            }
            if (C == 0 && i != com.kugou.common.entity.h.QUALITY_LOW.a()) {
                C = kGSong.C();
            }
            if (C == 0) {
                return ca.b(C);
            }
            return null;
        }
        C = O;
        if (C == 0) {
            C = kGSong.C();
        }
        if (C == 0) {
        }
    }

    private void c(String str) {
        this.an.setText(String.format(getContext().getString(R.string.md), str));
    }

    public void h(boolean z) {
        if (A() && !B()) {
            z = false;
        } else if (u()) {
            this.P.setText("还原");
        } else if (z) {
            this.P.setText("编辑");
        }
        this.P.setVisibility(z ? 0 : 8);
    }

    public void d(boolean z) {
        if (!z || this.aj == null) {
            return;
        }
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        try {
            if (this.aj.d() != null) {
                this.m = simpleDateFormat.format(Long.valueOf(Long.parseLong(this.aj.d())));
            }
            List<KGFile> d2 = com.kugou.common.filemanager.b.c.d(this.aj.j(), this.aj.Q());
            List<KGFile> d3 = com.kugou.common.filemanager.b.c.d(this.aj.bT_(), this.aj.Q());
            List<KGFile> a2 = com.kugou.common.filemanager.b.c.a(this.aj.bT_(), this.aj.Q());
            if (d2 != null) {
                if (!d3.isEmpty()) {
                    d2.addAll(d3);
                }
                if (!a2.isEmpty()) {
                    d2.addAll(a2);
                }
                ArrayList arrayList = new ArrayList();
                int i = 0;
                for (KGFile kGFile : d2) {
                    if (!arrayList.contains(Long.valueOf(kGFile.f()))) {
                        arrayList.add(Long.valueOf(kGFile.f()));
                        i += com.kugou.common.filemanager.b.e.b(kGFile.f());
                    }
                }
                this.n = i > 100000 ? "10万+" : i + "次";
            }
        } catch (Exception e2) {
            as.e(e2);
        }
    }

    @Override
    public void initBodyViewIfIsPlayerFragment() {
        int color = getContext().getResources().getColor(R.color.ph);
        this.f.setTextColor(color);
        this.at.setTextColor(color);
        this.an.setTextColor(color);
        this.ao.setTextColor(color);
        this.ap.setTextColor(color);
        this.aq.setTextColor(color);
        ((ImageView) this.ad.findViewById(R.id.cah)).setColorFilter(com.kugou.common.skinpro.d.b.b(color));
    }

    @Override
    public void checkAndDismissDialogIfNecessary() {
        super.checkAndDismissDialogIfNecessary();
    }

    public void e(boolean z) {
        this.ay = z;
    }

    public void b(final KGFile kGFile) {
        this.ae = rx.e.a(kGFile).b(Schedulers.io()).d(new rx.b.e<KGFile, j.c>() {
            @Override
            public j.c call(KGFile kGFile2) {
                com.kugou.common.i.b.a.g gVar = new com.kugou.common.i.b.a.g();
                if (bq.m(j.this.q)) {
                    LocalMusic localMusicByFileId = LocalMusicDao.getLocalMusicByFileId(kGFile2.f());
                    if (localMusicByFileId != null) {
                        j.this.q = localMusicByFileId.r();
                        if (bq.m(j.this.q)) {
                            j.this.q = com.kugou.framework.mymusic.cloudtool.s.a(localMusicByFileId).r();
                        }
                    } else {
                        j.this.q = kGFile2.bT_();
                    }
                }
                if (!TextUtils.isEmpty(kGFile2.L())) {
                    gVar.a(kGFile2.L());
                }
                if (kGFile2.Q() > 0) {
                    gVar.a(kGFile2.Q());
                }
                gVar.c(j.this.q);
                gVar.d(kGFile2.aa());
                boolean z = false;
                gVar.a(0);
                gVar.b(com.kugou.framework.musicfees.k.i);
                com.kugou.common.i.b.a.a a2 = com.kugou.common.environment.a.n() ? new com.kugou.framework.musicfees.k().a(gVar, "", "play", 0) : null;
                if (a2 != null && a2.a() != null && a2.a().size() > 0 && !com.kugou.framework.musicfees.l.l(a2.a().get(0)) && com.kugou.common.config.c.a().c(com.kugou.android.app.a.a.fF)) {
                    z = true;
                }
                if (z) {
                    return new com.kugou.android.ugc.b.j(j.this.q).a(kGFile.Q());
                }
                return null;
            }
        }).a(AndroidSchedulers.mainThread()).a((rx.b.b) new rx.b.b<j.c>() {
            @Override
            public void call(j.c cVar) {
                if (cVar == null || cVar.f43012a != 1 || cVar.g <= 0) {
                    j.this.ad.setVisibility(8);
                    j.this.findViewById(R.id.bz6).setVisibility(8);
                } else {
                    j.this.ad.setVisibility(0);
                    j.this.ad.startAnimation(new com.kugou.android.ugc.songdetail.b(j.this.ad, j.this.ad.getHeight(), 0));
                    j.this.af.setVisibility(0);
                }
            }
        }, new rx.b.b<Throwable>() {
            @Override
            public void call(Throwable th) {
                th.printStackTrace();
                j.this.ad.setVisibility(8);
            }
        });
    }

    public void c(final KGFile kGFile) {
        com.kugou.android.kuqun.f.b("zhpu_song_load");
        this.ag = rx.e.a(kGFile).b(Schedulers.io()).d(new rx.b.e<KGFile, s>() {
            @Override
            public s call(KGFile kGFile2) {
                com.kugou.android.mymusic.b.d dVar;
                if (kGFile2 == null) {
                    return null;
                }
                ArrayList arrayList = new ArrayList();
                KGMusic kGMusic = new KGMusic();
                kGMusic.j(kGFile.bT_());
                if (!TextUtils.isEmpty(kGFile2.L())) {
                    kGMusic.d(Integer.parseInt(kGFile2.L()));
                }
                kGMusic.r(kGFile2.Q());
                arrayList.add(kGMusic);
                List<com.kugou.android.mymusic.b.d> a2 = new com.kugou.android.mymusic.f().a(arrayList);
                if (a2 == null || (dVar = a2.get(0)) == null) {
                    return null;
                }
                s sVar = new s();
                sVar.b(dVar.d());
                sVar.b(dVar.c());
                sVar.f(j.this.d(dVar.e()));
                sVar.b(1);
                sVar.e(dVar.b());
                j.this.a(dVar.c(), sVar.i());
                return sVar;
            }
        }).a(AndroidSchedulers.mainThread()).a((rx.b.b) new rx.b.b<s>() {
            @Override
            public void call(s sVar) {
                com.kugou.android.kuqun.f.c("zhpu_song_load");
                if (sVar != null) {
                    if (!j.this.t()) {
                        if (j.this.V == null) {
                            j.this.V = sVar;
                        }
                        j.this.V.f(sVar.i());
                        if (j.this.aj != null) {
                            j.this.aj.n(sVar.c());
                        }
                    } else {
                        j jVar = j.this;
                        jVar.V = jVar.s();
                    }
                } else if (j.this.t()) {
                    j jVar2 = j.this;
                    jVar2.V = jVar2.s();
                }
                as.b("zhpu_song", "set album");
                if (j.this.V != null) {
                    j jVar3 = j.this;
                    jVar3.a(jVar3.V, false);
                }
            }
        }, new rx.b.b<Throwable>() {
            @Override
            public void call(Throwable th) {
                th.printStackTrace();
            }
        });
    }

    public String d(String str) {
        if (TextUtils.isEmpty(str)) {
            return str;
        }
        try {
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
            return simpleDateFormat.format(simpleDateFormat.parse(str));
        } catch (Exception unused) {
            return str;
        }
    }

    public void a(long j, String str) {
        s a2 = w.a(j);
        if (a2 != null) {
            a2.f(str);
            w.a(a2);
        }
    }

    @Override
    public void dismiss() {
        rx.l lVar = this.ae;
        if (lVar != null && !lVar.isUnsubscribed()) {
            this.ae.unsubscribe();
        }
        rx.l lVar2 = this.ag;
        if (lVar2 != null) {
            lVar2.unsubscribe();
        }
        super.dismiss();
    }
}