Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just have resolve this problem, here what I do:</p> <pre><code>private float[] mIntervals = { 0f, 0f }; private float drawSpeed = 2f; private int currentPath = -1; private PathMeasure mPathMeasure = new PathMeasure(); private ArrayList&lt;Path&gt; mListPath = new ArrayList&lt;Path&gt;(this.pathCount); @Override protected void onDraw(Canvas canvas) { if (mIntervals[1] &lt;= 0f &amp;&amp; currentPath &lt; (pathCount - 1)) { // Set the current path to draw // getPath(int num) a function to return a path. Path newPath = this.getPath(mListPath.size()); this.mListPath.add(newPath); this.mPathMeasure.setPath(newPath, false); mIntervals[0] = 0; mIntervals[1] = this.mPathMeasure.getLength(); } if (mIntervals[1] &gt; 0) { // draw the previous path int last = this.mListPath.size(); for (int i = 0; i &lt; last; i++) { canvas.drawPath(this.mListPath.get(i), mPaint); } // partially draw the last path this.mPaint.setPathEffect(new DashPathEffect(mIntervals, 0f)); canvas.drawPath(this.mListPath.get(last), mPaint); // Update the path effects values, to draw a little more // on the path. mIntervals[0] += drawSpeed; mIntervals[1] -= drawSpeed; super.invalidate(); } else { // The drawing have been done, draw it entirely for (int i = 0; i &lt; this.mListPath.size(); i++) { canvas.drawPath(this.mListPath.get(i), mPaint); } } } </code></pre> <p>This example, is an adaptation of what I've done (to simplify the example). Hope you will understand it. Since I've just made this function working, It lacks of optimizations and things like that.</p> <p>Hope it will help ;-)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload