diff --git a/actions/src/main/kotlin/com/alfresco/content/actions/ContextualActionsSheet.kt b/actions/src/main/kotlin/com/alfresco/content/actions/ContextualActionsSheet.kt index 398b95b9c..60512d90c 100644 --- a/actions/src/main/kotlin/com/alfresco/content/actions/ContextualActionsSheet.kt +++ b/actions/src/main/kotlin/com/alfresco/content/actions/ContextualActionsSheet.kt @@ -93,7 +93,7 @@ class ContextualActionsSheet : BottomSheetDialogFragment(), MavericksView { performMultiAction(action) dismiss() } else { - Snackbar.make(binding.root, R.string.message_no_internet, Snackbar.LENGTH_SHORT).show() + dialog?.window?.decorView?.let { Snackbar.make(it, R.string.message_no_internet, Snackbar.LENGTH_SHORT).show() } } } } diff --git a/actions/src/main/kotlin/com/alfresco/content/actions/ContextualActionsSheetExtension.kt b/actions/src/main/kotlin/com/alfresco/content/actions/ContextualActionsSheetExtension.kt index 1399871b9..809a3f8c7 100644 --- a/actions/src/main/kotlin/com/alfresco/content/actions/ContextualActionsSheetExtension.kt +++ b/actions/src/main/kotlin/com/alfresco/content/actions/ContextualActionsSheetExtension.kt @@ -16,7 +16,7 @@ fun ContextualActionsSheet.setHeader(state: ContextualActionsState) { val titleHeader = SpannableString(getString(R.string.title_action_mode, state.entries.size)) titleHeader.setSpan(ForegroundColorSpan(ContextCompat.getColor(requireContext(), R.color.colorActionMode)), 0, titleHeader.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) binding.header.apply { - parentTitle.contentDescription = title.toString() + parentTitle.contentDescription = titleHeader icon.visibility = View.GONE title.text = titleHeader title.updateLayoutParams { diff --git a/app/src/main/java/com/alfresco/content/app/activity/MainActivity.kt b/app/src/main/java/com/alfresco/content/app/activity/MainActivity.kt index 612c17f5a..c4f8ce10b 100644 --- a/app/src/main/java/com/alfresco/content/app/activity/MainActivity.kt +++ b/app/src/main/java/com/alfresco/content/app/activity/MainActivity.kt @@ -51,6 +51,7 @@ import com.alfresco.download.DownloadMonitor import com.alfresco.ui.getColorForAttribute import com.google.android.material.bottomnavigation.BottomNavigationView import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.google.android.material.snackbar.Snackbar import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import java.lang.ref.WeakReference @@ -283,8 +284,8 @@ class MainActivity : AppCompatActivity(), MavericksView, ActionMode.Callback { } override fun onCreateActionMode(mode: ActionMode?, menu: Menu?): Boolean { - mode?.let { - val inflater: MenuInflater = it.menuInflater + mode?.apply { + val inflater: MenuInflater = menuInflater inflater.inflate(R.menu.menu_action_multi_selection, menu) return true } @@ -301,8 +302,14 @@ class MainActivity : AppCompatActivity(), MavericksView, ActionMode.Callback { override fun onActionItemClicked(mode: ActionMode?, item: MenuItem?): Boolean { when (item?.itemId) { R.id.move -> { - viewModel.moveFilesFolder() - disableMultiSelection() + withState(viewModel) { state -> + if (state.isOnline) { + viewModel.moveFilesFolder() + disableMultiSelection() + } else { + Snackbar.make(bottomNav, com.alfresco.content.actions.R.string.message_no_internet, Snackbar.LENGTH_SHORT).show() + } + } return true } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1c72dd091..3bec04485 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -34,6 +34,7 @@ User Profile Button Username: %s Email: %s Close + Clear Selection Wi-Fi only diff --git a/build.gradle b/build.gradle index c01c7b0b9..0ce5b90ff 100644 --- a/build.gradle +++ b/build.gradle @@ -49,8 +49,8 @@ subprojects { targetSdkVersion 33 } compileOptions { - sourceCompatibility JavaVersion.VERSION_18 - targetCompatibility JavaVersion.VERSION_18 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } sourceSets['main'].java.srcDir('src/main/kotlin') @@ -84,8 +84,8 @@ subprojects { freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" - // Set JVM target to 18 - jvmTarget = "18" + // Set JVM target to 17 + jvmTarget = "17" } } }