This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 cách để làm task background: | |
1. asynctask: khi work on/off UI threads. | |
2. handler thread: thread có api callbacks. | |
3. threadpool: chạy nhiều cv song song. | |
ta co asynctask có method cho chạy song song asynctask.executeOnExecutor() nhưng cai này có nhược thay vào đó ta chọn sd threadpool. | |
4. intentservice: ko dính gi tời UI threads. | |
########################################################################################### | |
background và activity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb help // List all comands | |
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader |