Anyone got examples of using Workflow to render an...
# squarelibraries
g
Anyone got examples of using Workflow to render and trigger actions from an Android action bar menu item? Feels like I want my
LayoutRunner
to be an inner class of the Activity so it can access
invalidateOptionsMenu()
and
onOptionsItemSelected()
but in looking through the samples I didn’t see anything like this. Any pointers? If my
Rendering
includes fields to be rendered in a normal view and fields to toggle an action bar menu item, how should I approach that?
z
Great question, we should probably add a sample for this sort of thing. One way to do this would be to have your
Activity
expose menu selection as an observable, and then in your
LayoutRunner
search up the
Context
chain to find your activity.
If you don’t want to return
true
all the time, just use a custom callback that returns a boolean instead of an
Observable
.
g
Thanks, I’ll play around with that.