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.ui; | 5 package org.chromium.ui; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
9 import android.graphics.Canvas; | 9 import android.graphics.Canvas; |
10 import android.graphics.Rect; | 10 import android.graphics.Rect; |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 * | 326 * |
327 * @param context The application context. | 327 * @param context The application context. |
328 * @param file image capture file. | 328 * @param file image capture file. |
329 * @return URI for |file|. | 329 * @return URI for |file|. |
330 */ | 330 */ |
331 public static Uri getUriForImageCaptureFile(Context context, File file) { | 331 public static Uri getUriForImageCaptureFile(Context context, File file) { |
332 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 | 332 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 |
333 ? ContentUriUtils.getContentUriFromFile(context, file) | 333 ? ContentUriUtils.getContentUriFromFile(context, file) |
334 : Uri.fromFile(file); | 334 : Uri.fromFile(file); |
335 } | 335 } |
| 336 |
| 337 /** |
| 338 * Removes the view from its parent {@link ViewGroup}. No-op if the {@link V
iew} is not yet |
| 339 * attached to the view hierarchy. |
| 340 * |
| 341 * @param view The view to be removed from the parent. |
| 342 */ |
| 343 public static void removeViewFromParent(View view) { |
| 344 ViewGroup parent = (ViewGroup) view.getParent(); |
| 345 if (parent == null) return; |
| 346 parent.removeView(view); |
| 347 } |
336 } | 348 } |
OLD | NEW |