Index: ui/android/java/src/org/chromium/ui/text/NoUnderlineClickableSpan.java |
diff --git a/ui/android/java/src/org/chromium/ui/text/NoUnderlineClickableSpan.java b/ui/android/java/src/org/chromium/ui/text/NoUnderlineClickableSpan.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8cf97eba6c62f44535dec0704a8d7d88beae2b7f |
--- /dev/null |
+++ b/ui/android/java/src/org/chromium/ui/text/NoUnderlineClickableSpan.java |
@@ -0,0 +1,29 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.ui.text; |
+ |
+import android.graphics.Color; |
+import android.text.TextPaint; |
+import android.text.style.ClickableSpan; |
+import android.view.View; |
+ |
+/** |
+* Show a clickable link with underlines turned off. |
+*/ |
+public class NoUnderlineClickableSpan extends ClickableSpan { |
+ @Override |
+ public void onClick(View view) { |
+ // Get rid of the highlight background on selection. |
+ view.invalidate(); |
+ } |
+ |
+ // Disable underline on the link text. |
+ @Override |
+ public void updateDrawState(TextPaint textPaint) { |
+ super.updateDrawState(textPaint); |
+ textPaint.bgColor = Color.TRANSPARENT; |
+ textPaint.setUnderlineText(false); |
+ } |
+} |