diff options
author | pacien | 2018-08-21 01:35:06 +0200 |
---|---|---|
committer | pacien | 2018-08-21 01:35:06 +0200 |
commit | 4702b7441b65173a1e0c7f0b560e672d06ee4e4d (patch) | |
tree | a2f428073d4b9fb77edc3e539b3d6f118489e855 /app/src/main/res/layout/status_node_list_item.xml | |
parent | b321bbe07ff48d571feb4f81c66f58223584dc83 (diff) | |
download | tincapp-4702b7441b65173a1e0c7f0b560e672d06ee4e4d.tar.gz |
Show node reachability in node list
Diffstat (limited to 'app/src/main/res/layout/status_node_list_item.xml')
-rw-r--r-- | app/src/main/res/layout/status_node_list_item.xml | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/app/src/main/res/layout/status_node_list_item.xml b/app/src/main/res/layout/status_node_list_item.xml index dd1a842..96dad8c 100644 --- a/app/src/main/res/layout/status_node_list_item.xml +++ b/app/src/main/res/layout/status_node_list_item.xml | |||
@@ -18,10 +18,38 @@ | |||
18 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
19 | --> | 19 | --> |
20 | 20 | ||
21 | <TextView | 21 | <layout xmlns:android="http://schemas.android.com/apk/res/android"> |
22 | xmlns:android="http://schemas.android.com/apk/res/android" | 22 | |
23 | style="@style/AppTheme.BlockTitle" | 23 | <data> |
24 | android:paddingBottom="@dimen/activity_vertical_margin" | 24 | |
25 | android:paddingLeft="@dimen/activity_horizontal_margin" | 25 | <variable |
26 | android:paddingRight="@dimen/activity_horizontal_margin" | 26 | name="nodeInfo" |
27 | android:paddingTop="@dimen/activity_vertical_margin"/> | 27 | type="org.pacien.tincapp.activities.status.nodes.NodeInfo"/> |
28 | |||
29 | <variable | ||
30 | name="onClick" | ||
31 | type="kotlin.jvm.functions.Function1<org.pacien.tincapp.activities.status.nodes.NodeInfo, kotlin.Unit>"/> <!-- https://stackoverflow.com/a/38777594 --> | ||
32 | |||
33 | </data> | ||
34 | |||
35 | <LinearLayout | ||
36 | style="@style/AppTheme.ListBlock.Clickable" | ||
37 | android:layout_width="match_parent" | ||
38 | android:layout_height="wrap_content" | ||
39 | android:onClick="@{() -> onClick.invoke(nodeInfo)}" | ||
40 | android:orientation="horizontal"> | ||
41 | |||
42 | <TextView | ||
43 | style="@style/AppTheme.BlockTitle" | ||
44 | android:layout_weight="1" | ||
45 | android:text="@{nodeInfo.name}"/> | ||
46 | |||
47 | <TextView | ||
48 | android:layout_width="wrap_content" | ||
49 | android:layout_height="wrap_content" | ||
50 | android:layout_weight="0" | ||
51 | android:text="@{nodeInfo.reachabilityText()}"/> | ||
52 | |||
53 | </LinearLayout> | ||
54 | |||
55 | </layout> | ||