fix setSortMode range check
Modes are inverted indexes, so we can not use Math.abs()
This commit is contained in:
parent
e5e9ba3022
commit
c0854e2740
@ -560,9 +560,10 @@ public class MediaAdapter
|
|||||||
* is negative, the inverse of the index will be used and sort order will
|
* is negative, the inverse of the index will be used and sort order will
|
||||||
* be reversed.
|
* be reversed.
|
||||||
*/
|
*/
|
||||||
public void setSortMode(int i)
|
public void setSortMode(int mode)
|
||||||
{
|
{
|
||||||
mSortMode = (Math.abs(i) < mSortEntries.length ? i : 0);
|
int index = ( mode < 0 ? ~mode : mode); // 'negative' modes are actually inverted indexes
|
||||||
|
mSortMode = index < mSortEntries.length ? mode : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user