use of com.wm.remusic.dialog.LoadAllDownInfos in project remusic by aa112901.
the class PlaylistActivity method setHeaderView.
private void setHeaderView() {
albumArt = (ImageView) findViewById(R.id.album_art);
playlistTitleView = (TextView) findViewById(R.id.album_title);
playlistDetailView = (TextView) findViewById(R.id.album_details);
albumArtSmall = (SimpleDraweeView) findViewById(R.id.playlist_art);
SpannableString spanString;
Bitmap b = BitmapFactory.decodeResource(getResources(), R.mipmap.index_icn_earphone);
ImageSpan imgSpan = new ImageSpan(this, b, ImageSpan.ALIGN_BASELINE);
spanString = new SpannableString("icon");
spanString.setSpan(imgSpan, 0, 4, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
playlistCountView = (TextView) findViewById(R.id.playlist_listen_count);
playlistCountView.setText(spanString);
if (playlistCount == null) {
playlistCount = "0";
}
int count = Integer.parseInt(playlistCount);
if (count > 10000) {
count = count / 10000;
playlistCountView.append(" " + count + "万");
} else {
playlistCountView.append(" " + playlistCount);
}
LinearLayout downAll = (LinearLayout) headerViewContent.findViewById(R.id.playlist_down);
downAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new LoadAllDownInfos((Activity) mContext, mList).execute();
}
});
final LinearLayout addToplaylist = (LinearLayout) headerViewContent.findViewById(R.id.playlist_collect);
addToplaylist.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!mCollected) {
collectText.setText("已收藏");
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
String albumart = null;
for (MusicInfo info : adapterList) {
albumart = info.albumData;
if (!TextUtils.isEmpty(albumart)) {
break;
}
}
PlaylistInfo.getInstance(mContext).addPlaylist(Long.parseLong(playlsitId), playlistName, adapterList.size(), albumart, "net");
PlaylistsManager.getInstance(mContext).insertLists(mContext, Long.parseLong(playlsitId), adapterList);
Intent intent = new Intent(IConstants.PLAYLIST_COUNT_CHANGED);
MainApplication.context.sendBroadcast(intent);
mCollected = true;
return null;
}
}.execute();
} else {
collectText.setText("收藏");
PlaylistInfo.getInstance(mContext).deletePlaylist(Long.parseLong(playlsitId));
mCollected = false;
}
}
});
share.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("http://music.baidu.com/songlist/" + playlsitId));
shareIntent.setType("html/*");
startActivity(Intent.createChooser(shareIntent, getResources().getString(R.string.shared_to)));
}
});
if (!isLocalPlaylist)
headerDetail.setVisibility(View.GONE);
tryAgain.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
loadAllLists();
}
});
if (Integer.parseInt(playlsitId) == IConstants.FAV_PLAYLIST) {
favLayout.setVisibility(View.VISIBLE);
}
}
use of com.wm.remusic.dialog.LoadAllDownInfos in project remusic by aa112901.
the class AlbumsDetailActivity method setHeaderView.
private void setHeaderView() {
albumArt = (ImageView) findViewById(R.id.album_art);
albumTitle = (TextView) findViewById(R.id.album_title);
albumArtSmall = (SimpleDraweeView) findViewById(R.id.playlist_art);
LinearLayout downAll = (LinearLayout) headerViewContent.findViewById(R.id.playlist_down);
downAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new LoadAllDownInfos((Activity) AlbumsDetailActivity.this, mList).execute();
}
});
tryAgain.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
loadAllLists();
}
});
}
Aggregations