onLayout is only called when the position is changed within the parent container, but if the parent container itself moves, it's not called. This makes this._page{X,Y} be out of date. In my case, I have a draggable 'window' as the parent of the color picker and moving it around isn't updating this_page{X,Y}. This change makes it so this_page{X,Y} is computed whenever a new color picking gesture begins so that it's always up to date (unless the color picker moves while gesturing but we can take care of that later...).
Hi, thanks for contribution! It looks good, I have tested it and it is working on Android. It would be nice to have such functionality also in holo picker.
onLayout
is only called when the position is changed within the parent container, but if the parent container itself moves, it's not called. This makesthis._page{X,Y}
be out of date. In my case, I have a draggable 'window' as the parent of the color picker and moving it around isn't updatingthis_page{X,Y}
. This change makes it sothis_page{X,Y}
is computed whenever a new color picking gesture begins so that it's always up to date (unless the color picker moves while gesturing but we can take care of that later...).