From ed7d918c2667a378ff061302ff4a09867b0e9215 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Sat, 23 Jun 2018 22:57:26 +0200 Subject: [PATCH] extract dialog creation to separate method --- .../android/ui/dialog/SetupEncryptionDialogFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java b/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java index 69b7dae9df..9e97bb4170 100644 --- a/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java +++ b/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java @@ -61,7 +61,6 @@ import java.util.Locale; /* * Dialog to setup encryption */ - public class SetupEncryptionDialogFragment extends DialogFragment { public static final String SUCCESS = "SUCCESS"; @@ -143,7 +142,11 @@ public class SetupEncryptionDialogFragment extends DialogFragment { DrawableCompat.setTint(wrappedDrawable, accentColor); passwordField.setBackgroundDrawable(wrappedDrawable); - // Build the dialog + return createDialog(accentColor, v); + } + + @NonNull + private Dialog createDialog(int accentColor, View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setView(v).setPositiveButton(R.string.common_ok, null) .setNegativeButton(R.string.common_cancel, null) @@ -224,7 +227,6 @@ public class SetupEncryptionDialogFragment extends DialogFragment { }); } }); - return dialog; }