OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.payments.ui; | 5 package org.chromium.chrome.browser.payments.ui; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.DialogInterface; | 9 import android.content.DialogInterface; |
10 import android.graphics.Color; | 10 import android.graphics.Color; |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 public void show(final EditorModel editorModel) { | 327 public void show(final EditorModel editorModel) { |
328 setOnDismissListener(this); | 328 setOnDismissListener(this); |
329 mEditorModel = editorModel; | 329 mEditorModel = editorModel; |
330 | 330 |
331 mLayout = (LinearLayout) LayoutInflater.from(mContext).inflate( | 331 mLayout = (LinearLayout) LayoutInflater.from(mContext).inflate( |
332 R.layout.payment_request_editor, null); | 332 R.layout.payment_request_editor, null); |
333 setContentView(mLayout); | 333 setContentView(mLayout); |
334 prepareToolbar(); | 334 prepareToolbar(); |
335 prepareButtons(); | 335 prepareButtons(); |
336 prepareEditor(); | 336 prepareEditor(); |
| 337 getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, |
| 338 ViewGroup.LayoutParams.MATCH_PARENT); |
337 show(); | 339 show(); |
338 | 340 |
339 // Immediately focus the first invalid field to make it faster to edit. | 341 // Immediately focus the first invalid field to make it faster to edit. |
340 final List<EditorFieldView> invalidViews = getViewsWithInvalidInformatio
n(); | 342 final List<EditorFieldView> invalidViews = getViewsWithInvalidInformatio
n(); |
341 if (!invalidViews.isEmpty()) { | 343 if (!invalidViews.isEmpty()) { |
342 mHandler.post(new Runnable() { | 344 mHandler.post(new Runnable() { |
343 @Override | 345 @Override |
344 public void run() { | 346 public void run() { |
345 focusInputField(invalidViews.get(0)); | 347 focusInputField(invalidViews.get(0)); |
346 } | 348 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 } | 380 } |
379 return invalidViews; | 381 return invalidViews; |
380 } | 382 } |
381 | 383 |
382 private void focusInputField(View view) { | 384 private void focusInputField(View view) { |
383 view.requestFocus(); | 385 view.requestFocus(); |
384 view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED); | 386 view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED); |
385 if (mObserverForTest != null) mObserverForTest.onPaymentRequestReadyToEd
it(); | 387 if (mObserverForTest != null) mObserverForTest.onPaymentRequestReadyToEd
it(); |
386 } | 388 } |
387 } | 389 } |
OLD | NEW |