Android Open Source - drive-android-svg My Path






From Project

Back to project page drive-android-svg.

License

The source code is released under:

Apache License

If you think the Android project drive-android-svg listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.goodow.drive.android.svg.graphics;
/* w  w  w .j a  v a 2 s. c  o m*/
import android.graphics.Point;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by liudenghui on 14-6-3.
 */
public class MyPath extends MyBaseShape {
  private List<Point> points = new ArrayList<Point>();

  public void addPoint(Point point) {
    points.add(point);
  }

  public List<Point> getPoints() {
    return points;
  }

  @Override
  public void generatePath() {
    path.reset();
    path.moveTo(points.get(0).x, points.get(0).y);
    for (int i = 1; i < points.size(); i++) {
      path.quadTo((points.get(i - 1).x + points.get(i).x) / 2, (points.get(i - 1).y + points.get(i).y) / 2, points.get(i).x, points.get(i).y);
    }
    path.computeBounds(bounds, true);
    matrix.setRotate(rotate, bounds.centerX(), bounds.centerY());
    path.transform(matrix);
    path.computeBounds(bounds, true);
  }
}




Java Source Code List

com.goodow.drive.android.svg.DriveAndroidSvgModule.java
com.goodow.drive.android.svg.OnRemoteChangeListener.java
com.goodow.drive.android.svg.OnShowPopupListener.java
com.goodow.drive.android.svg.SvgMainActivity.java
com.goodow.drive.android.svg.SvgModule.java
com.goodow.drive.android.svg.graphics.MyBaseShape.java
com.goodow.drive.android.svg.graphics.MyEllipse.java
com.goodow.drive.android.svg.graphics.MyLine.java
com.goodow.drive.android.svg.graphics.MyPath.java
com.goodow.drive.android.svg.graphics.MyRect.java
com.goodow.drive.android.svg.samples.demo.MainActivity.java
com.goodow.drive.android.svg.utils.CoordinateUtil.java
com.goodow.drive.android.svg.utils.DrawUtil.java
com.goodow.drive.android.svg.utils.ParseUtil.java
com.goodow.drive.android.svg.utils.SwitchUtil.java
com.goodow.drive.android.svg.view.FillColorDialog.java
com.goodow.drive.android.svg.view.LeftMenuLayout.java
com.goodow.drive.android.svg.view.MyDrawable.java
com.goodow.drive.android.svg.view.MySurfaceView.java
com.goodow.drive.android.svg.view.MyViewGroup.java
com.goodow.drive.android.svg.view.MyView.java
com.goodow.drive.android.svg.view.StrokeColorDialog.java
com.goodow.drive.android.svg.view.StrokeWidthDialog.java