I'm building an app based on a card game. A user may look at his own cards; he can also scroll "around the table" to look at the open cards of his opponents. The screen shows one player (the user or one of the opponents) at a time.
I used Gallery to implement it. With a custom adapter, I made it circular. I have also intercepted onFling() to make sure it "flings" to the next player, not further around the table. So far, so good.
Here is the problem. If the element of the gallery is as wide as the entire screen, gallery does not work well. I can't drag the view "slightly" to expose the next player. Most of the time, the fling does not work. When it does, there is no animation; the view just switches to the next player.
I solved it by making gallery elements 2 pixels narrower than the screen. 1 pixel is not enough: it fixes scrolling in one direction, but the other direction is still "stiff".
I'm writing this for two reasons. First, if you have similar problems, this post may save you a few hours. Second, I'm curious: can any of the Android gurus explain this behavior of the Gallery control???