diff --git a/app/src/main/java/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java b/app/src/main/java/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java index 481427b97c..5574bb8fad 100644 --- a/app/src/main/java/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java @@ -38,6 +38,7 @@ import android.view.Window; import android.view.WindowManager.LayoutParams; import android.widget.Button; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.common.collect.Sets; import com.nextcloud.client.di.Injectable; import com.owncloud.android.R; @@ -79,6 +80,7 @@ public class RenameFileDialogFragment private OCFile mTargetFile; private Button positiveButton; + /** * Public factory method to create new RenameFileDialogFragment instances. * @@ -92,21 +94,18 @@ public class RenameFileDialogFragment args.putParcelable(ARG_PARENT_FOLDER, parentFolder); frag.setArguments(args); return frag; - } @Override public void onStart() { super.onStart(); - int color = themeColorUtils.primaryAccentColor(getContext()); - AlertDialog alertDialog = (AlertDialog) getDialog(); if (alertDialog != null) { positiveButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); - positiveButton.setTextColor(color); - alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(color); + viewThemeUtils.platform.colorTextButtons(positiveButton, + alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL)); } } @@ -176,13 +175,15 @@ public class RenameFileDialogFragment }); // Build the dialog - AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity()); + MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity()); builder.setView(view) .setPositiveButton(R.string.file_rename, this) .setNeutralButton(R.string.common_cancel, this) .setTitle(R.string.rename_dialog_title); Dialog d = builder.create(); + viewThemeUtils.dialog.colorMaterialAlertDialogBackground(binding.userInputContainer.getContext(), builder); + Window window = d.getWindow(); if (window != null) { window.setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);