From 131bd9e62c735aa5ccc9ebb8887d03954ad0d55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey?= Date: Wed, 14 Sep 2022 18:26:11 +0200 Subject: [PATCH] ProfileBottomSheetDialog: fix icon colors and detekt issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Brey --- .../com/owncloud/android/ui/dialog/DialogFragmentIT.java | 3 +-- .../com/owncloud/android/ui/activity/DrawerActivity.java | 3 --- .../android/ui/asynctasks/RetrieveHoverCardAsyncTask.java | 2 -- .../android/ui/fragment/ProfileBottomSheetDialog.kt | 8 +------- 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/app/src/androidTest/java/com/owncloud/android/ui/dialog/DialogFragmentIT.java b/app/src/androidTest/java/com/owncloud/android/ui/dialog/DialogFragmentIT.java index 4e8909fa3d..39b7edc233 100644 --- a/app/src/androidTest/java/com/owncloud/android/ui/dialog/DialogFragmentIT.java +++ b/app/src/androidTest/java/com/owncloud/android/ui/dialog/DialogFragmentIT.java @@ -438,8 +438,7 @@ public class DialogFragmentIT extends AbstractIT { ProfileBottomSheetDialog sut = new ProfileBottomSheetDialog(fda, user, hoverCard, - fda.themeColorUtils, - fda.themeDrawableUtils); + fda.viewThemeUtils); fda.runOnUiThread(sut::show); diff --git a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java index 83fdf6ffe4..effee11cf4 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java @@ -209,9 +209,6 @@ public abstract class DrawerActivity extends ToolbarActivity @Inject ClientFactory clientFactory; - @Inject - ViewThemeUtils viewThemeUtils; - /** * Initializes the drawer, its content and highlights the menu item with the given id. This method needs to be * called after the content view has been set. diff --git a/app/src/main/java/com/owncloud/android/ui/asynctasks/RetrieveHoverCardAsyncTask.java b/app/src/main/java/com/owncloud/android/ui/asynctasks/RetrieveHoverCardAsyncTask.java index bb7c199d35..2b7c32e6c3 100644 --- a/app/src/main/java/com/owncloud/android/ui/asynctasks/RetrieveHoverCardAsyncTask.java +++ b/app/src/main/java/com/owncloud/android/ui/asynctasks/RetrieveHoverCardAsyncTask.java @@ -91,8 +91,6 @@ public class RetrieveHoverCardAsyncTask extends AsyncTask new ProfileBottomSheetDialog(activity, user, hoverCard, - themeColorUtils, - themeDrawableUtils, viewThemeUtils) .show(); } else { diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/ProfileBottomSheetDialog.kt b/app/src/main/java/com/owncloud/android/ui/fragment/ProfileBottomSheetDialog.kt index 4a69016b66..572b3609f5 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/ProfileBottomSheetDialog.kt +++ b/app/src/main/java/com/owncloud/android/ui/fragment/ProfileBottomSheetDialog.kt @@ -39,8 +39,6 @@ import com.owncloud.android.R import com.owncloud.android.databinding.ProfileBottomSheetActionBinding import com.owncloud.android.databinding.ProfileBottomSheetFragmentBinding import com.owncloud.android.utils.DisplayUtils -import com.owncloud.android.utils.theme.ThemeColorUtils -import com.owncloud.android.utils.theme.ThemeDrawableUtils import com.owncloud.android.utils.theme.newm3.ViewThemeUtils /** @@ -50,8 +48,6 @@ class ProfileBottomSheetDialog( private val fileActivity: FragmentActivity, private val user: User, private val hoverCard: HoverCard, - private val themeColorUtils: ThemeColorUtils, - private val themeDrawableUtils: ThemeDrawableUtils, private val viewThemeUtils: ViewThemeUtils ) : BottomSheetDialog(fileActivity), DisplayUtils.AvatarGenerationListener { private var _binding: ProfileBottomSheetFragmentBinding? = null @@ -69,8 +65,6 @@ class ProfileBottomSheetDialog( viewThemeUtils.platform.themeDialog(binding.root) - val primaryColor = themeColorUtils.primaryColor(context, true) - binding.icon.tag = hoverCard.userId DisplayUtils.setAvatar( user, @@ -111,7 +105,7 @@ class ProfileBottomSheetDialog( null ) ) - themeDrawableUtils.tintDrawable(actionBinding.icon.drawable, primaryColor) + viewThemeUtils.platform.tintPrimaryDrawable(context, actionBinding.icon.drawable) creatorView.setOnClickListener { v: View? -> send(hoverCard.userId, action)