Refactor onCreate method: extract initLayout method

This commit refactors the onCreate() method by exctracting a new method to handle the layout inflation and setting of the content view. The readability of onCreate method is improved.

This change does not affect the functionality of the original code.

Signed-off-by: DESKTOP-EMSE65H\Archontis <arxontisk02@gmail.com>
This commit is contained in:
DESKTOP-EMSE65H\Archontis 2023-02-25 01:34:40 +02:00
parent 3316726a1d
commit 4cdfa994e9

View file

@ -251,12 +251,10 @@ public class FileDisplayActivity extends FileActivity
super.onCreate(savedInstanceState);
loadSavedInstanceState(savedInstanceState);
/// USER INTERFACE
// Inflate and set the layout view
binding = FilesBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
initLayout();
// setup toolbar
setupHomeSearchToolbarWithSortAndListButtons();
@ -303,6 +301,12 @@ public class FileDisplayActivity extends FileActivity
}
}
private void initLayout() {
// Inflate and set the layout view
binding = FilesBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
}
private void checkStoragePath() {
String newStorage = Environment.getExternalStorageDirectory().getAbsolutePath();
String storagePath = preferences.getStoragePath(newStorage);