mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 10:20:25 +01:00
Add support for updated server badge image url formats.
This commit is contained in:
committed by
Greyson Parrelli
parent
6e00920c95
commit
8d0acb277c
@@ -5,6 +5,8 @@ import android.util.DisplayMetrics;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -51,6 +53,16 @@ public final class ScreenDensity {
|
||||
return new ScreenDensity(bucket, density);
|
||||
}
|
||||
|
||||
public static @NonNull String getBestDensityBucketForDevice() {
|
||||
ScreenDensity density = get(ApplicationDependencies.getApplication());
|
||||
|
||||
if (density.isKnownDensity()) {
|
||||
return density.bucket;
|
||||
} else {
|
||||
return "xhdpi";
|
||||
}
|
||||
}
|
||||
|
||||
public String getBucket() {
|
||||
return bucket;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user