mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +03:00
convert conflicts and create folder dialogs to MaterialAlterDialogs
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
ee170a4e4c
commit
a131656d8f
2 changed files with 10 additions and 2 deletions
|
@ -29,6 +29,7 @@ import android.view.View;
|
|||
import android.widget.Button;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.nextcloud.client.account.User;
|
||||
import com.nextcloud.client.di.Injectable;
|
||||
import com.owncloud.android.R;
|
||||
|
@ -162,7 +163,7 @@ public class ConflictsResolveDialog extends DialogFragment implements Injectable
|
|||
viewThemeUtils.platform.themeCheckbox(binding.existingCheckbox);
|
||||
|
||||
// Build the dialog
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity());
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());
|
||||
builder.setView(binding.getRoot())
|
||||
.setPositiveButton(R.string.common_ok, (dialog, which) -> {
|
||||
if (listener != null) {
|
||||
|
@ -234,6 +235,8 @@ public class ConflictsResolveDialog extends DialogFragment implements Injectable
|
|||
positiveButton.setEnabled(binding.newCheckbox.isChecked() || binding.existingCheckbox.isChecked());
|
||||
});
|
||||
|
||||
viewThemeUtils.dialog.colorMaterialAlertDialogBackground(binding.existingFileContainer.getContext(), builder);
|
||||
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ import android.view.WindowManager.LayoutParams;
|
|||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.nextcloud.client.di.Injectable;
|
||||
import com.owncloud.android.R;
|
||||
|
@ -168,11 +169,14 @@ public class CreateFolderDialogFragment
|
|||
});
|
||||
|
||||
// Build the dialog
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity());
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());
|
||||
builder.setView(view)
|
||||
.setPositiveButton(R.string.folder_confirm_create, this)
|
||||
.setNeutralButton(R.string.common_cancel, this)
|
||||
.setTitle(R.string.uploader_info_dirname);
|
||||
|
||||
viewThemeUtils.dialog.colorMaterialAlertDialogBackground(binding.userInputContainer.getContext(), builder);
|
||||
|
||||
AlertDialog d = builder.create();
|
||||
|
||||
Window window = d.getWindow();
|
||||
|
@ -202,6 +206,7 @@ public class CreateFolderDialogFragment
|
|||
}
|
||||
|
||||
String path = mParentFolder.getDecryptedRemotePath() + newFolderName + OCFile.PATH_SEPARATOR;
|
||||
|
||||
((ComponentsGetter) getActivity()).getFileOperationsHelper().createFolder(path);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue