Skip to content

Issue #24 #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ public GlideLoader(String defaultPlaceholderString) {
@Override
public void loadImage(@NonNull AvatarView avatarView, @NonNull AvatarPlaceholder avatarPlaceholder, @NonNull String avatarUrl) {
Glide.with(avatarView.getContext())
.load(avatarUrl)
.crossFade()
.placeholder(avatarPlaceholder)
.fitCenter()
.into(avatarView);
.load(avatarUrl)
.fitCenter()
.centerCrop()
.placeholder(avatarPlaceholder)
.crossFade()
.into(avatarView);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ public PicassoLoader(String defaultPlaceholderString) {
@Override
public void loadImage(@NonNull AvatarView avatarView, @NonNull AvatarPlaceholder avatarPlaceholder, String avatarUrl) {
Picasso.with(avatarView.getContext())
.load(avatarUrl)
.placeholder(avatarPlaceholder)
.fit()
.into(avatarView);
.load(avatarUrl)
.fit()
.centerCrop()
.placeholder(avatarPlaceholder)
.into(avatarView);
}
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.novoda:bintray-release:0.3.4'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ExampleViewModel extends BaseObservable {
private static final String OBAMA_IMAGE = "http://pixel.nymag.com/imgs/daily/vulture/2016/08/11/11-obama-sex-playlist.w529.h529.jpg";
private static final String DUDA_IMAGE = "https://pbs.twimg.com/profile_images/556495456805453826/wKEOCDN0_400x400.png";
private static final String STONOGA_IMAGE = "http://brzeg24.pl/wp-content/uploads/2015/06/Zbigniew-Stonoga-e1434539892479.jpg";
private static final String LINDA_IMAGE = "http://www.cyfraplus.pl/ms_galeria/fotostar/3032_c.jpg";
private static final String PICHAI_IMAGE = "https://business-reporter.co.uk/wp-content/uploads/2016/02/pichai-PA.jpg";

public User userWithNoImageSmall;
public User userWithNoImage;
Expand All @@ -30,7 +30,7 @@ public ExampleViewModel() {
userWithImageSmall = new User("Obama", OBAMA_IMAGE);
userWithImage = new User("Duda", DUDA_IMAGE);
userWithImageBiggest = new User("Stonoga", STONOGA_IMAGE);
refreshableUser = new User("Linda", LINDA_IMAGE);
refreshableUser = new User("Pichai", PICHAI_IMAGE);
}

@Bindable
Expand All @@ -39,7 +39,7 @@ public User getRefreshableUser() {
}

public void reloadImage() {
refreshableUser.setAvatarUrl(String.format("%s?%s", LINDA_IMAGE, new Date().getTime())); //new Date() added in order to block Picasso caching
refreshableUser.setAvatarUrl(String.format("%s?%s", PICHAI_IMAGE, new Date().getTime())); //new Date() added in order to block Picasso caching
notifyPropertyChanged(BR.refreshableUser);
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Fri Sep 22 16:15:52 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip