OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.base; | 5 package org.chromium.base; |
6 | 6 |
7 import android.graphics.drawable.Drawable; | 7 import android.graphics.drawable.Drawable; |
8 import android.os.Build; | 8 import android.os.Build; |
9 import android.view.View; | 9 import android.view.View; |
10 import android.view.ViewGroup.MarginLayoutParams; | 10 import android.view.ViewGroup.MarginLayoutParams; |
(...skipping 24 matching lines...) Expand all Loading... |
35 } | 35 } |
36 | 36 |
37 /** | 37 /** |
38 * @return True if the running version of the Android supports printing. | 38 * @return True if the running version of the Android supports printing. |
39 */ | 39 */ |
40 public static boolean isPrintingSupported() { | 40 public static boolean isPrintingSupported() { |
41 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; | 41 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; |
42 } | 42 } |
43 | 43 |
44 /** | 44 /** |
| 45 * @return True if the running version of the Android supports HTML clipboar
d. |
| 46 */ |
| 47 public static boolean isHTMLClipboardSupported() { |
| 48 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN; |
| 49 } |
| 50 |
| 51 /** |
45 * @see android.view.View#setLayoutDirection(int) | 52 * @see android.view.View#setLayoutDirection(int) |
46 */ | 53 */ |
47 public static void setLayoutDirection(View view, int layoutDirection) { | 54 public static void setLayoutDirection(View view, int layoutDirection) { |
48 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { | 55 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { |
49 view.setLayoutDirection(layoutDirection); | 56 view.setLayoutDirection(layoutDirection); |
50 } else { | 57 } else { |
51 // Do nothing. RTL layouts aren't supported before JB MR1. | 58 // Do nothing. RTL layouts aren't supported before JB MR1. |
52 } | 59 } |
53 } | 60 } |
54 | 61 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 @SuppressWarnings("deprecation") | 232 @SuppressWarnings("deprecation") |
226 public static void removeOnGlobalLayoutListener( | 233 public static void removeOnGlobalLayoutListener( |
227 View view, ViewTreeObserver.OnGlobalLayoutListener listener) { | 234 View view, ViewTreeObserver.OnGlobalLayoutListener listener) { |
228 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { | 235 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { |
229 view.getViewTreeObserver().removeOnGlobalLayoutListener(listener); | 236 view.getViewTreeObserver().removeOnGlobalLayoutListener(listener); |
230 } else { | 237 } else { |
231 view.getViewTreeObserver().removeGlobalOnLayoutListener(listener); | 238 view.getViewTreeObserver().removeGlobalOnLayoutListener(listener); |
232 } | 239 } |
233 } | 240 } |
234 } | 241 } |
OLD | NEW |