aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2017-07-11 18:22:48 +0200
committerPacien TRAN-GIRARD2017-07-11 18:22:48 +0200
commita2f166f907b7c7ac6f1e0ed6ff8c0637800f6b91 (patch)
tree398bebaf42a7550600ae6c847dbe59b58f64da12 /app/src/main/java
parent1afc00f3f26472083d814a99f244dae39a960e34 (diff)
downloadtincapp-a2f166f907b7c7ac6f1e0ed6ff8c0637800f6b91.tar.gz
Fix empty list placeholder display
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt3
-rw-r--r--app/src/main/java/org/pacien/tincapp/activities/StatusActivity.kt2
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
10import android.widget.ArrayAdapter 10import android.widget.ArrayAdapter
11import android.widget.TextView 11import android.widget.TextView
12import kotlinx.android.synthetic.main.base.* 12import kotlinx.android.synthetic.main.base.*
13import kotlinx.android.synthetic.main.fragment_network_list_header.*
13import kotlinx.android.synthetic.main.page_start.* 14import kotlinx.android.synthetic.main.page_start.*
14import org.pacien.tincapp.R 15import org.pacien.tincapp.R
15import org.pacien.tincapp.context.AppPaths 16import 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 }