Skip to content

Commit

Permalink
Fix Loading screen not shown
Browse files Browse the repository at this point in the history
Previously the loading screen wasn't  shown when all apps are shown in request new or update
  • Loading branch information
Kaiserdragon2 committed Jun 4, 2023
1 parent ef4746e commit 6619e55
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions app/src/main/java/de/kaiserdragon/iconrequest/RequestActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,19 @@ public void onCreate(Bundle savedInstanceState) {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
if (OnlyNew || SecondIcon || (mode >= 2 && mode <= 5)) {
adapter = new AppAdapter(prepareData(true));
ExecutorService executor = Executors.newCachedThreadPool();
executor.execute(() -> {
if (OnlyNew || SecondIcon || (mode >= 2 && mode <= 5)) {
adapter = new AppAdapter(prepareData(true));
} else adapter = new AppAdapter(prepareData(false)); //show all apps
runOnUiThread(() -> {
if (!OnlyNew && !SecondIcon && (mode < 2 || mode > 5))
findViewById(R.id.text_ipack_chooser).setVisibility(View.GONE);
recyclerView.setAdapter(adapter);
switcherLoad.showNext();

} else adapter = new AppAdapter(prepareData(false)); //show all apps
if (!OnlyNew && !SecondIcon && (mode < 2 || mode > 5))
findViewById(R.id.text_ipack_chooser).setVisibility(View.GONE);
recyclerView.setAdapter(adapter);
switcherLoad.showNext();
});
});
activityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> actionSaveext(actionSave(), result));
}

Expand Down

0 comments on commit 6619e55

Please sign in to comment.