NEw install dialog, incognito dont show fix, crash fix old android search library

This commit is contained in:
Kelvin K
2025-12-03 11:44:27 -06:00
parent b37f48380b
commit 7ed1e8a28b
3 changed files with 26 additions and 13 deletions
@@ -4,6 +4,7 @@ import android.app.Dialog
import android.app.Service
import android.content.Intent
import android.os.IBinder
import com.futo.platformplayer.UIDialogs.ActionStyle
import com.futo.platformplayer.logging.Logger
import com.futo.platformplayer.states.StateApp
import com.futo.platformplayer.states.StateUpdate
@@ -219,10 +220,16 @@ class UpdateDownloadService : Service() {
StateApp.instance.scopeOrNull?.launch(Dispatchers.Main) {
StateApp.withContext { ctx ->
try {
updateDownloadedDialog = UIDialogs.showConfirmationDialog(ctx, "Update downloaded, press confirm to install", {
UpdateNotificationManager.cancelAll(ctx)
UpdateInstaller.startInstall(ctx, apkFile)
}, dismissAction = { updateDownloadedDialog = null })
updateDownloadedDialog = UIDialogs.showDialog(ctx, R.drawable.foreground,
"Update downloaded",
"Would you like to install it now?", null, 0,
UIDialogs.Action("Cancel", {
updateDownloadedDialog = null
}, ActionStyle.NONE, true),
UIDialogs.Action("Install", {
UpdateNotificationManager.cancelAll(ctx)
UpdateInstaller.startInstall(ctx, apkFile)
}, ActionStyle.PRIMARY, true));
} catch (t: Throwable) {
Logger.w(TAG, "Failed to show in-app update downloaded dialog", t)
updateDownloadedDialog = null
@@ -155,15 +155,16 @@ class MenuBottomBarFragment : MainActivityFragment() {
StateApp.instance.setPrivacyMode(true);
UIDialogs.appToast("Privacy mode enabled");
UIDialogs.showDialog(it.context ?: return@setOnClickListener, R.drawable.incognito, "Privacy Mode",
"All requests will be processed anonymously (any logins will be disabled except for the personalized home page), local playback and history tracking will also be disabled.\n\nTap the icon to disable.", null, 0,
UIDialogs.Action("Don't show again", {
Settings.instance.other.showPrivacyModeDialog = false;
Settings.instance.save();
}, UIDialogs.ActionStyle.NONE),
UIDialogs.Action("Understood", {
if(Settings.instance.other.showPrivacyModeDialog)
UIDialogs.showDialog(it.context ?: return@setOnClickListener, R.drawable.incognito, "Privacy Mode",
"All requests will be processed anonymously (any logins will be disabled except for the personalized home page), local playback and history tracking will also be disabled.\n\nTap the icon to disable.", null, 0,
UIDialogs.Action("Don't show again", {
Settings.instance.other.showPrivacyModeDialog = false;
Settings.instance.save();
}, UIDialogs.ActionStyle.NONE),
UIDialogs.Action("Understood", {
}, UIDialogs.ActionStyle.PRIMARY));
}, UIDialogs.ActionStyle.PRIMARY));
}
}
@@ -1,5 +1,6 @@
package com.futo.platformplayer.fragment.mainactivity.topbar
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
@@ -49,7 +50,11 @@ class GeneralTopBarFragment : TopFragment() {
} else if (currentMain is PlaylistsFragment || currentMain is PlaylistFragment) {
navigate<SuggestionsFragment>(SuggestionsFragmentData("", SearchType.PLAYLIST));
} else if (currentMain is LibraryFragment) {
navigate<LibrarySearchFragment>();
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
UIDialogs.toast("Your Android version is too old for Mediastore search", true);
}
else
navigate<LibrarySearchFragment>();
} else {
navigate<SuggestionsFragment>(SuggestionsFragmentData("", SearchType.VIDEO));
}