Android Open Source - GitHubContributionsApp Git Hub Profile Details Impl






From Project

Back to project page GitHubContributionsApp.

License

The source code is released under:

GNU General Public License

If you think the Android project GitHubContributionsApp 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 com.githubcardandroidapp.app.BusinessObjects;
/*  ww  w.j  a va 2s  .  c  o  m*/
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;

public class GitHubProfileDetailsImpl implements GitHubProfileDetails
{
    // Private Fields
    String loginName;
    String name;
    String avatarURL;
    String blog;
    Date createdAt;
    int numberOfFollowers;
    Bitmap avatarBitmap;

    // Constructors
    public GitHubProfileDetailsImpl(String loginName, String name, String avatarURL, String blog, Date createdAt, int numberOfFollowers){
        this.loginName = loginName;
        this.name = name;
        this.avatarURL = avatarURL;
        this.blog = blog;
        this.numberOfFollowers = numberOfFollowers;
        this.createdAt = createdAt;

        try {
            this.avatarBitmap =
                    BitmapFactory.decodeStream(new URL(avatarURL).openConnection().getInputStream());
        }
        catch (MalformedURLException exception){
            Log.e("BitmapLoad",exception.getMessage());
        }
        catch (IOException exception) {
            Log.e("BitmapLoad", exception.getMessage());
        }
    }

    public GitHubProfileDetailsImpl(GitHubProfileMemento profileMemento, Bitmap avatarBitmap) {
        this.name = profileMemento.ProfileName;
        this.blog = profileMemento.Blog;
        this.numberOfFollowers = profileMemento.NumberOfFollowers;
        this.createdAt = profileMemento.CreatedAt;
        this.avatarBitmap = avatarBitmap;
    }

    @Override
    public String getName() { return name; }

    @Override
    public String getBlog() {
        return blog;
    }

    @Override
    public Date getCreatedAt() { return createdAt; }

    @Override
    public int getNumberOfFollowers() { return numberOfFollowers; }

    @Override
    public Bitmap getAvatarBitmap() { return avatarBitmap;}

    public GitHubProfileMemento GetProfileMemento() {
        GitHubProfileMemento memento = new GitHubProfileMemento();
        
        memento.ProfileName = this.name;
        memento.Blog = this.blog;
        memento.NumberOfFollowers = this.numberOfFollowers;
        memento.CreatedAt = this.createdAt;
        
        return memento;
    }
    
    public class GitHubProfileMemento {
        public String ProfileName;
        public String Blog;
        public Date CreatedAt;
        public int NumberOfFollowers;
    }
}




Java Source Code List

com.githubcardandroidapp.app.GitHubCardActivity.java
com.githubcardandroidapp.app.SettingsActivity.java
com.githubcardandroidapp.app.BusinessObjects.GitHubProfileDetailsImpl.java
com.githubcardandroidapp.app.BusinessObjects.GitHubProfileDetails.java
com.githubcardandroidapp.app.BusinessObjects.GitHubUserRepositoriesImpl.java
com.githubcardandroidapp.app.BusinessObjects.GitHubUserRepositories.java
com.githubcardandroidapp.app.GitHubContributionsIO.GitHubProfileDetailsDownloaderBase.java
com.githubcardandroidapp.app.GitHubContributionsIO.GitHubProfileDetailsDownloader.java
com.githubcardandroidapp.app.GitHubContributionsIO.HttpClientProfileDetailsDownloader.java
com.githubcardandroidapp.app.GitHubContributionsIO.HttpUrlConnectionProfileDetailsDownloader.java
com.githubcardandroidapp.app.GitHubContributionsIO.Profile.GitHubActivityInternalStorageAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Profile.GitHubActivityOnlineUserProfileAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Profile.GitHubProfileAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Repositories.GitHubActivityOnlineUserRepositoriesAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Repositories.GitHubInternalStorageUserRepositoriesAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Repositories.GitHubUserRepositoriesAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Services.DeviceStartupReceiver.java
com.githubcardandroidapp.app.GitHubContributionsIO.Services.GitHubCardActivityReceiver.java
com.githubcardandroidapp.app.GitHubContributionsIO.Services.GitHubSyncService.java
com.githubcardandroidapp.app.Network.ConnectivityChecker.java
com.githubcardandroidapp.app.Network.ConnectivityReceiver.java
com.githubcardandroidapp.app.Serialization.PersistenceHandlerImpl.java
com.githubcardandroidapp.app.Serialization.PersistenceHandler.java
com.githubcardandroidapp.app.Serialization.UserNamePicker.java