Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialogTitleView.java

Issue 14886012: Implement layout transition animations for the Autofill dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed rotation logic, wasn't calling super. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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.chrome.browser.autofill; 5 package org.chromium.chrome.browser.autofill;
6 6
7 import java.util.List; 7 import java.util.List;
8 8
9 import android.content.Context; 9 import android.content.Context;
10 import android.view.LayoutInflater; 10 import android.util.AttributeSet;
11 import android.view.View; 11 import android.view.View;
12 import android.widget.ArrayAdapter; 12 import android.widget.ArrayAdapter;
13 import android.widget.FrameLayout; 13 import android.widget.FrameLayout;
14 import android.widget.Spinner; 14 import android.widget.Spinner;
15 import android.widget.AdapterView.OnItemSelectedListener; 15 import android.widget.AdapterView.OnItemSelectedListener;
16 16
17 import org.chromium.chrome.R; 17 import org.chromium.chrome.R;
18 18
19 /** 19 /**
20 * This is the layout that contains the title items for the autofill dialog. 20 * This is the layout that contains the title items for the autofill dialog.
21 * In principle it shouldn't contain any logic related with the 21 * In principle it shouldn't contain any logic related with the
22 * actual workflow, but rather respond to any UI update messages coming to it 22 * actual workflow, but rather respond to any UI update messages coming to it
23 * from the AutofillDialog. It should also be not dependent on the UI state of 23 * from the AutofillDialog. It should also be not dependent on the UI state of
24 * the content. 24 * the content.
25 */ 25 */
26 public class AutofillDialogTitleView extends FrameLayout { 26 public class AutofillDialogTitleView extends FrameLayout {
27 private ArrayAdapter<String> mAdapter; 27 private ArrayAdapter<String> mAdapter;
28 28
29 /** 29 public AutofillDialogTitleView(Context context, AttributeSet attrs) {
30 * Creates a title using the given context with only the default dropdown it ems. 30 super(context, attrs);
31 * @param context The context to create the title within.
32 */
33 public AutofillDialogTitleView(Context context) {
34 super(context);
35 31
36 LayoutInflater.from(context).inflate(R.layout.autofill_dialog_title, thi s, true);
37 Spinner accountsSpinner = (Spinner) findViewById(R.id.accounts_spinner);
38 mAdapter = new ArrayAdapter<String>(context, android.R.layout.simple_spi nner_item); 32 mAdapter = new ArrayAdapter<String>(context, android.R.layout.simple_spi nner_item);
39 mAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdow n_item); 33 mAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdow n_item);
34 }
35
36 @Override
37 protected void onFinishInflate () {
38 Spinner accountsSpinner = (Spinner) findViewById(R.id.accounts_spinner);
40 accountsSpinner.setAdapter(mAdapter); 39 accountsSpinner.setAdapter(mAdapter);
41 accountsSpinner.setEnabled(false); 40 accountsSpinner.setEnabled(false);
42 } 41 }
43 42
44 /** 43 /**
45 * Updates account chooser dropdown with given accounts and creates the titl e view if needed. 44 * Updates account chooser dropdown with given accounts and creates the titl e view if needed.
46 * @param accountNames The dropdown items to be listed. 45 * @param accountNames The dropdown items to be listed.
47 * @param selectedAccountIndex The index of a currently selected account or 46 * @param selectedAccountIndex The index of a currently selected account or
48 * -1 if nothing is selected. 47 * -1 if nothing is selected.
49 */ 48 */
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 82
84 /** 83 /**
85 * Sets the listener for all the dropdown members in the layout. 84 * Sets the listener for all the dropdown members in the layout.
86 * @param listener The listener object to attach to the dropdowns. 85 * @param listener The listener object to attach to the dropdowns.
87 */ 86 */
88 public void setOnItemSelectedListener(OnItemSelectedListener listener) { 87 public void setOnItemSelectedListener(OnItemSelectedListener listener) {
89 Spinner accounts_spinner = (Spinner) findViewById(R.id.accounts_spinner) ; 88 Spinner accounts_spinner = (Spinner) findViewById(R.id.accounts_spinner) ;
90 accounts_spinner.setOnItemSelectedListener(listener); 89 accounts_spinner.setOnItemSelectedListener(listener);
91 } 90 }
92 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698