Clean up & TODOs

This commit is contained in:
machiav3lli 2022-01-26 02:12:05 +01:00
parent 9027294e32
commit 996d80b425
4 changed files with 8 additions and 7 deletions

View File

@ -39,3 +39,5 @@ const val JOB_ID_SYNC = 1
const val PREFS_LANGUAGE = "languages"
const val PREFS_LANGUAGE_DEFAULT = "system"
const val EXTRA_REPOSITORY_ID = "repositoryId"

View File

@ -70,7 +70,7 @@ interface RepositoryDao : BaseDao<Repository> {
val allDisabledDeleted: List<Repository.IdAndDeleted>
@Query("DELETE FROM repository WHERE _id = :id")
fun deleteById(vararg id: Long): Int
fun deleteById(id: Long): Int
// TODO optimize
@Update(onConflict = OnConflictStrategy.REPLACE)
@ -91,7 +91,7 @@ interface ProductDao : BaseDao<Product> {
fun get(packageName: String): List<Product?>
@Query("DELETE FROM product WHERE repository_id = :id")
fun deleteById(vararg id: Long): Int
fun deleteById(id: Long): Int
@RawQuery
fun query(
@ -288,9 +288,10 @@ interface CategoryDao : BaseDao<Category> {
val allNames: List<String>
@Query("DELETE FROM category WHERE repository_id = :id")
fun deleteById(vararg id: Long): Int
fun deleteById(id: Long): Int
}
// TODO make sure that apps that not uninstalled by Droid-ify still get removed
@Dao
interface InstalledDao : BaseDao<Installed> {
fun put(vararg isntalled: com.looker.droidify.entity.InstalledItem) {

View File

@ -14,6 +14,7 @@ import androidx.fragment.app.viewModels
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.looker.droidify.EXTRA_REPOSITORY_ID
import com.looker.droidify.R
import com.looker.droidify.databinding.SheetRepositoryBinding
import com.looker.droidify.screen.MessageDialog
@ -33,10 +34,6 @@ class RepositorySheetX() : BottomSheetDialogFragment() {
RepositoryViewModelX.Factory((requireActivity() as PrefsActivityX).db, repositoryId)
}
companion object {
private const val EXTRA_REPOSITORY_ID = "repositoryId"
}
constructor(repositoryId: Long = 0) : this() {
arguments = Bundle().apply {
putLong(EXTRA_REPOSITORY_ID, repositoryId)

View File

@ -70,6 +70,7 @@ class MainNavFragmentViewModelX(val db: DatabaseX, primarySource: Source, second
mSections,
mOrder
)
// TODO differentiate between updated and new (e.g. number of releases)
Source.UPDATED -> Request.ProductsUpdated(
mSearchQuery,
mSections,