Example usage for android.transition PathMotion PathMotion

List of usage examples for android.transition PathMotion PathMotion

Introduction

In this page you can find the example usage for android.transition PathMotion PathMotion.

Prototype

public PathMotion() 

Source Link

Usage

From source file:com.imczy.customactivitytransition.transition.ChangePosition.java

public ChangePosition() {
    // ? ???//ww  w  . j a v  a  2  s  .com
    setPathMotion(new PathMotion() {
        @Override
        public Path getPath(float startX, float startY, float endX, float endY) {
            Path path = new Path();
            path.moveTo(startX, startY);

            float controlPointX = (startX + endX) / 3;
            float controlPointY = (startY + endY) / 2;

            // ??, (controlPointX, controlPointY) 
            path.quadTo(controlPointX, controlPointY, endX, endY);
            return path;
        }
    });
}

From source file:com.imczy.customactivitytransition.transition.ShareElemReturnChangePosition.java

public ShareElemReturnChangePosition() {
    setPathMotion(new PathMotion() {
        @Override/*www  .j  a v a  2 s.  c  o m*/
        public Path getPath(float startX, float startY, float endX, float endY) {
            Path path = new Path();
            path.moveTo(startX, startY);

            float controlPointX = (startX + endX) / 3;
            float controlPointY = (startY + endY) / 2;

            path.quadTo(controlPointX, controlPointY, endX, endY);
            return path;
        }
    });
}

From source file:andoridhost.imczy.com.activitymaterial.custom.ReturnChangePosition.java

public ReturnChangePosition() {
    setPathMotion(new PathMotion() {
        @Override//  w w  w .  j  av  a  2 s  .  c o m
        public Path getPath(float startX, float startY, float endX, float endY) {
            Path path = new Path();
            path.moveTo(startX, startY);

            Log.d(TAG, "getPath() called with: " + "startX = [" + startX + "], startY = [" + startY
                    + "], endX = [" + endX + "], endY = [" + endY + "]");

            float controlPointX = (startX + endX) / 3;
            float controlPointY = (startY + endY) / 2;

            path.quadTo(controlPointX, controlPointY, endX, endY);
            return path;
        }
    });
}

From source file:andoridhost.imczy.com.activitymaterial.custom.ChangePosition.java

public ChangePosition() {
    setPathMotion(new PathMotion() {
        @Override// ww  w.  j  ava 2s.c  o m
        public Path getPath(float startX, float startY, float endX, float endY) {
            Path path = new Path();
            path.moveTo(startX, startY);

            Log.d(TAG, "getPath() called with: " + "startX = [" + startX + "], startY = [" + startY
                    + "], endX = [" + endX + "], endY = [" + endY + "]");

            float controlPointX = (startX + endX) / 3;
            float controlPointY = (startY + endY) / 2;

            path.quadTo(controlPointX, controlPointY, endX, endY);
            return path;
        }
    });
}