diff options
author | stefan-niedermann <info@niedermann.it> | 2020-03-20 19:31:44 +0300 |
---|---|---|
committer | stefan-niedermann <info@niedermann.it> | 2020-03-20 19:31:44 +0300 |
commit | 1341fff4dd22f823994203fcea9ae61e5c118ef1 (patch) | |
tree | e1571319ca57371eab52a618bd0314f68b3b2b4c /app/src/main/java/it/niedermann/nextcloud/deck/ui/stack | |
parent | fa06851224fcaa4f93d22982e2b9ddf54901600d (diff) |
Move state persistence to Application
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/stack')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/EditStackDialogFragment.java | 5 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/EditStackDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/EditStackDialogFragment.java index 7ed0518f2..0ea7d95ac 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/EditStackDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/EditStackDialogFragment.java @@ -19,8 +19,9 @@ import it.niedermann.nextcloud.deck.Application; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.databinding.DialogStackCreateBinding; +import static it.niedermann.nextcloud.deck.Application.NO_STACK_ID; + public class EditStackDialogFragment extends DialogFragment { - public static final Long NO_STACK_ID = -1L; private static final String KEY_STACK_ID = "board_id"; private static final String KEY_OLD_TITLE = "old_title"; private long stackId = NO_STACK_ID; @@ -73,7 +74,7 @@ public class EditStackDialogFragment extends DialogFragment { @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { binding.input.requestFocus(); - Objects.requireNonNull(Objects.requireNonNull(getDialog()).getWindow()).setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); + Objects.requireNonNull(requireDialog().getWindow()).setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); return super.onCreateView(inflater, container, savedInstanceState); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java index 83a839272..45d4e8d85 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java @@ -72,10 +72,10 @@ public class StackFragment extends Fragment { throw new IllegalArgumentException("account and localStackId are required arguments."); } - boardId = getArguments().getLong(KEY_BOARD_ID); - stackId = getArguments().getLong(KEY_STACK_ID); - account = (Account) getArguments().getSerializable(KEY_ACCOUNT); - canEdit = getArguments().getBoolean(KEY_HAS_EDIT_PERMISSION); + boardId = requireArguments().getLong(KEY_BOARD_ID); + stackId = requireArguments().getLong(KEY_STACK_ID); + account = (Account) requireArguments().getSerializable(KEY_ACCOUNT); + canEdit = requireArguments().getBoolean(KEY_HAS_EDIT_PERMISSION); activity = requireActivity(); |