diff options
Diffstat (limited to 'app/src/main/java/org')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt | 3 | ||||
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/activities/StatusActivity.kt | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt index 6bd845d..05f8904 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt | |||
@@ -10,6 +10,7 @@ import android.widget.AdapterView | |||
10 | import android.widget.ArrayAdapter | 10 | import android.widget.ArrayAdapter |
11 | import android.widget.TextView | 11 | import android.widget.TextView |
12 | import kotlinx.android.synthetic.main.base.* | 12 | import kotlinx.android.synthetic.main.base.* |
13 | import kotlinx.android.synthetic.main.fragment_network_list_header.* | ||
13 | import kotlinx.android.synthetic.main.page_start.* | 14 | import kotlinx.android.synthetic.main.page_start.* |
14 | import org.pacien.tincapp.R | 15 | import org.pacien.tincapp.R |
15 | import org.pacien.tincapp.context.AppPaths | 16 | import org.pacien.tincapp.context.AppPaths |
@@ -35,7 +36,6 @@ class StartActivity : BaseActivity(), AdapterView.OnItemClickListener, SwipeRefr | |||
35 | network_list_wrapper.setOnRefreshListener(this) | 36 | network_list_wrapper.setOnRefreshListener(this) |
36 | network_list.addHeaderView(layoutInflater.inflate(R.layout.fragment_network_list_header, network_list, false), null, false) | 37 | network_list.addHeaderView(layoutInflater.inflate(R.layout.fragment_network_list_header, network_list, false), null, false) |
37 | network_list.addFooterView(View(this), null, false) | 38 | network_list.addFooterView(View(this), null, false) |
38 | network_list.emptyView = network_list_empty | ||
39 | network_list.adapter = networkListAdapter | 39 | network_list.adapter = networkListAdapter |
40 | network_list.onItemClickListener = this | 40 | network_list.onItemClickListener = this |
41 | } | 41 | } |
@@ -71,6 +71,7 @@ class StartActivity : BaseActivity(), AdapterView.OnItemClickListener, SwipeRefr | |||
71 | val networks = AppPaths.confDir().list().toList() | 71 | val networks = AppPaths.confDir().list().toList() |
72 | runOnUiThread { | 72 | runOnUiThread { |
73 | networkListAdapter?.setElements(networks) | 73 | networkListAdapter?.setElements(networks) |
74 | network_list_placeholder.visibility = if (networkListAdapter?.isEmpty ?: true) View.VISIBLE else View.GONE | ||
74 | network_list_wrapper.isRefreshing = false | 75 | network_list_wrapper.isRefreshing = false |
75 | } | 76 | } |
76 | } | 77 | } |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/StatusActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/StatusActivity.kt index a2c39dd..0d7af6e 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/StatusActivity.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/StatusActivity.kt | |||
@@ -43,7 +43,6 @@ class StatusActivity : BaseActivity(), AdapterView.OnItemClickListener, SwipeRef | |||
43 | node_list_wrapper.setOnRefreshListener(this) | 43 | node_list_wrapper.setOnRefreshListener(this) |
44 | node_list.addHeaderView(layoutInflater.inflate(R.layout.fragment_network_status_header, node_list, false), null, false) | 44 | node_list.addHeaderView(layoutInflater.inflate(R.layout.fragment_network_status_header, node_list, false), null, false) |
45 | node_list.addFooterView(View(this), null, false) | 45 | node_list.addFooterView(View(this), null, false) |
46 | node_list.emptyView = node_list_empty | ||
47 | node_list.onItemClickListener = this | 46 | node_list.onItemClickListener = this |
48 | node_list.adapter = nodeListAdapter | 47 | node_list.adapter = nodeListAdapter |
49 | } | 48 | } |
@@ -82,6 +81,7 @@ class StatusActivity : BaseActivity(), AdapterView.OnItemClickListener, SwipeRef | |||
82 | getNodeNames().thenAccept { | 81 | getNodeNames().thenAccept { |
83 | runOnUiThread { | 82 | runOnUiThread { |
84 | nodeListAdapter?.setElements(it) | 83 | nodeListAdapter?.setElements(it) |
84 | node_list_placeholder.visibility = if (nodeListAdapter?.isEmpty ?: true) View.VISIBLE else View.GONE | ||
85 | node_list_wrapper.isRefreshing = false | 85 | node_list_wrapper.isRefreshing = false |
86 | if (!TincVpnService.isConnected()) openStartActivity() | 86 | if (!TincVpnService.isConnected()) openStartActivity() |
87 | } | 87 | } |