AppDetails: Show warning if app in unavailable for the device
This commit is contained in:
@@ -217,6 +217,10 @@ class AppDetailsFragment : BaseFragment<FragmentDetailsBinding>() {
|
|||||||
updateAppHeader(app) // Re-inflate the app details, as web data may vary.
|
updateAppHeader(app) // Re-inflate the app details, as web data may vary.
|
||||||
updateExtraDetails(app)
|
updateExtraDetails(app)
|
||||||
|
|
||||||
|
if (app.versionCode == 0) {
|
||||||
|
warnAppUnavailable(app)
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch App Reviews
|
// Fetch App Reviews
|
||||||
viewModel.fetchAppReviews(app.packageName)
|
viewModel.fetchAppReviews(app.packageName)
|
||||||
|
|
||||||
@@ -225,8 +229,6 @@ class AppDetailsFragment : BaseFragment<FragmentDetailsBinding>() {
|
|||||||
|
|
||||||
// Fetch Exodus Privacy Report
|
// Fetch Exodus Privacy Report
|
||||||
viewModel.fetchAppReport(app.packageName)
|
viewModel.fetchAppReport(app.packageName)
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toast(getString(R.string.status_unavailable))
|
toast(getString(R.string.status_unavailable))
|
||||||
// TODO: Redirect to App Unavailable Fragment
|
// TODO: Redirect to App Unavailable Fragment
|
||||||
@@ -1032,6 +1034,13 @@ class AppDetailsFragment : BaseFragment<FragmentDetailsBinding>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun warnAppUnavailable(app: App) {
|
||||||
|
AuroraApp.events.send(InstallerEvent.Failed(app.packageName).apply {
|
||||||
|
error = getString(R.string.status_unavailable)
|
||||||
|
extra = getString(R.string.toast_app_unavailable)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/* App Review Helpers */
|
/* App Review Helpers */
|
||||||
|
|
||||||
private fun addAvgReviews(number: Int, max: Long, rating: Long): RelativeLayout {
|
private fun addAvgReviews(number: Int, max: Long, rating: Long): RelativeLayout {
|
||||||
|
|||||||
Reference in New Issue
Block a user