mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-06-05 21:49:21 +02:00
use a background thread for updating launcher order
This commit is contained in:
@ -18,6 +18,7 @@ import com.simplemobiletools.commons.extensions.applyColorFilter
|
|||||||
import com.simplemobiletools.commons.extensions.beInvisibleIf
|
import com.simplemobiletools.commons.extensions.beInvisibleIf
|
||||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||||
import com.simplemobiletools.commons.helpers.SORT_BY_CUSTOM
|
import com.simplemobiletools.commons.helpers.SORT_BY_CUSTOM
|
||||||
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
import com.simplemobiletools.commons.interfaces.ItemMoveCallback
|
import com.simplemobiletools.commons.interfaces.ItemMoveCallback
|
||||||
import com.simplemobiletools.commons.interfaces.ItemTouchHelperContract
|
import com.simplemobiletools.commons.interfaces.ItemTouchHelperContract
|
||||||
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
||||||
@ -99,10 +100,12 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: ArrayList<AppLau
|
|||||||
appLauncher.order = index + 1
|
appLauncher.order = index + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ensureBackgroundThread {
|
||||||
launchers.forEach {
|
launchers.forEach {
|
||||||
activity.dbHelper.updateLauncherOrder(it.id, it.order)
|
activity.dbHelper.updateLauncherOrder(it.id, it.order)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
isChangingOrder = false
|
isChangingOrder = false
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user