From 32d182cbfd739c437ebc00f9e196c8a675d708e1 Mon Sep 17 00:00:00 2001 From: A117870935 Date: Mon, 15 May 2023 01:05:37 +0530 Subject: [PATCH] Customized bottom sheet. --- .../ui/fileactions/FileActionsBottomSheet.kt | 19 ++-- .../GalleryFragmentBottomSheetDialog.kt | 17 ---- .../fragment/OCFileListBottomSheetDialog.java | 12 +-- .../main/res/drawable/ic_encrypted_folder.xml | 12 +++ .../main/res/drawable/ic_file_collection.xml | 12 +++ app/src/main/res/drawable/ic_upload_file.xml | 12 +++ .../res/layout/file_actions_bottom_sheet.xml | 2 + .../layout/file_actions_bottom_sheet_item.xml | 4 +- ...file_list_actions_bottom_sheet_creator.xml | 10 +- ...ile_list_actions_bottom_sheet_fragment.xml | 71 +++++++++++---- .../layout/fragment_gallery_bottom_sheet.xml | 12 ++- ...ring_permissions_bottom_sheet_fragment.xml | 1 + .../main/res/layout/send_share_fragment.xml | 5 +- app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-night/colors.xml | 66 ++++++++++++++ app/src/main/res/values/colors.xml | 91 +++++++++++++++++++ app/src/main/res/values/dims.xml | 4 +- app/src/main/res/values/strings.xml | 1 + 18 files changed, 285 insertions(+), 67 deletions(-) create mode 100644 app/src/main/res/drawable/ic_encrypted_folder.xml create mode 100644 app/src/main/res/drawable/ic_file_collection.xml create mode 100644 app/src/main/res/drawable/ic_upload_file.xml diff --git a/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt b/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt index 4ec9447f7ff2..e5149a2b2a3f 100644 --- a/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt +++ b/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt @@ -33,9 +33,9 @@ import android.view.View import android.view.ViewGroup import android.widget.Toast import androidx.annotation.IdRes -import androidx.appcompat.content.res.AppCompatResources import androidx.core.os.bundleOf import androidx.core.view.isEmpty +import androidx.core.content.res.ResourcesCompat import androidx.core.view.isVisible import androidx.fragment.app.FragmentManager import androidx.fragment.app.setFragmentResult @@ -44,7 +44,6 @@ import androidx.lifecycle.ViewModelProvider import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.client.account.CurrentAccountProvider import com.nextcloud.client.di.Injectable import com.nextcloud.client.di.ViewModelFactory @@ -109,8 +108,6 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable { bottomSheetDialog.behavior.state = BottomSheetBehavior.STATE_EXPANDED bottomSheetDialog.behavior.skipCollapsed = true - viewThemeUtils.platform.colorViewBackground(binding.bottomSheet, ColorRole.SURFACE) - return binding.root } @@ -164,7 +161,11 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable { private fun setMultipleFilesThumbnail() { context?.let { - val drawable = viewThemeUtils.platform.tintDrawable(it, R.drawable.file_multiple, ColorRole.PRIMARY) + // NMC Customization + val drawable = viewThemeUtils.platform.colorDrawable( + ResourcesCompat.getDrawable(it.resources, R.drawable.file_multiple, null)!!, + it.resources.getColor(R.color.primary, null) + ) binding.thumbnailLayout.thumbnail.setImageDrawable(drawable) } } @@ -297,12 +298,8 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable { } text.setText(action.title) if (action.icon != null) { - val drawable = - viewThemeUtils.platform.tintDrawable( - requireContext(), - AppCompatResources.getDrawable(requireContext(), action.icon)!! - ) - icon.setImageDrawable(drawable) + //NMC customization + icon.setImageResource(action.icon) } } return itemBinding.root diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragmentBottomSheetDialog.kt b/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragmentBottomSheetDialog.kt index 9e18426c52d7..7c9b464f4799 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragmentBottomSheetDialog.kt +++ b/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragmentBottomSheetDialog.kt @@ -53,23 +53,6 @@ class GalleryFragmentBottomSheetDialog( } private fun setupLayout() { - viewThemeUtils.platform.colorViewBackground(binding.bottomSheet, ColorRole.SURFACE) - - listOf( - binding.tickMarkShowImages, - binding.tickMarkShowVideos - ).forEach { - viewThemeUtils.platform.colorImageView(it, ColorRole.PRIMARY) - } - - listOf( - binding.btnSelectMediaFolder, - binding.btnHideVideos, - binding.btnHideImages - ).forEach { - viewThemeUtils.material.colorMaterialButtonText(it) - } - when (currentMediaState) { MediaState.MEDIA_STATE_PHOTOS_ONLY -> { binding.tickMarkShowImages.visibility = View.VISIBLE diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetDialog.java b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetDialog.java index 95701987ab50..680155db6f75 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetDialog.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetDialog.java @@ -89,13 +89,6 @@ protected void onCreate(Bundle savedInstanceState) { binding = FileListActionsBottomSheetFragmentBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); - viewThemeUtils.platform.colorImageView(binding.menuIconUploadFiles); - viewThemeUtils.platform.colorImageView(binding.menuIconUploadFromApp); - viewThemeUtils.platform.colorImageView(binding.menuIconDirectCameraUpload); - viewThemeUtils.platform.colorImageView(binding.menuIconScanDocUpload); - viewThemeUtils.platform.colorImageView(binding.menuIconMkdir); - viewThemeUtils.platform.colorImageView(binding.menuIconAddFolderInfo); - binding.addToCloud.setText(getContext().getResources().getString(R.string.add_to_cloud, themeUtils.getDefaultDisplayNameForRootFolder(getContext()))); @@ -149,8 +142,9 @@ protected void onCreate(Bundle savedInstanceState) { binding.menuDirectCameraUpload.setVisibility(View.GONE); } + // not required for NMC // create rich workspace - if (editorUtils.isEditorAvailable(user, + /* if (editorUtils.isEditorAvailable(user, MimeTypeUtil.MIMETYPE_TEXT_MARKDOWN) && file != null && !file.isEncrypted()) { // richWorkspace @@ -167,7 +161,7 @@ protected void onCreate(Bundle savedInstanceState) { } else { binding.menuCreateRichWorkspace.setVisibility(View.GONE); binding.menuCreateRichWorkspaceDivider.setVisibility(View.GONE); - } + } */ setupClickListener(); } diff --git a/app/src/main/res/drawable/ic_encrypted_folder.xml b/app/src/main/res/drawable/ic_encrypted_folder.xml new file mode 100644 index 000000000000..351565589c6a --- /dev/null +++ b/app/src/main/res/drawable/ic_encrypted_folder.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_file_collection.xml b/app/src/main/res/drawable/ic_file_collection.xml new file mode 100644 index 000000000000..8825d1f461cf --- /dev/null +++ b/app/src/main/res/drawable/ic_file_collection.xml @@ -0,0 +1,12 @@ + + + diff --git a/app/src/main/res/drawable/ic_upload_file.xml b/app/src/main/res/drawable/ic_upload_file.xml new file mode 100644 index 000000000000..3c16034fc8f9 --- /dev/null +++ b/app/src/main/res/drawable/ic_upload_file.xml @@ -0,0 +1,12 @@ + + + diff --git a/app/src/main/res/layout/file_actions_bottom_sheet.xml b/app/src/main/res/layout/file_actions_bottom_sheet.xml index 9275cf5a511c..137c2bcd243f 100644 --- a/app/src/main/res/layout/file_actions_bottom_sheet.xml +++ b/app/src/main/res/layout/file_actions_bottom_sheet.xml @@ -26,6 +26,7 @@ style="@style/Widget.Material3.BottomSheet" android:layout_width="match_parent" android:layout_height="wrap_content" + android:background="@color/bottom_sheet_bg_color" android:layout_gravity="bottom" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> @@ -72,6 +73,7 @@ android:ellipsize="middle" android:lines="1" android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" + android:textColor="@color/bottom_sheet_txt_color" tools:text="Test file name which is very very very very very long.pdf" /> diff --git a/app/src/main/res/layout/file_actions_bottom_sheet_item.xml b/app/src/main/res/layout/file_actions_bottom_sheet_item.xml index 8a0186f598e4..e476bb4e2e27 100644 --- a/app/src/main/res/layout/file_actions_bottom_sheet_item.xml +++ b/app/src/main/res/layout/file_actions_bottom_sheet_item.xml @@ -44,7 +44,7 @@ android:layout_width="@dimen/iconized_single_line_item_icon_size" android:layout_height="@dimen/iconized_single_line_item_icon_size" android:contentDescription="@null" - app:tint="@color/primary" + app:tint="@color/bottom_sheet_icon_color" tools:src="@drawable/ic_delete" /> diff --git a/app/src/main/res/layout/file_list_actions_bottom_sheet_creator.xml b/app/src/main/res/layout/file_list_actions_bottom_sheet_creator.xml index 50aafa58aefa..0050ddfb0d19 100644 --- a/app/src/main/res/layout/file_list_actions_bottom_sheet_creator.xml +++ b/app/src/main/res/layout/file_list_actions_bottom_sheet_creator.xml @@ -22,12 +22,15 @@ @@ -36,8 +39,7 @@ android:id="@+id/creator_thumbnail" android:layout_width="24dp" android:layout_height="24dp" - android:layout_marginTop="@dimen/standard_margin" - android:layout_marginBottom="@dimen/standard_margin" + app:tint="@color/bottom_sheet_icon_color" android:contentDescription="@null" android:src="@drawable/file_ppt" /> @@ -46,8 +48,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginStart="@dimen/bottom_sheet_text_start_margin" + android:layout_marginStart="@dimen/standard_margin" android:text="@string/create_new_presentation" - android:textColor="@color/text_color" + android:textColor="@color/bottom_sheet_txt_color" android:textSize="@dimen/bottom_sheet_text_size" /> diff --git a/app/src/main/res/layout/file_list_actions_bottom_sheet_fragment.xml b/app/src/main/res/layout/file_list_actions_bottom_sheet_fragment.xml index 2c3418d84562..e8fc3d1152b3 100644 --- a/app/src/main/res/layout/file_list_actions_bottom_sheet_fragment.xml +++ b/app/src/main/res/layout/file_list_actions_bottom_sheet_fragment.xml @@ -22,6 +22,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="@color/bottom_sheet_bg_color" android:orientation="vertical" android:paddingBottom="@dimen/standard_half_padding" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> @@ -38,7 +39,8 @@ android:paddingBottom="@dimen/standard_half_padding" android:text="@string/add_to_cloud" android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" - android:textColor="@color/text_color" /> + android:textColor="@color/text_color" + android:visibility="gone" /> @@ -70,8 +72,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@null" - android:src="@drawable/ic_action_upload" - app:tint="@color/primary" /> + android:src="@drawable/ic_upload_file" + app:tint="@color/bottom_sheet_icon_color" /> @@ -102,8 +104,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@null" - android:src="@drawable/ic_import" - app:tint="@color/primary" /> + android:src="@drawable/ic_file_collection" + app:tint="@color/bottom_sheet_icon_color" /> @@ -135,7 +137,7 @@ android:layout_height="wrap_content" android:contentDescription="@null" android:src="@drawable/ic_camera" - app:tint="@color/primary" /> + app:tint="@color/bottom_sheet_icon_color" /> @@ -198,7 +200,7 @@ android:layout_height="wrap_content" android:contentDescription="@null" android:src="@drawable/ic_action_create_dir" - app:tint="@color/primary" /> + app:tint="@color/bottom_sheet_icon_color" /> + + + + + + + @@ -275,7 +308,7 @@ android:layout_gravity="center_vertical" android:layout_marginStart="@dimen/bottom_sheet_text_start_margin" android:text="@string/create_new_spreadsheet" - android:textColor="@color/text_color" + android:textColor="@color/bottom_sheet_txt_color" android:textSize="@dimen/bottom_sheet_text_size" /> @@ -305,7 +338,7 @@ android:layout_gravity="center_vertical" android:layout_marginStart="@dimen/bottom_sheet_text_start_margin" android:text="@string/create_new_presentation" - android:textColor="@color/text_color" + android:textColor="@color/bottom_sheet_txt_color" android:textSize="@dimen/bottom_sheet_text_size" /> @@ -332,7 +365,8 @@ android:layout_marginStart="@dimen/bottom_sheet_menu_item_divider_standard_margin" android:layout_marginTop="@dimen/standard_half_margin" android:layout_marginBottom="@dimen/standard_half_margin" - android:background="@color/list_divider_background" /> + android:background="@color/list_divider_background" + android:visibility="gone" /> diff --git a/app/src/main/res/layout/fragment_gallery_bottom_sheet.xml b/app/src/main/res/layout/fragment_gallery_bottom_sheet.xml index e398f974997a..3839118f3af9 100644 --- a/app/src/main/res/layout/fragment_gallery_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_gallery_bottom_sheet.xml @@ -59,7 +59,9 @@ android:text="@string/show_images" app:iconPadding="@dimen/standard_half_padding" android:textSize="@dimen/bottom_sheet_text_size" - app:icon="@drawable/ic_camera" /> + android:textColor="@color/bottom_sheet_txt_color" + app:icon="@drawable/ic_camera" + app:iconTint="@color/bottom_sheet_icon_color"/> + android:textColor="@color/bottom_sheet_txt_color" + app:icon="@drawable/ic_video_camera" + app:iconTint="@color/bottom_sheet_icon_color"/> + android:textColor="@color/bottom_sheet_txt_color" + app:icon="@drawable/nav_photos" + app:iconTint="@color/bottom_sheet_icon_color"/> diff --git a/app/src/main/res/layout/send_share_fragment.xml b/app/src/main/res/layout/send_share_fragment.xml index 90623691f0fb..2d0a0dcf6a77 100644 --- a/app/src/main/res/layout/send_share_fragment.xml +++ b/app/src/main/res/layout/send_share_fragment.xml @@ -28,6 +28,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" + android:background="@color/bottom_sheet_bg_color" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> Neu erstellen Neues Dokument erstellen Neuen Ordner erstellen + Verschlüsselten Ordner erstellen Neue Präsentation erstellen Neue Tabelle erstellen Ordnerinfo hinzufügen diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 08bf64d552ad..88a29668c4cd 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -48,4 +48,70 @@ #1E1E1E @android:color/white + + + #FFFFFF + @color/grey_30 + @color/grey_30 + #CCCCCC + @color/grey_70 + @color/grey_80 + #2D2D2D + @color/grey_70 + @color/grey_70 + + + @color/grey_80 + @color/grey_0 + + + @color/grey_80 + @color/grey_0 + + + @color/grey_60 + @color/grey_0 + @color/grey_0 + @color/grey_30 + #FFFFFF + @color/grey_30 + @color/grey_80 + #FFFFFF + + + @color/grey_80 + @color/grey_30 + @color/grey_0 + + + @color/grey_80 + @color/grey_0 + @color/grey_80 + + + @color/grey_70 + @color/grey_60 + @color/grey_70 + @color/grey_60 + + + @color/grey_70 + @color/grey_70 + + + #FFFFFF + @color/grey_30 + @color/grey_0 + @color/grey_0 + @color/grey_0 + @color/grey_0 + @color/grey_60 + @color/grey_0 + #FFFFFF + + + #121212 + @color/grey_0 + @color/grey_80 + @color/grey_80 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index d72d9d458f83..0ae14280757c 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -80,4 +80,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 diff --git a/app/src/main/res/values/dims.xml b/app/src/main/res/values/dims.xml index f8d61805bd55..2f3db8d3a796 100644 --- a/app/src/main/res/values/dims.xml +++ b/app/src/main/res/values/dims.xml @@ -20,8 +20,8 @@ 164dp 12sp 20dp - 40dp - 56dp + 16dp + 48dp 80dp 40dp 128dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d552f8c69bc1..adb686a631ae 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -740,6 +740,7 @@ Scan document from camera Upload content from other apps Create new folder + Create new encrypted folder Virus detected. Upload cannot be completed! Tags Adding sharee failed