Bug 1328515 - Refine fallback margin left/right to include api23, r=sebastian
authormaliu <max@mxli.us>
Wed, 04 Jan 2017 12:04:28 +0800
changeset 456677 f01970b5e82b7c108e70788f501f667fe74cdfe9
parent 456676 8eb9f5ade3dfd8cae7c30da353f8c9e6b22e9e74
child 456678 b6d798426ca0d98b1ae703783bf89aa9bf56407b
push id40575
push userjwwang@mozilla.com
push dateFri, 06 Jan 2017 02:27:46 +0000
reviewerssebastian
bugs1328515
milestone53.0a1
Bug 1328515 - Refine fallback margin left/right to include api23, r=sebastian MozReview-Commit-ID: Ac8FP1fOGa
mobile/android/base/java/org/mozilla/gecko/util/ViewUtil.java
--- a/mobile/android/base/java/org/mozilla/gecko/util/ViewUtil.java
+++ b/mobile/android/base/java/org/mozilla/gecko/util/ViewUtil.java
@@ -36,17 +36,17 @@ public class ViewUtil {
 
     /**
      * Android framework have a bug margin start/end for RTL between 19~22. We can only use MarginLayoutParamsCompat before 17 and after 23.
      * @param layoutParams
      * @param marginStart
      * @param isLayoutRtl
      */
     public static void setMarginStart(ViewGroup.MarginLayoutParams layoutParams, int marginStart, boolean isLayoutRtl) {
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
+        if (AppConstants.Versions.feature17Plus && AppConstants.Versions.preN) {
             if (isLayoutRtl) {
                 layoutParams.rightMargin = marginStart;
             } else {
                 layoutParams.leftMargin = marginStart;
             }
         } else {
             MarginLayoutParamsCompat.setMarginStart(layoutParams, marginStart);
         }