Skip to content

Commit

Permalink
Bottom sheet item height fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder-tsys committed Jun 27, 2023
1 parent 60f044b commit 3b41292
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import android.widget.Toast
import androidx.annotation.IdRes
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
Expand All @@ -43,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
Expand Down Expand Up @@ -159,7 +159,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)
}
}
Expand Down Expand Up @@ -195,7 +199,6 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {
if (state is FileActionsViewModel.UiState.Loading) {
binding.bottomSheetLoading.isVisible = true
binding.bottomSheetContent.isVisible = false
viewThemeUtils.platform.colorCircularProgressBar(binding.bottomSheetLoading, ColorRole.PRIMARY)
} else {
binding.bottomSheetLoading.isVisible = false
binding.bottomSheetContent.isVisible = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ class GalleryFragmentBottomSheetDialog(
}

fun setupLayout() {
listOf(
binding.tickMarkShowImages,
binding.tickMarkShowVideo,
binding.hideImagesImageview,
binding.hideVideoImageView,
binding.selectMediaFolderImageView
).forEach {
viewThemeUtils.platform.colorImageView(it)
}

when (currentMediaState) {
MediaState.MEDIA_STATE_PHOTOS_ONLY -> {
binding.tickMarkShowImages.visibility = View.VISIBLE
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/drawable/ic_encrypted_folder.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="M4,21.75a3,3 0,0 1,-3 -3L1,2.25L7.5,2.25a3.65,3.65 0,0 1,2.7 1.2l0.45,0.45a1.43,1.43 0,0 0,0.85 0.35L23,4.25v14.5a3,3 0,0 1,-3 3ZM2.5,18.75a1.46,1.46 0,0 0,1.43 1.5L20,20.25a1.47,1.47 0,0 0,1.5 -1.44L21.5,5.75h-10A2.57,2.57 0,0 1,9.6 4.9l-0.45,-0.45a2.38,2.38 0,0 0,-1.65 -0.7h-5Z"
android:fillColor="#262626"/>
<path
android:pathData="M14.14,16.56L9.86,16.56a1.07,1.07 0,0 1,-1.07 -1.08L8.79,12.09h0.89v-0.71a2.32,2.32 0,0 1,4.64 0v0.71h0.89v3.39A1.07,1.07 0,0 1,14.14 16.56ZM12,13.56a0.54,0.54 0,0 0,-0.54 0.53,0.55 0.55,0 0,0 0.18,0.4v0.68h0.72v-0.68a0.53,0.53 0,0 0,0 -0.75A0.52,0.52 0,0 0,12 13.52ZM12,9.63a1.79,1.79 0,0 0,-1.79 1.79v0.71h3.58v-0.71A1.79,1.79 0,0 0,12 9.59Z"
android:fillColor="#262626"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/creator_container"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_item_height"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="@dimen/standard_half_padding"
android:paddingBottom="@dimen/standard_half_padding"
android:paddingLeft="@dimen/standard_padding"
android:paddingRight="@dimen/standard_padding"
tools:ignore="UseCompoundDrawables">
Expand All @@ -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" />

Expand All @@ -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" />
</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,37 @@

</LinearLayout>

<LinearLayout
android:id="@+id/menu_encrypted_mkdir"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_item_height"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/standard_padding"
android:paddingTop="@dimen/standard_half_padding"
android:paddingRight="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_half_padding"
tools:ignore="UseCompoundDrawables">

<ImageView
android:id="@+id/menu_icon_encrypted_mkdir"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/ic_encrypted_folder"
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_encrypted_folder"
android:textColor="@color/bottom_sheet_txt_color"
android:textSize="@dimen/bottom_sheet_text_size" />
</LinearLayout>

<LinearLayout
android:id="@+id/templates"
android:layout_width="match_parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bottom_sheet_bg_color"
android:paddingTop="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_padding"
android:orientation="vertical">
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
<string name="create_new">Neu erstellen</string>
<string name="create_new_document">Neues Dokument erstellen</string>
<string name="create_new_folder">Neuen Ordner erstellen</string>
<string name="create_new_encrypted_folder">Verschlüsselten Ordner erstellen</string>
<string name="create_new_presentation">Neue Präsentation erstellen</string>
<string name="create_new_spreadsheet">Neue Tabelle erstellen</string>
<string name="create_rich_workspace">Ordnerinfo hinzufügen</string>
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 @@ -21,7 +21,7 @@
<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">16dp</dimen>
<dimen name="bottom_sheet_item_height">56dp</dimen>
<dimen name="bottom_sheet_item_height">48dp</dimen>
<dimen name="bottom_sheet_menu_item_divider_standard_margin">80dp</dimen>
<dimen name="bottom_sheet_min_height">112dp</dimen>
<dimen name="file_icon_size">40dp</dimen>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@
<string name="upload_scan_doc_upload">Scan document from camera</string>
<string name="upload_content_from_other_apps">Upload content from other apps</string>
<string name="create_new_folder">Create new folder</string>
<string name="create_new_encrypted_folder">Create new encrypted folder</string>
<string name="uploads_view_upload_status_virus_detected">Virus detected. Upload cannot be completed!</string>
<string name="tags">Tags</string>
<string name="sharee_add_failed">Adding sharee failed</string>
Expand Down

0 comments on commit 3b41292

Please sign in to comment.