Skip to content

Commit

Permalink
MOBILEAPPS-2038 (#281)
Browse files Browse the repository at this point in the history
* accessibility action sheet issue fixed

* fixed internet issue
  • Loading branch information
aman-alfresco authored Jul 28, 2023
1 parent 913bf7b commit 8186c8d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<LinearLayout.LayoutParams> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}

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 @@ -34,6 +34,7 @@
<string name="accessibility_text_user_profile">User Profile Button</string>
<string name="accessibility_text_user_info">Username: %s Email: %s</string>
<string name="accessibility_text_close">Close</string>
<string name="close_button_content_description">Clear Selection</string>

<string-array name="settings_sync_network_value_labels">
<item>Wi-Fi only</item>
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -84,8 +84,8 @@ subprojects {

freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"

// Set JVM target to 18
jvmTarget = "18"
// Set JVM target to 17
jvmTarget = "17"
}
}
}
Expand Down

0 comments on commit 8186c8d

Please sign in to comment.