Skip to content

Commit

Permalink
Update rxjava
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongnv219 committed Jul 24, 2018
1 parent c954e0a commit 6711c8b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 33 deletions.
4 changes: 2 additions & 2 deletions mvvm-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {
api 'com.android.support:support-v4:27.1.1'
api 'com.android.support:design:27.1.1'
api 'com.android.support:appcompat-v7:27.1.1'
api 'com.github.bumptech.glide:glide:4.7.1'
// api 'com.github.bumptech.glide:glide:4.7.1'
// api 'com.google.code.gson:gson:2.8.2'
// api 'com.karumi:dexter:4.2.0'
api 'com.jakewharton:butterknife:8.8.1'
Expand All @@ -45,7 +45,7 @@ dependencies {
api "com.google.dagger:dagger-android-support:2.14.1"

// reactive
api "io.reactivex.rxjava2:rxjava:2.1.9"
api "io.reactivex.rxjava2:rxjava:2.1.15"
api "io.reactivex.rxjava2:rxandroid:2.0.2"

//View model
Expand Down
54 changes: 23 additions & 31 deletions mvvm-base/src/main/java/com/base/utils/ImageLoaderUtils.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package com.base.utils;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;

/**
* cuongnv
* 5/30/18
Expand All @@ -18,27 +10,27 @@ public ImageLoaderUtils() {

}

public static void show(ImageView iv, String url) {
Context c = iv.getContext();

RequestOptions options = new RequestOptions()
.centerCrop()
// .error(R.drawable.image_not_found)
.transform(new RoundedCorners(5))
.priority(Priority.HIGH);
Glide.with(c).load(url).apply(options)
.into(iv);
}

public static void show(ImageView iv, int url) {
Context c = iv.getContext();

RequestOptions options = new RequestOptions()
.centerCrop()
// .error(R.drawable.bg_world_cup)
.transform(new RoundedCorners(5))
.priority(Priority.HIGH);
Glide.with(c).load(url).apply(options)
.into(iv);
}
// public static void show(ImageView iv, String url) {
// Context c = iv.getContext();
//
// RequestOptions options = new RequestOptions()
// .centerCrop()
//// .error(R.drawable.image_not_found)
// .transform(new RoundedCorners(5))
// .priority(Priority.HIGH);
// Glide.with(c).load(url).apply(options)
// .into(iv);
// }
//
// public static void show(ImageView iv, int url) {
// Context c = iv.getContext();
//
// RequestOptions options = new RequestOptions()
// .centerCrop()
//// .error(R.drawable.bg_world_cup)
// .transform(new RoundedCorners(5))
// .priority(Priority.HIGH);
// Glide.with(c).load(url).apply(options)
// .into(iv);
// }
}

0 comments on commit 6711c8b

Please sign in to comment.