diff --git a/doric-android/doric/src/main/java/pub/doric/shader/slider/SlideAdapter.java b/doric-android/doric/src/main/java/pub/doric/shader/slider/SlideAdapter.java index 6b140676..62e79c1a 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/slider/SlideAdapter.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/slider/SlideAdapter.java @@ -76,7 +76,7 @@ class SlideAdapter extends RecyclerView.Adapter { sliderNode.getDoricContext().getDriver().getRegistry().onException(sliderNode.getDoricContext(), e); } - if (sliderNode.slideStyle.equals("gallery")) { + if ("gallery".equals(sliderNode.slideStyle)) { holder.itemView.getLayoutParams().width = DoricUtils.dp2px(this.itemWidth); } } diff --git a/doric-android/doric/src/main/java/pub/doric/shader/slider/SliderNode.java b/doric-android/doric/src/main/java/pub/doric/shader/slider/SliderNode.java index 8f01dbe5..142bc467 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/slider/SliderNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/slider/SliderNode.java @@ -99,7 +99,7 @@ public class SliderNode extends SuperNode { recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() { @Override public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { - if (slideStyle.equals("gallery")) { + if ("gallery".equals(slideStyle)) { int position = parent.getChildAdapterPosition(view); LinearLayoutManager layoutManager = (LinearLayoutManager) parent.getLayoutManager(); @@ -334,7 +334,7 @@ public class SliderNode extends SuperNode { mView.scrollToPosition(page); } - if (slideStyle.equals("gallery")) { + if ("gallery".equals(slideStyle)) { mView.post(new Runnable() { @Override public void run() {