Android Open Source - RoboBinding-album-sample View Album Presentation Model

From Project

Back to project page RoboBinding-album-sample.


The source code is released under:

Apache License

If you think the Android project RoboBinding-album-sample listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.robobinding.albumsample.presentationmodel;
/*  ww  w. ja  v  a m*/
import org.robobinding.albumsample.model.Album;
import org.robobinding.annotation.PresentationModel;
import org.robobinding.presentationmodel.HasPresentationModelChangeSupport;
import org.robobinding.presentationmodel.PresentationModelChangeSupport;

 * @author Cheng Wei
 * @author Robert Taylor
 * @since 1.0
public class ViewAlbumPresentationModel implements HasPresentationModelChangeSupport {
    private final ViewAlbumView view;
    private final AlbumStore albumStore;
    private final long albumId;
    private final PresentationModelChangeSupport changeSupport;

    private Album album;

    public ViewAlbumPresentationModel(ViewAlbumView view, AlbumStore albumStore, long albumId) {
        this.view = view;
        this.albumStore = albumStore;
        this.albumId = albumId;
        this.changeSupport = new PresentationModelChangeSupport(this);

    public String getTitle() {
        return album.getTitle();

    public String getArtist() {
        return album.getArtist();

    public String getComposer() {
        return album.getComposer();

    public boolean isComposerEnabled() {
        return album.isClassical();

    public String getClassicalDescription() {
        return album.isClassical() ? "Classical" : "Not classical";

    public void editAlbum() {

    public void deleteAlbum() {

    public void refresh() {
        this.album = albumStore.get(albumId);

    public PresentationModelChangeSupport getPresentationModelChangeSupport() {
        return changeSupport;

Java Source Code List