Comments (5)
I'm trying to reproduce, but I can't do it. I'm trying with a Nexus 7, Nexus 6 and an LG G2. I setted the sample to use this configuration. Do you know that dragging with 2 fingers is to move the canvas and dragging with one finger is for painting? I'm trying to play with both configurations and I can't reproduce. Can you show me the Layout XML/activity what are you using? I'm really interested in catch this bug.
Edit: are you drawing with one finger and later using a second one? if you are doing this I can see that the line paints and later disappears from the screen
from drawableview.
Here you will find a small video showing the bug: https://dl.dropboxusercontent.com/u/19390574/drawableView_horizontal.mp4
And here's my XML of that view, this is all a fragment that's sitting in a view pager. The config is set to the drawableView inside the onCreateView() method of the Fragment
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/bookmarkIMG"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<me.panavtec.drawableview.DrawableView
android:id="@+id/drawable_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ProgressBar/>
<RelativeLayout>
<TextView/>
<TextView/>
<TextView />
<TextView/>
</RelativeLayout>
<ImageButton/>
</RelativeLayout>
from drawableview.
Ah man! That's the problem you are using a ViewPager so your View Hierarchy is consuming the horizontal event before the view catches it. To solve this, use a custom wrapper for your DrawableView, you can face the same problem if you use a HorizontalScrollView inside a ViewPager or some other component that uses horizontal touches. Here is a solution, make a new class that extends from the DrawableView and override the "dispatchTouchEvent" in this way:
@Override public boolean dispatchTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_MOVE && getParent() != null) {
getParent().requestDisallowInterceptTouchEvent(true);
}
return super.dispatchTouchEvent(event);
}
And in your fragment XML use your new class. Tell me if it works.
from drawableview.
Makes sense, that's what I noticed too when I just finished recording the video but didn't act upon it. To avoid UX confusion Im not going to try and solve this because this is not the only problem that will arise from having both enabled at the same time (scrolling and drawing). I will make the drawable view in a non-moving way over the view pager and then the view pager can be returned to when the drawing is over, much clearer way.
Thanks for helping so far though :)
from drawableview.
You're welcome! for any doubts / requests tell me :)
from drawableview.
Related Issues (20)
- Ability to center canvas on w/h of the view HOT 7
- Set a color for background and canvas border
- supporting adding text
- Thanks guy!
- setBackgroundColor does not have an effect on the obtained bitmap HOT 2
- [SOLVED] Black Image in saved bitmap HOT 3
- appear android.os.BadParcelableException error HOT 2
- Saving Background bitmap with drawn paint causes the app to crash? HOT 1
- Maven Central artifact is dirty
- Drawableview no track
- Can we set a bitmap as the canvas background? HOT 1
- :( HOT 1
- Run very very slow if you use a background
- Disable Touch Listener
- Referenced class is missing
- How to set the color that has been drawn?
- what is the Lib version and the mvn central badge HOT 1
- ERROR: Failed to resolve: me.panavtec:drawableview:0.6.0
- Can't draw if widget are inside NestedScrollView
- Parcelable protocol requires that the class implements Parcelable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drawableview.