diff --git a/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt b/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt index f056b13acbe11cf59e2933ea35d3c6467f212108..0c45331ab4139eca842286c82b20697c37efd279 100644 --- a/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt +++ b/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt @@ -382,8 +382,8 @@ class ApplicationListRVAdapter( privacyInfoViewModel.getAppPrivacyInfoLiveData(searchApp).observe(lifecycleOwner!!) { showPrivacyScore() val calculatedScore = privacyInfoViewModel.getPrivacyScore(searchApp) + searchApp.privacyScore = calculatedScore if (it.isSuccess() && calculatedScore != -1) { - searchApp.privacyScore = calculatedScore appPrivacyScore.text = view.context.getString( R.string.privacy_rating_out_of, searchApp.privacyScore.toString() diff --git a/app/src/main/java/foundation/e/apps/search/SearchFragment.kt b/app/src/main/java/foundation/e/apps/search/SearchFragment.kt index 176c6ea36f6f609e1ae91b02755b82e72c0333d2..159a517d9888fd21ceaa4a7c1b8513029fb0e0ea 100644 --- a/app/src/main/java/foundation/e/apps/search/SearchFragment.kt +++ b/app/src/main/java/foundation/e/apps/search/SearchFragment.kt @@ -61,6 +61,7 @@ import foundation.e.apps.utils.exceptions.GPlayLoginException import foundation.e.apps.utils.modules.PWAManagerModule import foundation.e.apps.utils.parentFragment.TimeoutFragment import kotlinx.coroutines.launch +import timber.log.Timber import javax.inject.Inject @AndroidEntryPoint @@ -177,6 +178,7 @@ class SearchFragment : currentList ) ) { + binding.loadingProgressBar.isVisible = it.data!!.second return false } @@ -299,13 +301,11 @@ class SearchFragment : override fun showLoadingUI() { binding.shimmerLayout.startShimmer() binding.shimmerLayout.visibility = View.VISIBLE - binding.recyclerView.visibility = View.GONE } override fun stopLoadingUI() { binding.shimmerLayout.stopShimmer() binding.shimmerLayout.visibility = View.GONE - binding.recyclerView.visibility = View.VISIBLE } private fun updateProgressOfInstallingApps(downloadProgress: DownloadProgress) { @@ -372,12 +372,14 @@ class SearchFragment : view?.requestFocus() searchHintLayout?.visibility = View.GONE shimmerLayout?.visibility = View.VISIBLE - recyclerView?.visibility = View.GONE noAppsFoundLayout?.visibility = View.GONE /* * Set the search text and call for network result. */ searchText = text + val applicationListRVAdapter = recyclerView?.adapter as ApplicationListRVAdapter + applicationListRVAdapter.setData(mutableListOf()) +// applicationListRVAdapter.notifyDataSetChanged() repostAuthObjects() } return false @@ -398,7 +400,9 @@ class SearchFragment : override fun onSuggestionClick(position: Int): Boolean { searchViewModel.searchSuggest.value?.let { - searchView?.setQuery(it[position].suggestedQuery, true) + if (it.isNotEmpty()) { + searchView?.setQuery(it[position].suggestedQuery, true) + } } return true } diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml index 10d4481e0facf47f075b9b27d67db2aa2e2e42c4..786b2a930aa7a0178835928481a7b3b33f5af4e6 100644 --- a/app/src/main/res/layout/fragment_search.xml +++ b/app/src/main/res/layout/fragment_search.xml @@ -52,8 +52,7 @@ android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="0dp" - android:layout_weight="1" - android:visibility="gone" /> + android:layout_weight="1" />