Add alpha to disowned uploader name

This commit is contained in:
NekoInverter committed 2021-12-17 18:20:21 +08:00
1 parent e2fddd2610
commit cd08582208
5 files changed
+14 -3

No files matched your search

@@ -116,6 +116,7 @@ public class GalleryInfo implements Parcelable {
public int category;
public String posted;
public String uploader;
public boolean disowned;
public float rating;
public boolean rated;
@Nullable
@@ -156,6 +157,7 @@ public class GalleryInfo implements Parcelable {
this.spanGroupIndex = in.readInt();
this.favoriteSlot = in.readInt();
this.favoriteName = in.readString();
this.disowned = in.readByte() != 0;
}
public final void generateSLang() {
@@ -214,5 +216,6 @@ public class GalleryInfo implements Parcelable {
dest.writeInt(this.spanGroupIndex);
dest.writeInt(this.favoriteSlot);
dest.writeString(this.favoriteName);
dest.writeByte(this.disowned ? (byte) 1 : (byte) 0);
}
}
@@ -188,6 +188,7 @@ public class GalleryDetailParser {
// Uploader
Element gdn = gm.getElementById("gdn");
if (null != gdn) {
gd.disowned = "opacity:0.5".equals(gdn.attr("style"));
gd.uploader = StringUtils.trim(gdn.text());
} else {
gd.uploader = "";
@@ -262,9 +262,13 @@ public class GalleryListParser {
if (gl != null) {
Elements children = gl.children();
if (children.size() > uploaderIndex) {
Element a = children.get(uploaderIndex).children().first();
if (a != null) {
gi.uploader = a.text().trim();
Element div = children.get(uploaderIndex);
if (div != null) {
gi.disowned = "opacity:0.5".equals(div.attr("style"));
Element a = div.children().first();
if (a != null) {
gi.uploader = a.text().trim();
}
}
}
if (children.size() > pagesIndex) {
@@ -198,6 +198,7 @@ abstract class GalleryAdapter extends RecyclerView.Adapter<GalleryHolder> {
holder.thumb.load(EhCacheKeyFactory.getThumbKey(gi.gid), gi.thumb);
holder.title.setText(EhUtils.getSuitableTitle(gi));
holder.uploader.setText(gi.uploader);
holder.uploader.setAlpha(gi.disowned ? .5f : 1f);
holder.rating.setRating(gi.rating);
TextView category = holder.category;
String newCategoryText = EhUtils.getCategory(gi.category);
@@ -852,6 +852,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
mThumb.load(EhCacheKeyFactory.getThumbKey(gi.gid), gi.thumb);
mTitle.setText(EhUtils.getSuitableTitle(gi));
mUploader.setText(gi.uploader);
mUploader.setAlpha(gi.disowned ? .5f : 1f);
mCategory.setText(EhUtils.getCategory(gi.category));
mCategory.setTextColor(EhUtils.getCategoryColor(gi.category));
updateDownloadText();
@@ -908,6 +909,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
mThumb.load(EhCacheKeyFactory.getThumbKey(gd.gid), gd.thumb);
mTitle.setText(EhUtils.getSuitableTitle(gd));
mUploader.setText(gd.uploader);
mUploader.setAlpha(gd.disowned ? .5f : 1f);
mCategory.setText(EhUtils.getCategory(gd.category));
mCategory.setTextColor(EhUtils.getCategoryColor(gd.category));
updateDownloadText();