mirror of
https://github.com/sifacaii/VlcJellyfin
synced 2025-06-03 00:58:06 -04:00
修改首页
This commit is contained in:
parent
5b4045e67b
commit
92c6648283
@ -26,16 +26,16 @@ import okhttp3.Response;
|
|||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
|
|
||||||
// public static <T> T JsonToObj(String jsonStr, Class<T> tClass) {
|
public static <T> T JsonToObj(String jsonStr, Class<T> tClass) {
|
||||||
// if (jsonStr != null && jsonStr.length() > 0) {
|
if (jsonStr != null && jsonStr.length() > 0) {
|
||||||
// try {
|
try {
|
||||||
// return new Gson().fromJson(jsonStr, tClass);
|
return new Gson().fromJson(jsonStr, tClass);
|
||||||
// } catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// return null;
|
return null;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// return null;
|
return null;
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取Json项
|
* 获取Json项
|
||||||
@ -44,19 +44,18 @@ public class Utils {
|
|||||||
* @param key
|
* @param key
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
// public static JsonElement getJsonString(JsonObject jo, String key) {
|
public static JsonElement getJsonString(JsonObject jo, String key) {
|
||||||
// JsonElement je = new Gson().toJsonTree("", String.class);
|
JsonElement je = new Gson().toJsonTree("", String.class);
|
||||||
// if (jo.has(key)) {
|
if (jo.has(key)) {
|
||||||
// je = jo.get(key);
|
je = jo.get(key);
|
||||||
// }
|
}
|
||||||
// return je;
|
return je;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// public static int getPixelsFromDp(Activity context, int i) {
|
|
||||||
// DisplayMetrics metrics = new DisplayMetrics();
|
|
||||||
// context.getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
|
||||||
// return (i * metrics.densityDpi) / DisplayMetrics.DENSITY_DEFAULT;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
public static int getPixelsFromDp(Activity context, int i) {
|
||||||
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
|
context.getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||||
|
return (i * metrics.densityDpi) / DisplayMetrics.DENSITY_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user