mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Clean up
This commit is contained in:
parent
2f2856134f
commit
fc74146194
@ -213,8 +213,8 @@ dependencies {
|
|||||||
implementation("androidx.compose.material:material-icons-extended:$composeVersion")
|
implementation("androidx.compose.material:material-icons-extended:$composeVersion")
|
||||||
implementation("com.google.android.material:compose-theme-adapter-3:1.0.13")
|
implementation("com.google.android.material:compose-theme-adapter-3:1.0.13")
|
||||||
|
|
||||||
debugImplementation ("androidx.compose.ui:ui-tooling:$composeVersion")
|
debugImplementation("androidx.compose.ui:ui-tooling:$composeVersion")
|
||||||
debugImplementation ("androidx.compose.ui:ui-tooling-preview:$composeVersion")
|
debugImplementation("androidx.compose.ui:ui-tooling-preview:$composeVersion")
|
||||||
}
|
}
|
||||||
|
|
||||||
// using a task as a preBuild dependency instead of a function that takes some time insures that it runs
|
// using a task as a preBuild dependency instead of a function that takes some time insures that it runs
|
||||||
|
@ -194,12 +194,12 @@ class DownloadService : ConnectionService<DownloadService.Binder>() {
|
|||||||
mutableStateSubject.emit(State.Success(task.packageName, task.name, task.release))
|
mutableStateSubject.emit(State.Success(task.packageName, task.name, task.release))
|
||||||
consumed = true
|
consumed = true
|
||||||
}
|
}
|
||||||
if (!consumed) {
|
//if (!consumed) { TODO investigate if there's resulting issues
|
||||||
scope.launch {
|
scope.launch {
|
||||||
AppInstaller.getInstance(this@DownloadService)
|
AppInstaller.getInstance(this@DownloadService)
|
||||||
?.defaultInstaller?.install(task.name, task.release.cacheFileName)
|
?.defaultInstaller?.install(task.name, task.release.cacheFileName)
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun validatePackage(task: Task, file: File): ValidationError? {
|
private fun validatePackage(task: Task, file: File): ValidationError? {
|
||||||
|
@ -391,7 +391,6 @@ class SyncService : ConnectionService<SyncService.Binder>() {
|
|||||||
.subscribe { result, throwable ->
|
.subscribe { result, throwable ->
|
||||||
throwable?.printStackTrace()
|
throwable?.printStackTrace()
|
||||||
currentTask = null
|
currentTask = null
|
||||||
handleNextTask(false)
|
|
||||||
if (result.isNotEmpty()) {
|
if (result.isNotEmpty()) {
|
||||||
if (Preferences[Preferences.Key.InstallAfterSync])
|
if (Preferences[Preferences.Key.InstallAfterSync])
|
||||||
batchUpdate(result)
|
batchUpdate(result)
|
||||||
@ -400,6 +399,7 @@ class SyncService : ConnectionService<SyncService.Binder>() {
|
|||||||
)
|
)
|
||||||
displayUpdatesNotification(result)
|
displayUpdatesNotification(result)
|
||||||
}
|
}
|
||||||
|
handleNextTask(false)
|
||||||
}
|
}
|
||||||
if (hasUpdates) {
|
if (hasUpdates) {
|
||||||
currentTask = CurrentTask(null, disposable, true, State.Finishing)
|
currentTask = CurrentTask(null, disposable, true, State.Finishing)
|
||||||
|
@ -35,6 +35,7 @@ class MainActivityX : AppCompatActivity() {
|
|||||||
companion object {
|
companion object {
|
||||||
const val ACTION_UPDATES = "${BuildConfig.APPLICATION_ID}.intent.action.UPDATES"
|
const val ACTION_UPDATES = "${BuildConfig.APPLICATION_ID}.intent.action.UPDATES"
|
||||||
const val ACTION_INSTALL = "${BuildConfig.APPLICATION_ID}.intent.action.INSTALL"
|
const val ACTION_INSTALL = "${BuildConfig.APPLICATION_ID}.intent.action.INSTALL"
|
||||||
|
const val EXTRA_UPDATES = "${BuildConfig.APPLICATION_ID}.intent.extra.UPDATES"
|
||||||
const val EXTRA_CACHE_FILE_NAME =
|
const val EXTRA_CACHE_FILE_NAME =
|
||||||
"${BuildConfig.APPLICATION_ID}.intent.extra.CACHE_FILE_NAME"
|
"${BuildConfig.APPLICATION_ID}.intent.extra.CACHE_FILE_NAME"
|
||||||
}
|
}
|
||||||
@ -154,6 +155,7 @@ class MainActivityX : AppCompatActivity() {
|
|||||||
private fun handleSpecialIntent(specialIntent: SpecialIntent) {
|
private fun handleSpecialIntent(specialIntent: SpecialIntent) {
|
||||||
when (specialIntent) {
|
when (specialIntent) {
|
||||||
is SpecialIntent.Updates -> {
|
is SpecialIntent.Updates -> {
|
||||||
|
// TODO directly update the apps??
|
||||||
binding.bottomNavigation.selectedItemId = R.id.installedTab
|
binding.bottomNavigation.selectedItemId = R.id.installedTab
|
||||||
}
|
}
|
||||||
is SpecialIntent.Install -> {
|
is SpecialIntent.Install -> {
|
||||||
|
@ -43,7 +43,7 @@ fun ProductsVerticalRecycler(
|
|||||||
ProductsListItem(
|
ProductsListItem(
|
||||||
item = item,
|
item = item,
|
||||||
repo = repositories[item.repositoryId],
|
repo = repositories[item.repositoryId],
|
||||||
isFavorite = favorites?.contains(item.packageName) == true,
|
isFavorite = favorites.contains(item.packageName),
|
||||||
onUserClick = onUserClick,
|
onUserClick = onUserClick,
|
||||||
onFavouriteClick = onFavouriteClick,
|
onFavouriteClick = onFavouriteClick,
|
||||||
installed = getInstalled.invoke(item),
|
installed = getInstalled.invoke(item),
|
||||||
|
@ -171,8 +171,8 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
|||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
viewModel.downloadState.value = state
|
viewModel.downloadState.value = state
|
||||||
if (downloadState is DownloadService.State.Success && isResumed && !rootInstallerEnabled) {
|
|
||||||
viewModel.updateActions()
|
viewModel.updateActions()
|
||||||
|
if (downloadState is DownloadService.State.Success && !rootInstallerEnabled) { // && isResumed
|
||||||
withContext(Dispatchers.Default) {
|
withContext(Dispatchers.Default) {
|
||||||
AppInstaller.getInstance(context)?.defaultInstaller?.install(downloadState.release.cacheFileName)
|
AppInstaller.getInstance(context)?.defaultInstaller?.install(downloadState.release.cacheFileName)
|
||||||
}
|
}
|
||||||
@ -256,7 +256,6 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO fix in compose implementation
|
|
||||||
override fun onScreenshotClick(screenshot: Screenshot) {
|
override fun onScreenshotClick(screenshot: Screenshot) {
|
||||||
val pair = viewModel.productRepos.asSequence()
|
val pair = viewModel.productRepos.asSequence()
|
||||||
.map { it ->
|
.map { it ->
|
||||||
@ -354,7 +353,7 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
|||||||
val repos by viewModel.repositories.observeAsState()
|
val repos by viewModel.repositories.observeAsState()
|
||||||
val downloadState by viewModel.downloadState.observeAsState(null)
|
val downloadState by viewModel.downloadState.observeAsState(null)
|
||||||
val mainAction by viewModel.mainAction.observeAsState(if (installed == null) ActionState.Install else ActionState.Launch)
|
val mainAction by viewModel.mainAction.observeAsState(if (installed == null) ActionState.Install else ActionState.Launch)
|
||||||
val actions by viewModel.actions.observeAsState() // TODO add rest actions to UI
|
val actions by viewModel.actions.observeAsState()
|
||||||
val secondaryAction by viewModel.secondaryAction.observeAsState()
|
val secondaryAction by viewModel.secondaryAction.observeAsState()
|
||||||
val extras by viewModel.extras.observeAsState(Extras(packageName))
|
val extras by viewModel.extras.observeAsState(Extras(packageName))
|
||||||
val productRepos = products?.mapNotNull { product ->
|
val productRepos = products?.mapNotNull { product ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user