Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tokiii committed Jul 20, 2021
1 parent 982d20a commit 2f385c7
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 30 deletions.
4 changes: 1 addition & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// implementation project(':reveal-banner')
implementation 'com.tokiii:reveal-banner:1.0.2'

implementation project(':reveal-banner')
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void onClick(View v) {
});
loopLayout.setLoop_ms(3000);//轮播的速度(毫秒)
loopLayout.setLoop_duration(400);//滑动的速率(毫秒)
loopLayout.setScaleAnimation(true);// 设置是否需要动画
loopLayout.setScaleAnimation(false);// 设置是否需要动画
loopLayout.setLoop_style(LoopStyle.Empty);//轮播的样式-默认empty
loopLayout.setIndicatorLocation(IndicatorLocation.Center);//指示器位置-中Center
loopLayout.initializeData(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
private void initView() {
rvBannerList = findViewById(R.id.rv_banner_list);
slBannerList = findViewById(R.id.sl_banner_list);
bannerListAdapter = new BannerListAdapter(R.layout.item_banner, allBeans);
bannerListAdapter = new BannerListAdapter(R.layout.item_normal_banner, allBeans);
rvBannerList.setLayoutManager(new LinearLayoutManager(this));
rvBannerList.setAdapter(bannerListAdapter);

Expand Down
8 changes: 3 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven { url "http://maven.aliyun.com/nexus/content/repositories/releases" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.novoda:bintray-release:0.9.1'

classpath 'com.android.tools.build:gradle:4.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -19,8 +17,8 @@ allprojects {
repositories {
mavenCentral()
google()
jcenter()
maven{url "https://jitpack.io"}
maven { url "http://maven.aliyun.com/nexus/content/repositories/releases" }
}

tasks.withType(Javadoc) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

android.enableAapt2= false

12 changes: 1 addition & 11 deletions reveal-banner/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

publish {
userOrg = 'tokiii'
repoName = 'myLib'
groupId = 'com.tokiii'
artifactId = 'reveal-banner-x'
publishVersion = '1.0.2'
desc = 'reveal-banner-lib'
website = 'https://github.com/tokiii'
}



android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,19 +437,25 @@ public void onPageScrolled(int position, float positionOffset, int positionOffse
if (mViewPagerIndex == position) {
if (bannerBgContainer.getBannerBgViews().size() > position % bannerBgContainer.getBannerBgViews().size() + 1) {
bannerBgContainer.getBannerBgViews().get(position % bannerBgContainer.getBannerBgViews().size() + 1).bringToFront();
bannerBgContainer.getBannerBgViews().get(position % bannerBgContainer.getBannerBgViews().size() + 1)
.hideClipAnimation((positionOffset - reduceValue) * upValue > 1 ? 1 : (positionOffset - reduceValue) * upValue);
if (isScaleAnimation){
bannerBgContainer.getBannerBgViews().get(position % bannerBgContainer.getBannerBgViews().size() + 1)
.hideClipAnimation((positionOffset - reduceValue) * upValue > 1 ? 1 : (positionOffset - reduceValue) * upValue);
}
} else if (bannerBgContainer.getBannerBgViews().size() == position % bannerBgContainer.getBannerBgViews().size() + 1) {
bannerBgContainer.getBannerBgViews().get(0).bringToFront();
bannerBgContainer.getBannerBgViews().get(0)
.hideClipAnimation((positionOffset - reduceValue) * upValue > 1 ? 1 : (positionOffset - reduceValue) * upValue);
if (isScaleAnimation){
bannerBgContainer.getBannerBgViews().get(0)
.hideClipAnimation((positionOffset - reduceValue) * upValue > 1 ? 1 : (positionOffset - reduceValue) * upValue);
}
}
} else {
if (position / bannerBgContainer.getBannerBgViews().size() >= 0) {
bannerBgContainer.getBannerBgViews().get(position % bannerBgContainer.getBannerBgViews().size()).bringToFront();
bannerBgContainer.getBannerBgViews().get(position % bannerBgContainer.getBannerBgViews().size())
.showClipAnimation(0, bannerBgContainer.getHeight() / 2,
(1 - (positionOffset + reduceValue)) * upValue > 1 ? 1 : (1 - (positionOffset + reduceValue)) * upValue);
if (isScaleAnimation){
bannerBgContainer.getBannerBgViews().get(position % bannerBgContainer.getBannerBgViews().size())
.showClipAnimation(0, bannerBgContainer.getHeight() / 2,
(1 - (positionOffset + reduceValue)) * upValue > 1 ? 1 : (1 - (positionOffset + reduceValue)) * upValue);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public abstract class OnDefaultImageViewLoader implements OnLoadImageViewListene
public View createImageView(Context context, boolean isScaleAnimation) {
View view;
if (!isScaleAnimation) {
view = LayoutInflater.from(context).inflate(R.layout.item_banner, null, false);
view = LayoutInflater.from(context).inflate(R.layout.item_normal_banner, null, false);
} else {
view = LayoutInflater.from(context).inflate(R.layout.item_animation_banner, null, false);

Expand Down

0 comments on commit 2f385c7

Please sign in to comment.