diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java
index 07c854388..acd075e86 100644
--- a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java
+++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java
@@ -195,6 +195,8 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
private TextView mShare;
@Nullable
private TextView mRate;
+ @Nullable
+ private TextView mSimilar;
// Tags
@Nullable
private LinearLayout mTags;
@@ -451,15 +453,18 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
mTorrent = (TextView) ViewUtils.$$(mActions, R.id.torrent);
mShare = (TextView) ViewUtils.$$(mActions, R.id.share);
mRate = (TextView) ViewUtils.$$(mActions, R.id.rate);
+ mSimilar = (TextView) ViewUtils.$$(mActions, R.id.similar);
RippleSalon.addRipple(mHeartGroup, false);
RippleSalon.addRipple(mTorrent, false);
RippleSalon.addRipple(mShare, false);
RippleSalon.addRipple(mRate, false);
+ RippleSalon.addRipple(mSimilar, false);
mHeartGroup.setOnClickListener(this);
mTorrent.setOnClickListener(this);
mShare.setOnClickListener(this);
mRate.setOnClickListener(this);
- ensureActionDrawable();
+ mSimilar.setOnClickListener(this);
+ ensureActionDrawable(context);
mTags = (LinearLayout) ViewUtils.$$(belowHeader, R.id.tags);
mNoTags = (TextView) ViewUtils.$$(mTags, R.id.no_tags);
@@ -545,6 +550,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
mTorrent = null;
mShare = null;
mRate = null;
+ mSimilar = null;
mTags = null;
mNoTags = null;
@@ -617,9 +623,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
text.setCompoundDrawables(null, drawable, null, null);
}
- private void ensureActionDrawable() {
- Context context = getContext2();
- AssertUtils.assertNotNull(context);
+ private void ensureActionDrawable(Context context) {
Drawable heart = DrawableManager.getDrawable(context, R.drawable.v_heart_primary_x48);
setActionDrawable(mHeart, heart);
Drawable heartOutline = DrawableManager.getDrawable(context, R.drawable.v_heart_outline_primary_x48);
@@ -630,6 +634,8 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
setActionDrawable(mShare, share);
Drawable rate = DrawableManager.getDrawable(context, R.drawable.v_thumb_up_primary_x48);
setActionDrawable(mRate, rate);
+ Drawable similar = DrawableManager.getDrawable(context, R.drawable.v_similar_primary_x48);
+ setActionDrawable(mSimilar, similar);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@@ -982,6 +988,40 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
});
}
+ @Nullable
+ private static String getArtist(GalleryTagGroup[] tagGroups) {
+ if (null == tagGroups) {
+ return null;
+ }
+ for (GalleryTagGroup tagGroup: tagGroups) {
+ if ("artist".equals(tagGroup.groupName) && tagGroup.size() > 0) {
+ return tagGroup.getTagAt(0);
+ }
+ }
+ return null;
+ }
+
+ private void showSimilarGalleryList() {
+ GalleryDetail gd = mGalleryDetail;
+ if (null == gd) {
+ return;
+ }
+ String artist = getArtist(gd.tags);
+ if (null != artist) {
+ ListUrlBuilder lub = new ListUrlBuilder();
+ lub.setMode(ListUrlBuilder.MODE_TAG);
+ lub.setKeyword("artist:" + artist);
+ GalleryListScene.startScene(this, lub);
+ return;
+ }
+ if (null != gd.uploader) {
+ ListUrlBuilder lub = new ListUrlBuilder();
+ lub.setMode(ListUrlBuilder.MODE_UPLOADER);
+ lub.setKeyword(gd.uploader);
+ GalleryListScene.startScene(this, lub);
+ }
+ }
+
@Override
public void onClick(View v) {
Context context = getContext2();
@@ -1088,6 +1128,8 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
.setPositiveButton(android.R.string.ok, helper)
.show();
helper.setDialog(dialog, mGalleryDetail.rating);
+ } else if (mSimilar == v) {
+ showSimilarGalleryList();
} else if (mComments == v) {
if (mGalleryDetail == null) {
return;
diff --git a/app/src/main/res/drawable/v_similar_primary_x48.xml b/app/src/main/res/drawable/v_similar_primary_x48.xml
new file mode 100644
index 000000000..c20289ee6
--- /dev/null
+++ b/app/src/main/res/drawable/v_similar_primary_x48.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/gallery_detail_actions.xml b/app/src/main/res/layout/gallery_detail_actions.xml
index 7c79a66e5..348cbba8c 100644
--- a/app/src/main/res/layout/gallery_detail_actions.xml
+++ b/app/src/main/res/layout/gallery_detail_actions.xml
@@ -29,7 +29,10 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingLeft="@dimen/keyline_margin"
- android:paddingRight="@dimen/keyline_margin">
+ android:paddingRight="@dimen/keyline_margin"
+ android:clipToPadding="false"
+ android:scrollbars="none"
+ android:overScrollMode="never">
+
+
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 9bc6ee7d8..e19ae98d8 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -156,6 +156,7 @@
种子 (%d)
分享
评分
+ 相似画廊
暂无标签
暂无评论
已显示所有评论
diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml
index 99ba9768a..b871519dd 100644
--- a/app/src/main/res/values-zh-rHK/strings.xml
+++ b/app/src/main/res/values-zh-rHK/strings.xml
@@ -156,6 +156,7 @@
種子 (%d)
分享
評分
+ 相似畫廊
暫無標籤
暫無評論
已顯示所有評論
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index d801c0f59..d9e8f0cc9 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -156,6 +156,7 @@
種子 (%d)
分享
評分
+ 相似畫廊
暫無標籤
暫無評論
已顯示所有評論
diff --git a/app/src/main/res/values/pathdata.xml b/app/src/main/res/values/pathdata.xml
index f5478f5f0..e4519f39b 100644
--- a/app/src/main/res/values/pathdata.xml
+++ b/app/src/main/res/values/pathdata.xml
@@ -57,6 +57,7 @@
M15,9A1,1 0 0,1 14,8A1,1 0 0,1 15,7A1,1 0 0,1 16,8A1,1 0 0,1 15,9M9,9A1,1 0 0,1 8,8A1,1 0 0,1 9,7A1,1 0 0,1 10,8A1,1 0 0,1 9,9M16.12,4.37L18.22,2.27L17.4,1.44L15.09,3.75C14.16,3.28 13.11,3 12,3C10.88,3 9.84,3.28 8.91,3.75L6.6,1.44L5.78,2.27L7.88,4.37C6.14,5.64 5,7.68 5,10V11H19V10C19,7.68 17.86,5.64 16.12,4.37M5,16C5,19.86 8.13,23 12,23A7,7 0 0,0 19,16V12H5V16Z
M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z
M5,13H19V11H5M3,17H17V15H3M7,7V9H21V7
+ M2,20L17,10L22,22M14,9L2,8L11,2Z
M12.88,2H4V11L14.97,22.14L24,13.1L12.88,2ZM7.26,5.26C7.96,4.58,9.06,4.58,9.74,5.26C10.42,5.96,10.42,7.06,9.74,7.74S7.94,8.42,7.26,7.74S6.58,5.94,7.26,5.26ZM14.98,19.3L8.76,12.95L14.88,6.83L21.18,13.11L14.98,19.31ZM11.6,21.56L10.23,23L0,12.74V5H2V11.9L11.6,21.56Z
M20.46,14.65C21.86,16.15,20.31,18.6,18.32,17.87C19.78,17.57,20.79,16.37,20.46,14.65ZM4.32,17.87C6.32,18.6,7.86,16.17,6.46,14.65C6.79,16.38,5.78,17.55,4.32,17.87ZM16.87,4.3C16.6,3.56,15.87,3,15,3C13.7,3,12.7,4.24,13.1,5.58C14.2,5.18,15.44,4.48,16.87,4.31ZM24,16C24,18.76,21.76,21,19,21C14.96,21,14.84,16.88,12,16.88S9.04,21,5,21C2.24,21,0,18.76,0,16C0,13.87,1.53,11.43,3.94,7.18C5.84,3.81,8.69,5.92,10.76,6.58C11.54,6.85,12.41,6.88,13.24,6.58C15.3,5.92,18.14,3.81,20.06,7.18C22.46,11.43,24,13.88,24,16ZM8,16C8,14.35,6.65,13,5,13S2,14.35,2,16S3.35,19,5,19S8,17.65,8,16ZM13,14C13,13.45,12.55,13,12,13S11,13.45,11,14S11.45,15,12,15S13,14.55,13,14ZM22,16C22,14.35,20.65,13,19,13S16,14.35,16,16S17.35,19,19,19S22,17.65,22,16ZM9,3C8.14,3,7.4,3.55,7.13,4.3C8.56,4.48,9.79,5.2,10.9,5.58C11.3,4.24,10.3,3,9,3Z
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index bde64fd38..cd8a111d7 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -199,6 +199,7 @@
Torrent (%d)
Share
Rate
+ Similar
No tags
No comments
No more comments