use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.
the class CharactersFakeDataSource method getStorm.
@NonNull
private Character getStorm() {
Character storm = new Character();
storm.setKey(STORM_KEY);
storm.setName("Storm");
storm.setThumbnailUrl("https://x.annihil.us/u/prod/marvel/i/mg/c/b0/537bc5f8a8df0.jpg");
storm.setDescription("Ororo Monroe is the descendant of an ancient line of African priestesses, all of whom " + "have white hair, blue eyes, and the potential to wield magic. Her mother, N'dare, " + "was an African princess who married American photojournalist David Monroe and moved " + "with him to Manhattan, where Ororo was born. When Ororo was six months old, she and " + "her parents moved to Cairo, Egypt. Five years later, during the Arab-Israeli " + "conflict, a plane crashed into their home. Ororo's parents were killed, but she " + "survived, buried under rubble near her mother's body. The resultant trauma left " + "Ororo with severe claustrophobia that still affects her today.");
return storm;
}
use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.
the class CharactersFakeDataSource method getWolverine.
@NonNull
private Character getWolverine() {
Character wolverine = new Character();
wolverine.setKey(WOLVERINE_KEY);
wolverine.setName("Wolverine");
wolverine.setThumbnailUrl("https://i.annihil.us/u/prod/marvel/i/mg/9/00/537bcb1133fd7.jpg");
wolverine.setDescription("Born the second son of wealthy landowners John and Elizabeth Howlett in Alberta, Canada " + "during the late 19th Century, James Howlett was a frail boy of poor health. James " + "was largely neglected by his mother, who was institutionalized for a time " + "following the death of her first son, John Jr., in 1897. He spent most of " + "his early years on the estate grounds and had two playmates that lived on the " + "Howlett estate with him: Rose, a red-headed girl who was brought in from town " + "to be a companion to young James, and a boy nicknamed \"Dog\" who was the son of " + "the groundskeeper, Thomas Logan. Thomas Logan was an alcoholic and was extremely " + "abusive to his son. The children were close friends but as they reached young " + "adulthood, the abuse inflicted upon Dog warped his mind. His actions would lead to" + " a tragic chain of events. that started as the three neared their adolescent years " + "when Dog made unwanted advances toward Rose and James reported it to his father." + " In retaliation Dog killed James's pet dog. This in turn resulted in the expulsion " + "of Thomas Logan and Dog Logan from the estate.");
return wolverine;
}
use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.
the class CharacterToCharacterDtoMapper method reverseMap.
@Override
public Character reverseMap(CharacterDto value) {
Character character = new Character();
character.setKey(value.getId());
character.setName(value.getName());
character.setDescription(value.getDescription());
character.setThumbnailUrl(value.getThumbnail().getImageUrl(MarvelImage.Size.PORTRAIT_UNCANNY));
return character;
}
use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.
the class CharacterDetailsPresenter method loadCharacterDetails.
private void loadCharacterDetails() {
getView().hideCharacterDetail();
createUseCaseCall(getCharacterDetails).args(characterKey).onSuccess(new OnSuccessCallback() {
@Success
public void onCharacterDetailsLoaded(Character character) {
hideLoading();
CharacterDetailViewModel characterDetailViewModel = mapper.mapCharacterToCharacterDetailViewModel(character);
getView().showCharacterDetail(characterDetailViewModel);
}
}).onError(new OnErrorCallback() {
@Override
public boolean onError(Error error) {
getView().hideLoading();
return false;
}
}).execute();
}
use of com.karumi.rosie.sample.characters.domain.model.Character in project Rosie by Karumi.
the class CharacterToCharacterViewModelMapper method mapCharactersToCharacterViewModels.
public List<CharacterViewModel> mapCharactersToCharacterViewModels(PaginatedCollection<Character> characters) {
List<CharacterViewModel> characterViewModels = new LinkedList<>();
for (Character character : characters.getItems()) {
CharacterViewModel characterViewModel = new CharacterViewModel();
characterViewModel.setKey(character.getKey());
characterViewModel.setName(character.getName());
characterViewModel.setThumbnailUrl(character.getThumbnailUrl());
characterViewModels.add(characterViewModel);
}
return characterViewModels;
}
Aggregations