From 32e74a1941957a7db1850fee5adfe370185c28dd Mon Sep 17 00:00:00 2001 From: zhpanvip Date: Sat, 17 Apr 2021 18:42:23 +0800 Subject: [PATCH] Fix Warning --- .../java/com/zhpan/bannerview/BannerViewPager.java | 3 --- .../bannerview/provider/ReflectLayoutManager.java | 4 +--- .../bannerview/provider/ScrollDurationManger.java | 12 ++++-------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/bannerview/src/main/java/com/zhpan/bannerview/BannerViewPager.java b/bannerview/src/main/java/com/zhpan/bannerview/BannerViewPager.java index 0d1063ee..f2adef7d 100644 --- a/bannerview/src/main/java/com/zhpan/bannerview/BannerViewPager.java +++ b/bannerview/src/main/java/com/zhpan/bannerview/BannerViewPager.java @@ -32,13 +32,11 @@ import com.zhpan.indicator.annotation.AIndicatorSlideMode; import com.zhpan.indicator.annotation.AIndicatorStyle; import com.zhpan.indicator.base.IIndicator; -import com.zhpan.indicator.enums.IndicatorOrientation; import com.zhpan.indicator.option.IndicatorOptions; import java.util.ArrayList; import java.util.List; -import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; import static com.zhpan.bannerview.BaseBannerAdapter.MAX_VALUE; import static com.zhpan.bannerview.constants.IndicatorGravity.CENTER; import static com.zhpan.bannerview.constants.IndicatorGravity.END; @@ -930,7 +928,6 @@ public void setCurrentItem(int item, boolean smoothScroll) { /** * Set Page Style for Banner * {@link PageStyle#NORMAL} - * {@link PageStyle#MULTI_PAGE} * * @return BannerViewPager */ diff --git a/bannerview/src/main/java/com/zhpan/bannerview/provider/ReflectLayoutManager.java b/bannerview/src/main/java/com/zhpan/bannerview/provider/ReflectLayoutManager.java index 26d9023d..029d0ad9 100644 --- a/bannerview/src/main/java/com/zhpan/bannerview/provider/ReflectLayoutManager.java +++ b/bannerview/src/main/java/com/zhpan/bannerview/provider/ReflectLayoutManager.java @@ -48,9 +48,7 @@ public static void reflectLayoutManager(ViewPager2 viewPager2, int scrollDuratio layoutManager.setAccessible(true); layoutManager.set(mScrollEventAdapter, scrollDurationManger); } - } catch (NoSuchFieldException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { + } catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); } } diff --git a/bannerview/src/main/java/com/zhpan/bannerview/provider/ScrollDurationManger.java b/bannerview/src/main/java/com/zhpan/bannerview/provider/ScrollDurationManger.java index 28850061..5ac80a0b 100644 --- a/bannerview/src/main/java/com/zhpan/bannerview/provider/ScrollDurationManger.java +++ b/bannerview/src/main/java/com/zhpan/bannerview/provider/ScrollDurationManger.java @@ -60,16 +60,12 @@ public void onInitializeAccessibilityNodeInfo(@NonNull RecyclerView.Recycler rec protected void calculateExtraLayoutSpace(@NonNull RecyclerView.State state, @NonNull int[] extraLayoutSpace) { try { - Method method = mParent.getClass().getDeclaredMethod("calculateExtraLayoutSpace", state.getClass(), extraLayoutSpace.getClass()); + Method method = mParent.getClass() + .getDeclaredMethod("calculateExtraLayoutSpace", + state.getClass(), extraLayoutSpace.getClass()); method.setAccessible(true); method.invoke(mParent, state, extraLayoutSpace); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - BannerUtils.log(e.getMessage()); - } catch (IllegalAccessException e) { - e.printStackTrace(); - BannerUtils.log(e.getMessage()); - } catch (InvocationTargetException e) { + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); BannerUtils.log(e.getMessage()); }