what-the-bank/sources/o/C10965eUa.java

55 lines
2.1 KiB
Java

package o;
import android.text.Layout;
import android.text.Spannable;
import android.text.method.LinkMovementMethod;
import android.text.style.URLSpan;
import android.view.MotionEvent;
import android.widget.TextView;
/* renamed from: o.eUa, reason: case insensitive filesystem */
/* loaded from: classes5.dex */
public final class C10965eUa extends LinkMovementMethod {
private final RVV d;
/* renamed from: o.eUa$RVV */
/* loaded from: classes5.dex */
public interface RVV {
boolean b(String str);
}
public C10965eUa(RVV rvv) {
C14957gcv.e(rvv, "");
this.d = rvv;
}
@Override // android.text.method.LinkMovementMethod, android.text.method.ScrollingMovementMethod, android.text.method.BaseMovementMethod, android.text.method.MovementMethod
public final boolean onTouchEvent(TextView textView, Spannable spannable, MotionEvent motionEvent) {
C14957gcv.e(textView, "");
C14957gcv.e(spannable, "");
C14957gcv.e(motionEvent, "");
if (motionEvent.getAction() == 1) {
int x = (int) motionEvent.getX();
int y = (int) motionEvent.getY();
int totalPaddingLeft = textView.getTotalPaddingLeft();
int totalPaddingTop = textView.getTotalPaddingTop();
int scrollX = textView.getScrollX();
int scrollY = textView.getScrollY();
Layout layout = textView.getLayout();
int offsetForHorizontal = layout.getOffsetForHorizontal(layout.getLineForVertical((y - totalPaddingTop) + scrollY), (x - totalPaddingLeft) + scrollX);
URLSpan[] uRLSpanArr = (URLSpan[]) spannable.getSpans(offsetForHorizontal, offsetForHorizontal, URLSpan.class);
C14957gcv.c(uRLSpanArr, "");
if (!(uRLSpanArr.length == 0)) {
String url = uRLSpanArr[0].getURL();
RVV rvv = this.d;
C14957gcv.c((Object) url, "");
if (rvv.b(url)) {
return true;
}
return super.onTouchEvent(textView, spannable, motionEvent);
}
}
return super.onTouchEvent(textView, spannable, motionEvent);
}
}