Back to project page android-pathview.
The source code is released under:
Apache License
If you think the Android project android-pathview listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.eftimoff.empty; // w w w .ja v a2 s . c om import android.graphics.Path; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import com.eftimoff.androipathview.PathView; public class SecondActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_second); final PathView pathView = (PathView) findViewById(R.id.pathView); // final Path path = makeConvexArrow(50, 100); // pathView.setPath(path); pathView.setFillAfter(true); pathView.useNaturalColors(); pathView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { pathView.getPathAnimator(). delay(100). duration(1500). interpolator(new AccelerateDecelerateInterpolator()). start(); } }); } private Path makeConvexArrow(float length, float height) { final Path path = new Path(); path.moveTo(0.0f, 0.0f); path.lineTo(length / 4f, 0.0f); path.lineTo(length, height / 2.0f); path.lineTo(length / 4f, height); path.lineTo(0.0f, height); path.lineTo(length * 3f / 4f, height / 2f); path.lineTo(0.0f, 0.0f); path.close(); return path; } }