Skip to content

Commit

Permalink
bug修复,kotlin使用demo修改
Browse files Browse the repository at this point in the history
Change-Id: I070e509d5241a11a6e306d0a3cf5809a42e01a5f
  • Loading branch information
youth5201314 committed May 27, 2021
1 parent 97f262c commit a2c7ba6
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 127 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -145,7 +145,7 @@ dependencies{
//2.1.0以前jcenter的依赖
//implementation 'com.youth.banner:banner:2.1.0'
//现在Maven Central
implementation 'io.github.youth5201314:banner:2.2.1'
implementation 'io.github.youth5201314:banner:2.2.2'
}
```
Expand Down
22 changes: 11 additions & 11 deletions app/build.gradle
Expand Up @@ -5,7 +5,7 @@ android {

defaultConfig {
applicationId "com.test.banner"
minSdkVersion 19
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
Expand All @@ -30,23 +30,23 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha04'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.jakewharton:butterknife:10.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'com.google.android.material:material:1.2.0-alpha06'
implementation 'com.jakewharton:butterknife:10.2.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'

implementation 'com.shuyu:GSYVideoPlayer:7.1.3'


// implementation project(':banner')
implementation 'io.github.youth5201314:banner:2.2.1'
implementation project(':banner')
// implementation 'io.github.youth5201314:banner:2.2.1'
}
22 changes: 12 additions & 10 deletions app/src/main/java/com/test/banner/MainActivity.java
Expand Up @@ -72,15 +72,17 @@ protected void onCreate(Bundle savedInstanceState) {
//和下拉刷新配套使用
refresh.setOnRefreshListener(() -> {
//模拟网络请求需要3秒,请求完成,设置setRefreshing 为false
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
refresh.setRefreshing(false);
//给banner重新设置数据
banner.setDatas(DataBean.getTestData());
//对setdatas不满意?你可以自己在adapter控制数据,可以参考setDatas()的实现修改
// adapter.updateData(DataBean.getTestData2());
}
new Handler().postDelayed(() -> {
refresh.setRefreshing(false);

//给banner重新设置数据
banner.setDatas(DataBean.getTestData());

//对setDatas()方法不满意?你可以自己在adapter控制数据,参考setDatas()的实现修改
// adapter.updateData(DataBean.getTestData());
// banner.setCurrentItem(banner.getStartPosition(), false);
// banner.setIndicatorPageChange();

}, 3000);
});

Expand Down Expand Up @@ -115,7 +117,7 @@ public void click(View view) {
break;
case R.id.style_multiple:
refresh.setEnabled(true);
banner.setIndicator(new DrawableIndicator(this,R.drawable.indicator_normal,R.drawable.indicator_selected));
banner.setIndicator(new CircleIndicator(this));
banner.setAdapter(new MultipleTypesAdapter(this, DataBean.getTestData()));
break;
case R.id.style_net_image:
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Expand Up @@ -17,7 +17,7 @@
android:layout_margin="10dp"
banner:banner_indicator_normal_color="@android:color/white"
banner:banner_indicator_selected_color="@color/colorPrimary"
banner:banner_radius="5dp" />
banner:banner_radius="5dp"/>

<com.youth.banner.indicator.RoundLinesIndicator
android:id="@+id/indicator"
Expand Down Expand Up @@ -66,7 +66,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/style_image"
android:text="多类型UI(Drawable指示器)"
android:text="多类型UI"
android:textAllCaps="false" />

<Button
Expand All @@ -81,7 +81,8 @@
android:id="@+id/change_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/style_net_image"
android:layout_toRightOf="@+id/style_net_image"
android:layout_below="@+id/style_image_title_num"
android:text="外部指示器" />


Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/banner_image.xml
Expand Up @@ -3,4 +3,4 @@
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"/>
android:scaleType="centerCrop"/>
6 changes: 3 additions & 3 deletions banner/build.gradle
Expand Up @@ -2,15 +2,15 @@ apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'

version = '2.2.1'
version = '2.2.2'

android {
compileSdkVersion 30

defaultConfig {
minSdkVersion 14
targetSdkVersion 30
versionCode 202001
versionCode 202002
versionName version
consumerProguardFiles 'proguard-rules.pro'
}
Expand All @@ -26,7 +26,7 @@ android {
}

dependencies {
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation "androidx.viewpager2:viewpager2:1.1.0-alpha01"
}

task androidSourcesJar(type: Jar) {
Expand Down

0 comments on commit a2c7ba6

Please sign in to comment.