Skip to content

Commit

Permalink
发布v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jenly1314 committed Sep 16, 2023
1 parent a9fcdec commit a5386cd
Show file tree
Hide file tree
Showing 33 changed files with 279 additions and 285 deletions.
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ orbs:

jobs:
build:
executor: android/android

docker:
- image: cimg/android:2023.02
steps:
- checkout
- run:
command: ./gradlew build
command: ./gradlew build

4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Build with Gradle
run: ./gradlew build
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: android
dist: trusty
jdk: oraclejdk8
jdk: oraclejdk11
sudo: false

env:
global:
- ANDROID_API_LEVEL=29
- ANDROID_BUILD_TOOLS_VERSION=29.0.2
- ANDROID_API_LEVEL=30
- ANDROID_BUILD_TOOLS_VERSION=30.0.3
- TRAVIS_SECURE_ENV_VARS=true

before_install:
Expand Down
68 changes: 32 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,28 @@
ImageViewer for Android 是一个图片查看器,一般用来查看图片详情或查看大图时使用。

## Gif 展示
![Image](GIF.gif)

![Image](GIF.gif)

## 引入

### Gradle:

1. 在Project的 **build.gradle** 里面添加远程仓库
1. 在Project的 **build.gradle** **setting.gradle** 中添加远程仓库

```gradle
allprojects {
```gradle
repositories {
//...
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
```
```
2. 在Module的 **build.gradle** 里面添加引入依赖项
```gradle
implementation 'com.github.jenly1314:imageviewer:1.0.4'
```


以前发布至JCenter的版本

```gradle
implementation 'com.king.image:imageviewer:1.0.2'
```

```gradle
implementation 'com.github.jenly1314:imageviewer:1.1.0'
```
## 示例
Expand All @@ -55,7 +46,7 @@ implementation 'com.king.image:imageviewer:1.0.2'
```Java
//图片查看器 - 简单调用
// data 可以多张图片List或单张图片,支持的类型可以是{@link Uri}, {@code url}, {@code path},{@link File}, {@link DrawableRes resId}…等
// data 可以多张图片List或单张图片,支持的类型可以是{@link Uri}, {@code url}, {@code path},{@link File}, {@link DrawableRes resId}…等
ImageViewer.load(data)//要加载的图片数据,单张或多张
.imageLoader(new GlideImageLoader())//加载器,imageLoader必须配置,目前内置的有GlideImageLoader或PicassoImageLoader,也可以自己实现
.start(activity,sharedElement);//activity or fragment, 跳转时的共享元素视图
Expand All @@ -65,7 +56,7 @@ implementation 'com.king.image:imageviewer:1.0.2'
```Java
//图片查看器

// data 可以多张图片List或单张图片,支持的类型可以是{@link Uri}, {@code url}, {@code path},{@link File}, {@link DrawableRes resId}…等
// data 可以多张图片List或单张图片,支持的类型可以是{@link Uri}, {@code url}, {@code path},{@link File}, {@link DrawableRes resId}…等
ImageViewer.load(data)//要加载的图片数据,单张或多张
.selection(position)//当前选中位置,默认:0
.indicator(true)//是否显示指示器,默认不显示
Expand All @@ -77,49 +68,54 @@ implementation 'com.king.image:imageviewer:1.0.2'
```

### 相关说明
> * 使用 **ImageViewer** 时,必须配置一个实现的 **ImageLoader**

> * **ImageViewer** 一次可以查看多张图片或单张图片,支持的类型可以是 **Uri****url****path****File****Drawable****ImageDataSource**
* 使用 **ImageViewer** 时,必须配置一个实现的 **ImageLoader**

> * 目前内置默认实现的 **ImageLoader** 有和 **PicassoImageLoader** ,二者选其一即可,如果二者不满足您的需求,您也可以自己实现一个 **ImageLoader**
* **ImageViewer** 一次可以查看多张图片或单张图片,支持的类型可以是 **Uri****url****path** **File****DrawableRes****ImageDataSource**

> * 为了保证 **ImageViewer** 体积最小化,和用户更多可能的选择性,并未将 **Glide****Picasso** 打包进 **aar**
>> 当您使用了 **GlideImageLoader** 时,必须依赖[ **Glide** ](https://github.com/bumptech/glide)库。
* 目前内置默认实现 **ImageLoader** 的有 **GlideImageLoader****PicassoImageLoader** ,二者选其一即可,如果二者不满足您的需求,您也可以自己实现一个 **ImageLoader**

>> 当您使用了 **PicassoImageLoader** 时,必须依赖[ **Picasso** ](https://github.com/square/picasso)
* 为了保证 **ImageViewer** 体积最小化,让用户有更多选择的可能性, **ImageViewer** 仅编译时用到了 **Glide** **Picasso**

> 当你使用了 **GlideImageLoader** 时,则需依赖[ **Glide** ](https://github.com/bumptech/glide)库。
> 当你使用了 **PicassoImageLoader** 时,则需依赖[ **Picasso** ](https://github.com/square/picasso)库。
更多使用详情,请查看[app](app)中的源码使用示例

## 版本记录

#### v1.1.0:2023-9-16
* 更新Gradle至v7.3.3
* 更新compileSdk至30
* 优化细节

#### v1.0.4:2022-9-11
* 优化细节
* 优化细节

#### v1.0.3:2022-9-10 (从v1.0.3开始发布至 MavenCentral)
* 看大图界面支持自定义扩展
* 看大图界面支持自定义扩展

#### v1.0.2:2020-12-3
* 加载的图片数据新增支持ImageDataSource类型,便于扩展
* 加载的图片数据新增支持ImageDataSource类型,便于扩展

#### v1.0.1:2019-11-15
* 简化集成步骤
* 简化集成步骤

#### v1.0.0:2019-11-7
* ImageViewer初始版本
* ImageViewer初始版本

## 赞赏
如果您喜欢ImageViewer,或感觉ImageViewer帮助到了您,可以点右上角“Star”支持一下,您的支持就是我的动力,谢谢 :smiley:<p>

如果您喜欢ImageViewer,或感觉ImageViewer帮助到了您,可以点右上角“Star”支持一下,您的支持就是我的动力,谢谢 :
smiley:<p>
您也可以扫描下面的二维码,请作者喝杯咖啡 :coffee:
<div>
<img src="https://jenly1314.github.io/image/pay/wxpay.png" width="280" heght="350">
<img src="https://jenly1314.github.io/image/pay/alipay.png" width="280" heght="350">
<img src="https://jenly1314.github.io/image/pay/qqpay.png" width="280" heght="350">
<img src="https://jenly1314.github.io/image/alipay_red_envelopes.jpg" width="233" heght="350">
<img src="https://jenly1314.github.io/image/pay/sponsor.png" width="98%">
</div>

## 关于我
Name: <a title="关于作者" href="https://about.me/jenly1314" target="_blank">Jenly</a>
Name: <a title="关于作者" href="https://jenly1314.github.io" target="_blank">Jenly</a>

Email: <a title="欢迎邮件与我交流" href="mailto:jenly1314@gmail.com" target="_blank">jenly1314#gmail.com</a> / <a title="给我发邮件" href="mailto:jenly1314@vip.qq.com" target="_blank">jenly1314#vip.qq.com</a>

Expand Down
25 changes: 16 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion build_versions.compileSdk
buildToolsVersion build_versions.buildTools
namespace 'com.king.imageviewer.app'
compileSdk build_versions.compileSdk

defaultConfig {
applicationId "com.king.imageviewer.app"
minSdkVersion build_versions.minSdk
targetSdkVersion build_versions.targetSdk
minSdk build_versions.minSdk
targetSdk build_versions.targetSdk
versionCode app_version.versionCode
versionName app_version.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
abortOnError false
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.appcompat:appcompat:$versions.appcompat"
implementation "androidx.constraintlayout:constraintlayout:$versions.constraintlayout"
testImplementation "junit:junit:$versions.junit"
Expand All @@ -32,8 +41,6 @@ dependencies {
implementation "com.github.bumptech.glide:glide:$versions.glide"
annotationProcessor "com.github.bumptech.glide:compiler:$versions.glide"

implementation "com.facebook.fresco:fresco:$versions.fresco"

implementation "com.squareup.picasso:picasso:$versions.picasso"

implementation project(path: ':imageviewer')
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
10 changes: 6 additions & 4 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 2,
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
Expand All @@ -10,9 +10,11 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 5,
"versionName": "1.0.4",
"attributes": [],
"versionCode": 6,
"versionName": "1.1.0",
"outputFile": "app-release.apk"
}
]
],
"elementType": "File"
}
7 changes: 1 addition & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.king.imageviewer.app">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!--允许程序打开网络套接字-->
<uses-permission android:name="android.permission.INTERNET" />
<!--允许程序设置内置sd卡的写权限-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--允许程序读取内置sd卡的写权限-->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ public PhotoHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
@Override
public void onBindViewHolder(@NonNull PhotoHolder holder, final int position) {
holder.displayImage(mDatas.get(position));
holder.imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(mOnItemClickListener!=null){
mOnItemClickListener.onClick(v,position);
}
holder.imageView.setOnClickListener(v -> {
if(mOnItemClickListener!=null){
mOnItemClickListener.onClick(v, holder.getAdapterPosition());
}
});
}
Expand Down
52 changes: 7 additions & 45 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,47 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
apply from: 'versions.gradle'
repositories {
google()
mavenCentral()

}
dependencies {
classpath "com.android.tools.build:gradle:$versions.gradle"
classpath "com.vanniktech:gradle-maven-publish-plugin:$versions.mavenPublish"
}
}

allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }

}
}

allprojects {
plugins.withId("com.vanniktech.maven.publish") {
mavenPublish {
sonatypeHost = "S01"
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

allprojects {
tasks.withType(Javadoc) {
options{
encoding "UTF-8"
charSet 'UTF-8'
links "http://docs.oracle.com/javase/8/docs/api"
}
options.addStringOption('Xdoclint:none', '-quiet')
failOnError false
}
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
id 'com.vanniktech.maven.publish' version '0.22.0' apply false
}
2 changes: 2 additions & 0 deletions gitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jdk:
- openjdk11
12 changes: 7 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ android.useAndroidX = true
android.enableJetifier = true
android.debug.obsoleteApi=true

VERSION_NAME=1.1.0
VERSION_CODE=6
GROUP=com.github.jenly1314
VERSION_NAME=1.0.4
VERSION_CODE=5

POM_DESCRIPTION=ImageViewer for Android
POM_INCEPTION_YEAR=2020
POM_URL=https://github.com/jenly1314/ImageViewer

POM_SCM_URL=https://github.com/jenly1314/ImageViewer
Expand All @@ -41,7 +40,10 @@ POM_DEVELOPER_ID=jenly
POM_DEVELOPER_NAME=Jenly Yu
POM_DEVELOPER_URL=https://github.com/jenly1314/

#RELEASE_REPOSITORY_URL=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
#SNAPSHOT_REPOSITORY_URL=https://s01.oss.sonatype.org/content/repositories/snapshots/
SONATYPE_HOST=S01

RELEASE_REPOSITORY_URL=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
SNAPSHOT_REPOSITORY_URL=https://s01.oss.sonatype.org/content/repositories/snapshots/

RELEASE_SIGNING_ENABLED=false

12 changes: 6 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Nov 06 11:18:11 CST 2019
distributionBase = GRADLE_USER_HOME
distributionPath = wrapper/dists
zipStoreBase = GRADLE_USER_HOME
zipStorePath = wrapper/dists
distributionUrl = https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
#Thu Jan 10 09:17:54 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
Loading

0 comments on commit a5386cd

Please sign in to comment.