Commit 3c13ed9c authored by Curt Clemens's avatar Curt Clemens Committed by Commit Bot

[Nearby] Show share target name on confimation page, adjust layout

Remove a line that sets |selectedShareTarget| null on the discovery
page so that the selected share target is preserved on the
confirmation page.

Adjust margins and fix vertical centering of content on the
confimation page. Allow the content to expand horizontally instead of
fixing the width.

Screenshot:
https://screenshot.googleplex.com/B7Dc6rZPPSHkTip.png

Bug: b/163036847
Change-Id: Ie41d7a18026f72c621c7f5801f16f5c09dabdb05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2555803
Commit-Queue: Curt Clemens <cclem@google.com>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarJames Vecore <vecore@google.com>
Cr-Commit-Position: refs/heads/master@{#830723}
parent d64ea965
...@@ -19,42 +19,39 @@ ...@@ -19,42 +19,39 @@
flex-grow: 1; flex-grow: 1;
font-size: 90%; font-size: 90%;
letter-spacing: 0.3px; letter-spacing: 0.3px;
margin-inline-end: -15px; margin-top: 46px;
margin-top: 48px;
padding-top: 6px; padding-top: 6px;
text-align: center; text-align: center;
width: 200px;
}
nearby-preview {
margin-inline-end: 10px;
margin-inline-start: 10px;
} }
nearby-progress { nearby-progress {
margin-top: 8px; width: 116px;
width: 126px;
} }
#centerContent { #centerContent {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; flex-grow: 1;
padding: 27px 32px 25px 37px; margin: 0 32px;
} }
#processRow { #processRow {
display: flex; display: flex;
margin-top: 48px; flex-grow: 1;
}
#processRowContent {
align-self: center;
display: flex;
flex-grow: 1;
margin: 24px 8px;
} }
#errorSection { #errorSection {
align-items: flex-start; align-items: flex-start;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
margin-inline-end: var(--nearby-page-space-inline);
margin-inline-start: var(--nearby-page-space-inline);
padding: 8px; padding: 8px;
} }
...@@ -92,17 +89,19 @@ ...@@ -92,17 +89,19 @@
cancel-button-event-name="[[getCancelEventName_(needsConfirmation_)]]"> cancel-button-event-name="[[getCancelEventName_(needsConfirmation_)]]">
<div id="centerContent" slot="content"> <div id="centerContent" slot="content">
<div id="processRow"> <div id="processRow">
<nearby-preview send-preview="[[sendPreview]]" <div id="processRowContent">
disabled="[[errorTitle_]]"> <nearby-preview send-preview="[[sendPreview]]"
</nearby-preview> disabled="[[errorTitle_]]">
<div id="confirmationToken"> </nearby-preview>
<template is="dom-if" if="[[confirmationToken_]]"> <div id="confirmationToken">
[[i18n('nearbyShareSecureConnectionId', confirmationToken_)]] <template is="dom-if" if="[[confirmationToken_]]">
</template> [[i18n('nearbyShareSecureConnectionId', confirmationToken_)]]
</template>
</div>
<nearby-progress share-target="[[shareTarget]]"
has-error="[[errorTitle_]]">
</nearby-progress>
</div> </div>
<nearby-progress share-target="[[shareTarget]]"
has-error="[[errorTitle_]]">
</nearby-progress>
</div> </div>
<template is="dom-if" if="[[contactName_(shareTarget)]]"> <template is="dom-if" if="[[contactName_(shareTarget)]]">
......
...@@ -233,7 +233,6 @@ Polymer({ ...@@ -233,7 +233,6 @@ Polymer({
this.shareTargetMap_.clear(); this.shareTargetMap_.clear();
} }
this.lastSelectedShareTarget_ = null; this.lastSelectedShareTarget_ = null;
this.selectedShareTarget = null;
this.shareTargets_ = []; this.shareTargets_ = [];
}, },
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
height: 60px; height: 60px;
letter-spacing: 0.2px; letter-spacing: 0.2px;
line-height: 20px; line-height: 20px;
margin-top: 6px;
overflow: hidden; overflow: hidden;
overflow-wrap: break-word; overflow-wrap: break-word;
text-align: center; text-align: center;
......
...@@ -6,15 +6,14 @@ ...@@ -6,15 +6,14 @@
display: -webkit-box; display: -webkit-box;
letter-spacing: 0.25px; letter-spacing: 0.25px;
line-height: 154%; line-height: 154%;
margin-top: 10px;
overflow: hidden; overflow: hidden;
text-align: center; text-align: center;
} }
#icon { #icon {
height: 70px; height: 68px;
margin: auto; margin: auto;
width: 70px; width: 68px;
} }
.has-error #icon { .has-error #icon {
...@@ -24,10 +23,10 @@ ...@@ -24,10 +23,10 @@
#progress-container { #progress-container {
display: flex; display: flex;
height: 80px; height: 76px;
margin: 0 auto; margin: 8px auto 20px auto;
position: relative; position: relative;
width: 80px; width: 76px;
} }
#wheel { #wheel {
......
...@@ -272,7 +272,7 @@ suite('DiscoveryPageTest', function() { ...@@ -272,7 +272,7 @@ suite('DiscoveryPageTest', function() {
assertEquals(null, discoveryPageElement.selectedShareTarget); assertEquals(null, discoveryPageElement.selectedShareTarget);
// Click on fist share target and expect it to be selected. // Click on first share target and expect it to be selected.
assertTrue(clickOnDevice(0)); assertTrue(clickOnDevice(0));
assertShareTargetsEqual( assertShareTargetsEqual(
targets[0], discoveryPageElement.selectedShareTarget); targets[0], discoveryPageElement.selectedShareTarget);
...@@ -281,6 +281,16 @@ suite('DiscoveryPageTest', function() { ...@@ -281,6 +281,16 @@ suite('DiscoveryPageTest', function() {
assertTrue(clickOnDevice(2)); assertTrue(clickOnDevice(2));
assertShareTargetsEqual( assertShareTargetsEqual(
targets[2], discoveryPageElement.selectedShareTarget); targets[2], discoveryPageElement.selectedShareTarget);
const shareTarget = discoveryPageElement.selectedShareTarget;
const onConnectionClosedPromise = new Promise(
(resolve) => listener.onConnectionError.addListener(resolve));
discoveryPageElement.fire('view-exit-finish');
await onConnectionClosedPromise;
// Stopping discovery does not clear selected share target.
assertShareTargetsEqual(
shareTarget, discoveryPageElement.selectedShareTarget);
}); });
test('loosing selected device disables next button', async function() { test('loosing selected device disables next button', async function() {
......
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