Android Open Source - XkcdViewer Xkcd Comic Info






From Project

Back to project page XkcdViewer.

License

The source code is released under:

GNU General Public License

If you think the Android project XkcdViewer 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 net.bytten.xkcdviewer;
/*from   w  ww  .  ja  va2s.co m*/
import net.bytten.comicviewer.IComicInfo;
import android.net.Uri;

public class XkcdComicInfo implements IComicInfo {

    public Uri img, link;
    public int num;
    public String title = "", alt = "";
    public boolean bookmarked;

    @Override
    public String getAlt() {
        return alt;
    }

    @Override
    public String getId() {
        return Integer.toString(num);
    }

    @Override
    public Uri getImage() {
        return img;
    }

    @Override
    public String getNextId() {
        int n = num + 1;
        // #404 is xkcd's error page!
        if (n == 404) ++n;
        return Integer.toString(n);
    }

    @Override
    public String getPrevId() {
        int n = num - 1;
        // #404 is xkcd's error page!
        if (n == 404) --n;
        return Integer.toString(n);
    }

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public String getUrl() {
        return "http://xkcd.com/"+getId()+"/";
    }

    @Override
    public boolean isBookmarked() {
        return bookmarked;
    }

    @Override
    public void setBookmarked(boolean b) {
        bookmarked = b;
    }

    @Override
    public Uri getLink() {
        return link;
    }

}




Java Source Code List

net.bytten.xkcdviewer.XkcdArchiveActivity.java
net.bytten.xkcdviewer.XkcdComicDefinition.java
net.bytten.xkcdviewer.XkcdComicInfo.java
net.bytten.xkcdviewer.XkcdComicProvider.java
net.bytten.xkcdviewer.XkcdViewerActivity.java