-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sendtion
committed
May 5, 2018
1 parent
bb7ee81
commit c0753db
Showing
17 changed files
with
277 additions
and
108 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,46 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 26 | ||
buildToolsVersion "26.0.2" | ||
compileSdkVersion 27 | ||
buildToolsVersion "27.0.3" | ||
defaultConfig { | ||
applicationId "com.sendtion.xrichtext" | ||
minSdkVersion 14 | ||
targetSdkVersion 22 | ||
versionCode 2 | ||
versionName "1.1" | ||
versionCode 5 | ||
versionName "1.3" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
lintOptions { | ||
disable 'GoogleAppIndexingWarning' | ||
baseline file("lint-baseline.xml") | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
testImplementation 'junit:junit:4.12' | ||
|
||
implementation project(':xrichtext') | ||
//implementation 'com.github.sendtion:XRichText:1.2' | ||
|
||
//implementation 'com.android.support:appcompat-v7:26.1.0' | ||
implementation 'com.android.support:design:26.1.0' | ||
implementation 'com.android.support:cardview-v7:26.1.0' | ||
implementation 'com.android.support:design:27.1.1' | ||
implementation 'com.android.support:cardview-v7:27.1.1' | ||
|
||
//图片选择器 https://github.com/donglua/PhotoPicker | ||
implementation 'me.iwf.photopicker:PhotoPicker:0.8.4@aar' | ||
//implementation 'me.iwf.photopicker:PhotoPicker:0.8.4@aar' | ||
//知乎图片选择 https://github.com/zhihu/Matisse | ||
implementation 'com.zhihu.android:matisse:0.4.3' | ||
|
||
implementation 'io.reactivex:rxjava:1.3.0' | ||
implementation 'io.reactivex:rxandroid:1.2.1' | ||
|
||
} |
This file contains 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
This file contains 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
61 changes: 61 additions & 0 deletions
61
app/src/main/java/com/sendtion/xrichtextdemo/util/MyGlideEngine.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.sendtion.xrichtextdemo.util; | ||
|
||
import android.content.Context; | ||
import android.graphics.drawable.Drawable; | ||
import android.net.Uri; | ||
import android.widget.ImageView; | ||
|
||
import com.bumptech.glide.Priority; | ||
import com.sendtion.xrichtext.GlideApp; | ||
import com.zhihu.matisse.engine.ImageEngine; | ||
|
||
/** | ||
* 自定义Glide加载引擎,用于知乎图片选择器 | ||
*/ | ||
public class MyGlideEngine implements ImageEngine { | ||
@Override | ||
public void loadThumbnail(Context context, int resize, Drawable placeholder, ImageView imageView, Uri uri) { | ||
GlideApp.with(context) | ||
.asBitmap() // some .jpeg files are actually gif | ||
.load(uri) | ||
.placeholder(placeholder) | ||
.override(resize, resize) | ||
.centerCrop() | ||
.into(imageView); | ||
} | ||
|
||
@Override | ||
public void loadAnimatedGifThumbnail(Context context, int resize, Drawable placeholder, ImageView imageView, Uri uri) { | ||
GlideApp.with(context) | ||
.asBitmap() | ||
.load(uri) | ||
.placeholder(placeholder) | ||
.override(resize, resize) | ||
.centerCrop() | ||
.into(imageView); | ||
} | ||
|
||
@Override | ||
public void loadImage(Context context, int resizeX, int resizeY, ImageView imageView, Uri uri) { | ||
GlideApp.with(context) | ||
.load(uri) | ||
.override(resizeX, resizeY) | ||
.priority(Priority.HIGH) | ||
.into(imageView); | ||
} | ||
|
||
@Override | ||
public void loadAnimatedGifImage(Context context, int resizeX, int resizeY, ImageView imageView, Uri uri) { | ||
GlideApp.with(context) | ||
.asGif() | ||
.load(uri) | ||
.override(resizeX, resizeY) | ||
.priority(Priority.HIGH) | ||
.into(imageView); | ||
} | ||
|
||
@Override | ||
public boolean supportAnimatedGif() { | ||
return true; | ||
} | ||
} |
Oops, something went wrong.