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 | |
parent | b321bbe07ff48d571feb4f81c66f58223584dc83 (diff) | |
download | tincapp-4702b7441b65173a1e0c7f0b560e672d06ee4e4d.tar.gz |
Show node reachability in node list
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/status_node_info_dialog.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/layout/status_node_list_item.xml | 42 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 7 |
3 files changed, 42 insertions, 9 deletions
diff --git a/app/src/main/res/layout/status_node_info_dialog.xml b/app/src/main/res/layout/status_node_info_dialog.xml index 36f3e86..5216875 100644 --- a/app/src/main/res/layout/status_node_info_dialog.xml +++ b/app/src/main/res/layout/status_node_info_dialog.xml | |||
@@ -31,7 +31,7 @@ | |||
31 | android:layout_width="match_parent" | 31 | android:layout_width="match_parent" |
32 | android:layout_height="wrap_content" | 32 | android:layout_height="wrap_content" |
33 | android:fontFamily="monospace" | 33 | android:fontFamily="monospace" |
34 | android:text="@string/status_node_list_modal_placeholder_text" | 34 | android:text="@string/status_node_info_modal_placeholder_text" |
35 | android:textColor="@color/textSecondary"/> | 35 | android:textColor="@color/textSecondary"/> |
36 | 36 | ||
37 | </ScrollView> | 37 | </ScrollView> |
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> | ||
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e5dc2f5..3f2e800 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml | |||
@@ -132,7 +132,12 @@ | |||
132 | <string name="status_network_info_none_value">none</string> | 132 | <string name="status_network_info_none_value">none</string> |
133 | 133 | ||
134 | <string name="status_node_list_empty_placeholder_text">Loading…</string> | 134 | <string name="status_node_list_empty_placeholder_text">Loading…</string> |
135 | <string name="status_node_list_modal_placeholder_text">Loading…</string> | 135 | <string name="status_node_reachability_unreachable">unreachable</string> |
136 | <string name="status_node_reachability_this_node">this node</string> | ||
137 | <string name="status_node_reachability_direct_connection">direct</string> | ||
138 | <string name="status_node_reachability_via_format">via %s</string> | ||
139 | <string name="status_node_reachability_unknown">…</string> | ||
140 | <string name="status_node_info_modal_placeholder_text">Loading…</string> | ||
136 | <string name="status_node_info_dialog_title">Node info</string> | 141 | <string name="status_node_info_dialog_title">Node info</string> |
137 | <string name="status_node_info_dialog_close_action">Close</string> | 142 | <string name="status_node_info_dialog_close_action">Close</string> |
138 | 143 | ||