Fix connected devices

This commit is contained in:
Mygod
2018-01-03 20:58:03 +08:00
parent e486c8fcf6
commit aab5a6a432
4 changed files with 45 additions and 35 deletions

View File

@@ -3,44 +3,31 @@
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="android.view.View"/>
<variable
name="device"
type="android.net.wifi.p2p.WifiP2pDevice"/>
<variable
name="ipAddress"
type="String"/>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{device.deviceName}"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:text="Device name"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{device.deviceAddress}"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:text="xx:xx:xx:xx:xx:xx"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{device.primaryDeviceType}"
tools:text="Primary type"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{device.secondaryDeviceType}"
tools:text="Secondary type"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{Integer.toString(device.status)}"
tools:text="Status"/>
android:visibility="@{ipAddress == null ? View.GONE : View.VISIBLE}"
android:text="@{ipAddress}"
tools:text="192.168.49.123"/>
</LinearLayout>
</layout>