WhisperSystems/RedPhone — pull request #264 by kevinthecity (2014-02-25 07:11:16+00:00)
Title: Scroll to top when re-selecting a tab

Add UI pattern for scrolling to top when selecting a tab that you are already viewing.

This is accomplished by sending broadcasts from the "onTabReselected" callback in the DialerActivity, and receiving the broadcasts in each of the child fragments. The fragments determine if they should be scrolling to top by extracting the "selected tab position" from the broadcast and comparing it with what "we" know to be that tabs position.

This solution requires magic numbers for determining which list to actually scroll, which I'm generally very against. However, I think there is enough documentation and safeguards to prevent any problems in the future, and I think the benefit to the end user is worth it.