From 33294957fbc8c4749342ec0a90cff9a9047d18c9 Mon Sep 17 00:00:00 2001 From: Kumar Date: Tue, 3 May 2022 16:02:19 +0530 Subject: [PATCH] Rebased with master and conflicts resolved --- .../com/owncloud/android/ui/activity/ToolbarActivity.java | 4 +++- .../com/owncloud/android/ui/fragment/GalleryFragment.java | 6 ++++-- .../com/owncloud/android/utils/theme/ThemeMenuUtils.java | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java index 4f00914e64..09705355a4 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java @@ -2,9 +2,11 @@ * Nextcloud Android client application * * @author Andy Scherzinger + * @author TSI-mc * Copyright (C) 2016 Andy Scherzinger * Copyright (C) 2016 Nextcloud * Copyright (C) 2016 ownCloud Inc. + * Copyright (C) 2022 TSI-mc * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE @@ -294,6 +296,6 @@ public abstract class ToolbarActivity extends BaseActivity implements Injectable } ActionBar actionBar = getSupportActionBar(); - ThemeToolbarUtils.setColoredSubtitle(actionBar, subtitle, this); + themeToolbarUtils.setColoredSubtitle(actionBar, subtitle, this); } } diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragment.java index e38a22dac1..fe272d451b 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragment.java @@ -76,6 +76,8 @@ public class GalleryFragment extends OCFileListFragment implements GalleryFragme private GalleryFragmentBottomSheetDialog galleryFragmentBottomSheetDialog; @Inject AppPreferences appPreferences; + @Inject ThemeColorUtils themeColorUtils; + @Inject ThemeMenuUtils themeMenuUtils; @Override public void onCreate(Bundle savedInstanceState) { @@ -277,8 +279,8 @@ public class GalleryFragment extends OCFileListFragment implements GalleryFragme MenuItem menuItem = menu.findItem(R.id.action_three_dot_icon); if (menuItem != null) { - ThemeMenuUtils.tintMenuIcon(requireContext(), menuItem, - ThemeColorUtils.appBarPrimaryFontColor(requireContext())); + themeMenuUtils.tintMenuIcon(menuItem, + themeColorUtils.appBarPrimaryFontColor(requireContext())); } } diff --git a/app/src/main/java/com/owncloud/android/utils/theme/ThemeMenuUtils.java b/app/src/main/java/com/owncloud/android/utils/theme/ThemeMenuUtils.java index c9b628d83f..7b862b665f 100644 --- a/app/src/main/java/com/owncloud/android/utils/theme/ThemeMenuUtils.java +++ b/app/src/main/java/com/owncloud/android/utils/theme/ThemeMenuUtils.java @@ -24,7 +24,6 @@ */ package com.owncloud.android.utils.theme; -import android.content.Context; import android.graphics.drawable.Drawable; import android.text.Spannable; import android.text.SpannableString; @@ -54,11 +53,10 @@ public final class ThemeMenuUtils { /** * tinting menu item color * - * @param context * @param item the menu item object * @param color the color wanted as a color resource */ - public static void tintMenuIcon(@NonNull Context context, @NonNull MenuItem item, int color) { + public void tintMenuIcon(@NonNull MenuItem item, int color) { Drawable normalDrawable = item.getIcon(); Drawable wrapDrawable = DrawableCompat.wrap(normalDrawable); DrawableCompat.setTint(wrapDrawable, color);