Android: fix npe
This commit is contained in:
parent
722d0873d4
commit
fdc5fb4555
@ -76,7 +76,7 @@ class SlideAdapter extends RecyclerView.Adapter<SlideAdapter.DoricViewHolder> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ public class SliderNode extends SuperNode<RecyclerView> {
|
||||
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<RecyclerView> {
|
||||
mView.scrollToPosition(page);
|
||||
}
|
||||
|
||||
if (slideStyle.equals("gallery")) {
|
||||
if ("gallery".equals(slideStyle)) {
|
||||
mView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
Reference in New Issue
Block a user