From 20c9af217ba542e2720cbc6f9b4631eb5d412b6d Mon Sep 17 00:00:00 2001 From: "zhipeng.zhuo" Date: Wed, 18 Mar 2020 22:55:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9E=82=E7=9B=B4?= =?UTF-8?q?=E6=97=B6=E5=85=BC=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marqueerecyclerview/LooperLayoutManager.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/marqueerecyclerview/src/main/java/com/gibbon/marqueerecyclerview/LooperLayoutManager.java b/marqueerecyclerview/src/main/java/com/gibbon/marqueerecyclerview/LooperLayoutManager.java index a743c65..f045d38 100644 --- a/marqueerecyclerview/src/main/java/com/gibbon/marqueerecyclerview/LooperLayoutManager.java +++ b/marqueerecyclerview/src/main/java/com/gibbon/marqueerecyclerview/LooperLayoutManager.java @@ -73,10 +73,17 @@ public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State } - //如果当前布局过的itemView的宽度总和大于RecyclerView的宽(水平)或宽(垂直),则不再进行布局 - if (autalLenght > getWidth()) { - break; + //如果当前布局过的itemView的宽度或高度总和大于RecyclerView的宽(水平)或高(垂直),则不再进行布局 + if (this.scrollVertical) { + if (autalLenght > getHeight()) { + break; + } + } else { + if (autalLenght > getWidth()) { + break; + } } + } }