mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-02-08 07:48:39 +01:00
use a background thread for updating launcher order
This commit is contained in:
parent
da7acb2c9f
commit
ab63fccac8
@ -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,8 +100,10 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: ArrayList<AppLau
|
|||||||
appLauncher.order = index + 1
|
appLauncher.order = index + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
launchers.forEach {
|
ensureBackgroundThread {
|
||||||
activity.dbHelper.updateLauncherOrder(it.id, it.order)
|
launchers.forEach {
|
||||||
|
activity.dbHelper.updateLauncherOrder(it.id, it.order)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user