| 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.animation.ValueAnimator; | 7 import android.animation.ValueAnimator; |
| 8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
| 9 import android.app.Activity; | 9 import android.app.Activity; |
| 10 import android.app.ActivityManager; | 10 import android.app.ActivityManager; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 | 66 |
| 67 /** | 67 /** |
| 68 * @return True if the running version of the Android supports printing. | 68 * @return True if the running version of the Android supports printing. |
| 69 */ | 69 */ |
| 70 public static boolean isPrintingSupported() { | 70 public static boolean isPrintingSupported() { |
| 71 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; | 71 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; |
| 72 } | 72 } |
| 73 | 73 |
| 74 /** | 74 /** |
| 75 * @return True if the running version of the Android supports HTML clipboar
d. | |
| 76 */ | |
| 77 public static boolean isHTMLClipboardSupported() { | |
| 78 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN; | |
| 79 } | |
| 80 | |
| 81 /** | |
| 82 * @see android.view.View#setLayoutDirection(int) | 75 * @see android.view.View#setLayoutDirection(int) |
| 83 */ | 76 */ |
| 84 public static void setLayoutDirection(View view, int layoutDirection) { | 77 public static void setLayoutDirection(View view, int layoutDirection) { |
| 85 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { | 78 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { |
| 86 view.setLayoutDirection(layoutDirection); | 79 view.setLayoutDirection(layoutDirection); |
| 87 } else { | 80 } else { |
| 88 // Do nothing. RTL layouts aren't supported before JB MR1. | 81 // Do nothing. RTL layouts aren't supported before JB MR1. |
| 89 } | 82 } |
| 90 } | 83 } |
| 91 | 84 |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 Window window = activity.getWindow(); | 474 Window window = activity.getWindow(); |
| 482 if (statusBarColor == Color.BLACK && window.getNavigationBarColor()
== Color.BLACK) { | 475 if (statusBarColor == Color.BLACK && window.getNavigationBarColor()
== Color.BLACK) { |
| 483 window.clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_B
AR_BACKGROUNDS); | 476 window.clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_B
AR_BACKGROUNDS); |
| 484 } else { | 477 } else { |
| 485 window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR
_BACKGROUNDS); | 478 window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR
_BACKGROUNDS); |
| 486 } | 479 } |
| 487 window.setStatusBarColor(statusBarColor); | 480 window.setStatusBarColor(statusBarColor); |
| 488 } | 481 } |
| 489 } | 482 } |
| 490 } | 483 } |
| OLD | NEW |