QS: Fix RTL handling for listening
RTL is hard, math is hard, so yeah... Change-Id: I290c5b05ed5a7f383b9b7ba9a48ed104168a07a3 Fixes: 30478996
This commit is contained in:
@@ -88,9 +88,9 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
|
|||||||
if (mListening == listening) return;
|
if (mListening == listening) return;
|
||||||
mListening = listening;
|
mListening = listening;
|
||||||
if (mListening) {
|
if (mListening) {
|
||||||
mPages.get(mPosition).setListening(listening);
|
setPageListening(mPosition, true);
|
||||||
if (mOffPage) {
|
if (mOffPage) {
|
||||||
mPages.get(mPosition + 1).setListening(listening);
|
setPageListening(mPosition + 1, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Make sure no pages are listening.
|
// Make sure no pages are listening.
|
||||||
@@ -131,6 +131,9 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
|
|||||||
|
|
||||||
private void setPageListening(int position, boolean listening) {
|
private void setPageListening(int position, boolean listening) {
|
||||||
if (position >= mPages.size()) return;
|
if (position >= mPages.size()) return;
|
||||||
|
if (isLayoutRtl()) {
|
||||||
|
position = mPages.size() - 1 - position;
|
||||||
|
}
|
||||||
mPages.get(position).setListening(listening);
|
mPages.get(position).setListening(listening);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user