Search in sources :

Example 6 with Character

use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.

the class CharactersFakeDataSource method getCaptainMarvel.

@NonNull
private Character getCaptainMarvel() {
    Character captainMarvel = new Character();
    captainMarvel.setKey(CAPTAIN_MARVEL_KEY);
    captainMarvel.setName("Captain Marvel");
    captainMarvel.setThumbnailUrl("http://x.annihil.us/u/prod/marvel/i/mg/6/30/537ba61b764b4.jpg");
    captainMarvel.setDescription("Carol Danvers entered the Air Force upon graduating from high school to pursue her love" + " of aircrafts and her dreams of flying.");
    return captainMarvel;
}
Also used : Character(com.karumi.rosie.sample.characters.domain.model.Character) NonNull(android.support.annotation.NonNull)

Example 7 with Character

use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.

the class CharactersFakeDataSource method getHulk.

@NonNull
private Character getHulk() {
    Character hulk = new Character();
    hulk.setKey(HULK_KEY);
    hulk.setName("Hulk");
    hulk.setThumbnailUrl("http://x.annihil.us/u/prod/marvel/i/mg/e/e0/537bafa34baa9.jpg");
    hulk.setDescription("Caught in a gamma bomb explosion while trying to save the life of a teenager, Dr. Bruce" + " Banner was transformed into the incredibly powerful creature called the Hulk. An" + " all too often misunderstood hero, the angrier the Hulk gets, the stronger the Hulk" + " gets.");
    return hulk;
}
Also used : Character(com.karumi.rosie.sample.characters.domain.model.Character) NonNull(android.support.annotation.NonNull)

Example 8 with Character

use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.

the class CharactersFakeDataSource method getIronMan.

@NonNull
private Character getIronMan() {
    Character hulk = new Character();
    hulk.setKey(IRON_MAN_KEY);
    hulk.setName("Iron Man");
    hulk.setThumbnailUrl("http://i.annihil.us/u/prod/marvel/i/mg/c/60/55b6a28ef24fa.jpg");
    hulk.setDescription("Wounded, captured and forced to build a weapon by his enemies, billionaire industrialist" + " Tony Stark instead created an advanced suit of armor to save his life and escape" + " captivity. Now with a new outlook on life, Tony uses his money and intelligence" + " to make the world a safer, better place as Iron Man.");
    return hulk;
}
Also used : Character(com.karumi.rosie.sample.characters.domain.model.Character) NonNull(android.support.annotation.NonNull)

Example 9 with Character

use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.

the class CharactersFakeDataSource method getThor.

@NonNull
private Character getThor() {
    Character hulk = new Character();
    hulk.setKey(THOR_KEY);
    hulk.setName("Thor");
    hulk.setThumbnailUrl("http://x.annihil.us/u/prod/marvel/i/mg/7/10/537bc71e9286f.jpg");
    hulk.setDescription("As the Norse God of thunder and lightning, Thor wields one of the greatest weapons ever" + " made, the enchanted hammer Mjolnir. While others have described Thor as an" + " over-muscled, oafish imbecile, he's quite smart and compassionate." + " He's self-assured, and he would never, ever stop fighting for a worthwhile cause.");
    return hulk;
}
Also used : Character(com.karumi.rosie.sample.characters.domain.model.Character) NonNull(android.support.annotation.NonNull)

Example 10 with Character

use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.

the class CharactersFakeDataSource method getByKey.

@Override
public Character getByKey(String key) throws Exception {
    Character character;
    fakeDelay();
    switch(key) {
        case SPIDERMAN_KEY:
            character = getSpiderman();
            break;
        case CAPTAIN_MARVEL_KEY:
            character = getCaptainMarvel();
            break;
        case HULK_KEY:
            character = getHulk();
            break;
        case THOR_KEY:
            character = getThor();
            break;
        case SCARLET_KEY:
            character = getScarletWitch();
            break;
        case WOLVERINE_KEY:
            character = getWolverine();
            break;
        case STORM_KEY:
            character = getStorm();
            break;
        case IRON_MAN_KEY:
        default:
            character = getIronMan();
            break;
    }
    return character;
}
Also used : Character(com.karumi.rosie.sample.characters.domain.model.Character)

Aggregations

Character (com.karumi.rosie.sample.characters.domain.model.Character)23 NonNull (android.support.annotation.NonNull)10 Page (com.karumi.rosie.repository.datasource.paginated.Page)4 PaginatedCollection (com.karumi.rosie.repository.PaginatedCollection)3 MarvelApiException (com.karumi.marvelapiclient.MarvelApiException)2 InjectedInstrumentationTest (com.karumi.rosie.sample.InjectedInstrumentationTest)2 LinkedList (java.util.LinkedList)2 Test (org.junit.Test)2 LargeTest (android.test.suitebuilder.annotation.LargeTest)1 CharactersDto (com.karumi.marvelapiclient.model.CharactersDto)1 RosieUseCase (com.karumi.rosie.domain.usecase.RosieUseCase)1 Success (com.karumi.rosie.domain.usecase.annotation.Success)1 UseCase (com.karumi.rosie.domain.usecase.annotation.UseCase)1 OnSuccessCallback (com.karumi.rosie.domain.usecase.callback.OnSuccessCallback)1 OnErrorCallback (com.karumi.rosie.domain.usecase.error.OnErrorCallback)1 CharacterDetailViewModel (com.karumi.rosie.sample.characters.view.viewmodel.CharacterDetailViewModel)1 CharacterViewModel (com.karumi.rosie.sample.characters.view.viewmodel.CharacterViewModel)1 UnknownHostException (java.net.UnknownHostException)1 ArrayList (java.util.ArrayList)1