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

Side by Side Diff: ui/android/java/src/org/chromium/ui/text/NoUnderlineClickableSpan.java

Issue 1739523002: WebUsb Android chooser UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.ui.text;
6
7 import android.graphics.Color;
8 import android.text.TextPaint;
9 import android.text.style.ClickableSpan;
10 import android.view.View;
11
12 /**
13 * Show a clickable link with underlines turned off.
14 */
15 public class NoUnderlineClickableSpan extends ClickableSpan {
16 @Override
17 public void onClick(View view) {
18 // Get rid of the highlight background on selection.
19 view.invalidate();
newt (away) 2016/03/15 19:03:54 Why is this needed? Are you copying this from some
Finnur 2016/03/15 21:11:26 My ears are burning... ;) It was definitely usefu
newt (away) 2016/03/15 21:24:45 Ahhhh, thanks for explaining. So this *might* be n
juncai 2016/03/16 00:40:36 I did some test and it seems that this is needed f
20 }
21
22 // Disable underline on the link text.
23 @Override
24 public void updateDrawState(TextPaint textPaint) {
25 super.updateDrawState(textPaint);
26 textPaint.bgColor = Color.TRANSPARENT;
newt (away) 2016/03/15 19:03:54 Also, why set the background color to transparent?
Finnur 2016/03/15 21:11:26 Might be related to the above, not sure. Don't rem
juncai 2016/03/16 00:40:36 I did some test and it seems that with or without
Finnur 2016/03/16 13:35:14 Like I said. Coo coo crazy. ;)
newt (away) 2016/03/16 17:17:16 I'm sure there was a reason at the time :)
27 textPaint.setUnderlineText(false);
28 }
29 }
OLDNEW
« chrome/browser/ui/android/usb_chooser_android.h ('K') | « device/usb/webusb_descriptors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698