Commit 11503f43 by Zac Chan

Updated android to register tap on text only

parent 2eba8930
...@@ -83,10 +83,9 @@ public class FluttertoastPlugin implements MethodCallHandler { ...@@ -83,10 +83,9 @@ public class FluttertoastPlugin implements MethodCallHandler {
toast.setGravity(Gravity.BOTTOM, 0, 100); toast.setGravity(Gravity.BOTTOM, 0, 100);
} }
TextView text = toast.getView().findViewById(android.R.id.message); final TextView text = toast.getView().findViewById(android.R.id.message);
text.setTextSize(textSize.floatValue()); text.setTextSize(textSize.floatValue());
text.setMaxLines(1); text.setMaxLines(1);
final View toastView = toast.getView();
if(bgcolor != null) { if(bgcolor != null) {
...@@ -102,11 +101,11 @@ public class FluttertoastPlugin implements MethodCallHandler { ...@@ -102,11 +101,11 @@ public class FluttertoastPlugin implements MethodCallHandler {
} }
} }
toastView.setOnTouchListener(new View.OnTouchListener() { text.setOnTouchListener(new View.OnTouchListener() {
@Override @Override
public boolean onTouch(View v, MotionEvent event) { public boolean onTouch(View v, MotionEvent event) {
handler.removeCallbacks(run); handler.removeCallbacks(run);
toastView.setOnTouchListener(null); text.setOnTouchListener(null);
toast.cancel(); toast.cancel();
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment