From abb6e2dbd56c0d076ad7fdbcea69ac92afe76bae Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Fri, 14 Aug 2015 15:29:22 +0200 Subject: [PATCH] Move to AppCompat AlertDialog for proper rendering on pre-lollipop devices --- res/values/styles.xml | 11 +++++++++++ .../android/ui/activity/FileDisplayActivity.java | 2 +- src/com/owncloud/android/ui/activity/Uploader.java | 4 ++-- .../owncloud/android/ui/dialog/ChangelogDialog.java | 2 +- .../android/ui/dialog/ConflictsResolveDialog.java | 2 +- .../android/ui/dialog/CreateFolderDialogFragment.java | 2 +- .../android/ui/dialog/CredentialsDialogFragment.java | 4 ++-- .../android/ui/dialog/RenameFileDialogFragment.java | 2 +- .../owncloud/android/ui/dialog/ShareLinkToDialog.java | 2 +- .../ui/dialog/SharePasswordDialogFragment.java | 2 +- .../android/ui/dialog/UploadSourceDialogFragment.java | 2 +- .../android/ui/preview/PreviewMediaFragment.java | 2 +- .../android/ui/preview/PreviewVideoActivity.java | 2 +- 13 files changed, 25 insertions(+), 14 deletions(-) diff --git a/res/values/styles.xml b/res/values/styles.xml index 3bb1fe433c..4e35d08921 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -28,6 +28,7 @@ @color/primary_dark @color/color_accent @style/Theme.ownCloud.Dialog + @style/ownCloud.AlertDialog @@ -38,12 +39,22 @@ @color/primary_dark @color/color_accent @style/Theme.ownCloud.Dialog + @style/ownCloud.AlertDialog + + + + diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 6c8c219bc0..c9545cf60a 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -26,7 +26,7 @@ import android.accounts.Account; import android.accounts.AccountManager; import android.accounts.AuthenticatorException; import android.annotation.TargetApi; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.ContentResolver; diff --git a/src/com/owncloud/android/ui/activity/Uploader.java b/src/com/owncloud/android/ui/activity/Uploader.java index 3a55cdc504..8ff505bc98 100644 --- a/src/com/owncloud/android/ui/activity/Uploader.java +++ b/src/com/owncloud/android/ui/activity/Uploader.java @@ -33,8 +33,8 @@ import java.util.Vector; import android.accounts.Account; import android.accounts.AccountManager; -import android.app.AlertDialog; -import android.app.AlertDialog.Builder; +import android.support.v7.app.AlertDialog; +import android.support.v7.app.AlertDialog.Builder; import android.app.Dialog; import android.app.ProgressDialog; import android.content.Context; diff --git a/src/com/owncloud/android/ui/dialog/ChangelogDialog.java b/src/com/owncloud/android/ui/dialog/ChangelogDialog.java index 83c6053b10..56df50edc2 100644 --- a/src/com/owncloud/android/ui/dialog/ChangelogDialog.java +++ b/src/com/owncloud/android/ui/dialog/ChangelogDialog.java @@ -19,7 +19,7 @@ package com.owncloud.android.ui.dialog; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; diff --git a/src/com/owncloud/android/ui/dialog/ConflictsResolveDialog.java b/src/com/owncloud/android/ui/dialog/ConflictsResolveDialog.java index 7c5f2b281a..dc22812516 100644 --- a/src/com/owncloud/android/ui/dialog/ConflictsResolveDialog.java +++ b/src/com/owncloud/android/ui/dialog/ConflictsResolveDialog.java @@ -21,7 +21,7 @@ package com.owncloud.android.ui.dialog; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; diff --git a/src/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java b/src/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java index ac1e312d49..7b58f4d863 100644 --- a/src/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java +++ b/src/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java @@ -25,7 +25,7 @@ import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.resources.files.FileUtils; import com.owncloud.android.ui.activity.ComponentsGetter; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; diff --git a/src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java b/src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java index c12b9dd7f2..609f7215a5 100644 --- a/src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java +++ b/src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java @@ -22,9 +22,9 @@ package com.owncloud.android.ui.dialog; import com.owncloud.android.R; import com.owncloud.android.authentication.AuthenticatorActivity; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; -import android.app.AlertDialog.Builder; +import android.support.v7.app.AlertDialog.Builder; import android.content.DialogInterface; import android.os.Bundle; import android.support.v4.app.DialogFragment; diff --git a/src/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java b/src/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java index d4bf31c2c5..24e1b14d50 100644 --- a/src/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java +++ b/src/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java @@ -25,7 +25,7 @@ package com.owncloud.android.ui.dialog; * * Triggers the rename operation. */ -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; diff --git a/src/com/owncloud/android/ui/dialog/ShareLinkToDialog.java b/src/com/owncloud/android/ui/dialog/ShareLinkToDialog.java index 29b591d201..a315a1d5f2 100644 --- a/src/com/owncloud/android/ui/dialog/ShareLinkToDialog.java +++ b/src/com/owncloud/android/ui/dialog/ShareLinkToDialog.java @@ -25,7 +25,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.content.ComponentName; import android.content.Context; diff --git a/src/com/owncloud/android/ui/dialog/SharePasswordDialogFragment.java b/src/com/owncloud/android/ui/dialog/SharePasswordDialogFragment.java index d2d29fef6e..d069b5a0bc 100644 --- a/src/com/owncloud/android/ui/dialog/SharePasswordDialogFragment.java +++ b/src/com/owncloud/android/ui/dialog/SharePasswordDialogFragment.java @@ -18,7 +18,7 @@ */ package com.owncloud.android.ui.dialog; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; diff --git a/src/com/owncloud/android/ui/dialog/UploadSourceDialogFragment.java b/src/com/owncloud/android/ui/dialog/UploadSourceDialogFragment.java index 7eb861c9b7..5b01c8f7e0 100644 --- a/src/com/owncloud/android/ui/dialog/UploadSourceDialogFragment.java +++ b/src/com/owncloud/android/ui/dialog/UploadSourceDialogFragment.java @@ -20,7 +20,7 @@ package com.owncloud.android.ui.dialog; import android.accounts.Account; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; diff --git a/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java b/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java index d87b82cbec..679308a2ef 100644 --- a/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java @@ -21,7 +21,7 @@ package com.owncloud.android.ui.preview; import android.accounts.Account; import android.app.Activity; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; diff --git a/src/com/owncloud/android/ui/preview/PreviewVideoActivity.java b/src/com/owncloud/android/ui/preview/PreviewVideoActivity.java index 938d52d484..42b7fb28dc 100644 --- a/src/com/owncloud/android/ui/preview/PreviewVideoActivity.java +++ b/src/com/owncloud/android/ui/preview/PreviewVideoActivity.java @@ -26,7 +26,7 @@ import com.owncloud.android.media.MediaService; import com.owncloud.android.ui.activity.FileActivity; import android.accounts.Account; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.media.MediaPlayer;