diff options
author | euxane | 2024-09-18 23:41:13 +0200 |
---|---|---|
committer | euxane | 2024-09-18 23:41:13 +0200 |
commit | 0bfa505bb1e7fdd514592dbd79a4ccd244d13cad (patch) | |
tree | f4e8ee1836ac926449207df10018edb1c18e5cbe | |
parent | d166fcda24fdd5dcb2bcb9bb5500b751dfb9be0e (diff) | |
download | tincapp-0bfa505bb1e7fdd514592dbd79a4ccd244d13cad.tar.gz |
activities/listviews: workaround list view adapter bug on old android
Setting up the list adapter after adding the headers suddenly started
crashing on Android API 25 together with the more recent libraries.
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt | 2 | ||||
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListFragment.kt | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt index 7b5006a..fc5b6ff 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt | |||
@@ -54,10 +54,10 @@ class NetworkListFragment : BaseFragment() { | |||
54 | 54 | ||
55 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 55 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
56 | val listHeaderView = layoutInflater.inflate(R.layout.start_network_list_header, startNetworkListBinding.root, false) | 56 | val listHeaderView = layoutInflater.inflate(R.layout.start_network_list_header, startNetworkListBinding.root, false) |
57 | startNetworkListBinding.startNetworkList.adapter = networkListAdapter | ||
57 | startNetworkListBinding.startNetworkList.addHeaderView(listHeaderView, null, false) | 58 | startNetworkListBinding.startNetworkList.addHeaderView(listHeaderView, null, false) |
58 | startNetworkListBinding.startNetworkList.hideBottomSeparator() | 59 | startNetworkListBinding.startNetworkList.hideBottomSeparator() |
59 | startNetworkListBinding.startNetworkList.onItemClickListener = AdapterView.OnItemClickListener(this::onItemClick) | 60 | startNetworkListBinding.startNetworkList.onItemClickListener = AdapterView.OnItemClickListener(this::onItemClick) |
60 | startNetworkListBinding.startNetworkList.adapter = networkListAdapter | ||
61 | } | 61 | } |
62 | 62 | ||
63 | @Suppress("UNUSED_PARAMETER") | 63 | @Suppress("UNUSED_PARAMETER") |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListFragment.kt index 474ab6e..8c0ef88 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListFragment.kt | |||
@@ -57,9 +57,9 @@ class NodeListFragment : BaseFragment() { | |||
57 | } | 57 | } |
58 | 58 | ||
59 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 59 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
60 | statusNodeListFragmentBinding.statusNodeList.adapter = nodeListAdapter | ||
60 | statusNodeListFragmentBinding.statusNodeList.hideTopSeparator() | 61 | statusNodeListFragmentBinding.statusNodeList.hideTopSeparator() |
61 | statusNodeListFragmentBinding.statusNodeList.hideBottomSeparator() | 62 | statusNodeListFragmentBinding.statusNodeList.hideBottomSeparator() |
62 | statusNodeListFragmentBinding.statusNodeList.adapter = nodeListAdapter | ||
63 | } | 63 | } |
64 | 64 | ||
65 | private fun updateNodeList(nodes: List<NodeInfo>) { | 65 | private fun updateNodeList(nodes: List<NodeInfo>) { |