Skip to content

Commit

Permalink
Fixed the problem of pulling the progress bar to flash back, closed #107
Browse files Browse the repository at this point in the history
  • Loading branch information
Haleydu committed Sep 11, 2020
1 parent 4e4511c commit 82936e0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/hiroshi/cimoc/source/CCMH.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public List<ImageUrl> 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;
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/hiroshi/cimoc/source/JMTT.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ public List<ImageUrl> 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){
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/hiroshi/cimoc/source/MH517.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public List<ImageUrl> 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;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/hiroshi/cimoc/source/QiMiaoMH.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public List<ImageUrl> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ public List<ImageUrl> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 82936e0

Please sign in to comment.