TRsnnPP♥️️ v2.7.0版本的 MD5 值为:b2c0ede0dab6219a3c74c99b83ed6b25
以下内容为反编译后的 URLSpanNoUnderline.java 源代码,内容仅作参考
package im.uslhaplvsp.ui.components;
import android.net.Uri;
import android.text.TextPaint;
import android.text.style.URLSpan;
import android.view.View;
import im.uslhaplvsp.messenger.browser.Browser;
import im.uslhaplvsp.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);
}
}
}