mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +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. Signed-off-by: DESKTOP-EMSE65H\Archontis <arxontisk02@gmail.com>
This commit is contained in:
parent
3316726a1d
commit
4cdfa994e9
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