This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class AutoValue_PersonData extends PersonData { | |
| private final long id; | |
| private final String name; | |
| private final int status; | |
| private final String eMail; | |
| private final String profileUrl; | |
| private final String pictureImageUrl; | |
| AutoValue_PersonData( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.auto.value.AutoValue; | |
| @AutoValue | |
| public abstract class PersonData { | |
| abstract long id(); | |
| abstract String name(); | |
| abstract int status(); | |
| abstract String eMail(); | |
| abstract String profileUrl(); | |
| abstract String pictureImageUrl(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PersonData { | |
| private final long id; | |
| private final String name; | |
| private final int status; | |
| private final String eMail; | |
| private final String profileUrl; | |
| private final String pictureImageUrl; | |
| public PersonData(long id, String name, int status, String eMail, String profileUrl, String pictureImageUrl) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| provided 'com.google.auto.value:auto-value:1.2' | |
| annotationProcessor 'com.google.auto.value:auto-value:1.2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { | |
| assert imageView != null; | |
| imageView.setImageBitmap(bitmap); | |
| Palette.from(bitmap) | |
| .generate(new Palette.PaletteAsyncListener() { | |
| @Override | |
| public void onGenerated(Palette palette) { | |
| Palette.Swatch textSwatch = palette.getVibrantSwatch(); | |
| if (textSwatch == null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int imageDimension = | |
| (int) getResources().getDimension(R.dimen.image_size); | |
| Picasso.with(MainActivity.this) | |
| .load("https://source.unsplash.com/random") | |
| .resize(imageDimension, imageDimension) | |
| .centerCrop() | |
| .into(new Target() { | |
| @Override | |
| public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Picasso.with(MainActivity.this) | |
| .load("https://source.unsplash.com/random") | |
| .into(new Target() { | |
| @Override | |
| public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { | |
| } | |
| @Override | |
| public void onBitmapFailed(Drawable errorDrawable) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Picasso.with(MainActivity.this) | |
| .load("https://source.unsplash.com/random") | |
| .centerCrop() | |
| .into(imageView); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| compile 'com.android.support:appcompat-v7:23.2.1' | |
| compile 'com.android.support:palette-v7:23.2.1' | |
| compile 'com.squareup.picasso:picasso:2.5.2' |