chinwag-android/app/src/main/java/com/keylesspalace/tusky/util/CustomURLSpan.java
Konrad Pozniak 41233a837b
UI Improvements (#445)
UI Improvements
2017-11-30 20:12:09 +01:00

41 lines
1,001 B
Java

package com.keylesspalace.tusky.util;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextPaint;
import android.text.style.URLSpan;
import android.view.View;
public class CustomURLSpan extends URLSpan {
public CustomURLSpan(String url) {
super(url);
}
private CustomURLSpan(Parcel src) {
super(src);
}
public static final Parcelable.Creator<CustomURLSpan> CREATOR = new Parcelable.Creator<CustomURLSpan>() {
@Override
public CustomURLSpan createFromParcel(Parcel source) {
return new CustomURLSpan(source);
}
@Override
public CustomURLSpan[] newArray(int size) {
return new CustomURLSpan[size];
}
};
@Override
public void onClick(View view) {
LinkHelper.openLink(getURL(), view.getContext());
}
@Override public void updateDrawState(TextPaint ds) {
super.updateDrawState(ds);
ds.setUnderlineText(false);
}
}