Reputation: 2258
I've implemented ChrisBanes' pull-to-refresh using a Stock Action Bar.
However, after the pull, the "Loading..." message appears and covers all my action bar buttons. This is great, and what I expect. However, if I touch the action bar where I know the buttons normally are, they behave just as if the buttons were there.
How can I get the 'loading...' actionbar header to consume all touch events?
Upvotes: 0
Views: 80
Reputation: 30794
How can I get the 'loading...' actionbar header to consume all touch events?
The reason it doesn't to begin with is due to how the View
is added to the Window
. When PullToRefreshAttacher
creates the WindowManager.LayoutParams
used for calling WindowManager.addView(View, LayoutParams)
, it uses the flag:
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
Which as per the docs indicates:
Window flag: this window can never receive touch events.
So, if you want the header view to consume touch events, you'll have to modify the PullToRefreshAttacher
and remove this flag.
Upvotes: 1