mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 11:48:07 +01:00
Remove single URL in favor of density based sprite sheets
This commit is contained in:
@@ -7,28 +7,42 @@ package org.whispersystems.textsecuregcm.entities;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.net.URL;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Badge {
|
||||
private final String id;
|
||||
private final String category;
|
||||
private final URL imageUrl;
|
||||
private final String name;
|
||||
private final String description;
|
||||
private final String ldpi;
|
||||
private final String mdpi;
|
||||
private final String hdpi;
|
||||
private final String xhdpi;
|
||||
private final String xxhdpi;
|
||||
private final String xxxhdpi;
|
||||
|
||||
@JsonCreator
|
||||
public Badge(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("category") final String category,
|
||||
@JsonProperty("imageUrl") final URL imageUrl,
|
||||
@JsonProperty("name") final String name,
|
||||
@JsonProperty("description") final String description) {
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("ldpi") final String ldpi,
|
||||
@JsonProperty("mdpi") final String mdpi,
|
||||
@JsonProperty("hdpi") final String hdpi,
|
||||
@JsonProperty("xhdpi") final String xhdpi,
|
||||
@JsonProperty("xxhdpi") final String xxhdpi,
|
||||
@JsonProperty("xxxhdpi") final String xxxhdpi) {
|
||||
this.id = id;
|
||||
this.category = category;
|
||||
this.imageUrl = imageUrl;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.ldpi = ldpi;
|
||||
this.mdpi = mdpi;
|
||||
this.hdpi = hdpi;
|
||||
this.xhdpi = xhdpi;
|
||||
this.xxhdpi = xxhdpi;
|
||||
this.xxxhdpi = xxxhdpi;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
@@ -39,10 +53,6 @@ public class Badge {
|
||||
return category;
|
||||
}
|
||||
|
||||
public URL getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -51,6 +61,30 @@ public class Badge {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getLdpi() {
|
||||
return ldpi;
|
||||
}
|
||||
|
||||
public String getMdpi() {
|
||||
return mdpi;
|
||||
}
|
||||
|
||||
public String getHdpi() {
|
||||
return hdpi;
|
||||
}
|
||||
|
||||
public String getXhdpi() {
|
||||
return xhdpi;
|
||||
}
|
||||
|
||||
public String getXxhdpi() {
|
||||
return xxhdpi;
|
||||
}
|
||||
|
||||
public String getXxxhdpi() {
|
||||
return xxxhdpi;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -61,13 +95,15 @@ public class Badge {
|
||||
}
|
||||
Badge badge = (Badge) o;
|
||||
return Objects.equals(id, badge.id) && Objects.equals(category,
|
||||
badge.category) && Objects.equals(imageUrl, badge.imageUrl)
|
||||
&& Objects.equals(name, badge.name) && Objects.equals(description,
|
||||
badge.description);
|
||||
badge.category) && Objects.equals(name, badge.name) && Objects.equals(
|
||||
description, badge.description) && Objects.equals(ldpi, badge.ldpi)
|
||||
&& Objects.equals(mdpi, badge.mdpi) && Objects.equals(hdpi, badge.hdpi)
|
||||
&& Objects.equals(xhdpi, badge.xhdpi) && Objects.equals(xxhdpi,
|
||||
badge.xxhdpi) && Objects.equals(xxxhdpi, badge.xxxhdpi);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, category, imageUrl, name, description);
|
||||
return Objects.hash(id, category, name, description, ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
|
||||
package org.whispersystems.textsecuregcm.entities;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.net.URL;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -18,16 +16,20 @@ public class SelfBadge extends Badge {
|
||||
private final Instant expiration;
|
||||
private final boolean visible;
|
||||
|
||||
@JsonCreator
|
||||
public SelfBadge(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("category") final String category,
|
||||
@JsonProperty("imageUrl") final URL imageUrl,
|
||||
@JsonProperty("name") final String name,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("expiration") final Instant expiration,
|
||||
@JsonProperty("visible") final boolean visible) {
|
||||
super(id, category, imageUrl, name, description);
|
||||
@JsonProperty("ldpi") final String ldpi,
|
||||
@JsonProperty("mdpi") final String mdpi,
|
||||
@JsonProperty("hdpi") final String hdpi,
|
||||
@JsonProperty("xhdpi") final String xhdpi,
|
||||
@JsonProperty("xxhdpi") final String xxhdpi,
|
||||
@JsonProperty("xxxhdpi") final String xxxhdpi,
|
||||
final Instant expiration,
|
||||
final boolean visible) {
|
||||
super(id, category, name, description, ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi);
|
||||
this.expiration = expiration;
|
||||
this.visible = visible;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user