public PlaybackState getFurthestPlaybackState ( ) { PlaybackState result = null ; for ( PlaybackState state : playbackStateMap . values ( ) ) { if ( result == null || ( ! result . playing && state . playing ) || ( result . position < state . position ) && ( state . playing || ! result . playing ) ) { result = state ; } } return result ; }
Look up the playback state that has reached furthest in the track but give playing players priority over stopped players . This is used to choose the scroll center when auto - scrolling is active .