Commit 0d93be21 authored by Timothy Loh's avatar Timothy Loh Committed by Commit Bot

Remove trailing full stop from modal permission prompts

This patch updates the modal permission prompt ui to not show a trailing
full stop. Since we share the strings with infobar code, for now we just
remove the full stop in code.

Bug: 760360
Change-Id: I6ec4821d7e2f81df76656048bde1bb712dab32dd
Reviewed-on: https://chromium-review.googlesource.com/658169
Commit-Queue: Timothy Loh <timloh@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501559}
parent 0ff0ce95
...@@ -238,12 +238,20 @@ public class PermissionDialogController implements AndroidPermissionRequester.Re ...@@ -238,12 +238,20 @@ public class PermissionDialogController implements AndroidPermissionRequester.Re
String messageText = delegate.getMessageText(); String messageText = delegate.getMessageText();
String linkText = delegate.getLinkText(); String linkText = delegate.getLinkText();
if (!TextUtils.isEmpty(messageText)) fullString.append(messageText); assert !TextUtils.isEmpty(messageText);
// TODO(timloh): Currently the strings are shared with infobars, so we for now manually
// remove the full stop (this code catches most but not all languages). Update the strings
// after removing the infobar path.
if (TextUtils.isEmpty(linkText)
&& (messageText.endsWith(".") || messageText.endsWith("。"))) {
messageText = messageText.substring(0, messageText.length() - 1);
}
// If the linkText exists, then wrap it in a clickable span and concatenate it with the main fullString.append(messageText);
// dialog message.
if (!TextUtils.isEmpty(linkText)) { if (!TextUtils.isEmpty(linkText)) {
if (fullString.length() > 0) fullString.append(" "); // If the linkText exists, then wrap it in a clickable span and concatenate it with the
// main dialog message.
fullString.append(" ");
int spanStart = fullString.length(); int spanStart = fullString.length();
fullString.append(linkText); fullString.append(linkText);
......
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