diff --git a/res/layout/gallery_list_thumb_item.xml b/res/layout/gallery_list_thumb_item.xml
index e2b07b217..187c938db 100644
--- a/res/layout/gallery_list_thumb_item.xml
+++ b/res/layout/gallery_list_thumb_item.xml
@@ -30,7 +30,7 @@
android:id="@+id/category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@id/thumb"
+ android:layout_alignBottom="@id/thumb"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/primary_text_light" />
@@ -41,7 +41,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
- android:background="@android:color/holo_blue_light"
+ android:background="#ca80cbc4"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:textColor="@android:color/white" />
diff --git a/src/com/hippo/ehviewer/data/GalleryInfo.java b/src/com/hippo/ehviewer/data/GalleryInfo.java
index 30e7b94b7..89b15a382 100644
--- a/src/com/hippo/ehviewer/data/GalleryInfo.java
+++ b/src/com/hippo/ehviewer/data/GalleryInfo.java
@@ -76,7 +76,6 @@ public class GalleryInfo implements Parcelable {
"[(\\[]dutch[)\\]]",
};
-
public int gid;
public String token;
public String title;
@@ -85,6 +84,14 @@ public class GalleryInfo implements Parcelable {
public String thumb;
public String uploader;
public float rating;
+ /**
+ * Will not be recond
+ */
+ public int thumbWidth;
+ /**
+ * Will not be recond
+ */
+ public int thumbHeight;
/**
* language get from title
*/
diff --git a/src/com/hippo/ehviewer/ehclient/ListParser.java b/src/com/hippo/ehviewer/ehclient/ListParser.java
index f18599336..a48bf7df9 100644
--- a/src/com/hippo/ehviewer/ehclient/ListParser.java
+++ b/src/com/hippo/ehviewer/ehclient/ListParser.java
@@ -134,7 +134,7 @@ public class ListParser {
p = Pattern.compile("
(?:)?(?:)? | " // category
+ "(.+?)" // posted
- + ""
+ + ""
+ "(?:"
+ "|init~([^<>\"~]+~[^<>\"~]+)~([^<>]+))" // thumb and title
+ ""
@@ -150,26 +150,29 @@ public class ListParser {
gi.category = EhUtils.getCategory(m.group(1));
gi.posted = m.group(2);
- if (m.group(3) == null) {
+ gi.thumbHeight = Integer.parseInt(m.group(3));
+ gi.thumbWidth = Integer.parseInt(m.group(4));
+
+ if (m.group(5) == null) {
gi.thumb = Utils.unescapeXml("http://"
- + m.group(5).replace('~', '/'));
- gi.title = Utils.unescapeXml(m.group(6));
+ + m.group(7).replace('~', '/'));
+ gi.title = Utils.unescapeXml(m.group(8));
} else {
- gi.thumb = Utils.unescapeXml(m.group(3));
- gi.title = Utils.unescapeXml(m.group(4));
+ gi.thumb = Utils.unescapeXml(m.group(5));
+ gi.title = Utils.unescapeXml(m.group(6));
}
Pattern pattern = Pattern
.compile("/(\\d+)/(\\w+)");
- Matcher matcher = pattern.matcher(m.group(7));
+ Matcher matcher = pattern.matcher(m.group(9));
if (matcher.find()) {
gi.gid = Integer.parseInt(matcher.group(1));
gi.token = matcher.group(2);
} else
continue;
- gi.rating = Float.parseFloat(getRate(m.group(9)));
- gi.uploader = m.group(10);
+ gi.rating = Float.parseFloat(getRate(m.group(11)));
+ gi.uploader = m.group(12);
gi.generateSLang();
giList.add(gi);
diff --git a/src/com/hippo/ehviewer/widget/GalleryListView.java b/src/com/hippo/ehviewer/widget/GalleryListView.java
index 1bd9ec138..8dfc26a6d 100644
--- a/src/com/hippo/ehviewer/widget/GalleryListView.java
+++ b/src/com/hippo/ehviewer/widget/GalleryListView.java
@@ -738,13 +738,6 @@ public class GalleryListView extends FrameLayout implements RefreshLayout.OnFoot
mImageLoader.add(gi.thumb, String.valueOf(gi.gid),
new LoadImageView.SimpleImageGetListener(thumb).setFixScaleType(true));
}
- // Set category
- TextView category = holder.category;
- String newText = Ui.getCategoryText(gi.category);
- if (!newText.equals(category.getText())) {
- category.setText(newText);
- category.setBackgroundColor(Ui.getCategoryColor(gi.category));
- }
// Set simple language
TextView simpleLanguage = holder.simpleLanguage;
if (gi.simpleLanguage == null) {
@@ -756,6 +749,13 @@ public class GalleryListView extends FrameLayout implements RefreshLayout.OnFoot
// For detail mode
if (holder.viewType == LIST_MODE_DETAIL) {
+ // Set category
+ TextView category = holder.category;
+ String newText = Ui.getCategoryText(gi.category);
+ if (!newText.equals(category.getText())) {
+ category.setText(newText);
+ category.setBackgroundColor(Ui.getCategoryColor(gi.category));
+ }
// Set manga title
TextView title = holder.title;
title.setText(gi.title);
@@ -768,6 +768,15 @@ public class GalleryListView extends FrameLayout implements RefreshLayout.OnFoot
// set posted
TextView posted = holder.posted;
posted.setText(gi.posted);
+ } else {
+ // Set category
+ TextView category = holder.category;
+ String newText = Ui.getCategoryText(gi.category);
+ if (!newText.equals(category.getText())) {
+ category.setText(newText);
+ category.setBackgroundColor(Ui.getCategoryColor(gi.category)
+ & 0x00ffffff | 0xca000000);
+ }
}
}