Bug 1328515 - Refine fallback margin left/right to include api23, r=sebastian draft
authormaliu <max@mxli.us>
Wed, 04 Jan 2017 12:04:28 +0800
changeset 455539 57d5da8ff4e3cb3b0f27a9bd8383719269e7bd00
parent 455176 c91249f41e3766274131a84f9157a4d9d9949520
child 541030 97cac89171f7c18f6771649324aea5fd1de8b620
push id40280
push userbmo:max@mxli.us
push dateWed, 04 Jan 2017 05:36:40 +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);
         }