diff --git a/app/build.gradle b/app/build.gradle index 64c9e49e1..ce2d0daf1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,7 +27,7 @@ android { mobile { dimension "mode" versionCode 10 - versionName "20230409#1" + versionName "20230409#3" } java { dimension "api" diff --git a/app/src/main/java/com/fongmi/android/tv/bean/Device.java b/app/src/main/java/com/fongmi/android/tv/bean/Device.java index 4bb3e5be4..eaf1784c7 100644 --- a/app/src/main/java/com/fongmi/android/tv/bean/Device.java +++ b/app/src/main/java/com/fongmi/android/tv/bean/Device.java @@ -37,10 +37,20 @@ public class Device { return device; } + public static Device get(org.fourthline.cling.model.meta.Device item) { + Device device = new Device(); + device.setName(item.getDetails().getFriendlyName()); + device.setUuid(item.getIdentity().getUdn().getIdentifierString()); + return device; + } + public static Device objectFrom(String str) { return new Gson().fromJson(str, Device.class); } + public Device() { + } + public Integer getId() { return id; } @@ -73,8 +83,12 @@ public class Device { this.ip = ip; } + public boolean isCast() { + return getIp().isEmpty(); + } + public String getHost() { - return Uri.parse(getIp()).getHost(); + return isCast() ? getUuid() : Uri.parse(getIp()).getHost(); } public Device save() { diff --git a/app/src/mobile/res/layout/view_control_vod.xml b/app/src/mobile/res/layout/view_control_vod.xml index 13e08a168..12c128437 100644 --- a/app/src/mobile/res/layout/view_control_vod.xml +++ b/app/src/mobile/res/layout/view_control_vod.xml @@ -39,37 +39,44 @@ - + android:gravity="center_vertical" + android:orientation="horizontal"> - + - + - + + + +