mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
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.
This commit is contained in:
parent
3ba5d02894
commit
d3c4968312
1 changed files with 9 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue