diff --git a/app/src/main/java/com/nmc/android/utils/FabThemeUtils.kt b/app/src/main/java/com/nmc/android/utils/FabThemeUtils.kt
new file mode 100644
index 000000000000..a8662285ea47
--- /dev/null
+++ b/app/src/main/java/com/nmc/android/utils/FabThemeUtils.kt
@@ -0,0 +1,40 @@
+package com.nmc.android.utils
+
+import android.content.Context
+import android.content.res.ColorStateList
+import android.graphics.Color
+import com.google.android.material.floatingactionbutton.FloatingActionButton
+import com.owncloud.android.R
+
+object FabThemeUtils {
+ @JvmStatic
+ fun colorFloatingActionButton(
+ context: Context,
+ button: FloatingActionButton
+ ) {
+ val primaryColor = context.resources.getColor(R.color.primary, null)
+ val disableColor = context.resources.getColor(R.color.grey_0, null)
+
+ val bgStates = arrayOf(
+ intArrayOf(android.R.attr.state_enabled),
+ intArrayOf(-android.R.attr.state_enabled),
+ )
+ val bgColors = intArrayOf(
+ primaryColor,
+ disableColor
+ )
+
+ button.backgroundTintList = ColorStateList(bgStates, bgColors)
+
+ val imageStates = arrayOf(
+ intArrayOf(android.R.attr.state_enabled),
+ intArrayOf(-android.R.attr.state_enabled),
+ )
+ val imageColors = intArrayOf(
+ Color.WHITE,
+ disableColor
+ )
+
+ button.imageTintList = ColorStateList(imageStates, imageColors)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java
index 3cb523a6e4b3..80713959b374 100644
--- a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java
+++ b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java
@@ -63,6 +63,7 @@
import com.nextcloud.common.NextcloudClient;
import com.nextcloud.ui.fileactions.FileActionsBottomSheet;
import com.nextcloud.utils.EditorUtils;
+import com.nmc.android.utils.FabThemeUtils;
import com.nextcloud.utils.ShortcutUtil;
import com.nextcloud.utils.view.FastScrollUtils;
import com.owncloud.android.MainApp;
@@ -330,7 +331,8 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
if (mFabMain != null) {
// is not available in FolderPickerActivity
- viewThemeUtils.material.themeFAB(mFabMain);
+ //NMC customization
+ FabThemeUtils.colorFloatingActionButton(requireContext(), mFabMain);
}
Log_OC.i(TAG, "onCreateView() end");
@@ -482,7 +484,8 @@ public void registerFabListener() {
if (mFabMain != null) {
// is not available in FolderPickerActivity
- viewThemeUtils.material.themeFAB(mFabMain);
+ //NMC customization
+ FabThemeUtils.colorFloatingActionButton(requireContext(), mFabMain);
mFabMain.setOnClickListener(v -> {
final OCFileListBottomSheetDialog dialog =
new OCFileListBottomSheetDialog(activity,
@@ -1966,7 +1969,8 @@ public void setFabVisible(final boolean visible) {
getActivity().runOnUiThread(() -> {
if (visible) {
mFabMain.show();
- viewThemeUtils.material.themeFAB(mFabMain);
+ //NMC customization
+ FabThemeUtils.colorFloatingActionButton(requireContext(), mFabMain);
} else {
mFabMain.hide();
}
@@ -2016,10 +2020,12 @@ public void setFabEnabled(final boolean enabled) {
getActivity().runOnUiThread(() -> {
if (enabled) {
mFabMain.setEnabled(true);
- viewThemeUtils.material.themeFAB(mFabMain);
+ //NMC customization
+ FabThemeUtils.colorFloatingActionButton(requireContext(), mFabMain);
} else {
mFabMain.setEnabled(false);
- viewThemeUtils.material.themeFAB(mFabMain);
+ //NMC customization
+ FabThemeUtils.colorFloatingActionButton(requireContext(), mFabMain);
}
});
}
diff --git a/app/src/main/java/com/owncloud/android/ui/preview/PreviewTextStringFragment.java b/app/src/main/java/com/owncloud/android/ui/preview/PreviewTextStringFragment.java
index 3d7c5a52d0b6..9ab89f7faf7d 100644
--- a/app/src/main/java/com/owncloud/android/ui/preview/PreviewTextStringFragment.java
+++ b/app/src/main/java/com/owncloud/android/ui/preview/PreviewTextStringFragment.java
@@ -34,6 +34,7 @@
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.nextcloud.android.lib.richWorkspace.RichWorkspaceDirectEditingRemoteOperation;
import com.nextcloud.client.account.UserAccountManager;
+import com.nmc.android.utils.FabThemeUtils;
import com.owncloud.android.R;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.ui.activity.FileDisplayActivity;
@@ -102,7 +103,8 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
fabMain.setOnClickListener(v -> edit());
fabMain.setImageResource(R.drawable.ic_edit);
- viewThemeUtils.material.themeFAB(fabMain);
+ //NMC customization
+ FabThemeUtils.colorFloatingActionButton(requireActivity(), fabMain);
return view;
}
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index f844b3156f33..1ddf1a93ca08 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -81,4 +81,95 @@
@android:color/white
#666666
#A5A5A5
+
+
+ #191919
+ @color/primary
+ #191919
+ #191919
+ @color/grey_30
+ @android:color/white
+ #FFFFFF
+ @color/grey_0
+ #CCCCCC
+ #77c4ff
+ #B3FFFFFF
+ @color/grey_10
+
+
+ #101010
+ #F2F2F2
+ #E5E5E5
+ #B2B2B2
+ #666666
+ #4C4C4C
+ #333333
+
+
+ @color/design_snackbar_background_color
+ @color/white
+
+
+ #FFFFFF
+ #191919
+
+
+ @color/grey_0
+ #191919
+ @color/primary
+ #191919
+ @color/primary
+ @color/grey_30
+ @color/white
+ #191919
+
+
+ #FFFFFF
+ #191919
+ #191919
+
+
+ #FFFFFF
+ #191919
+ #FFFFFF
+
+
+ @color/primary
+ #F399C7
+ @color/grey_0
+ @color/grey_0
+ #FFFFFF
+ @color/grey_30
+ @color/grey_0
+ @color/grey_0
+
+
+ @color/primary
+ @color/grey_30
+ @color/grey_30
+ #CCCCCC
+
+
+ #191919
+ @color/grey_30
+ #191919
+ #191919
+ #191919
+ #191919
+ @color/grey_30
+ #191919
+ #000000
+ #191919
+ #F6E5EB
+ #C16F81
+ #0D39DF
+ #0099ff
+
+
+ @color/grey_0
+ #191919
+ @color/grey_0
+ @color/grey_30
+ #77b6bb
+ #5077b6bb