百灵 v1.0.0版本的 MD5 值为:52dfab5df87776411abdee28e290000c
以下内容为反编译后的 URLSpanNoUnderline.java 源代码,内容仅作参考
package im.mzmrebenud.ui.components;
import android.net.Uri;
import android.text.TextPaint;
import android.text.style.URLSpan;
import android.view.View;
import im.mzmrebenud.messenger.browser.Browser;
import im.mzmrebenud.ui.components.TextStyleSpan;
public class URLSpanNoUnderline extends URLSpan {
private TextStyleSpan.TextStyleRun style;
public URLSpanNoUnderline(String url) {
this(url, null);
}
public URLSpanNoUnderline(String url, TextStyleSpan.TextStyleRun run) {
super(url != null ? url.replace((char) 8238, ' ') : url);
this.style = run;
}
@Override
public void onClick(View widget) {
String url = getURL();
if (url.startsWith("@")) {
Uri uri = Uri.parse("https://m12345.com/" + url.substring(1));
Browser.openUrl(widget.getContext(), uri);
return;
}
Browser.openUrl(widget.getContext(), url);
}
@Override
public void updateDrawState(TextPaint p) {
super.updateDrawState(p);
TextStyleSpan.TextStyleRun textStyleRun = this.style;
if (textStyleRun != null) {
textStyleRun.applyStyle(p);
} else {
p.setUnderlineText(false);
}
}
}