Danh sách mã transparent color hex
- 100% — FF
- 95% — F2
- 90% — E6
- 85% — D9
- 80% — CC
- 75% — BF
- 70% — B3
- 65% — A6
- 60% — 99
- 55% — 8C
- 50% — 80
- 45% — 73
- 40% — 66
- 35% — 59
- 30% — 4D
- 25% — 40
- 20% — 33
- 15% — 26
- 10% — 1A
- 5% — 0D
- 0% — 00
/**
* Bring up launcher task to front
*/
public static void navToLauncherTask(Context appContext) {
if (appContext != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ActivityManager activityManager = (ActivityManager)
appContext.getSystemService(Context.ACTIVITY_SERVICE);
// iterate app tasks available and navigate to launcher task (browse task)
if (activityManager != null) {
final List<ActivityManager.AppTask> appTasks;
appTasks = activityManager.getAppTasks();
for (ActivityManager.AppTask task : appTasks) {
final Intent baseIntent = task.getTaskInfo().baseIntent;
final Set<String> categories = baseIntent.getCategories();
if (categories != null && categories.contains(Intent.CATEGORY_LAUNCHER)) {
task.moveToFront();
return;
}
}
}
}
}
/**
* Bring up launcher task to front
*/
fun FragmentActivity?.navToLauncherTask() {
if (this == null || this.isFinishing) return
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val activityManager = (getSystemService(AppCompatActivity.ACTIVITY_SERVICE) as ActivityManager)
val appTasks = activityManager.appTasks
for (task in appTasks) {
val baseIntent = task.taskInfo.baseIntent
val categories = baseIntent.categories
if (categories != null && (categories.contains(Intent.CATEGORY_LAUNCHER)
|| categories.contains(Intent.CATEGORY_DEFAULT))) {
task.moveToFront()
return
}
}
}
}