Skip to content

unify alert dialog button theming logic - #17437

Open
alperozturk96 wants to merge 3 commits into
masterfrom
unify-alert-dialog-button-theming
Open

unify alert dialog button theming logic#17437
alperozturk96 wants to merge 3 commits into
masterfrom
unify-alert-dialog-button-theming

Conversation

@alperozturk96

Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@alperozturk96 alperozturk96 added the 鈾伙笍 refactor Refactor code (not a bug fix, not a feature just refactoring) label Aug 5, 2026
@alperozturk96 alperozturk96 added this to the Nextcloud App 35.0.0 milestone Aug 5, 2026
@alperozturk96
alperozturk96 requested review from AndyScherzinger and a lite review from Copilot August 5, 2026 08:48
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Centralizes alert dialog button theming by reusing a shared themeButtons extension across multiple dialogs/fragments, reducing duplicated styling code.

Changes:

  • Made themeButtons a nullable-safe extension and updated its internal implementation.
  • Replaced per-dialog button theming code in multiple DialogFragments/activities with dialog?.themeButtons(viewThemeUtils).
  • Simplified imports and removed now-redundant theming helper methods.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/src/main/java/com/owncloud/android/ui/dialog/setupEncryption/SetupEncryptionDialogFragment.kt Replaces custom theming method with shared themeButtons call.
app/src/main/java/com/owncloud/android/ui/dialog/extensions/DialogExtensions.kt Updates themeButtons signature and consolidates button theming logic.
app/src/main/java/com/owncloud/android/ui/dialog/ThemeSelectionDialog.kt Uses themeButtons instead of inline positive button theming.
app/src/main/java/com/owncloud/android/ui/dialog/StoragePermissionDialogFragment.kt Replaces inline theming of all buttons with themeButtons.
app/src/main/java/com/owncloud/android/ui/dialog/RenameFileDialogFragment.kt Drops local alert dialog init/theming in favor of themeButtons.
app/src/main/java/com/owncloud/android/ui/dialog/RemoveFilesDialogFragment.kt Uses themeButtons to style positive/negative/neutral buttons.
app/src/main/java/com/owncloud/android/ui/dialog/LocalStoragePathPickerDialogFragment.kt Uses themeButtons instead of inline positive button theming.
app/src/main/java/com/owncloud/android/ui/dialog/ConfirmationDialogFragment.kt Replaces inline theming with shared themeButtons call.
app/src/main/java/com/owncloud/android/ui/dialog/AccountRemovalDialog.kt Switches to themeButtons for positive/negative button styling.
app/src/main/java/com/owncloud/android/ui/activity/SyncedFoldersActivity.kt Replaces platform.colorTextButtons usage with themeButtons.
app/src/main/java/com/nextcloud/ui/fileInfo/GovernanceDetailInfo.kt Uses themeButtons after showing the dialog to theme the positive button.
app/src/main/java/com/nextcloud/ui/ChooseStorageLocationDialogFragment.kt Uses themeButtons instead of inline positive button theming.

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +17
fun Dialog.themeButtons(util: ViewThemeUtils?) {
val dialog = (this as? AlertDialog) ?: return
val util = util ?: return
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE),
alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL)
)
alertDialog.themeButtons(viewThemeUtils)
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE) as MaterialButton
)

alertDialog.themeButtons(viewThemeUtils)
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3232
Correctness6464
Dodgy code216216
Experimental11
Malicious code vulnerability22
Multithreaded correctness2525
Performance4040
Security1919
Total399399

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review 鈾伙笍 refactor Refactor code (not a bug fix, not a feature just refactoring)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants