本文整理汇总了Java中kaaes.spotify.webapi.android.models.AlbumSimple类的典型用法代码示例。如果您正苦于以下问题:Java AlbumSimple类的具体用法?Java AlbumSimple怎么用?Java AlbumSimple使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AlbumSimple类属于kaaes.spotify.webapi.android.models包,在下文中一共展示了AlbumSimple类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchAlbums
import kaaes.spotify.webapi.android.models.AlbumSimple; //导入依赖的package包/类
private void searchAlbums(String query) {
SpotifyTvApplication.getInstance().getSpotifyService().searchAlbums(query, getSearchOptions(), new Callback<AlbumsPager>() {
@Override
public void success(AlbumsPager albumsPager, Response response) {
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new AlbumCardPresenter());
for (AlbumSimple artist : albumsPager.albums.items) {
listRowAdapter.add(artist);
}
HeaderItem header = new HeaderItem(getString(R.string.albums));
mRowsAdapter.add(new ListRow(header, listRowAdapter));
// TODO next pages ?
}
@Override
public void failure(RetrofitError error) {
}
});
}
示例2: searchAlbums
import kaaes.spotify.webapi.android.models.AlbumSimple; //导入依赖的package包/类
private void searchAlbums(String query, MatrixCursor cursor) {
AlbumsPager albumsPager = SpotifyTvApplication.getInstance().getSpotifyService().searchAlbums(query, getSearchOptions());
if (albumsPager != null && albumsPager.albums != null) {
for (AlbumSimple album : albumsPager.albums.items) {
MatrixCursor.RowBuilder row = cursor.newRow();
row.add(SearchManager.SUGGEST_COLUMN_TEXT_1, album.name);
row.add(SearchManager.SUGGEST_COLUMN_CONTENT_TYPE, album.type);
row.add(SearchManager.SUGGEST_COLUMN_INTENT_DATA, album.uri);
row.add(SearchManager.SUGGEST_COLUMN_TEXT_2, getContext().getString(R.string.albums));
if (album.images != null && album.images.size() > 0) {
row.add(SearchManager.SUGGEST_COLUMN_RESULT_CARD_IMAGE, album.images.get(0).url);
}
}
}
}
示例3: Song
import kaaes.spotify.webapi.android.models.AlbumSimple; //导入依赖的package包/类
public Song(String addedBySpotifyId, String addedByUserName, String songSpotifyId,
List<ArtistSimple> artists, AlbumSimple album, long durationMs,
String name, String previewUrl) {
this.addedBySpotifyId = addedBySpotifyId;
this.songSpotifyId = songSpotifyId;
this.addedByUserName = addedByUserName;
this.artists = artists;
this.album = album;
this.durationMs = durationMs;
this.name = name;
this.previewUrl = previewUrl;
}
示例4: getImageUrlSmallForAlbum
import kaaes.spotify.webapi.android.models.AlbumSimple; //导入依赖的package包/类
/**
* Returns a URL for a small image for a Spotify album.
* @param album the Spotify album
* @return a URL for a small image for the Spotify album.
*/
public static String getImageUrlSmallForAlbum(AlbumSimple album) {
if (album == null) {
return null;
}
return SpotifyUtil.getImageUrlSmall(album.images);
}
示例5: getImageUrlLargeForAlbum
import kaaes.spotify.webapi.android.models.AlbumSimple; //导入依赖的package包/类
/**
* Returns a URL for a small image for a Spotify album.
* @param album the Spotify album
* @return a URL for a small image for the Spotify album.
*/
public static String getImageUrlLargeForAlbum(AlbumSimple album) {
if (album == null) {
return null;
}
return SpotifyUtil.getImageUrlLarge(album.images);
}
示例6: launchDetailScreen
import kaaes.spotify.webapi.android.models.AlbumSimple; //导入依赖的package包/类
public void launchDetailScreen(Activity activity, Object item) {
if (item instanceof AlbumSimple) {
AlbumSimple albumSimple = (AlbumSimple) item;
AlbumActivity.launch(activity, albumSimple.id, albumSimple.name);
} else if (item instanceof ArtistSimple) {
ArtistSimple artistSimple = (ArtistSimple) item;
ArtistsAlbumsActivity.launch(activity, artistSimple.id, artistSimple.name);
} else if (item instanceof PlaylistBase) {
PlaylistBase playlist = (PlaylistBase) item;
PlaylistActivity.launch(activity, playlist.id, playlist.name, playlist.owner.id);
} else if (item instanceof Category) {
Category category = (Category) item;
CategoryActivity.launch(activity, category.id, category.name);
}
}
示例7: getUriFromSpotiyObject
import kaaes.spotify.webapi.android.models.AlbumSimple; //导入依赖的package包/类
public static String getUriFromSpotiyObject(Object spotifyObject) {
String uri = null;
if (spotifyObject instanceof TrackSimple) {
uri = ((TrackSimple) spotifyObject).uri;
} else if (spotifyObject instanceof Playlist) {
uri = ((Playlist) spotifyObject).uri;
} else if (spotifyObject instanceof PlaylistSimple) {
uri = ((PlaylistSimple) spotifyObject).uri;
} else if (spotifyObject instanceof AlbumSimple) {
uri = ((AlbumSimple) spotifyObject).uri;
} else if (spotifyObject instanceof ArtistSimple) {
uri = ((ArtistSimple) spotifyObject).uri;
}
return uri;
}
示例8: onBindViewHolder
import kaaes.spotify.webapi.android.models.AlbumSimple; //导入依赖的package包/类
@Override
public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item) {
super.onBindViewHolder(viewHolder, item);
final CardViewHolder cardViewHolder = (CardViewHolder) viewHolder;
final SpotifyCardView imageCardView = cardViewHolder.getImageCardView();
AlbumSimple albumSimple = (AlbumSimple) item;
// name
imageCardView.setTitleText(albumSimple.name);
if (albumSimple instanceof Album) {
// if full album object, display info
setupFullAlbumInfo(((Album) albumSimple), imageCardView, cardViewHolder);
} else {
// if not, reset the info views
imageCardView.setContentText("");
// and load the full object from API
SpotifyTvApplication.getInstance().getSpotifyService().getAlbum(albumSimple.id, new Callback<Album>() {
@Override
public void success(final Album album, Response response) {
setupFullAlbumInfo(album, imageCardView, cardViewHolder);
}
@Override
public void failure(RetrofitError error) {
}
});
}
}
示例9: Album
import kaaes.spotify.webapi.android.models.AlbumSimple; //导入依赖的package包/类
public Album(AlbumSimple album) {
id = album.id;
name = album.name;
for (Image image : album.images) {
if ((image.width >= 150) && (image.width <= 250)) {
smallImageUrl = image.url;
} else if ((image.width >= 600) && (image.width <= 700)) {
imageUrl = image.url;
}
}
}
示例10: getAlbum
import kaaes.spotify.webapi.android.models.AlbumSimple; //导入依赖的package包/类
public AlbumSimple getAlbum() {
return album;
}