Package io.didomi.sdk.utils
Class CatchableLinkMovementMethod
- java.lang.Object
-
- android.text.method.BaseMovementMethod
-
- android.text.method.ScrollingMovementMethod
-
- android.text.method.LinkMovementMethod
-
- io.didomi.sdk.utils.CatchableLinkMovementMethod
-
- All Implemented Interfaces:
android.text.method.MovementMethod
public class CatchableLinkMovementMethod extends android.text.method.LinkMovementMethodCustom MovementMethod allowing to check the clicked link before opening the browser. It is based on LinkMovementMethod, only the onTouchEvent is overriden to add a call to the listener before it performs the Open action. Source : http://stackoverflow.com/questions/1697084/handle-textview-link-click-in-my-android-app Core Android source : https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/text/method/LinkMovementMethod.java
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCatchableLinkMovementMethod.OnLinkClickedListenerListener to react to link clicks
-
Constructor Summary
Constructors Constructor Description CatchableLinkMovementMethod(CatchableLinkMovementMethod.OnLinkClickedListener onLinkClickedListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanonTouchEvent(android.widget.TextView widget, android.text.Spannable buffer, android.view.MotionEvent event)-
Methods inherited from class android.text.method.LinkMovementMethod
canSelectArbitrarily, down, getInstance, handleMovementKey, initialize, left, onTakeFocus, right, up
-
Methods inherited from class android.text.method.ScrollingMovementMethod
bottom, end, home, lineEnd, lineStart, pageDown, pageUp, top
-
Methods inherited from class android.text.method.BaseMovementMethod
getMovementMetaState, onGenericMotionEvent, onKeyDown, onKeyOther, onKeyUp, onTrackballEvent
-
-
-
-
Constructor Detail
-
CatchableLinkMovementMethod
public CatchableLinkMovementMethod(@NonNull CatchableLinkMovementMethod.OnLinkClickedListener onLinkClickedListener)- Parameters:
onLinkClickedListener- listener called each time a link is clicked
-
-