Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d802e16 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

issue_656: function togglePrivacyInfo(Boolean) for all privacy info layouts

parent 0533a443
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -749,6 +749,29 @@ class ApplicationFragment : TimeoutFragment(R.layout.fragment_application) {
        }
    }

    /**
     * It takes fair amount of time to load trackers information after loading app details.
     * Till trackers are loaded, we should show loading icon for privacy info.
     *
     * Issue: https://gitlab.e.foundation/e/os/backlog/-/issues/656
     *
     * @param visible Boolean to toggle visibility of loading progress bar or the
     * layout contents.
     */
    private fun togglePrivacyInfo(visible: Boolean) {
        binding.privacyInclude.run {
            (if (visible) View.VISIBLE else View.INVISIBLE).run {
                appPermissions.visibility = this
                appTrackers.visibility = this
            }
            loadingBar.isVisible = !visible
        }
        binding.ratingsInclude.appPrivacyScoreLayout.run {
            findViewById<View>(R.id.loadingBar).isVisible = !visible
            findViewById<View>(R.id.appPrivacyScore).isVisible = visible
        }
    }

    override fun onDestroyView() {
        super.onDestroyView()
        _binding?.recyclerView?.adapter = null