├── README.md.bak ├── .idea ├── .name ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── vcs.xml ├── inspectionProfiles │ ├── profiles_settings.xml │ └── Project_Default.xml ├── runConfigurations.xml ├── modules.xml ├── compiler.xml ├── gradle.xml └── misc.xml ├── glidesample ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ ├── drawable │ │ │ ├── error.jpg │ │ │ └── placeholder.jpg │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ ├── anim │ │ │ └── scale.xml │ │ └── layout │ │ │ ├── item_card.xml │ │ │ ├── activity_gird_view.xml │ │ │ ├── activity_image_view_pager.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_image_detial.xml │ │ │ └── activity_simple.xml │ │ ├── java │ │ └── example │ │ │ └── com │ │ │ └── glidesample │ │ │ ├── model │ │ │ ├── CustomImageSizeModel.java │ │ │ ├── Url.java │ │ │ └── CustomImageSizeModelImp.java │ │ │ ├── glide │ │ │ ├── CustomImageModelLoader.java │ │ │ ├── CustomImageSizeGlideModule.java │ │ │ ├── CustomImageSizeModelFactory.java │ │ │ └── GlideConfigModule.java │ │ │ ├── MainActivity.java │ │ │ ├── ui │ │ │ ├── GirdViewActivity.java │ │ │ ├── ImageViewPagerActivity.java │ │ │ └── SimpleActivity.java │ │ │ └── adapter │ │ │ └── GirdAdapter.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── imageloadpk ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── error.jpg │ │ │ │ └── placeholder.jpg │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── imageloadpk │ │ │ │ ├── adapter │ │ │ │ ├── watcher │ │ │ │ │ ├── WatchInterface.java │ │ │ │ │ ├── Drawables.java │ │ │ │ │ ├── WatchListener.java │ │ │ │ │ ├── WatchImageView.java │ │ │ │ │ ├── WatchDraweeImage.java │ │ │ │ │ └── WatchImpl.java │ │ │ │ ├── config │ │ │ │ │ ├── ConfigConstants.java │ │ │ │ │ ├── PicassoConfigFactory.java │ │ │ │ │ ├── ImageLoaderFactory.java │ │ │ │ │ ├── GlideConfigModule.java │ │ │ │ │ └── FrescoConfigFactory.java │ │ │ │ ├── holders │ │ │ │ │ ├── FrescoHolder.java │ │ │ │ │ ├── PicassoHolder.java │ │ │ │ │ ├── ImageLoaderHolder.java │ │ │ │ │ ├── BaseHolder.java │ │ │ │ │ └── GlideHolder.java │ │ │ │ └── adapters │ │ │ │ │ ├── GlideAdapter.java │ │ │ │ │ ├── ImageLoaderAdapter.java │ │ │ │ │ ├── PicassoAdapter.java │ │ │ │ │ ├── ImageListAdapter.java │ │ │ │ │ └── FrescoAdapter.java │ │ │ │ └── model │ │ │ │ ├── Data.java │ │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── imageloadpk │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── example │ │ └── imageloadpk │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── imagescaletype ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ ├── cat.jpg │ │ │ │ └── bulldog.jpg │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── imagescaletype │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── imagescaletype │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── example │ │ └── imagescaletype │ │ └── ApplicationTest.java └── proguard-rules.pro ├── README.md ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── gradlew └── LICENSE /README.md.bak: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | ImageLoadPK -------------------------------------------------------------------------------- /glidesample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /imageloadpk/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /imagescaletype/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/README.md -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':imageloadpk', ':imagescaletype', ':glidesample' 2 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /glidesample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GlideSample 3 | 4 | -------------------------------------------------------------------------------- /imagescaletype/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ImageScaleType 3 | 4 | -------------------------------------------------------------------------------- /glidesample/src/main/res/drawable/error.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/glidesample/src/main/res/drawable/error.jpg -------------------------------------------------------------------------------- /imageloadpk/src/main/res/drawable/error.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/imageloadpk/src/main/res/drawable/error.jpg -------------------------------------------------------------------------------- /imagescaletype/src/main/res/drawable/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/imagescaletype/src/main/res/drawable/cat.jpg -------------------------------------------------------------------------------- /glidesample/src/main/res/drawable/placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/glidesample/src/main/res/drawable/placeholder.jpg -------------------------------------------------------------------------------- /imageloadpk/src/main/res/drawable/placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/imageloadpk/src/main/res/drawable/placeholder.jpg -------------------------------------------------------------------------------- /imagescaletype/src/main/res/drawable/bulldog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/imagescaletype/src/main/res/drawable/bulldog.jpg -------------------------------------------------------------------------------- /glidesample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/glidesample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /glidesample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/glidesample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /glidesample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/glidesample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /glidesample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/glidesample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /imageloadpk/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/imageloadpk/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /imageloadpk/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/imageloadpk/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /glidesample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/glidesample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /imagescaletype/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/imagescaletype/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /imagescaletype/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/imagescaletype/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /imagescaletype/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhouruikevin/ImageLoadPK/HEAD/imagescaletype/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /glidesample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /glidesample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /imageloadpk/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /imagescaletype/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /imagescaletype/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Aug 25 16:42:21 CST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip 7 | -------------------------------------------------------------------------------- /imageloadpk/src/main/java/com/example/imageloadpk/adapter/watcher/WatchInterface.java: -------------------------------------------------------------------------------- 1 | package com.example.imageloadpk.adapter.watcher; 2 | 3 | /** 4 | * Created by Nevermore on 16/7/3. 5 | */ 6 | public interface WatchInterface { 7 | void initWatcher(final String tag, WatchListener watchListener); 8 | } 9 | -------------------------------------------------------------------------------- /imageloadpk/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ImageLoadPK 3 | Fresco 4 | ImageLoad 5 | Picasso 6 | Glide 7 | 8 | -------------------------------------------------------------------------------- /glidesample/src/main/java/example/com/glidesample/model/CustomImageSizeModel.java: -------------------------------------------------------------------------------- 1 | package example.com.glidesample.model; 2 | 3 | /** 4 | * Created by Administrator on 2016/7/7. 5 | */ 6 | public interface CustomImageSizeModel { 7 | String requestCustomSizeUrl(int width, int height); 8 | 9 | String getBaseUrl(); 10 | } 11 | -------------------------------------------------------------------------------- /imageloadpk/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 8dp 6 | 4dp 7 | 12dp 8 | 9 | -------------------------------------------------------------------------------- /glidesample/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /imageloadpk/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /imagescaletype/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /imageloadpk/src/test/java/com/example/imageloadpk/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.example.imageloadpk; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /imagescaletype/src/test/java/com/example/imagescaletype/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.example.imagescaletype; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /glidesample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /imageloadpk/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /imagescaletype/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /imageloadpk/src/androidTest/java/com/example/imageloadpk/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.example.imageloadpk; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /imageloadpk/src/main/java/com/example/imageloadpk/adapter/config/ConfigConstants.java: -------------------------------------------------------------------------------- 1 | package com.example.imageloadpk.adapter.config; 2 | 3 | /** 4 | * Created by Administrator on 2016/7/4. 5 | */ 6 | public class ConfigConstants { 7 | public static final int MAX_HEAP_SIZE = (int) Runtime.getRuntime().maxMemory(); 8 | public static final int MAX_CACHE_MEMORY_SIZE = MAX_HEAP_SIZE / 4; 9 | public static final int MAX_CACHE_DISK_SIZE = 50 * 1024 * 1024; 10 | } 11 | -------------------------------------------------------------------------------- /glidesample/src/main/res/anim/scale.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | -------------------------------------------------------------------------------- /imagescaletype/src/androidTest/java/com/example/imagescaletype/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.example.imagescaletype; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /glidesample/src/main/res/layout/item_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /glidesample/src/main/res/layout/activity_gird_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /glidesample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\AndroidStudio\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /glidesample/src/main/java/example/com/glidesample/glide/CustomImageModelLoader.java: -------------------------------------------------------------------------------- 1 | package example.com.glidesample.glide; 2 | 3 | import android.content.Context; 4 | 5 | import com.bumptech.glide.load.model.stream.BaseGlideUrlLoader; 6 | 7 | import example.com.glidesample.model.CustomImageSizeModel; 8 | 9 | /** 10 | * Created by Administrator on 2016/7/7. 11 | */ 12 | public class CustomImageModelLoader extends BaseGlideUrlLoader { 13 | public CustomImageModelLoader(Context context) { 14 | super(context); 15 | } 16 | 17 | @Override 18 | protected String getUrl(CustomImageSizeModel model, int width, int height) { 19 | return model.requestCustomSizeUrl(width, height); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /imageloadpk/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/Nevermore/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Android template 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | 18 | # Gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Android Studio Navigation editor temp files 32 | .navigation/ 33 | 34 | # Android Studio captures folder 35 | captures/ 36 | 37 | # Intellij 38 | *.iml 39 | .idea/workspace.xml 40 | 41 | # Keystore files 42 | *.jks 43 | 44 | /.idea/ 45 | /.gradle/ 46 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /imagescaletype/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /glidesample/src/main/java/example/com/glidesample/model/Url.java: -------------------------------------------------------------------------------- 1 | package example.com.glidesample.model; 2 | 3 | /** 4 | * Created by Administrator on 2016/7/7. 5 | */ 6 | public interface Url { 7 | String IMAGE_URL_TROCHILIDAE = "http://o9xuvf3m3.bkt.clouddn.com/trochilidae.jpg"; 8 | String IMAGE_URL_NEW_YORK = "http://o9xuvf3m3.bkt.clouddn.com/new_york.jpg"; 9 | String IMAGE_URL_PERU = "http://o9xuvf3m3.bkt.clouddn.com/peru.jpg"; 10 | String IMAGE_URL_FRANCE_1 = "http://o9xuvf3m3.bkt.clouddn.com/france-217.jpg"; 11 | String IMAGE_URL_FRANCE_2 = "http://o9xuvf3m3.bkt.clouddn.com/france-220.jpg"; 12 | String IMAGE_URL_FRANCE_3 = "http://o9xuvf3m3.bkt.clouddn.com/france-216.jpg"; 13 | String IMAGE_URL_FRANCE_4 = "http://o9xuvf3m3.bkt.clouddn.com/france-221.jpg"; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /imagescaletype/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/Nevermore/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -keep public class * implements com.bumptech.glide.module.GlideModule -------------------------------------------------------------------------------- /imageloadpk/src/main/java/com/example/imageloadpk/adapter/watcher/Drawables.java: -------------------------------------------------------------------------------- 1 | package com.example.imageloadpk.adapter.watcher; 2 | 3 | import android.content.res.Resources; 4 | import android.graphics.drawable.Drawable; 5 | 6 | import com.example.imageloadpk.R; 7 | 8 | /** 9 | * Created by Nevermore on 16/7/3. 10 | */ 11 | public class Drawables { 12 | public static Drawable sPlaceholderDrawable; 13 | public static Drawable sErrorDrawable; 14 | 15 | private Drawables() { 16 | } 17 | 18 | public static void init(final Resources resources) { 19 | if (sPlaceholderDrawable == null) { 20 | sPlaceholderDrawable = resources.getDrawable(R.drawable.placeholder, null); 21 | } 22 | if (sErrorDrawable == null) { 23 | sErrorDrawable = resources.getDrawable(R.drawable.error, null); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /glidesample/src/main/java/example/com/glidesample/glide/CustomImageSizeGlideModule.java: -------------------------------------------------------------------------------- 1 | package example.com.glidesample.glide; 2 | 3 | import android.content.Context; 4 | import android.util.Log; 5 | 6 | import com.bumptech.glide.Glide; 7 | import com.bumptech.glide.GlideBuilder; 8 | import com.bumptech.glide.module.GlideModule; 9 | 10 | import java.io.InputStream; 11 | 12 | import example.com.glidesample.model.CustomImageSizeModel; 13 | 14 | /** 15 | * Created by Administrator on 2016/7/7. 16 | */ 17 | public class CustomImageSizeGlideModule implements GlideModule { 18 | @Override 19 | public void applyOptions(Context context, GlideBuilder builder) { 20 | } 21 | 22 | @Override 23 | public void registerComponents(Context context, Glide glide) { 24 | glide.register(CustomImageSizeModel.class, InputStream.class, new CustomImageSizeModelFactory()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /glidesample/src/main/java/example/com/glidesample/glide/CustomImageSizeModelFactory.java: -------------------------------------------------------------------------------- 1 | package example.com.glidesample.glide; 2 | 3 | import android.content.Context; 4 | 5 | import com.bumptech.glide.load.model.GenericLoaderFactory; 6 | import com.bumptech.glide.load.model.ModelLoader; 7 | import com.bumptech.glide.load.model.ModelLoaderFactory; 8 | 9 | import java.io.InputStream; 10 | 11 | import example.com.glidesample.model.CustomImageSizeModel; 12 | 13 | /** 14 | * Created by Administrator on 2016/7/7. 15 | */ 16 | public class CustomImageSizeModelFactory implements ModelLoaderFactory { 17 | public final static String TAG = "CustomImageSizeModelFactory"; 18 | @Override 19 | public ModelLoader build(Context context, GenericLoaderFactory factories) { 20 | return new CustomImageModelLoader(context); 21 | } 22 | 23 | @Override 24 | public void teardown() { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /glidesample/src/main/java/example/com/glidesample/glide/GlideConfigModule.java: -------------------------------------------------------------------------------- 1 | package example.com.glidesample.glide; 2 | 3 | import android.content.Context; 4 | 5 | import com.bumptech.glide.Glide; 6 | import com.bumptech.glide.GlideBuilder; 7 | import com.bumptech.glide.load.DecodeFormat; 8 | import com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool; 9 | import com.bumptech.glide.load.engine.cache.InternalCacheDiskCacheFactory; 10 | import com.bumptech.glide.load.engine.cache.LruResourceCache; 11 | import com.bumptech.glide.module.GlideModule; 12 | 13 | /** 14 | * Created by Administrator on 2016/7/4. 15 | */ 16 | 17 | public class GlideConfigModule implements GlideModule { 18 | 19 | @Override 20 | public void applyOptions(Context context, GlideBuilder builder) { 21 | builder.setDecodeFormat(DecodeFormat.PREFER_ARGB_8888);//和Picasso配置一样 22 | } 23 | 24 | @Override 25 | public void registerComponents(Context context, Glide glide) { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /glidesample/src/main/res/layout/activity_image_view_pager.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 16 | 24 | 25 | -------------------------------------------------------------------------------- /imageloadpk/src/main/java/com/example/imageloadpk/adapter/config/PicassoConfigFactory.java: -------------------------------------------------------------------------------- 1 | package com.example.imageloadpk.adapter.config; 2 | 3 | import android.content.Context; 4 | 5 | import com.squareup.picasso.LruCache; 6 | import com.squareup.picasso.OkHttpDownloader; 7 | import com.squareup.picasso.Picasso; 8 | 9 | /** 10 | * Created by Administrator on 2016/7/4. 11 | */ 12 | public class PicassoConfigFactory { 13 | private static Picasso sPicasso; 14 | 15 | public static Picasso getPicasso(Context context) { 16 | if (sPicasso == null) { 17 | sPicasso = new Picasso.Builder(context) 18 | //硬盘缓存池大小 19 | .downloader(new OkHttpDownloader(context, ConfigConstants.MAX_CACHE_DISK_SIZE)) 20 | //内存缓存池大小 21 | .memoryCache(new LruCache(ConfigConstants.MAX_CACHE_MEMORY_SIZE)) 22 | // .defaultBitmapConfig(Bitmap.Config.ARGB_4444) 23 | .build(); 24 | } 25 | return sPicasso; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /imageloadpk/src/main/java/com/example/imageloadpk/adapter/config/ImageLoaderFactory.java: -------------------------------------------------------------------------------- 1 | package com.example.imageloadpk.adapter.config; 2 | 3 | import android.content.Context; 4 | 5 | import com.nostra13.universalimageloader.core.ImageLoader; 6 | import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; 7 | 8 | /** 9 | * Created by Administrator on 2016/7/4. 10 | */ 11 | public class ImageLoaderFactory { 12 | private static ImageLoader sImageLoader; 13 | 14 | 15 | public static ImageLoader getImageLoader(Context context) { 16 | 17 | 18 | if (sImageLoader == null) { 19 | ImageLoaderConfiguration imageLoaderConfiguration = new ImageLoaderConfiguration.Builder(context) 20 | .diskCacheSize(ConfigConstants.MAX_CACHE_DISK_SIZE) 21 | .memoryCacheSize(ConfigConstants.MAX_CACHE_MEMORY_SIZE) 22 | .build(); 23 | 24 | sImageLoader = ImageLoader.getInstance(); 25 | sImageLoader.init(imageLoaderConfiguration); 26 | } 27 | return sImageLoader; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 26 | 27 | -------------------------------------------------------------------------------- /glidesample/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |