OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.photo_picker; |
| 6 |
| 7 import android.content.Context; |
| 8 import android.os.Bundle; |
| 9 import android.support.v7.app.AlertDialog; |
| 10 import android.view.ViewGroup.LayoutParams; |
| 11 import android.view.WindowManager; |
| 12 |
| 13 import org.chromium.chrome.R; |
| 14 import org.chromium.ui.PhotoPickerListener; |
| 15 |
| 16 /** |
| 17 * UI for the photo chooser that shows on the Android platform as a result of |
| 18 * <input type=file accept=image > form element. |
| 19 */ |
| 20 public class PhotoPickerDialog extends AlertDialog { |
| 21 // The category we're showing photos for. |
| 22 private PickerCategoryView mCategoryView; |
| 23 |
| 24 /** |
| 25 * The PhotoPickerDialog constructor. |
| 26 * @param context The context to use. |
| 27 * @param listener The listener object that gets notified when an action is
taken. |
| 28 * @param multiSelectionAllowed Whether the photo picker should allow multip
le items to be |
| 29 * selected. |
| 30 */ |
| 31 public PhotoPickerDialog( |
| 32 Context context, PhotoPickerListener listener, boolean multiSelectio
nAllowed) { |
| 33 super(context, R.style.FullscreenWhite); |
| 34 |
| 35 // Initialize the main content view. |
| 36 mCategoryView = new PickerCategoryView(context); |
| 37 mCategoryView.initialize(this, listener, multiSelectionAllowed); |
| 38 setView(mCategoryView); |
| 39 } |
| 40 |
| 41 @Override |
| 42 protected void onCreate(Bundle savedInstanceState) { |
| 43 super.onCreate(savedInstanceState); |
| 44 |
| 45 getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARE
NT); |
| 46 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, |
| 47 WindowManager.LayoutParams.FLAG_FULLSCREEN); |
| 48 } |
| 49 } |
OLD | NEW |