2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 14:15:14 +00:00

Add detection of Android TV devices with a proper icon

KDE app :  https://phabricator.kde.org/D12802

Test Plan: Tested with an Android TV device (Nvidia Shield)

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: tfella, nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12803
This commit is contained in:
Yoann Laissus
2018-05-10 12:34:28 +02:00
parent 0c6b584d57
commit 5463be96a4
9 changed files with 39 additions and 4 deletions

View File

@@ -103,11 +103,13 @@ public class Device implements BaseLink.PacketReceiver {
public enum DeviceType {
Phone,
Tablet,
Computer;
Computer,
Tv;
public static DeviceType FromString(String s) {
if ("tablet".equals(s)) return Tablet;
if ("phone".equals(s)) return Phone;
if ("tv".equals(s)) return Tv;
return Computer; //Default
}
@@ -117,6 +119,8 @@ public class Device implements BaseLink.PacketReceiver {
return "tablet";
case Phone:
return "phone";
case Tv:
return "tv";
default:
return "desktop";
}
@@ -195,6 +199,9 @@ public class Device implements BaseLink.PacketReceiver {
case Tablet:
drawableId = R.drawable.ic_device_tablet;
break;
case Tv:
drawableId = R.drawable.ic_device_tv;
break;
default:
drawableId = R.drawable.ic_device_laptop;
}