Commit 4ba9b212 authored by parastoog's avatar parastoog Committed by Commit bot

Align text-fields/drop-down-fields on Payment Request form.

-- When we click on a text-field, the title text moves, so the best way
 to make it permanently aligned is to make all the drop-down fields
 take a full line.

BUG=707860

Review-Url: https://codereview.chromium.org/2791363002
Cr-Commit-Position: refs/heads/master@{#462831}
parent b1586e23
......@@ -321,14 +321,19 @@ public class EditorView extends AlwaysDismissedDialog implements OnClickListener
EditorFieldModel nextFieldModel = null;
boolean isLastField = i == mEditorModel.getFields().size() - 1;
boolean useFullLine = fieldModel.isFullLine();
if (!isLastField && !useFullLine) {
// Dropdown fields will take a full line
boolean useFullLine = fieldModel.isFullLine() || isLastField
|| (fieldModel.getInputTypeHint() == EditorFieldModel.INPUT_TYPE_HINT_DROPDOWN);
if (!useFullLine) {
// If the next field isn't full, stretch it out.
nextFieldModel = mEditorModel.getFields().get(i + 1);
if (nextFieldModel.isFullLine()) useFullLine = true;
useFullLine = useFullLine || nextFieldModel.isFullLine()
|| (nextFieldModel.getInputTypeHint()
== EditorFieldModel.INPUT_TYPE_HINT_DROPDOWN);
}
if (useFullLine || isLastField) {
if (useFullLine) {
addFieldViewToEditor(mDataView, fieldModel);
} else {
// Create a LinearLayout to put it and the next view side by side.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment