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