Skip to content

Commit

Permalink
Customized bottom sheet.
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder-tsys committed May 16, 2023
1 parent ceb6cd6 commit fe7f4bb
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ 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.isVisible
import androidx.fragment.app.FragmentManager
Expand Down Expand Up @@ -284,12 +283,8 @@ class FileActionsBottomSheet private constructor() : BottomSheetDialogFragment()
}
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())));

Expand Down Expand Up @@ -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
Expand All @@ -167,7 +161,7 @@ protected void onCreate(Bundle savedInstanceState) {
} else {
binding.menuCreateRichWorkspace.setVisibility(View.GONE);
binding.menuCreateRichWorkspaceDivider.setVisibility(View.GONE);
}
} */

setupClickListener();
}
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/drawable/ic_file_collection.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M17.75,0.5L8,0.5L8,3.5L5,3.5L5,6.5L2,6.5L2,21.25C2,22.4925 3.0075,23.5 4.25,23.5L13.25,23.5C14.4925,23.5 15.5,22.4925 15.5,21.25L15.5,20.5L16.25,20.5C17.4925,20.5 18.5,19.4925 18.5,18.25L18.5,17.5L19.25,17.5C20.4925,17.5 21.5,16.4925 21.5,15.25L21.5,4.3635L17.75,0.5ZM14,21.25C14,21.6635 13.6635,22 13.25,22L4.25,22C3.8365,22 3.5,21.6635 3.5,21.25L3.5,8L5,8L5,18.25C5,19.4925 6.0075,20.5 7.25,20.5L14,20.5L14,21.25ZM17,18.25C17,18.6635 16.6635,19 16.25,19L7.25,19C6.8365,19 6.5,18.6635 6.5,18.25L6.5,5L8,5L8,15.25C8,16.4925 9.0075,17.5 10.25,17.5L17,17.5L17,18.25ZM19.25,16L10.25,16C9.8365,16 9.5,15.6635 9.5,15.25L9.5,2L16,2L16,4.1705C16,4.9045 16.595,5.5 17.3295,5.5L20,5.5L20,15.25C20,15.6635 19.6635,16 19.25,16Z"
android:strokeWidth="1"
android:fillColor="#262626"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
</vector>
12 changes: 12 additions & 0 deletions app/src/main/res/drawable/ic_upload_file.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2.5,1L2.5,20C2.5,21.65 3.85,23 5.5,23L15.5,23L20.5,18L20.5,1L2.5,1ZM4,20L4,2.5L19,2.5L19,17L16,17C15.15,17 14.5,17.65 14.5,18.5L14.5,21.5L5.5,21.5C4.65,21.5 4,20.85 4,20Z"
android:strokeWidth="1"
android:fillColor="#262626"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</vector>
4 changes: 3 additions & 1 deletion app/src/main/res/layout/file_actions_bottom_sheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/bottom_sheet_bg_color">

<LinearLayout
android:id="@+id/bottom_sheet"
Expand Down Expand Up @@ -79,6 +80,7 @@
app:layout_constraintStart_toEndOf="@id/thumbnail_container"
app:layout_constraintTop_toTopOf="parent"
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" />

<androidx.core.widget.NestedScrollView
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/file_actions_bottom_sheet_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />

<LinearLayout
Expand All @@ -59,7 +59,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/bottom_sheet_text_start_margin"
android:textColor="@color/text_color"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size"
tools:text="Delete file" />

Expand Down
38 changes: 22 additions & 16 deletions app/src/main/res/layout/file_list_actions_bottom_sheet_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/standard_half_padding"
android:background="@color/bottom_sheet_bg_color"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

<com.google.android.material.bottomsheet.BottomSheetDragHandleView
Expand All @@ -35,6 +36,7 @@
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_half_padding"
android:visibility="gone"
android:text="@string/add_to_cloud"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
android:textColor="@color/text_color" />
Expand All @@ -47,7 +49,7 @@
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:paddingLeft="@dimen/standard_padding"
android:paddingTop="@dimen/standard_half_padding"
android:paddingTop="@dimen/standard_padding"
android:paddingRight="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_half_padding"
tools:ignore="UseCompoundDrawables">
Expand All @@ -57,16 +59,16 @@
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"/>

<TextView
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:text="@string/upload_files"
android:textColor="@color/text_color"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size" />

</LinearLayout>
Expand All @@ -89,16 +91,16 @@
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"/>

<TextView
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:text="@string/upload_content_from_other_apps"
android:textColor="@color/text_color"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size" />

</LinearLayout>
Expand All @@ -122,15 +124,15 @@
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/ic_camera"
app:tint="@color/primary" />
app:tint="@color/bottom_sheet_icon_color" />

<TextView
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:text="@string/upload_direct_camera_upload"
android:textColor="@color/text_color"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size" />

</LinearLayout>
Expand Down Expand Up @@ -185,15 +187,15 @@
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"/>

<TextView
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:text="@string/create_new_folder"
android:textColor="@color/text_color"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size" />

</LinearLayout>
Expand Down Expand Up @@ -232,7 +234,7 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/bottom_sheet_text_start_margin"
android:text="@string/create_new_document"
android:textColor="@color/text_color"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size" />
</LinearLayout>

Expand Down Expand Up @@ -262,7 +264,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" />
</LinearLayout>

Expand Down Expand Up @@ -292,7 +294,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" />
</LinearLayout>
</LinearLayout>
Expand All @@ -318,7 +320,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" />

<LinearLayout
android:id="@+id/menu_create_rich_workspace"
Expand All @@ -328,7 +331,10 @@
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:paddingLeft="@dimen/standard_padding"
android:paddingTop="@dimen/standard_half_padding"
android:paddingRight="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_padding"
android:visibility="gone"
tools:ignore="UseCompoundDrawables">

<ImageView
Expand All @@ -345,7 +351,7 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/bottom_sheet_text_start_margin"
android:text="@string/create_rich_workspace"
android:textColor="@color/text_color"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size"
android:contentDescription="@string/creates_rich_workspace" />

Expand Down
12 changes: 6 additions & 6 deletions app/src/main/res/layout/fragment_gallery_bottom_sheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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" />

<TextView
android:id="@+id/hideImagesTextview"
Expand All @@ -55,7 +55,7 @@
android:layout_marginEnd="30dp"
android:layout_toEndOf="@id/hideImagesImageview"
android:text="@string/show_images"
android:textColor="@color/text_color"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size" />

<ImageView
Expand Down Expand Up @@ -89,7 +89,7 @@
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/ic_video_camera"
app:tint="@color/primary" />
app:tint="@color/bottom_sheet_icon_color" />

<TextView
android:id="@+id/hideVideoTextview"
Expand All @@ -99,7 +99,7 @@
android:layout_marginStart="@dimen/standard_margin"
android:layout_toEndOf="@id/hideVideoImageView"
android:text="@string/show_video"
android:textColor="@color/text_color"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size" />

<ImageView
Expand Down Expand Up @@ -132,15 +132,15 @@
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/nav_photos"
app:tint="@color/primary" />
app:tint="@color/bottom_sheet_icon_color" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/standard_margin"
android:text="@string/select_media_folder"
android:textColor="@color/text_color"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size" />
</LinearLayout>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/send_share_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_default">
android:background="@color/bottom_sheet_bg_color">

<RelativeLayout
android:layout_width="match_parent"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
<color name="nc_grey">#222222</color>
<color name="icon_on_nc_grey">#ffffff</color>

<!-- Bottom Sheet Colors -->
<color name="bottom_sheet_bg_color">@color/grey_80</color>
<color name="bottom_sheet_icon_color">@color/grey_30</color>
<color name="bottom_sheet_txt_color">@color/grey_0</color>

<!-- Multiselect backgrounds -->
<color name="action_mode_background">@color/appbar</color>
<color name="selected_item_background">#373535</color>
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
<!-- Colors -->
<color name="standard_grey">#757575</color>
<color name="actionbar_shadow">#222222</color>
<color name="dark_grey">#101010</color>
<color name="grey_0">#F2F2F2</color>
<color name="grey_10">#E5E5E5</color>
<color name="grey_30">#B2B2B2</color>
<color name="grey_60">#666666</color>
<color name="grey_70">#4C4C4C</color>
<color name="grey_80">#333333</color>
<color name="grey_200">#EEEEEE</color>
<color name="grey_400">#BDBDBD</color>
<color name="grey_600">#666666</color>
Expand All @@ -59,6 +66,11 @@
<color name="nc_grey">#ededed</color>
<color name="icon_on_nc_grey">#000000</color>

<!-- Bottom Sheet Colors -->
<color name="bottom_sheet_bg_color">#FFFFFF</color>
<color name="bottom_sheet_icon_color">#191919</color>
<color name="bottom_sheet_txt_color">#191919</color>

<color name="process_dialog_background">#ffffff</color>
<color name="indicator_dot_selected">#ffffff</color>
<color name="drawer_shadow">#000000</color>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/dims.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dimen name="nav_drawer_header_height">164dp</dimen>
<dimen name="nav_drawer_menu_avatar_radius">12sp</dimen>
<dimen name="list_item_avatar_icon_radius">20dp</dimen>
<dimen name="bottom_sheet_text_start_margin">40dp</dimen>
<dimen name="bottom_sheet_text_start_margin">16dp</dimen>
<dimen name="bottom_sheet_item_height">56dp</dimen>
<dimen name="bottom_sheet_menu_item_divider_standard_margin">80dp</dimen>
<dimen name="bottom_sheet_min_height">112dp</dimen>
Expand Down

0 comments on commit fe7f4bb

Please sign in to comment.