mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 12:20:51 +01:00
adding some floating contextual menu related fixes
This commit is contained in:
parent
291de123c2
commit
096685dc2a
@ -70,7 +70,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:b30a1e0b37'
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:d04f40487b'
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||
|
@ -38,7 +38,7 @@ class ManageEventTypesAdapter(
|
||||
}
|
||||
|
||||
when (id) {
|
||||
R.id.cab_edit -> itemClick.invoke(getSelectedItems().first())
|
||||
R.id.cab_edit -> editEventType()
|
||||
R.id.cab_delete -> askConfirmDelete()
|
||||
}
|
||||
}
|
||||
@ -90,6 +90,7 @@ class ManageEventTypesAdapter(
|
||||
}
|
||||
|
||||
private fun showPopupMenu(view: View, eventType: EventType) {
|
||||
finishActMode()
|
||||
val theme = activity.getPopupMenuTheme()
|
||||
val contextTheme = ContextThemeWrapper(activity, theme)
|
||||
|
||||
@ -116,11 +117,16 @@ class ManageEventTypesAdapter(
|
||||
}
|
||||
|
||||
private fun executeItemMenuOperation(eventTypeId: Int, callback: () -> Unit) {
|
||||
finishActMode()
|
||||
selectedKeys.clear()
|
||||
selectedKeys.add(eventTypeId)
|
||||
callback()
|
||||
}
|
||||
|
||||
private fun editEventType() {
|
||||
itemClick.invoke(getSelectedItems().first())
|
||||
finishActMode()
|
||||
}
|
||||
|
||||
private fun askConfirmDelete() {
|
||||
val eventTypes = eventTypes.filter { selectedKeys.contains(it.id?.toInt()) }.map { it.id } as ArrayList<Long>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user