Skip to content

Instantly share code, notes, and snippets.

iconDrawable.let { drawable ->
val scaleX = lerp(0f, 1f, scaleIconFraction)
val scaleY = scaleX
val pivotX = width / 2f
val pivotY = height / 2f
canvas.withScale(scaleX, scaleY, pivotX, pivotY) {
// rotate the icon if it appears
if (scaleIconFraction > 0) {
invalidate()
}
@minhngoc826
minhngoc826 / 0 background.java
Created May 10, 2024 10:46 — forked from PhongHuynh93/0 background.java
Worker thread, UI thread, Asynctask, Post, PostDelayed, RunOnUiThread
3 cách để làm task background:
1. asynctask: khi work on/off UI threads.
2. handler thread: thread api callbacks.
3. threadpool: chạy nhiều cv song song.
ta co asynctask method cho chạy song song asynctask.executeOnExecutor() nhưng cai này nhược thay vào đó ta chọn sd threadpool.
4. intentservice: ko dính gi tời UI threads.
###########################################################################################
background activity
@minhngoc826
minhngoc826 / AdbCommands
Last active August 28, 2023 06:00 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader