Skip to content

Commit

Permalink
发布1.1.0版本;
Browse files Browse the repository at this point in the history
  • Loading branch information
lcyluo committed Apr 8, 2021
0 parents commit 831a629
Show file tree
Hide file tree
Showing 244 changed files with 20,008 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.DS_Store

# Built application files
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea
.idea/workspace.xml
.idea/modules.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches

# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# test
/src/test
/src/androidTest
439 changes: 439 additions & 0 deletions README.md

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url "http://maven.aliyun.com/nexus/content/groups/public" }
}
dependencies {
//noinspection GradleDependency
classpath 'com.android.tools.build:gradle:3.4.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "http://maven.aliyun.com/nexus/content/groups/public" }
}
}
72 changes: 72 additions & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.DS_Store

# Built application files
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea
.idea/workspace.xml
.idea/modules.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches

# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# test
/src/test
/src/androidTest
Binary file added demo/KeyForEasyPhotos.jks
Binary file not shown.
43 changes: 43 additions & 0 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 30

defaultConfig {
applicationId "com.huantansheng.easyphotos.demo"
minSdkVersion 15
targetSdkVersion 30
versionCode 2
versionName "1.0.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
testImplementation 'junit:junit:4.12'

implementation project(':easyPhotos')

implementation("com.github.bumptech.glide:glide:4.9.0") {
exclude group: "com.android.support"
}
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
//检测内存泄漏
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
}
11 changes: 11 additions & 0 deletions demo/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#EasyPhotos

-keep class com.huantansheng.easyphotos.models.** { *; }

#glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.AppGlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
Binary file added demo/release/demo-release.apk
Binary file not shown.
1 change: 1 addition & 0 deletions demo/release/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":2,"versionName":"1.0.2","enabled":true,"outputFile":"demo-release.apk","fullName":"release","baseName":"release"},"path":"demo-release.apk","properties":{}}]
62 changes: 62 additions & 0 deletions demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.huantansheng.easyphotos.demo">

<application
android:name="com.huantansheng.easyphotos.demo.MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name="com.huantansheng.easyphotos.demo.SampleActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.huantansheng.easyphotos.demo.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths_public" />
</provider>

<!-- <activity -->
<!-- android:name="com.huantansheng.easyphotos.ui.EasyPhotosActivity" -->
<!-- android:screenOrientation="unspecified" -->
<!-- tools:replace="android:screenOrientation"/> -->


<!-- <activity -->
<!-- android:name="com.huantansheng.easyphotos.ui.PreviewActivity" -->
<!-- android:screenOrientation="unspecified" -->
<!-- tools:replace="android:screenOrientation" /> -->


<!-- <activity -->
<!-- android:name="com.huantansheng.easyphotos.ui.PuzzleActivity" -->
<!-- android:screenOrientation="unspecified" -->
<!-- tools:replace="android:screenOrientation" /> -->


<!-- <activity -->
<!-- android:name="com.huantansheng.easyphotos.ui.PuzzleSelectorActivity" -->
<!-- android:screenOrientation="unspecified" -->
<!-- tools:replace="android:screenOrientation" /> -->

<activity android:name="com.huantansheng.easyphotos.demo.SampleFragments" />
</application>

</manifest>
100 changes: 100 additions & 0 deletions demo/src/main/java/com/huantansheng/easyphotos/demo/GlideEngine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package com.huantansheng.easyphotos.demo;

import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.huantansheng.easyphotos.engine.ImageEngine;

import static com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade;

/**
* Glide4.x的加载图片引擎实现,单例模式
* Glide4.x的缓存机制更加智能,已经达到无需配置的境界。如果使用Glide3.x,需要考虑缓存机制。
* Created by huan on 2018/1/15.
*/

public class GlideEngine implements ImageEngine {
//单例
private static GlideEngine instance = null;
//单例模式,私有构造方法
private GlideEngine() {
}
//获取单例
public static GlideEngine getInstance() {
if (null == instance) {
synchronized (GlideEngine.class) {
if (null == instance) {
instance = new GlideEngine();
}
}
}
return instance;
}

/**
* 加载图片到ImageView
*
* @param context 上下文
* @param uri 图片路径Uri
* @param imageView 加载到的ImageView
*/
//安卓10推荐uri,并且path的方式不再可用
@Override
public void loadPhoto(@NonNull Context context, @NonNull Uri uri, @NonNull ImageView imageView) {
Glide.with(context).load(uri).transition(withCrossFade()).into(imageView);
}

/**
* 加载gif动图图片到ImageView,gif动图不动
*
* @param context 上下文
* @param gifUri gif动图路径Uri
* @param imageView 加载到的ImageView
* <p>
* 备注:不支持动图显示的情况下可以不写
*/
//安卓10推荐uri,并且path的方式不再可用
@Override
public void loadGifAsBitmap(@NonNull Context context, @NonNull Uri gifUri, @NonNull ImageView imageView) {
Glide.with(context).asBitmap().load(gifUri).into(imageView);
}

/**
* 加载gif动图到ImageView,gif动图动
*
* @param context 上下文
* @param gifUri gif动图路径Uri
* @param imageView 加载动图的ImageView
* <p>
* 备注:不支持动图显示的情况下可以不写
*/
//安卓10推荐uri,并且path的方式不再可用
@Override
public void loadGif(@NonNull Context context, @NonNull Uri gifUri, @NonNull ImageView imageView) {
Glide.with(context).asGif().load(gifUri).transition(withCrossFade()).into(imageView);
}


/**
* 获取图片加载框架中的缓存Bitmap
*
* @param context 上下文
* @param uri 图片路径
* @param width 图片宽度
* @param height 图片高度
* @return Bitmap
* @throws Exception 异常直接抛出,EasyPhotos内部处理
*/
//安卓10推荐uri,并且path的方式不再可用
@Override
public Bitmap getCacheBitmap(@NonNull Context context, @NonNull Uri uri, int width, int height) throws Exception {
return Glide.with(context).asBitmap().load(uri).submit(width, height).get();
}


}
Loading

0 comments on commit 831a629

Please sign in to comment.