diff --git a/mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunPager.java b/mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunPager.java index c2838ee3e021..3e716a7b8172 100644 --- a/mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunPager.java +++ b/mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunPager.java @@ -9,7 +9,6 @@ import android.content.Context; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; -import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; @@ -17,6 +16,8 @@ import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; +import com.booking.rtlviewpager.RtlViewPager; + import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.TelemetryContract; import org.mozilla.gecko.home.HomePager.Decor; @@ -30,7 +31,7 @@ import java.util.List; * * @see FirstrunPanel for the first run pages that are used in this pager. */ -public class FirstrunPager extends ViewPager { +public class FirstrunPager extends RtlViewPager { private Context context; protected FirstrunPanel.PagerNavigation pagerNavigation; @@ -48,7 +49,7 @@ public class FirstrunPager extends ViewPager { @Override public void addView(View child, int index, ViewGroup.LayoutParams params) { if (child instanceof Decor) { - ((ViewPager.LayoutParams) params).isDecor = true; + ((RtlViewPager.LayoutParams) params).isDecor = true; mDecor = (Decor) child; mDecor.setOnTitleClickListener(new TabMenuStrip.OnTitleClickListener() { @Override diff --git a/mobile/android/base/java/org/mozilla/gecko/home/HomePager.java b/mobile/android/base/java/org/mozilla/gecko/home/HomePager.java index cccca47b184b..1e3f3b981618 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/HomePager.java +++ b/mobile/android/base/java/org/mozilla/gecko/home/HomePager.java @@ -28,13 +28,14 @@ import android.support.v4.app.FragmentManager; import android.support.v4.app.LoaderManager; import android.support.v4.app.LoaderManager.LoaderCallbacks; import android.support.v4.content.Loader; -import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; -public class HomePager extends ViewPager implements HomeScreen { +import com.booking.rtlviewpager.RtlViewPager; + +public class HomePager extends RtlViewPager implements HomeScreen { @Override public boolean requestFocus(int direction, Rect previouslyFocusedRect) { @@ -172,7 +173,7 @@ public class HomePager extends ViewPager implements HomeScreen { setFocusableInTouchMode(true); mOriginalBackground = getBackground(); - setOnPageChangeListener(new PageChangeListener()); + addOnPageChangeListener(new PageChangeListener()); mLoadState = LoadState.UNLOADED; } @@ -180,7 +181,7 @@ public class HomePager extends ViewPager implements HomeScreen { @Override public void addView(View child, int index, ViewGroup.LayoutParams params) { if (child instanceof Decor) { - ((ViewPager.LayoutParams) params).isDecor = true; + ((RtlViewPager.LayoutParams) params).isDecor = true; mDecor = (Decor) child; mTabStrip = child; @@ -519,7 +520,7 @@ public class HomePager extends ViewPager implements HomeScreen { } } - private class PageChangeListener implements ViewPager.OnPageChangeListener { + private class PageChangeListener implements RtlViewPager.OnPageChangeListener { @Override public void onPageSelected(int position) { notifyPanelSelected(position); diff --git a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/CirclePageIndicator.java b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/CirclePageIndicator.java index fd7197d0bef3..5ec58d1cee00 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/CirclePageIndicator.java +++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/CirclePageIndicator.java @@ -386,13 +386,13 @@ public class CirclePageIndicator return; } if (mViewPager != null) { - mViewPager.setOnPageChangeListener(null); + mViewPager.removeOnPageChangeListener(this); } if (view.getAdapter() == null) { throw new IllegalStateException("ViewPager does not have adapter instance."); } mViewPager = view; - mViewPager.setOnPageChangeListener(this); + mViewPager.addOnPageChangeListener(this); invalidate(); } diff --git a/mobile/android/base/resources/layout/activity_stream_main_toppanel.xml b/mobile/android/base/resources/layout/activity_stream_main_toppanel.xml index 60c420063c49..bb2e1870a72e 100644 --- a/mobile/android/base/resources/layout/activity_stream_main_toppanel.xml +++ b/mobile/android/base/resources/layout/activity_stream_main_toppanel.xml @@ -6,7 +6,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> -