Fix event tap ui
This commit is contained in:
@ -147,9 +147,9 @@ class CalendarSettingsFragment : Fragment() {
|
||||
}
|
||||
})
|
||||
|
||||
viewModel.eventAppName.observe(viewLifecycleOwner, Observer {
|
||||
viewModel.openEventDetails.observe(viewLifecycleOwner, Observer {
|
||||
maintainScrollPosition {
|
||||
event_app_label.text = if (it != "") it else getString(R.string.default_calendar_app)
|
||||
open_event_details_label.text = if (it) getString(R.string.default_event_app) else getString(R.string.default_calendar_app)
|
||||
}
|
||||
})
|
||||
|
||||
@ -301,8 +301,15 @@ class CalendarSettingsFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
action_event_app.setOnClickListener {
|
||||
startActivityForResult(Intent(requireContext(), ChooseApplicationActivity::class.java), RequestCode.EVENT_APP_REQUEST_CODE.code)
|
||||
action_open_event_details.setOnClickListener {
|
||||
if (Preferences.showEvents) {
|
||||
BottomSheetMenu<Boolean>(requireContext(), header = getString(R.string.settings_event_app_title)).setSelectedValue(Preferences.openEventDetails)
|
||||
.addItem(getString(R.string.default_event_app), true)
|
||||
.addItem(getString(R.string.default_calendar_app), false)
|
||||
.addOnSelectItemListener { value ->
|
||||
Preferences.openEventDetails = value
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
|
||||
action_calendar_app.setOnClickListener {
|
||||
|
@ -21,10 +21,9 @@ class MainViewModel : ViewModel() {
|
||||
val showDiffTime = Preferences.asLiveData(Preferences::showDiffTime)
|
||||
val showDeclinedEvents = Preferences.asLiveData(Preferences::showDeclinedEvents)
|
||||
val showNextEvent = Preferences.asLiveData(Preferences::showNextEvent)
|
||||
|
||||
val openEventDetails = Preferences.asLiveData(Preferences::openEventDetails)
|
||||
val calendarAppName = Preferences.asLiveData(Preferences::calendarAppName)
|
||||
|
||||
val eventAppName = Preferences.asLiveData(Preferences::eventAppName)
|
||||
|
||||
// Clock Settings
|
||||
val showClock = Preferences.asLiveData(Preferences::showClock)
|
||||
|
@ -156,7 +156,8 @@ class MainWidget : AppWidgetProvider() {
|
||||
val mapIntent = PendingIntent.getActivity(context, widgetID, IntentHelper.getGoogleMapsIntentFromAddress(context, nextEvent.address), 0)
|
||||
views.setOnClickPendingIntent(R.id.second_row_rect, mapIntent)
|
||||
} else {
|
||||
views.setOnClickPendingIntent(R.id.second_row_rect, pIntent)
|
||||
val pIntentDetail = PendingIntent.getActivity(context, widgetID, IntentHelper.getEventIntent(context, nextEvent, forceEventDetails = true), 0)
|
||||
views.setOnClickPendingIntent(R.id.second_row_rect, pIntentDetail)
|
||||
}
|
||||
|
||||
views.setImageViewBitmap(R.id.next_event_rect, BitmapHelper.getBitmapFromView(v.next_event, draw = false))
|
||||
|
Reference in New Issue
Block a user