I am developing a drawing application and i'm using android's gesture for the same. So if i want to change the gesture color at runtime the old gestures which i have already drawn is also taking the new color. Any solution for the same?
Below is my gesture in xml
<android.gesture.GestureOverlayView
android:id="@+id/gestures_overlay1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:eventsInterceptionEnabled="true"
android:fadeEnabled="false"
android:fadeOffset="5000000000"
android:gestureStrokeAngleThreshold="0"
android:gestureStrokeLengthThreshold="0"
android:gestureStrokeSquarenessThreshold="0"
android:gestureStrokeType="multiple"
android:gestureStrokeWidth="2"
android:orientation="vertical" />
And my gesture in java call is like
overlay = (GestureOverlayView) findViewById(R.id.gestures_overlay1);
overlay.addOnGesturePerformedListener(this);
overlay.setGestureStrokeWidth(stroke);
overlay.setGestureColor(color);
overlay.setDrawingCacheEnabled(true);
I was facing the same problem to change the gesture color after it's drawn. Found a workaround where you just need to:
1. Get and store the gesture drawn.
2. Set the gesture color of your choice
3. Set the gesture back to your view, that's it!
Hope I am not too late found this though..
Gesture gesture = signGesture.getGesture();
signGesture.setGestureColor(Color.parseColor("#FFFF0000"));
signGesture.setGesture(gesture);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With