Skip to content
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
Binary file added .idea/caches/build_file_checksums.ser
Binary file not shown.
116 changes: 116 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,7 @@ dependencies {

**备注**
> 文件上传、下载中的UIProgressListener 实现的3个方法onUIProgress()、onUIStart()、onUIFinish()的内容都可以根据项目需求自定义

### 2020.6.25.Thu.
改成自选图片是不是方便demo呢?
感觉这个带进度条上传的更清晰,但是携带参数不方便
21 changes: 12 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
buildToolsVersion '30.0.0'
defaultConfig {
applicationId "com.zx.okhttp3"
applicationId "com.zx_mod.okhttp3"
minSdkVersion 17
targetSdkVersion 24
versionCode 1
Expand All @@ -20,13 +20,16 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.google.code.gson:gson:2.8.0'
compile project(':library')
implementation 'com.android.support:appcompat-v7:24.2.1'
testImplementation 'junit:junit:4.12'
implementation 'com.squareup.okhttp3:okhttp:3.5.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation project(':library')
implementation 'com.lzy.widget:imagepicker:0.4.1'
implementation 'com.zhy:base-adapter:3.0.3'
implementation 'com.github.bumptech.glide:glide:3.7.0'
}
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
30 changes: 30 additions & 0 deletions app/src/main/java/com/zx/okhttp3/GlideImageLoader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.zx.okhttp3;

import android.app.Activity;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.lzy.imagepicker.loader.ImageLoader;

import java.io.File;

/**
* Created by lee on 2017/3/17.
*/

public class GlideImageLoader implements ImageLoader {

@Override
public void displayImage(Activity activity, String path, ImageView imageView, int width, int height) {
Glide.with(activity)//
.load(path.contains("http")?path:new File(path))//
.placeholder(R.mipmap.default_image)//
.error(R.mipmap.default_image)//
.fitCenter()
.into(imageView);
}

@Override
public void clearMemoryCache() {
}
}
Loading