mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-24 03:42:15 +00:00
Clean up & TODOs
This commit is contained in:
parent
9027294e32
commit
996d80b425
@ -39,3 +39,5 @@ const val JOB_ID_SYNC = 1
|
|||||||
|
|
||||||
const val PREFS_LANGUAGE = "languages"
|
const val PREFS_LANGUAGE = "languages"
|
||||||
const val PREFS_LANGUAGE_DEFAULT = "system"
|
const val PREFS_LANGUAGE_DEFAULT = "system"
|
||||||
|
|
||||||
|
const val EXTRA_REPOSITORY_ID = "repositoryId"
|
@ -70,7 +70,7 @@ interface RepositoryDao : BaseDao<Repository> {
|
|||||||
val allDisabledDeleted: List<Repository.IdAndDeleted>
|
val allDisabledDeleted: List<Repository.IdAndDeleted>
|
||||||
|
|
||||||
@Query("DELETE FROM repository WHERE _id = :id")
|
@Query("DELETE FROM repository WHERE _id = :id")
|
||||||
fun deleteById(vararg id: Long): Int
|
fun deleteById(id: Long): Int
|
||||||
|
|
||||||
// TODO optimize
|
// TODO optimize
|
||||||
@Update(onConflict = OnConflictStrategy.REPLACE)
|
@Update(onConflict = OnConflictStrategy.REPLACE)
|
||||||
@ -91,7 +91,7 @@ interface ProductDao : BaseDao<Product> {
|
|||||||
fun get(packageName: String): List<Product?>
|
fun get(packageName: String): List<Product?>
|
||||||
|
|
||||||
@Query("DELETE FROM product WHERE repository_id = :id")
|
@Query("DELETE FROM product WHERE repository_id = :id")
|
||||||
fun deleteById(vararg id: Long): Int
|
fun deleteById(id: Long): Int
|
||||||
|
|
||||||
@RawQuery
|
@RawQuery
|
||||||
fun query(
|
fun query(
|
||||||
@ -288,9 +288,10 @@ interface CategoryDao : BaseDao<Category> {
|
|||||||
val allNames: List<String>
|
val allNames: List<String>
|
||||||
|
|
||||||
@Query("DELETE FROM category WHERE repository_id = :id")
|
@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
|
@Dao
|
||||||
interface InstalledDao : BaseDao<Installed> {
|
interface InstalledDao : BaseDao<Installed> {
|
||||||
fun put(vararg isntalled: com.looker.droidify.entity.InstalledItem) {
|
fun put(vararg isntalled: com.looker.droidify.entity.InstalledItem) {
|
||||||
|
@ -14,6 +14,7 @@ import androidx.fragment.app.viewModels
|
|||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||||
|
import com.looker.droidify.EXTRA_REPOSITORY_ID
|
||||||
import com.looker.droidify.R
|
import com.looker.droidify.R
|
||||||
import com.looker.droidify.databinding.SheetRepositoryBinding
|
import com.looker.droidify.databinding.SheetRepositoryBinding
|
||||||
import com.looker.droidify.screen.MessageDialog
|
import com.looker.droidify.screen.MessageDialog
|
||||||
@ -33,10 +34,6 @@ class RepositorySheetX() : BottomSheetDialogFragment() {
|
|||||||
RepositoryViewModelX.Factory((requireActivity() as PrefsActivityX).db, repositoryId)
|
RepositoryViewModelX.Factory((requireActivity() as PrefsActivityX).db, repositoryId)
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
|
||||||
private const val EXTRA_REPOSITORY_ID = "repositoryId"
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(repositoryId: Long = 0) : this() {
|
constructor(repositoryId: Long = 0) : this() {
|
||||||
arguments = Bundle().apply {
|
arguments = Bundle().apply {
|
||||||
putLong(EXTRA_REPOSITORY_ID, repositoryId)
|
putLong(EXTRA_REPOSITORY_ID, repositoryId)
|
||||||
|
@ -70,6 +70,7 @@ class MainNavFragmentViewModelX(val db: DatabaseX, primarySource: Source, second
|
|||||||
mSections,
|
mSections,
|
||||||
mOrder
|
mOrder
|
||||||
)
|
)
|
||||||
|
// TODO differentiate between updated and new (e.g. number of releases)
|
||||||
Source.UPDATED -> Request.ProductsUpdated(
|
Source.UPDATED -> Request.ProductsUpdated(
|
||||||
mSearchQuery,
|
mSearchQuery,
|
||||||
mSections,
|
mSections,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user