Load custom start button images on separate thread
@@ -336,7 +336,10 @@ public class TaskbarController implements UIController {
case "custom":
File file = new File(context.getFilesDir() + "/tb_images", "custom_image");
if(file.exists()) {
+ Handler handler = new Handler();
+ new Thread(() -> {
Bitmap bitmap = BitmapFactory.decodeFile(file.getPath());
+ handler.post(() -> {
if(bitmap != null) {
BitmapDrawable bitmapDrawable = new BitmapDrawable(context.getResources(), bitmap);
bitmapDrawable.setFilterBitmap(bitmap.getWidth() * bitmap.getHeight() > 2000);
@@ -345,6 +348,8 @@ public class TaskbarController implements UIController {
U.showToastLong(context, R.string.tb_error_reading_custom_start_image);
startButton.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.tb_all_apps_button_icon));
}
+ });
+ }).start();
} else
startButton.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.tb_all_apps_button_icon));
