mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 07:05:49 +03:00
Update theming on rename dialog
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
8a31f9b8f7
commit
90f060e944
1 changed files with 7 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue