diff --git a/app/src/main/java/com/hiroshi/cimoc/source/CCMH.java b/app/src/main/java/com/hiroshi/cimoc/source/CCMH.java index 3bc4798a..e17aa069 100644 --- a/app/src/main/java/com/hiroshi/cimoc/source/CCMH.java +++ b/app/src/main/java/com/hiroshi/cimoc/source/CCMH.java @@ -156,7 +156,7 @@ public List parseImages(String html, Chapter chapter) { for (int i = 0; i < pageCount; i++) { Long comicChapter = chapter.getId(); Long id = Long.parseLong(comicChapter + "000" + i); - list.add(new ImageUrl(id, comicChapter, i, StringUtils.format("http://m.ccmh6.com/manhua/%s/%s.html?p=%d", _cid, _path, i + 1), true)); + list.add(new ImageUrl(id, comicChapter, i+1, StringUtils.format("http://m.ccmh6.com/manhua/%s/%s.html?p=%d", _cid, _path, i + 1), true)); } return list; } diff --git a/app/src/main/java/com/hiroshi/cimoc/source/JMTT.java b/app/src/main/java/com/hiroshi/cimoc/source/JMTT.java index 2447221f..fa6e36cc 100644 --- a/app/src/main/java/com/hiroshi/cimoc/source/JMTT.java +++ b/app/src/main/java/com/hiroshi/cimoc/source/JMTT.java @@ -135,9 +135,9 @@ public List parseImages(String html, Chapter chapter) { String img2 = node.attr("img","data-original"); String reg[] = imgpath.split("\\/"); if (img1.contains(reg[2])){ - list.add(new ImageUrl(id, comicChapter, i++, img1, false)); + list.add(new ImageUrl(id, comicChapter, ++i, img1, false)); }else if (img2.contains(reg[2])){ - list.add(new ImageUrl(id, comicChapter, i++, img2, false)); + list.add(new ImageUrl(id, comicChapter, ++i, img2, false)); } } } catch (Exception e){ diff --git a/app/src/main/java/com/hiroshi/cimoc/source/MH517.java b/app/src/main/java/com/hiroshi/cimoc/source/MH517.java index ab05ca5b..1abb73e5 100644 --- a/app/src/main/java/com/hiroshi/cimoc/source/MH517.java +++ b/app/src/main/java/com/hiroshi/cimoc/source/MH517.java @@ -130,7 +130,7 @@ public List parseImages(String html, Chapter chapter) { Long comicChapter = chapter.getId(); Long id = Long.parseLong(comicChapter + "000" + i); - list.add(new ImageUrl(id, comicChapter, i++, url, false)); + list.add(new ImageUrl(id, comicChapter, ++i, url, false)); } } finally { return list; diff --git a/app/src/main/java/com/hiroshi/cimoc/source/QiMiaoMH.java b/app/src/main/java/com/hiroshi/cimoc/source/QiMiaoMH.java index ce794326..52437d5b 100644 --- a/app/src/main/java/com/hiroshi/cimoc/source/QiMiaoMH.java +++ b/app/src/main/java/com/hiroshi/cimoc/source/QiMiaoMH.java @@ -131,7 +131,7 @@ public List parseImages(String html, Chapter chapter) throws Manga.Net for (int i = 0; i < jsonArray.length(); ++i) { Long comicChapter = chapter.getId(); Long id = Long.parseLong(comicChapter + "000" + i); - list.add(new ImageUrl(id, comicChapter, i, jsonArray.getString(i), false)); + list.add(new ImageUrl(id, comicChapter, i + 1, jsonArray.getString(i), false)); } } catch (JSONException e) { e.printStackTrace(); diff --git a/app/src/main/java/com/hiroshi/cimoc/source/WebtoonDongManManHua.java b/app/src/main/java/com/hiroshi/cimoc/source/WebtoonDongManManHua.java index cd87f2f7..746adf99 100644 --- a/app/src/main/java/com/hiroshi/cimoc/source/WebtoonDongManManHua.java +++ b/app/src/main/java/com/hiroshi/cimoc/source/WebtoonDongManManHua.java @@ -178,8 +178,7 @@ public List parseImages(String html, Chapter chapter) { if (key.contains("layer")) { Long comicChapter = chapter.getId(); Long id = Long.parseLong(comicChapter + "000" + i); - list.add(new ImageUrl(id, comicChapter, i, motiontoonPath + motiontoonJson.getString(key), false)); - i++; + list.add(new ImageUrl(id, comicChapter, i++, motiontoonPath + motiontoonJson.getString(key), false)); } } } catch (Manga.NetworkErrorException e) { diff --git a/app/src/main/java/com/hiroshi/cimoc/ui/adapter/ReaderAdapter.java b/app/src/main/java/com/hiroshi/cimoc/ui/adapter/ReaderAdapter.java index 0f6f8215..87cb68b2 100644 --- a/app/src/main/java/com/hiroshi/cimoc/ui/adapter/ReaderAdapter.java +++ b/app/src/main/java/com/hiroshi/cimoc/ui/adapter/ReaderAdapter.java @@ -238,10 +238,15 @@ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, Recycle * 假设一定找得到 */ public int getPositionByNum(int current, int num, boolean reverse) { - while (mDataSet.get(current).getNum() != num) { - current = reverse ? current - 1 : current + 1; + try { + while (mDataSet.get(current).getNum() < num) { + current = reverse ? current - 1 : current + 2; + } + }catch (Exception e){ + e.printStackTrace(); + }finally { + return current; } - return current; } public int getPositionById(Long id) {