OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
Theresa
2017/03/28 20:40:28
s/2016/2017
Finnur
2017/03/31 14:26:49
Done.
| |
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 multiSelection True if the photo picker should allow multiple item s to be selected. | |
29 */ | |
30 public PhotoPickerDialog( | |
31 Context context, PhotoPickerListener listener, boolean multiSelectio n) { | |
32 super(context, R.style.FullscreenWhite); | |
33 | |
34 // Initialize the main content view. | |
35 mCategoryView = new PickerCategoryView(context); | |
36 mCategoryView.setStartingState(this, listener, multiSelection); | |
37 setView(mCategoryView); | |
38 } | |
39 | |
40 @Override | |
41 protected void onCreate(Bundle savedInstanceState) { | |
42 super.onCreate(savedInstanceState); | |
43 | |
44 getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARE NT); | |
45 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
46 WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
47 } | |
48 } | |
OLD | NEW |