Question

Is there a way I can get a reference to the Views that onFling has not yet revealed? I'm extending Gallery, and in my onFling method, of course I can get the current View (the one that is showing already). But I haven't found a way to get the views that are about to be flung by. I need to change properties like backgroundColor (it's a Gallery of TextViews).

Was it helpful?

Solution

There's a nifty method for handling each onFocus event in a gallery fling. As each item comes into focus, this will get fired.

thisGallery.setOnItemSelectedListener(new OnItemSelectedListener() {
   @Override
   public void onItemSelected(AdapterView<?> parentView,
                              View selectedItemView,
                              int position,
                              long id) { }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top