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