| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.ui.base; | 5 package org.chromium.ui.base; |
| 6 | 6 |
| 7 import android.content.res.Configuration; | 7 import android.content.res.Configuration; |
| 8 import android.view.View; | 8 import android.view.View; |
| 9 | 9 |
| 10 import org.chromium.base.ApiCompatibilityUtils; | 10 import org.chromium.base.ApiCompatibilityUtils; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 return sIsLayoutRtl.booleanValue(); | 60 return sIsLayoutRtl.booleanValue(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 /** | 63 /** |
| 64 * Jni binding to base::i18n::GetFirstStrongCharacterDirection | 64 * Jni binding to base::i18n::GetFirstStrongCharacterDirection |
| 65 * @param string String to decide the direction. | 65 * @param string String to decide the direction. |
| 66 * @return One of the UNKNOWN_DIRECTION, RIGHT_TO_LEFT, and LEFT_TO_RIGHT. | 66 * @return One of the UNKNOWN_DIRECTION, RIGHT_TO_LEFT, and LEFT_TO_RIGHT. |
| 67 */ | 67 */ |
| 68 public static int getFirstStrongCharacterDirection(String string) { | 68 public static int getFirstStrongCharacterDirection(String string) { |
| 69 assert string != null; |
| 69 return nativeGetFirstStrongCharacterDirection(string); | 70 return nativeGetFirstStrongCharacterDirection(string); |
| 70 } | 71 } |
| 71 | 72 |
| 72 /** | 73 /** |
| 73 * Jni binding to ui::TimeFormat::TimeRemaining. Converts milliseconds to | 74 * Jni binding to ui::TimeFormat::TimeRemaining. Converts milliseconds to |
| 74 * time remaining format : "3 mins left", "2 days left". | 75 * time remaining format : "3 mins left", "2 days left". |
| 75 * @param timeInMillis time in milliseconds | 76 * @param timeInMillis time in milliseconds |
| 76 * @return time remaining | 77 * @return time remaining |
| 77 */ | 78 */ |
| 78 public static String getDurationString(long timeInMillis) { | 79 public static String getDurationString(long timeInMillis) { |
| 79 return nativeGetDurationString(timeInMillis); | 80 return nativeGetDurationString(timeInMillis); |
| 80 } | 81 } |
| 81 | 82 |
| 82 private static native int nativeGetFirstStrongCharacterDirection(String stri
ng); | 83 private static native int nativeGetFirstStrongCharacterDirection(String stri
ng); |
| 83 | 84 |
| 84 private static native String nativeGetDurationString(long timeInMillis); | 85 private static native String nativeGetDurationString(long timeInMillis); |
| 85 } | 86 } |
| OLD | NEW |