├── sample
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ ├── styles.xml
│ │ │ │ └── dimens.xml
│ │ │ ├── drawable
│ │ │ │ └── toolbar_dropshadow.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ ├── values-v21
│ │ │ │ └── styles.xml
│ │ │ ├── menu
│ │ │ │ └── menu_main.xml
│ │ │ └── layout
│ │ │ │ └── activity_main.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── jp
│ │ │ └── co
│ │ │ └── recruit_lifesytle
│ │ │ └── sample
│ │ │ └── MainActivity.java
│ └── androidTest
│ │ └── java
│ │ └── jp
│ │ └── co
│ │ └── recruit_lifesytle
│ │ └── sample
│ │ └── ApplicationTest.java
├── proguard-rules.pro
└── build.gradle
├── library
├── .gitignore
├── src
│ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── jp
│ │ └── co
│ │ └── recruit_lifestyle
│ │ └── android
│ │ └── widget
│ │ ├── BackgroundPath.java
│ │ ├── PencilPath.java
│ │ ├── character
│ │ ├── ToothPath.java
│ │ ├── NinjaStarPath.java
│ │ ├── CatPath.java
│ │ ├── HairStylePath.java
│ │ ├── NinjaPath.java
│ │ ├── ViolinPath.java
│ │ └── DogezaPath.java
│ │ ├── LoadingPath.java
│ │ └── ColoringLoadingView.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── .gitignore
├── sc
├── ill1.png
├── ill2.png
├── ill3.png
├── ill4.png
├── sc1.png
├── sc10.png
├── sc11.png
├── sc12.png
├── sc2.png
├── sc3.png
├── sc4.png
├── sc5.png
├── sc6.png
├── sc7.png
├── sc8.png
├── sc9.png
└── animation.gif
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── ConvertScript.jsx
├── gradlew.bat
├── README.md
├── gradlew
└── LICENSE
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':library', ':sample'
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | .DS_Store
4 | /build
5 | /.idea
6 | *.iml
7 |
--------------------------------------------------------------------------------
/sc/ill1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/ill1.png
--------------------------------------------------------------------------------
/sc/ill2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/ill2.png
--------------------------------------------------------------------------------
/sc/ill3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/ill3.png
--------------------------------------------------------------------------------
/sc/ill4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/ill4.png
--------------------------------------------------------------------------------
/sc/sc1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc1.png
--------------------------------------------------------------------------------
/sc/sc10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc10.png
--------------------------------------------------------------------------------
/sc/sc11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc11.png
--------------------------------------------------------------------------------
/sc/sc12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc12.png
--------------------------------------------------------------------------------
/sc/sc2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc2.png
--------------------------------------------------------------------------------
/sc/sc3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc3.png
--------------------------------------------------------------------------------
/sc/sc4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc4.png
--------------------------------------------------------------------------------
/sc/sc5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc5.png
--------------------------------------------------------------------------------
/sc/sc6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc6.png
--------------------------------------------------------------------------------
/sc/sc7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc7.png
--------------------------------------------------------------------------------
/sc/sc8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc8.png
--------------------------------------------------------------------------------
/sc/sc9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/sc9.png
--------------------------------------------------------------------------------
/sc/animation.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/recruit-lifestyle/ColoringLoading/HEAD/sc/animation.gif
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
|
|
|
18 |
19 | | RIFLE | HEAR STYLE | TOOTH |
20 | |:------------------------------------|:-----------------------------------|:-----------------------------------|
21 | |
|
|
|
22 |
23 | | CUCUMBER | STORM | DOGEZA |
24 | |:------------------------------------|:-----------------------------------|:-----------------------------------|
25 | |
|
|
|
26 |
27 | | CAT |
28 | |:------------------------------------|
29 | |
|
30 |
31 |
32 | ## Requirements
33 | Target Sdk Version : 21
34 | Min Sdk Version : 14
35 |
36 | ## How to use
37 | 1) Add this to your **build.gradle**.
38 | ```java
39 | repositories {
40 | maven {
41 | url "https://jitpack.io"
42 | }
43 | }
44 |
45 | dependencies {
46 | compile 'com.github.recruit-lifestyle:ColoringLoading:1.0'
47 | }
48 | ```
49 |
50 | 2) Add ```java jp.co.recruit_lifestyle.android.widget.ColoringLoadingView ```.
51 | ```xml
52 |
81 |
82 | 3) Open ExtendScript ToolKit and import ConvertScript.jsx
83 |
84 | 4) Select new Character, Run ConvertScript.jsx
85 |
86 |
87 |
88 | 5) Copy the results outputted to CharacterPath.java
89 |
90 | 6) Update ColoringLoadingView.java
91 | Update Character
92 |
93 |
94 | Add new case and put in CharacterPath variable
95 |
96 |
97 | ## Credits
98 |
99 | ColoringLoading is owned and maintained by [RECRUIT LIFESTYLE CO., LTD.](http://www.recruit-lifestyle.co.jp/)
100 |
101 | ColoringLoading was originally created by [Yuki Mima](https://github.com/amyu)
102 |
103 |
104 | ## License
105 |
106 | Copyright 2015 RECRUIT LIFESTYLE CO., LTD.
107 |
108 | Licensed under the Apache License, Version 2.0 (the "License");
109 | you may not use this file except in compliance with the License.
110 | You may obtain a copy of the License at
111 |
112 | http://www.apache.org/licenses/LICENSE-2.0
113 |
114 | Unless required by applicable law or agreed to in writing, software
115 | distributed under the License is distributed on an "AS IS" BASIS,
116 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
117 | See the License for the specific language governing permissions and
118 | limitations under the License.
119 |
--------------------------------------------------------------------------------
/library/src/main/java/jp/co/recruit_lifestyle/android/widget/character/ToothPath.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 RECRUIT LIFESTYLE CO., LTD.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package jp.co.recruit_lifestyle.android.widget.character;
18 |
19 | import android.graphics.Path;
20 |
21 | /**
22 | * @author amyu
23 | */
24 | public class ToothPath {
25 |
26 | public static Path getToothPath(float width, float[] centerPoint){
27 | Path path = new Path();
28 |
29 | path.moveTo(centerPoint[0] - width / 2 + 0.405f * width, centerPoint[1] - width / 2 + 0.152f * width);
30 | path.cubicTo(
31 | centerPoint[0] - width / 2 + 0.447f * width, centerPoint[1] - width / 2 + 0.149f * width,
32 | centerPoint[0] - width / 2 + 0.457f * width, centerPoint[1] - width / 2 + 0.085f * width,
33 | centerPoint[0] - width / 2 + 0.541f * width, centerPoint[1] - width / 2 + 0.089f * width
34 | );
35 | path.cubicTo(
36 | centerPoint[0] - width / 2 + 0.625f * width, centerPoint[1] - width / 2 + 0.092f * width,
37 | centerPoint[0] - width / 2 + 0.608f * width, centerPoint[1] - width / 2 + 0.152f * width,
38 | centerPoint[0] - width / 2 + 0.657f * width, centerPoint[1] - width / 2 + 0.155f * width
39 | );
40 | path.cubicTo(
41 | centerPoint[0] - width / 2 + 0.706f * width, centerPoint[1] - width / 2 + 0.159f * width,
42 | centerPoint[0] - width / 2 + 0.804f * width, centerPoint[1] - width / 2 + 0.166f * width,
43 | centerPoint[0] - width / 2 + 0.811f * width, centerPoint[1] - width / 2 + 0.281f * width
44 | );
45 | path.cubicTo(
46 | centerPoint[0] - width / 2 + 0.818f * width, centerPoint[1] - width / 2 + 0.397f * width,
47 | centerPoint[0] - width / 2 + 0.8f * width, centerPoint[1] - width / 2 + 0.477f * width,
48 | centerPoint[0] - width / 2 + 0.751f * width, centerPoint[1] - width / 2 + 0.61f * width
49 | );
50 | path.cubicTo(
51 | centerPoint[0] - width / 2 + 0.702f * width, centerPoint[1] - width / 2 + 0.743f * width,
52 | centerPoint[0] - width / 2 + 0.713f * width, centerPoint[1] - width / 2 + 0.851f * width,
53 | centerPoint[0] - width / 2 + 0.667f * width, centerPoint[1] - width / 2 + 0.862f * width
54 | );
55 | path.cubicTo(
56 | centerPoint[0] - width / 2 + 0.622f * width, centerPoint[1] - width / 2 + 0.872f * width,
57 | centerPoint[0] - width / 2 + 0.59f * width, centerPoint[1] - width / 2 + 0.655f * width,
58 | centerPoint[0] - width / 2 + 0.566f * width, centerPoint[1] - width / 2 + 0.648f * width
59 | );
60 | path.cubicTo(
61 | centerPoint[0] - width / 2 + 0.541f * width, centerPoint[1] - width / 2 + 0.641f * width,
62 | centerPoint[0] - width / 2 + 0.482f * width, centerPoint[1] - width / 2 + 0.585f * width,
63 | centerPoint[0] - width / 2 + 0.443f * width, centerPoint[1] - width / 2 + 0.722f * width
64 | );
65 | path.cubicTo(
66 | centerPoint[0] - width / 2 + 0.405f * width, centerPoint[1] - width / 2 + 0.858f * width,
67 | centerPoint[0] - width / 2 + 0.401f * width, centerPoint[1] - width / 2 + 0.9f * width,
68 | centerPoint[0] - width / 2 + 0.359f * width, centerPoint[1] - width / 2 + 0.911f * width
69 | );
70 | path.cubicTo(
71 | centerPoint[0] - width / 2 + 0.317f * width, centerPoint[1] - width / 2 + 0.921f * width,
72 | centerPoint[0] - width / 2 + 0.314f * width, centerPoint[1] - width / 2 + 0.776f * width,
73 | centerPoint[0] - width / 2 + 0.283f * width, centerPoint[1] - width / 2 + 0.697f * width
74 | );
75 | path.cubicTo(
76 | centerPoint[0] - width / 2 + 0.241f * width, centerPoint[1] - width / 2 + 0.592f * width,
77 | centerPoint[0] - width / 2 + 0.185f * width, centerPoint[1] - width / 2 + 0.509f * width,
78 | centerPoint[0] - width / 2 + 0.188f * width, centerPoint[1] - width / 2 + 0.299f * width
79 | );
80 | path.cubicTo(
81 | centerPoint[0] - width / 2 + 0.192f * width, centerPoint[1] - width / 2 + 0.085f * width,
82 | centerPoint[0] - width / 2 + 0.349f * width, centerPoint[1] - width / 2 + 0.155f * width,
83 | centerPoint[0] - width / 2 + 0.405f * width, centerPoint[1] - width / 2 + 0.152f * width
84 | );
85 | return path;
86 |
87 | }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/library/src/main/java/jp/co/recruit_lifestyle/android/widget/character/NinjaStarPath.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 RECRUIT LIFESTYLE CO., LTD.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package jp.co.recruit_lifestyle.android.widget.character;
18 |
19 | import android.graphics.Path;
20 |
21 | /**
22 | * @author amyu
23 | */
24 | public class NinjaStarPath {
25 | public static Path getNinjaStarPath(float width, float[] centerPoint){
26 | Path path = new Path();
27 |
28 | path.moveTo(centerPoint[0] - width / 2 + 0.903f * width, centerPoint[1] - width / 2 + 0.374f * width);
29 | path.cubicTo(
30 | centerPoint[0] - width / 2 + 0.859f * width, centerPoint[1] - width / 2 + 0.439f * width,
31 | centerPoint[0] - width / 2 + 0.688f * width, centerPoint[1] - width / 2 + 0.469f * width,
32 | centerPoint[0] - width / 2 + 0.622f * width, centerPoint[1] - width / 2 + 0.394f * width
33 | );
34 | path.cubicTo(
35 | centerPoint[0] - width / 2 + 0.575f * width, centerPoint[1] - width / 2 + 0.34f * width,
36 | centerPoint[0] - width / 2 + 0.606f * width, centerPoint[1] - width / 2 + 0.298f * width,
37 | centerPoint[0] - width / 2 + 0.567f * width, centerPoint[1] - width / 2 + 0.204f * width
38 | );
39 | path.cubicTo(
40 | centerPoint[0] - width / 2 + 0.527f * width, centerPoint[1] - width / 2 + 0.11f * width,
41 | centerPoint[0] - width / 2 + 0.403f * width, centerPoint[1] - width / 2 + 0.088f * width,
42 | centerPoint[0] - width / 2 + 0.374f * width, centerPoint[1] - width / 2 + 0.097f * width
43 | );
44 | path.cubicTo(
45 | centerPoint[0] - width / 2 + 0.439f * width, centerPoint[1] - width / 2 + 0.141f * width,
46 | centerPoint[0] - width / 2 + 0.469f * width, centerPoint[1] - width / 2 + 0.312f * width,
47 | centerPoint[0] - width / 2 + 0.394f * width, centerPoint[1] - width / 2 + 0.378f * width
48 | );
49 | path.cubicTo(
50 | centerPoint[0] - width / 2 + 0.34f * width, centerPoint[1] - width / 2 + 0.425f * width,
51 | centerPoint[0] - width / 2 + 0.298f * width, centerPoint[1] - width / 2 + 0.394f * width,
52 | centerPoint[0] - width / 2 + 0.204f * width, centerPoint[1] - width / 2 + 0.433f * width
53 | );
54 | path.cubicTo(
55 | centerPoint[0] - width / 2 + 0.11f * width, centerPoint[1] - width / 2 + 0.473f * width,
56 | centerPoint[0] - width / 2 + 0.088f * width, centerPoint[1] - width / 2 + 0.597f * width,
57 | centerPoint[0] - width / 2 + 0.097f * width, centerPoint[1] - width / 2 + 0.626f * width
58 | );
59 | path.cubicTo(
60 | centerPoint[0] - width / 2 + 0.141f * width, centerPoint[1] - width / 2 + 0.561f * width,
61 | centerPoint[0] - width / 2 + 0.307f * width, centerPoint[1] - width / 2 + 0.536f * width,
62 | centerPoint[0] - width / 2 + 0.378f * width, centerPoint[1] - width / 2 + 0.606f * width
63 | );
64 | path.cubicTo(
65 | centerPoint[0] - width / 2 + 0.429f * width, centerPoint[1] - width / 2 + 0.656f * width,
66 | centerPoint[0] - width / 2 + 0.394f * width, centerPoint[1] - width / 2 + 0.702f * width,
67 | centerPoint[0] - width / 2 + 0.433f * width, centerPoint[1] - width / 2 + 0.796f * width
68 | );
69 | path.cubicTo(
70 | centerPoint[0] - width / 2 + 0.473f * width, centerPoint[1] - width / 2 + 0.89f * width,
71 | centerPoint[0] - width / 2 + 0.597f * width, centerPoint[1] - width / 2 + 0.912f * width,
72 | centerPoint[0] - width / 2 + 0.626f * width, centerPoint[1] - width / 2 + 0.903f * width
73 | );
74 | path.cubicTo(
75 | centerPoint[0] - width / 2 + 0.561f * width, centerPoint[1] - width / 2 + 0.859f * width,
76 | centerPoint[0] - width / 2 + 0.531f * width, centerPoint[1] - width / 2 + 0.688f * width,
77 | centerPoint[0] - width / 2 + 0.606f * width, centerPoint[1] - width / 2 + 0.622f * width
78 | );
79 | path.cubicTo(
80 | centerPoint[0] - width / 2 + 0.66f * width, centerPoint[1] - width / 2 + 0.575f * width,
81 | centerPoint[0] - width / 2 + 0.702f * width, centerPoint[1] - width / 2 + 0.606f * width,
82 | centerPoint[0] - width / 2 + 0.796f * width, centerPoint[1] - width / 2 + 0.567f * width
83 | );
84 | path.cubicTo(
85 | centerPoint[0] - width / 2 + 0.89f * width, centerPoint[1] - width / 2 + 0.527f * width,
86 | centerPoint[0] - width / 2 + 0.912f * width, centerPoint[1] - width / 2 + 0.403f * width,
87 | centerPoint[0] - width / 2 + 0.903f * width, centerPoint[1] - width / 2 + 0.374f * width
88 | );
89 | return path;
90 |
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/library/src/main/java/jp/co/recruit_lifestyle/android/widget/LoadingPath.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 RECRUIT LIFESTYLE CO., LTD.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package jp.co.recruit_lifestyle.android.widget;
18 |
19 | import android.graphics.Path;
20 |
21 | /**
22 | * @author amyu
23 | */
24 | public class LoadingPath {
25 |
26 | public static Path getPath(float width) {
27 | Path path = new Path();
28 |
29 | path.moveTo(0.641f * width, 0.859f * width);
30 | path.cubicTo(0.642f * width, 0.864f * width, 0.646f * width, 0.866f * width, 0.649f * width,
31 | 0.867f * width);
32 | path.cubicTo(0.683f * width, 0.874f * width, 0.703f * width, 0.854f * width, 0.7f * width,
33 | 0.847f * width);
34 | path.cubicTo(0.699f * width, 0.847f * width, 0.698f * width, 0.844f * width, 0.694f * width,
35 | 0.844f * width);
36 | path.cubicTo(0.689f * width, 0.844f * width, 0.683f * width, 0.849f * width, 0.677f * width,
37 | 0.865f * width);
38 | path.cubicTo(0.665f * width, 0.895f * width, 0.665f * width, 0.903f * width, 0.656f * width,
39 | 0.913f * width);
40 | path.cubicTo(0.638f * width, 0.931f * width, 0.63f * width, 0.917f * width, 0.63f * width,
41 | 0.913f * width);
42 | path.cubicTo(0.63f * width, 0.91f * width, 0.63f * width, 0.908f * width, 0.632f * width,
43 | 0.906f * width);
44 | path.cubicTo(0.636f * width, 0.902f * width, 0.644f * width, 0.903f * width, 0.65f * width,
45 | 0.905f * width);
46 | path.cubicTo(0.667f * width, 0.912f * width, 0.67f * width, 0.921f * width, 0.681f * width,
47 | 0.919f * width);
48 | path.cubicTo(0.693f * width, 0.917f * width, 0.697f * width, 0.91f * width, 0.701f * width,
49 | 0.903f * width);
50 | path.cubicTo(0.714f * width, 0.885f * width, 0.716f * width, 0.885f * width, 0.716f * width,
51 | 0.885f * width);
52 | path.cubicTo(0.715f * width, 0.884f * width, 0.705f * width, 0.894f * width, 0.702f * width,
53 | 0.907f * width);
54 | path.cubicTo(0.702f * width, 0.911f * width, 0.702f * width, 0.917f * width, 0.709f * width,
55 | 0.917f * width);
56 | path.cubicTo(0.718f * width, 0.917f * width, 0.728f * width, 0.905f * width, 0.729f * width,
57 | 0.891f * width);
58 | path.cubicTo(0.729f * width, 0.888f * width, 0.727f * width, 0.883f * width, 0.725f * width,
59 | 0.883f * width);
60 | path.cubicTo(0.72f * width, 0.883f * width, 0.713f * width, 0.901f * width, 0.72f * width,
61 | 0.908f * width);
62 | path.cubicTo(0.723f * width, 0.91f * width, 0.728f * width, 0.91f * width, 0.731f * width,
63 | 0.908f * width);
64 | path.cubicTo(0.738f * width, 0.905f * width, 0.739f * width, 0.899f * width, 0.746f * width,
65 | 0.892f * width);
66 | path.cubicTo(0.756f * width, 0.882f * width, 0.769f * width, 0.883f * width, 0.769f * width,
67 | 0.882f * width);
68 | path.cubicTo(0.769f * width, 0.882f * width, 0.754f * width, 0.883f * width, 0.746f * width,
69 | 0.892f * width);
70 | path.cubicTo(0.744f * width, 0.895f * width, 0.736f * width, 0.902f * width, 0.738f * width,
71 | 0.909f * width);
72 | path.cubicTo(0.738f * width, 0.912f * width, 0.74f * width, 0.916f * width, 0.743f * width,
73 | 0.917f * width);
74 | path.cubicTo(0.753f * width, 0.919f * width, 0.77f * width, 0.883f * width, 0.769f * width,
75 | 0.882f * width);
76 | path.cubicTo(0.768f * width, 0.882f * width, 0.765f * width, 0.893f * width, 0.759f * width,
77 | 0.907f * width);
78 | path.cubicTo(0.758f * width, 0.908f * width, 0.759f * width, 0.917f * width, 0.763f * width,
79 | 0.916f * width);
80 | path.cubicTo(0.77f * width, 0.916f * width, 0.777f * width, 0.906f * width, 0.785f * width,
81 | 0.894f * width);
82 | path.cubicTo(0.788f * width, 0.889f * width, 0.793f * width, 0.885f * width, 0.8f * width,
83 | 0.883f * width);
84 | path.cubicTo(0.803f * width, 0.882f * width, 0.808f * width, 0.88f * width, 0.81f * width,
85 | 0.882f * width);
86 | path.cubicTo(0.804f * width, 0.894f * width, 0.801f * width, 0.903f * width, 0.801f * width,
87 | 0.903f * width);
88 | path.cubicTo(0.802f * width, 0.904f * width, 0.811f * width, 0.887f * width, 0.811f * width,
89 | 0.883f * width);
90 | path.cubicTo(0.812f * width, 0.877f * width, 0.78f * width, 0.888f * width, 0.779f * width,
91 | 0.905f * width);
92 | path.cubicTo(0.779f * width, 0.909f * width, 0.78f * width, 0.914f * width, 0.784f * width,
93 | 0.915f * width);
94 | path.cubicTo(0.794f * width, 0.918f * width, 0.808f * width, 0.894f * width, 0.812f * width,
95 | 0.879f * width);
96 | path.cubicTo(0.817f * width, 0.865f * width, 0.823f * width, 0.851f * width, 0.823f * width,
97 | 0.851f * width);
98 | path.cubicTo(0.823f * width, 0.851f * width, 0.819f * width, 0.861f * width, 0.802f * width,
99 | 0.905f * width);
100 | path.cubicTo(0.802f * width, 0.909f * width, 0.802f * width, 0.915f * width, 0.805f * width,
101 | 0.915f * width);
102 | path.cubicTo(0.812f * width, 0.914f * width, 0.835f * width, 0.881f * width, 0.835f * width,
103 | 0.882f * width);
104 | path.cubicTo(0.836f * width, 0.882f * width, 0.831f * width, 0.89f * width, 0.827f * width,
105 | 0.901f * width);
106 | path.cubicTo(0.824f * width, 0.908f * width, 0.824f * width, 0.912f * width, 0.825f * width,
107 | 0.913f * width);
108 | path.cubicTo(0.826f * width, 0.913f * width, 0.827f * width, 0.915f * width, 0.829f * width,
109 | 0.914f * width);
110 | path.cubicTo(0.845f * width, 0.904f * width, 0.842f * width, 0.894f * width, 0.858f * width,
111 | 0.882f * width);
112 | path.cubicTo(0.86f * width, 0.881f * width, 0.861f * width, 0.881f * width, 0.862f * width,
113 | 0.881f * width);
114 | path.cubicTo(0.869f * width, 0.884f * width, 0.854f * width, 0.912f * width, 0.855f * width,
115 | 0.913f * width);
116 | path.cubicTo(0.855f * width, 0.913f * width, 0.867f * width, 0.885f * width, 0.879f * width,
117 | 0.88f * width);
118 | path.cubicTo(0.88f * width, 0.88f * width, 0.882f * width, 0.879f * width, 0.884f * width,
119 | 0.88f * width);
120 | path.cubicTo(0.887f * width, 0.882f * width, 0.885f * width, 0.889f * width, 0.885f * width,
121 | 0.891f * width);
122 | path.cubicTo(0.882f * width, 0.898f * width, 0.878f * width, 0.906f * width, 0.878f * width,
123 | 0.909f * width);
124 | path.cubicTo(0.878f * width, 0.909f * width, 0.879f * width, 0.913f * width, 0.882f * width,
125 | 0.912f * width);
126 | path.cubicTo(0.887f * width, 0.911f * width, 0.897f * width, 0.9f * width, 0.904f * width,
127 | 0.888f * width);
128 | path.cubicTo(0.909f * width, 0.879f * width, 0.927f * width, 0.875f * width, 0.928f * width,
129 | 0.877f * width);
130 | path.cubicTo(0.928f * width, 0.877f * width, 0.904f * width, 0.875f * width, 0.896f * width,
131 | 0.904f * width);
132 | path.cubicTo(0.896f * width, 0.907f * width, 0.9f * width, 0.913f * width, 0.903f * width,
133 | 0.912f * width);
134 | path.cubicTo(0.926f * width, 0.903f * width, 0.926f * width, 0.876f * width, 0.928f * width,
135 | 0.878f * width);
136 | path.cubicTo(0.928f * width, 0.878f * width, 0.909f * width, 0.93f * width, 0.902f * width,
137 | 0.943f * width);
138 | path.cubicTo(0.901f * width, 0.945f * width, 0.898f * width, 0.948f * width, 0.896f * width,
139 | 0.947f * width);
140 | path.cubicTo(0.893f * width, 0.947f * width, 0.892f * width, 0.943f * width, 0.891f * width,
141 | 0.941f * width);
142 | path.cubicTo(0.89f * width, 0.936f * width, 0.896f * width, 0.923f * width, 0.913f * width,
143 | 0.912f * width);
144 | path.cubicTo(0.919f * width, 0.909f * width, 0.929f * width, 0.9f * width, 0.933f * width,
145 | 0.895f * width);
146 |
147 | return path;
148 | }
149 |
150 | public static Path getCirclePath(float width) {
151 | Path path = new Path();
152 | path.moveTo(0.843f * width, 0.857f * width);
153 | path.cubicTo(
154 | 0.844f * width, 0.857f * width,
155 | 0.845f * width, 0.858f * width,
156 | 0.845f * width, 0.86f * width
157 | );
158 | path.cubicTo(
159 | 0.845f * width, 0.861f * width,
160 | 0.844f * width, 0.862f * width,
161 | 0.843f * width, 0.862f * width
162 | );
163 | path.cubicTo(
164 | 0.842f * width, 0.862f * width,
165 | 0.841f * width, 0.861f * width,
166 | 0.841f * width, 0.86f * width
167 | );
168 | path.cubicTo(
169 | 0.841f * width, 0.859f * width,
170 | 0.842f * width, 0.857f * width,
171 | 0.843f * width, 0.857f * width
172 | );
173 | return path;
174 | }
175 | }
176 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright 2015 RECRUIT LIFESTYLE CO., LTD.
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/library/src/main/java/jp/co/recruit_lifestyle/android/widget/ColoringLoadingView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 RECRUIT LIFESTYLE CO., LTD.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package jp.co.recruit_lifestyle.android.widget;
18 |
19 | import android.content.Context;
20 | import android.graphics.BlurMaskFilter;
21 | import android.graphics.Canvas;
22 | import android.graphics.Color;
23 | import android.graphics.CornerPathEffect;
24 | import android.graphics.Paint;
25 | import android.graphics.Path;
26 | import android.graphics.PathMeasure;
27 | import android.graphics.RectF;
28 | import android.graphics.Region;
29 | import android.os.Handler;
30 | import android.support.annotation.NonNull;
31 | import android.support.v4.view.ViewCompat;
32 | import android.util.AttributeSet;
33 | import android.view.MotionEvent;
34 | import android.view.View;
35 | import jp.co.recruit_lifestyle.android.widget.character.AkPath;
36 | import jp.co.recruit_lifestyle.android.widget.character.ButterflyPath;
37 | import jp.co.recruit_lifestyle.android.widget.character.CatPath;
38 | import jp.co.recruit_lifestyle.android.widget.character.CucumberPath;
39 | import jp.co.recruit_lifestyle.android.widget.character.DogezaPath;
40 | import jp.co.recruit_lifestyle.android.widget.character.HairStylePath;
41 | import jp.co.recruit_lifestyle.android.widget.character.NinjaPath;
42 | import jp.co.recruit_lifestyle.android.widget.character.NinjaStarPath;
43 | import jp.co.recruit_lifestyle.android.widget.character.StormPath;
44 | import jp.co.recruit_lifestyle.android.widget.character.ToothPath;
45 | import jp.co.recruit_lifestyle.android.widget.character.ViolinPath;
46 |
47 | /**
48 | * @author amyu
49 | */
50 | public class ColoringLoadingView extends View {
51 |
52 | private PencilPath mPencilPath;
53 |
54 | private BackgroundPath mBackgroundPath;
55 |
56 | private Paint mCharacterPaint;
57 |
58 | private Paint mPencilPaint;
59 |
60 | private Paint mColoringPaint;
61 |
62 | private Paint mLoadingPaint;
63 |
64 | private Paint mBackgroundPaint;
65 |
66 | private Paint mShadowPaint;
67 |
68 | private Path mCharacterPath;
69 |
70 | private Path mLoadingPath;
71 |
72 | private PathMeasure mCharacterPathMeasure;
73 |
74 | private PathMeasure mLoadingPathMeasure;
75 |
76 | private int mViewWidth;
77 |
78 | private float[] mCenterPoint = new float[2];
79 |
80 | private float[] mCurrentPoint = new float[2];
81 |
82 | private boolean isHandWriting = false;
83 |
84 | private Handler mCharacterHandler;
85 |
86 | private Handler mLoadingHandler;
87 |
88 | private int mCharacterRunnableCount = 0;
89 |
90 | private int mLoadingRunnableCount = 0;
91 |
92 | private RectF mRectF;
93 |
94 | private Region mRegion;
95 |
96 | private Path mColoringPath;
97 |
98 | private float[] mCurrentTouchPoint = new float[2];
99 |
100 | private boolean isPreDraw = false;
101 |
102 | private Character mCharacter;
103 |
104 | public ColoringLoadingView(Context context) {
105 | this(context, null, 0);
106 | }
107 |
108 | public ColoringLoadingView(Context context, AttributeSet attrs) {
109 | this(context, attrs, 0);
110 | }
111 |
112 | public ColoringLoadingView(Context context, AttributeSet attrs, int defStyleAttr) {
113 | super(context, attrs, defStyleAttr);
114 | initView();
115 |
116 | mLoadingHandler = new Handler();
117 | mCharacterHandler = new Handler();
118 | mRectF = new RectF();
119 | mRegion = new Region();
120 | setLayerType(View.LAYER_TYPE_SOFTWARE, null);
121 | }
122 |
123 | private void initView() {
124 | initPaint();
125 | }
126 |
127 | private void initPath() {
128 | mColoringPath = new Path();
129 |
130 | mLoadingPath = new Path();
131 | mCharacterPath = new Path();
132 | mPencilPath = new PencilPath();
133 | mPencilPath.setWidth(mViewWidth / 6);
134 |
135 | Path loadingPath = LoadingPath.getPath(mViewWidth);
136 | mLoadingPathMeasure = new PathMeasure(loadingPath, false);
137 | mBackgroundPath = new BackgroundPath();
138 | mBackgroundPath.setWidth(mViewWidth);
139 | }
140 |
141 | private void initPaint() {
142 | mCharacterPaint = new Paint();
143 | mCharacterPaint.setColor(Color.BLACK);
144 | mCharacterPaint.setStyle(Paint.Style.STROKE);
145 | mCharacterPaint.setStrokeWidth(20);
146 | mCharacterPaint.setStrokeCap(Paint.Cap.ROUND);
147 | mCharacterPaint.setPathEffect(new CornerPathEffect(10));
148 | mCharacterPaint.setAntiAlias(true);
149 |
150 | mLoadingPaint = new Paint();
151 | mLoadingPaint.setColor(Color.BLACK);
152 | mLoadingPaint.setStrokeWidth(10);
153 | mLoadingPaint.setStyle(Paint.Style.STROKE);
154 | mLoadingPaint.setStrokeCap(Paint.Cap.ROUND);
155 | mLoadingPaint.setPathEffect(new CornerPathEffect(10));
156 | mLoadingPaint.setAntiAlias(true);
157 |
158 | mPencilPaint = new Paint();
159 | mPencilPaint.setStyle(Paint.Style.FILL);
160 | mPencilPaint.setColor(Color.BLACK);
161 | mPencilPaint.setAntiAlias(true);
162 |
163 | mColoringPaint = new Paint();
164 | mColoringPaint.setStyle(Paint.Style.STROKE);
165 | mColoringPaint.setStrokeWidth(30);
166 | mColoringPaint.setStrokeCap(Paint.Cap.ROUND);
167 | mColoringPaint.setAntiAlias(true);
168 | mColoringPaint.setColor(0xffF8C92C);
169 |
170 | mBackgroundPaint = new Paint();
171 | mBackgroundPaint.setStyle(Paint.Style.FILL);
172 | mBackgroundPaint.setAntiAlias(true);
173 | mBackgroundPaint.setColor(Color.WHITE);
174 |
175 | mShadowPaint = new Paint();
176 | mShadowPaint.setStyle(Paint.Style.FILL);
177 | mShadowPaint.setColor(0x70000000);
178 | mShadowPaint.setMaskFilter(new BlurMaskFilter(16, BlurMaskFilter.Blur.NORMAL));
179 |
180 | }
181 |
182 | @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) {
183 | mViewWidth = w;
184 | mCenterPoint[0] = w / 2.f;
185 | mCenterPoint[1] = h / 2.f;
186 | initPath();
187 |
188 | isPreDraw = true;
189 | setCharacter(mCharacter);
190 | if (isStartAnimationFlag) {
191 | startDrawAnimation();
192 | isStartAnimationFlag = false;
193 | }
194 | super.onSizeChanged(w, h, oldw, oldh);
195 | }
196 |
197 | public void startDrawAnimation() {
198 | if (!isPreDraw) {
199 | isStartAnimationFlag = true;
200 | return;
201 | }
202 | stopHandler();
203 | mPencilPaint.setColor(Color.BLACK);
204 | isHandWriting = true;
205 | mLoadingPath.reset();
206 | mCharacterPath.reset();
207 | mColoringPath.reset();
208 | mCharacterHandler.post(mCharacterRunnable);
209 | mCharacterRunnableCount = 0;
210 | }
211 |
212 | private Runnable mCharacterRunnable = new Runnable() {
213 | @Override public void run() {
214 | if ((mCharacterRunnableCount / 200.f) == 1.f) {
215 | mCharacterHandler.removeCallbacks(this);
216 | mLoadingHandler.post(mLoadingRunnable);
217 | mLoadingRunnableCount = 0;
218 | return;
219 | }
220 |
221 | float[] point = new float[2];
222 | mCharacterPathMeasure.getPosTan(
223 | mCharacterPathMeasure.getLength() * (mCharacterRunnableCount / 200.f), point, null);
224 | if (mCharacterRunnableCount == 0) {
225 | mCharacterPath.moveTo(point[0], point[1]);
226 | } else {
227 | mCharacterPath.lineTo(point[0], point[1]);
228 | }
229 | mCurrentPoint = point;
230 | ViewCompat.postInvalidateOnAnimation(ColoringLoadingView.this);
231 | mCharacterHandler.postDelayed(this, 10);
232 | mCharacterRunnableCount++;
233 | }
234 | };
235 |
236 | private Runnable mLoadingRunnable = new Runnable() {
237 | @Override public void run() {
238 | if ((mLoadingRunnableCount / 100.f) == 1.f) {
239 | mLoadingHandler.removeCallbacks(this);
240 | mLoadingPath.addPath(LoadingPath.getCirclePath(mViewWidth));
241 | ViewCompat.postInvalidateOnAnimation(ColoringLoadingView.this);
242 | isHandWriting = false;
243 | mPencilPaint.setColor(mColoringPaint.getColor());
244 | return;
245 | }
246 | float[] point = new float[2];
247 | mLoadingPathMeasure.getPosTan(
248 | mLoadingPathMeasure.getLength() * (mLoadingRunnableCount / 100.f), point, null);
249 |
250 | if (mLoadingRunnableCount == 0) {
251 | mLoadingPath.moveTo(point[0], point[1]);
252 | } else {
253 | mLoadingPath.lineTo(point[0], point[1]);
254 | }
255 | mCurrentPoint = point;
256 |
257 | ViewCompat.postInvalidateOnAnimation(ColoringLoadingView.this);
258 | mLoadingHandler.postDelayed(this, 10);
259 | mLoadingRunnableCount++;
260 | }
261 | };
262 |
263 | @Override protected void onDraw(Canvas canvas) {
264 | canvas.drawPath(mBackgroundPath.getShadowPath(), mShadowPaint);
265 | canvas.drawPath(mBackgroundPath.getBackgroundPath(), mBackgroundPaint);
266 |
267 | if (isHandWriting) {
268 | //Auto
269 | canvas.drawPath(mCharacterPath, mCharacterPaint);
270 | canvas.drawPath(mLoadingPath, mLoadingPaint);
271 | canvas.drawPath(mPencilPath.getPencilPath(mCurrentPoint), mPencilPaint);
272 | } else {
273 | //Touch
274 | canvas.drawPath(mColoringPath, mColoringPaint);
275 | canvas.drawPath(mCharacterPath, mCharacterPaint);
276 | canvas.drawPath(mPencilPath.getPencilPath(mCurrentTouchPoint), mPencilPaint);
277 | canvas.drawPath(mLoadingPath, mLoadingPaint);
278 | }
279 | }
280 |
281 | @Override protected void onDetachedFromWindow() {
282 | stopHandler();
283 | super.onDetachedFromWindow();
284 | }
285 |
286 | private void stopHandler() {
287 | mCharacterHandler.removeCallbacks(mCharacterRunnable);
288 | mLoadingHandler.removeCallbacks(mLoadingRunnable);
289 | }
290 |
291 | @Override public boolean onTouchEvent(@NonNull MotionEvent event) {
292 | if (isHandWriting) {
293 | return true;
294 | }
295 |
296 | mCurrentTouchPoint[0] = event.getX();
297 | mCurrentTouchPoint[1] = event.getY();
298 |
299 | switch (event.getAction()) {
300 | case MotionEvent.ACTION_DOWN:
301 | mColoringPath.moveTo(mCurrentTouchPoint[0], mCurrentTouchPoint[1]);
302 | return true;
303 | case MotionEvent.ACTION_MOVE:
304 | if (mRegion.contains((int) mCurrentTouchPoint[0], (int) mCurrentTouchPoint[1])) {
305 | mColoringPath.lineTo(mCurrentTouchPoint[0], mCurrentTouchPoint[1]);
306 | } else {
307 | mColoringPath.moveTo(mCurrentTouchPoint[0], mCurrentTouchPoint[1]);
308 | }
309 | ViewCompat.postInvalidateOnAnimation(this);
310 | break;
311 | }
312 | return true;
313 | }
314 |
315 | public void setColoringColor(int color) {
316 | mColoringPaint.setColor(color);
317 | invalidate();
318 | }
319 |
320 | public void setCnavasColor(int color) {
321 | mBackgroundPaint.setColor(color);
322 | invalidate();
323 | }
324 |
325 | public void setLineColor(int color) {
326 | mLoadingPaint.setColor(color);
327 | mCharacterPaint.setColor(color);
328 | }
329 |
330 | private boolean isStartAnimationFlag = false;
331 |
332 | public void setCharacter(Character character) {
333 | if (!isPreDraw) {
334 | mCharacter = character;
335 | return;
336 | }
337 | Path characterPath;
338 | switch (character) {
339 | case NINJA:
340 | characterPath = NinjaPath.getNinjaPath(mViewWidth / 1.5f, mCenterPoint);
341 | break;
342 | case BUTTERFLY:
343 | characterPath = ButterflyPath.getButterflyPath(mViewWidth / 1.5f, mCenterPoint);
344 | break;
345 | case AK:
346 | characterPath = AkPath.getAkPath(mViewWidth / 1.5f, mCenterPoint);
347 | break;
348 | case HAIR_STYLE:
349 | characterPath = HairStylePath.getHairStylePath(mViewWidth / 1.5f, mCenterPoint);
350 | break;
351 | case TOOTH:
352 | characterPath = ToothPath.getToothPath(mViewWidth / 1.5f, mCenterPoint);
353 | break;
354 | case STORM:
355 | characterPath = StormPath.getStormPath(mViewWidth / 1.5f, mCenterPoint);
356 | break;
357 | case DOGEZA:
358 | characterPath = DogezaPath.getDogezaPath(mViewWidth / 1.5f, mCenterPoint);
359 | break;
360 | case CAT:
361 | characterPath = CatPath.getCatPath(mViewWidth / 1.5f, mCenterPoint);
362 | break;
363 | case VIOLIN:
364 | characterPath = ViolinPath.getViolinPath(mViewWidth / 1.5f, mCenterPoint);
365 | break;
366 | case CUCUMBER:
367 | characterPath = CucumberPath.getCucumberPath(mViewWidth / 1.5f, mCenterPoint);
368 | break;
369 | case NINJA_STAR:
370 | characterPath = NinjaStarPath.getNinjaStarPath(mViewWidth / 1.5f, mCenterPoint);
371 | break;
372 |
373 | default:
374 | characterPath = NinjaPath.getNinjaPath(mViewWidth / 1.5f, mCenterPoint);
375 | break;
376 | }
377 | mCharacterPathMeasure = new PathMeasure(characterPath, false);
378 | mRectF.setEmpty();
379 | characterPath.computeBounds(mRectF, true);
380 | mRegion.setEmpty();
381 | mRegion.set((int) mRectF.left, (int) mRectF.top, (int) mRectF.right, (int) mRectF.bottom);
382 | mRegion.setPath(characterPath, mRegion);
383 | }
384 |
385 | public enum Character {
386 | NINJA(1),
387 | BUTTERFLY(2),
388 | AK(4),
389 | HAIR_STYLE(5),
390 | TOOTH(6),
391 | STORM(8),
392 | DOGEZA(9),
393 | CAT(10),
394 | VIOLIN(11),
395 | CUCUMBER(12),
396 | NINJA_STAR(13),
397 |
398 | '';
399 |
400 | Character(int i) {
401 | nativeInt = i;
402 | }
403 |
404 | final int nativeInt;
405 | }
406 | }
--------------------------------------------------------------------------------
/library/src/main/java/jp/co/recruit_lifestyle/android/widget/character/CatPath.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 RECRUIT LIFESTYLE CO., LTD.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package jp.co.recruit_lifestyle.android.widget.character;
18 |
19 | import android.graphics.Path;
20 |
21 | /**
22 | * @author amyu
23 | */
24 | public class CatPath {
25 |
26 | public static Path getCatPath(float width, float[] centerPoint){
27 | Path path = new Path();
28 |
29 | path.moveTo(centerPoint[0] - width / 2 + 0.058f * width, centerPoint[1] - width / 2 + 0.153f * width);
30 | path.cubicTo(
31 | centerPoint[0] - width / 2 + 0.058f * width, centerPoint[1] - width / 2 + 0.141f * width,
32 | centerPoint[0] - width / 2 + 0.049f * width, centerPoint[1] - width / 2 + 0.085f * width,
33 | centerPoint[0] - width / 2 + 0.058f * width, centerPoint[1] - width / 2 + 0.076f * width
34 | );
35 | path.cubicTo(
36 | centerPoint[0] - width / 2 + 0.066f * width, centerPoint[1] - width / 2 + 0.068f * width,
37 | centerPoint[0] - width / 2 + 0.102f * width, centerPoint[1] - width / 2 + 0.125f * width,
38 | centerPoint[0] - width / 2 + 0.108f * width, centerPoint[1] - width / 2 + 0.129f * width
39 | );
40 | path.cubicTo(
41 | centerPoint[0] - width / 2 + 0.114f * width, centerPoint[1] - width / 2 + 0.133f * width,
42 | centerPoint[0] - width / 2 + 0.197f * width, centerPoint[1] - width / 2 + 0.149f * width,
43 | centerPoint[0] - width / 2 + 0.205f * width, centerPoint[1] - width / 2 + 0.149f * width
44 | );
45 | path.cubicTo(
46 | centerPoint[0] - width / 2 + 0.213f * width, centerPoint[1] - width / 2 + 0.149f * width,
47 | centerPoint[0] - width / 2 + 0.262f * width, centerPoint[1] - width / 2 + 0.099f * width,
48 | centerPoint[0] - width / 2 + 0.278f * width, centerPoint[1] - width / 2 + 0.099f * width
49 | );
50 | path.cubicTo(
51 | centerPoint[0] - width / 2 + 0.294f * width, centerPoint[1] - width / 2 + 0.099f * width,
52 | centerPoint[0] - width / 2 + 0.278f * width, centerPoint[1] - width / 2 + 0.178f * width,
53 | centerPoint[0] - width / 2 + 0.28f * width, centerPoint[1] - width / 2 + 0.198f * width
54 | );
55 | path.cubicTo(
56 | centerPoint[0] - width / 2 + 0.282f * width, centerPoint[1] - width / 2 + 0.218f * width,
57 | centerPoint[0] - width / 2 + 0.308f * width, centerPoint[1] - width / 2 + 0.271f * width,
58 | centerPoint[0] - width / 2 + 0.337f * width, centerPoint[1] - width / 2 + 0.293f * width
59 | );
60 | path.cubicTo(
61 | centerPoint[0] - width / 2 + 0.365f * width, centerPoint[1] - width / 2 + 0.315f * width,
62 | centerPoint[0] - width / 2 + 0.387f * width, centerPoint[1] - width / 2 + 0.331f * width,
63 | centerPoint[0] - width / 2 + 0.387f * width, centerPoint[1] - width / 2 + 0.331f * width
64 | );
65 | path.cubicTo(
66 | centerPoint[0] - width / 2 + 0.387f * width, centerPoint[1] - width / 2 + 0.331f * width,
67 | centerPoint[0] - width / 2 + 0.6f * width, centerPoint[1] - width / 2 + 0.414f * width,
68 | centerPoint[0] - width / 2 + 0.622f * width, centerPoint[1] - width / 2 + 0.516f * width
69 | );
70 | path.cubicTo(
71 | centerPoint[0] - width / 2 + 0.644f * width, centerPoint[1] - width / 2 + 0.617f * width,
72 | centerPoint[0] - width / 2 + 0.677f * width, centerPoint[1] - width / 2 + 0.592f * width,
73 | centerPoint[0] - width / 2 + 0.681f * width, centerPoint[1] - width / 2 + 0.584f * width
74 | );
75 | path.cubicTo(
76 | centerPoint[0] - width / 2 + 0.685f * width, centerPoint[1] - width / 2 + 0.576f * width,
77 | centerPoint[0] - width / 2 + 0.707f * width, centerPoint[1] - width / 2 + 0.481f * width,
78 | centerPoint[0] - width / 2 + 0.786f * width, centerPoint[1] - width / 2 + 0.467f * width
79 | );
80 | path.cubicTo(
81 | centerPoint[0] - width / 2 + 0.865f * width, centerPoint[1] - width / 2 + 0.453f * width,
82 | centerPoint[0] - width / 2 + 0.944f * width, centerPoint[1] - width / 2 + 0.439f * width,
83 | centerPoint[0] - width / 2 + 0.932f * width, centerPoint[1] - width / 2 + 0.38f * width
84 | );
85 | path.cubicTo(
86 | centerPoint[0] - width / 2 + 0.926f * width, centerPoint[1] - width / 2 + 0.356f * width,
87 | centerPoint[0] - width / 2 + 0.952f * width, centerPoint[1] - width / 2 + 0.333f * width,
88 | centerPoint[0] - width / 2 + 0.964f * width, centerPoint[1] - width / 2 + 0.36f * width
89 | );
90 | path.cubicTo(
91 | centerPoint[0] - width / 2 + 0.976f * width, centerPoint[1] - width / 2 + 0.386f * width,
92 | centerPoint[0] - width / 2 + 0.978f * width, centerPoint[1] - width / 2 + 0.455f * width,
93 | centerPoint[0] - width / 2 + 0.92f * width, centerPoint[1] - width / 2 + 0.483f * width
94 | );
95 | path.cubicTo(
96 | centerPoint[0] - width / 2 + 0.861f * width, centerPoint[1] - width / 2 + 0.512f * width,
97 | centerPoint[0] - width / 2 + 0.778f * width, centerPoint[1] - width / 2 + 0.493f * width,
98 | centerPoint[0] - width / 2 + 0.746f * width, centerPoint[1] - width / 2 + 0.568f * width
99 | );
100 | path.cubicTo(
101 | centerPoint[0] - width / 2 + 0.713f * width, centerPoint[1] - width / 2 + 0.643f * width,
102 | centerPoint[0] - width / 2 + 0.685f * width, centerPoint[1] - width / 2 + 0.669f * width,
103 | centerPoint[0] - width / 2 + 0.667f * width, centerPoint[1] - width / 2 + 0.686f * width
104 | );
105 | path.cubicTo(
106 | centerPoint[0] - width / 2 + 0.693f * width, centerPoint[1] - width / 2 + 0.718f * width,
107 | centerPoint[0] - width / 2 + 0.677f * width, centerPoint[1] - width / 2 + 0.797f * width,
108 | centerPoint[0] - width / 2 + 0.622f * width, centerPoint[1] - width / 2 + 0.835f * width
109 | );
110 | path.cubicTo(
111 | centerPoint[0] - width / 2 + 0.567f * width, centerPoint[1] - width / 2 + 0.874f * width,
112 | centerPoint[0] - width / 2 + 0.537f * width, centerPoint[1] - width / 2 + 0.856f * width,
113 | centerPoint[0] - width / 2 + 0.525f * width, centerPoint[1] - width / 2 + 0.868f * width
114 | );
115 | path.cubicTo(
116 | centerPoint[0] - width / 2 + 0.513f * width, centerPoint[1] - width / 2 + 0.88f * width,
117 | centerPoint[0] - width / 2 + 0.46f * width, centerPoint[1] - width / 2 + 0.912f * width,
118 | centerPoint[0] - width / 2 + 0.43f * width, centerPoint[1] - width / 2 + 0.896f * width
119 | );
120 | path.cubicTo(
121 | centerPoint[0] - width / 2 + 0.41f * width, centerPoint[1] - width / 2 + 0.896f * width,
122 | centerPoint[0] - width / 2 + 0.393f * width, centerPoint[1] - width / 2 + 0.888f * width,
123 | centerPoint[0] - width / 2 + 0.402f * width, centerPoint[1] - width / 2 + 0.874f * width
124 | );
125 | path.cubicTo(
126 | centerPoint[0] - width / 2 + 0.402f * width, centerPoint[1] - width / 2 + 0.874f * width,
127 | centerPoint[0] - width / 2 + 0.406f * width, centerPoint[1] - width / 2 + 0.862f * width,
128 | centerPoint[0] - width / 2 + 0.416f * width, centerPoint[1] - width / 2 + 0.856f * width
129 | );
130 | path.cubicTo(
131 | centerPoint[0] - width / 2 + 0.426f * width, centerPoint[1] - width / 2 + 0.849f * width,
132 | centerPoint[0] - width / 2 + 0.432f * width, centerPoint[1] - width / 2 + 0.839f * width,
133 | centerPoint[0] - width / 2 + 0.432f * width, centerPoint[1] - width / 2 + 0.839f * width
134 | );
135 | path.cubicTo(
136 | centerPoint[0] - width / 2 + 0.432f * width, centerPoint[1] - width / 2 + 0.839f * width,
137 | centerPoint[0] - width / 2 + 0.381f * width, centerPoint[1] - width / 2 + 0.821f * width,
138 | centerPoint[0] - width / 2 + 0.365f * width, centerPoint[1] - width / 2 + 0.801f * width
139 | );
140 | path.cubicTo(
141 | centerPoint[0] - width / 2 + 0.365f * width, centerPoint[1] - width / 2 + 0.815f * width,
142 | centerPoint[0] - width / 2 + 0.351f * width, centerPoint[1] - width / 2 + 0.845f * width,
143 | centerPoint[0] - width / 2 + 0.349f * width, centerPoint[1] - width / 2 + 0.862f * width
144 | );
145 | path.cubicTo(
146 | centerPoint[0] - width / 2 + 0.347f * width, centerPoint[1] - width / 2 + 0.878f * width,
147 | centerPoint[0] - width / 2 + 0.321f * width, centerPoint[1] - width / 2 + 0.945f * width,
148 | centerPoint[0] - width / 2 + 0.288f * width, centerPoint[1] - width / 2 + 0.918f * width
149 | );
150 | path.cubicTo(
151 | centerPoint[0] - width / 2 + 0.27f * width, centerPoint[1] - width / 2 + 0.926f * width,
152 | centerPoint[0] - width / 2 + 0.25f * width, centerPoint[1] - width / 2 + 0.91f * width,
153 | centerPoint[0] - width / 2 + 0.25f * width, centerPoint[1] - width / 2 + 0.91f * width
154 | );
155 | path.cubicTo(
156 | centerPoint[0] - width / 2 + 0.236f * width, centerPoint[1] - width / 2 + 0.91f * width,
157 | centerPoint[0] - width / 2 + 0.232f * width, centerPoint[1] - width / 2 + 0.89f * width,
158 | centerPoint[0] - width / 2 + 0.24f * width, centerPoint[1] - width / 2 + 0.882f * width
159 | );
160 | path.cubicTo(
161 | centerPoint[0] - width / 2 + 0.244f * width, centerPoint[1] - width / 2 + 0.87f * width,
162 | centerPoint[0] - width / 2 + 0.256f * width, centerPoint[1] - width / 2 + 0.862f * width,
163 | centerPoint[0] - width / 2 + 0.266f * width, centerPoint[1] - width / 2 + 0.862f * width
164 | );
165 | path.cubicTo(
166 | centerPoint[0] - width / 2 + 0.276f * width, centerPoint[1] - width / 2 + 0.862f * width,
167 | centerPoint[0] - width / 2 + 0.276f * width, centerPoint[1] - width / 2 + 0.852f * width,
168 | centerPoint[0] - width / 2 + 0.276f * width, centerPoint[1] - width / 2 + 0.852f * width
169 | );
170 | path.cubicTo(
171 | centerPoint[0] - width / 2 + 0.276f * width, centerPoint[1] - width / 2 + 0.852f * width,
172 | centerPoint[0] - width / 2 + 0.252f * width, centerPoint[1] - width / 2 + 0.852f * width,
173 | centerPoint[0] - width / 2 + 0.238f * width, centerPoint[1] - width / 2 + 0.852f * width
174 | );
175 | path.cubicTo(
176 | centerPoint[0] - width / 2 + 0.223f * width, centerPoint[1] - width / 2 + 0.852f * width,
177 | centerPoint[0] - width / 2 + 0.209f * width, centerPoint[1] - width / 2 + 0.839f * width,
178 | centerPoint[0] - width / 2 + 0.209f * width, centerPoint[1] - width / 2 + 0.839f * width
179 | );
180 | path.cubicTo(
181 | centerPoint[0] - width / 2 + 0.209f * width, centerPoint[1] - width / 2 + 0.839f * width,
182 | centerPoint[0] - width / 2 + 0.193f * width, centerPoint[1] - width / 2 + 0.829f * width,
183 | centerPoint[0] - width / 2 + 0.203f * width, centerPoint[1] - width / 2 + 0.821f * width
184 | );
185 | path.cubicTo(
186 | centerPoint[0] - width / 2 + 0.211f * width, centerPoint[1] - width / 2 + 0.809f * width,
187 | centerPoint[0] - width / 2 + 0.219f * width, centerPoint[1] - width / 2 + 0.807f * width,
188 | centerPoint[0] - width / 2 + 0.23f * width, centerPoint[1] - width / 2 + 0.807f * width
189 | );
190 | path.cubicTo(
191 | centerPoint[0] - width / 2 + 0.24f * width, centerPoint[1] - width / 2 + 0.807f * width,
192 | centerPoint[0] - width / 2 + 0.242f * width, centerPoint[1] - width / 2 + 0.738f * width,
193 | centerPoint[0] - width / 2 + 0.234f * width, centerPoint[1] - width / 2 + 0.714f * width
194 | );
195 | path.cubicTo(
196 | centerPoint[0] - width / 2 + 0.225f * width, centerPoint[1] - width / 2 + 0.69f * width,
197 | centerPoint[0] - width / 2 + 0.207f * width, centerPoint[1] - width / 2 + 0.615f * width,
198 | centerPoint[0] - width / 2 + 0.197f * width, centerPoint[1] - width / 2 + 0.599f * width
199 | );
200 | path.cubicTo(
201 | centerPoint[0] - width / 2 + 0.187f * width, centerPoint[1] - width / 2 + 0.582f * width,
202 | centerPoint[0] - width / 2 + 0.118f * width, centerPoint[1] - width / 2 + 0.499f * width,
203 | centerPoint[0] - width / 2 + 0.11f * width, centerPoint[1] - width / 2 + 0.445f * width
204 | );
205 | path.cubicTo(
206 | centerPoint[0] - width / 2 + 0.102f * width, centerPoint[1] - width / 2 + 0.39f * width,
207 | centerPoint[0] - width / 2 + 0.098f * width, centerPoint[1] - width / 2 + 0.366f * width,
208 | centerPoint[0] - width / 2 + 0.098f * width, centerPoint[1] - width / 2 + 0.366f * width
209 | );
210 | path.cubicTo(
211 | centerPoint[0] - width / 2 + 0.098f * width, centerPoint[1] - width / 2 + 0.366f * width,
212 | centerPoint[0] - width / 2 + 0.066f * width, centerPoint[1] - width / 2 + 0.348f * width,
213 | centerPoint[0] - width / 2 + 0.062f * width, centerPoint[1] - width / 2 + 0.331f * width
214 | );
215 | path.cubicTo(
216 | centerPoint[0] - width / 2 + 0.045f * width, centerPoint[1] - width / 2 + 0.315f * width,
217 | centerPoint[0] - width / 2 + 0.027f * width, centerPoint[1] - width / 2 + 0.289f * width,
218 | centerPoint[0] - width / 2 + 0.029f * width, centerPoint[1] - width / 2 + 0.253f * width
219 | );
220 | path.cubicTo(
221 | centerPoint[0] - width / 2 + 0.031f * width, centerPoint[1] - width / 2 + 0.216f * width,
222 | centerPoint[0] - width / 2 + 0.039f * width, centerPoint[1] - width / 2 + 0.2f * width,
223 | centerPoint[0] - width / 2 + 0.049f * width, centerPoint[1] - width / 2 + 0.182f * width
224 | );
225 | path.cubicTo(
226 | centerPoint[0] - width / 2 + 0.06f * width, centerPoint[1] - width / 2 + 0.163f * width,
227 | centerPoint[0] - width / 2 + 0.058f * width, centerPoint[1] - width / 2 + 0.153f * width,
228 | centerPoint[0] - width / 2 + 0.058f * width, centerPoint[1] - width / 2 + 0.153f * width
229 | );
230 | return path;
231 |
232 | }
233 |
234 | }
235 |
--------------------------------------------------------------------------------
/library/src/main/java/jp/co/recruit_lifestyle/android/widget/character/HairStylePath.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 RECRUIT LIFESTYLE CO., LTD.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package jp.co.recruit_lifestyle.android.widget.character;
18 |
19 | import android.graphics.Path;
20 |
21 | /**
22 | * @author amyu
23 | */
24 | public class HairStylePath {
25 |
26 | public static Path getHairStylePath(float width, float[] centerPoint){
27 | Path path = new Path();
28 |
29 | path.moveTo(centerPoint[0] - width / 2 + 0.784f * width, centerPoint[1] - width / 2 + 0.864f * width);
30 | path.cubicTo(
31 | centerPoint[0] - width / 2 + 0.784f * width, centerPoint[1] - width / 2 + 0.864f * width,
32 | centerPoint[0] - width / 2 + 0.769f * width, centerPoint[1] - width / 2 + 0.872f * width,
33 | centerPoint[0] - width / 2 + 0.752f * width, centerPoint[1] - width / 2 + 0.864f * width
34 | );
35 | path.cubicTo(
36 | centerPoint[0] - width / 2 + 0.735f * width, centerPoint[1] - width / 2 + 0.855f * width,
37 | centerPoint[0] - width / 2 + 0.73f * width, centerPoint[1] - width / 2 + 0.84f * width,
38 | centerPoint[0] - width / 2 + 0.76f * width, centerPoint[1] - width / 2 + 0.806f * width
39 | );
40 | path.cubicTo(
41 | centerPoint[0] - width / 2 + 0.79f * width, centerPoint[1] - width / 2 + 0.772f * width,
42 | centerPoint[0] - width / 2 + 0.788f * width, centerPoint[1] - width / 2 + 0.729f * width,
43 | centerPoint[0] - width / 2 + 0.773f * width, centerPoint[1] - width / 2 + 0.704f * width
44 | );
45 | path.cubicTo(
46 | centerPoint[0] - width / 2 + 0.818f * width, centerPoint[1] - width / 2 + 0.544f * width,
47 | centerPoint[0] - width / 2 + 0.715f * width, centerPoint[1] - width / 2 + 0.567f * width,
48 | centerPoint[0] - width / 2 + 0.722f * width, centerPoint[1] - width / 2 + 0.544f * width
49 | );
50 | path.cubicTo(
51 | centerPoint[0] - width / 2 + 0.728f * width, centerPoint[1] - width / 2 + 0.52f * width,
52 | centerPoint[0] - width / 2 + 0.709f * width, centerPoint[1] - width / 2 + 0.488f * width,
53 | centerPoint[0] - width / 2 + 0.713f * width, centerPoint[1] - width / 2 + 0.452f * width
54 | );
55 | path.cubicTo(
56 | centerPoint[0] - width / 2 + 0.717f * width, centerPoint[1] - width / 2 + 0.416f * width,
57 | centerPoint[0] - width / 2 + 0.735f * width, centerPoint[1] - width / 2 + 0.317f * width,
58 | centerPoint[0] - width / 2 + 0.656f * width, centerPoint[1] - width / 2 + 0.196f * width
59 | );
60 | path.cubicTo(
61 | centerPoint[0] - width / 2 + 0.577f * width, centerPoint[1] - width / 2 + 0.074f * width,
62 | centerPoint[0] - width / 2 + 0.474f * width, centerPoint[1] - width / 2 + 0.098f * width,
63 | centerPoint[0] - width / 2 + 0.414f * width, centerPoint[1] - width / 2 + 0.132f * width
64 | );
65 | path.cubicTo(
66 | centerPoint[0] - width / 2 + 0.312f * width, centerPoint[1] - width / 2 + 0.132f * width,
67 | centerPoint[0] - width / 2 + 0.271f * width, centerPoint[1] - width / 2 + 0.292f * width,
68 | centerPoint[0] - width / 2 + 0.273f * width, centerPoint[1] - width / 2 + 0.36f * width
69 | );
70 | path.cubicTo(
71 | centerPoint[0] - width / 2 + 0.276f * width, centerPoint[1] - width / 2 + 0.428f * width,
72 | centerPoint[0] - width / 2 + 0.26f * width, centerPoint[1] - width / 2 + 0.459f * width,
73 | centerPoint[0] - width / 2 + 0.259f * width, centerPoint[1] - width / 2 + 0.534f * width
74 | );
75 | path.cubicTo(
76 | centerPoint[0] - width / 2 + 0.257f * width, centerPoint[1] - width / 2 + 0.592f * width,
77 | centerPoint[0] - width / 2 + 0.275f * width, centerPoint[1] - width / 2 + 0.623f * width,
78 | centerPoint[0] - width / 2 + 0.294f * width, centerPoint[1] - width / 2 + 0.642f * width
79 | );
80 | path.cubicTo(
81 | centerPoint[0] - width / 2 + 0.29f * width, centerPoint[1] - width / 2 + 0.657f * width,
82 | centerPoint[0] - width / 2 + 0.279f * width, centerPoint[1] - width / 2 + 0.674f * width,
83 | centerPoint[0] - width / 2 + 0.254f * width, centerPoint[1] - width / 2 + 0.663f * width
84 | );
85 | path.cubicTo(
86 | centerPoint[0] - width / 2 + 0.254f * width, centerPoint[1] - width / 2 + 0.663f * width,
87 | centerPoint[0] - width / 2 + 0.286f * width, centerPoint[1] - width / 2 + 0.694f * width,
88 | centerPoint[0] - width / 2 + 0.31f * width, centerPoint[1] - width / 2 + 0.657f * width
89 | );
90 | path.cubicTo(
91 | centerPoint[0] - width / 2 + 0.313f * width, centerPoint[1] - width / 2 + 0.659f * width,
92 | centerPoint[0] - width / 2 + 0.316f * width, centerPoint[1] - width / 2 + 0.661f * width,
93 | centerPoint[0] - width / 2 + 0.318f * width, centerPoint[1] - width / 2 + 0.663f * width
94 | );
95 | path.cubicTo(
96 | centerPoint[0] - width / 2 + 0.34f * width, centerPoint[1] - width / 2 + 0.68f * width,
97 | centerPoint[0] - width / 2 + 0.38f * width, centerPoint[1] - width / 2 + 0.704f * width,
98 | centerPoint[0] - width / 2 + 0.404f * width, centerPoint[1] - width / 2 + 0.7f * width
99 | );
100 | path.cubicTo(
101 | centerPoint[0] - width / 2 + 0.37f * width, centerPoint[1] - width / 2 + 0.687f * width,
102 | centerPoint[0] - width / 2 + 0.367f * width, centerPoint[1] - width / 2 + 0.659f * width,
103 | centerPoint[0] - width / 2 + 0.367f * width, centerPoint[1] - width / 2 + 0.659f * width
104 | );
105 | path.cubicTo(
106 | centerPoint[0] - width / 2 + 0.367f * width, centerPoint[1] - width / 2 + 0.659f * width,
107 | centerPoint[0] - width / 2 + 0.376f * width, centerPoint[1] - width / 2 + 0.67f * width,
108 | centerPoint[0] - width / 2 + 0.391f * width, centerPoint[1] - width / 2 + 0.655f * width
109 | );
110 | path.cubicTo(
111 | centerPoint[0] - width / 2 + 0.367f * width, centerPoint[1] - width / 2 + 0.659f * width,
112 | centerPoint[0] - width / 2 + 0.355f * width, centerPoint[1] - width / 2 + 0.636f * width,
113 | centerPoint[0] - width / 2 + 0.363f * width, centerPoint[1] - width / 2 + 0.612f * width
114 | );
115 | path.cubicTo(
116 | centerPoint[0] - width / 2 + 0.408f * width, centerPoint[1] - width / 2 + 0.642f * width,
117 | centerPoint[0] - width / 2 + 0.416f * width, centerPoint[1] - width / 2 + 0.582f * width,
118 | centerPoint[0] - width / 2 + 0.416f * width, centerPoint[1] - width / 2 + 0.582f * width
119 | );
120 | path.cubicTo(
121 | centerPoint[0] - width / 2 + 0.416f * width, centerPoint[1] - width / 2 + 0.582f * width,
122 | centerPoint[0] - width / 2 + 0.41f * width, centerPoint[1] - width / 2 + 0.597f * width,
123 | centerPoint[0] - width / 2 + 0.402f * width, centerPoint[1] - width / 2 + 0.599f * width
124 | );
125 | path.cubicTo(
126 | centerPoint[0] - width / 2 + 0.359f * width, centerPoint[1] - width / 2 + 0.623f * width,
127 | centerPoint[0] - width / 2 + 0.331f * width, centerPoint[1] - width / 2 + 0.448f * width,
128 | centerPoint[0] - width / 2 + 0.344f * width, centerPoint[1] - width / 2 + 0.435f * width
129 | );
130 | path.cubicTo(
131 | centerPoint[0] - width / 2 + 0.357f * width, centerPoint[1] - width / 2 + 0.422f * width,
132 | centerPoint[0] - width / 2 + 0.391f * width, centerPoint[1] - width / 2 + 0.354f * width,
133 | centerPoint[0] - width / 2 + 0.397f * width, centerPoint[1] - width / 2 + 0.32f * width
134 | );
135 | path.cubicTo(
136 | centerPoint[0] - width / 2 + 0.404f * width, centerPoint[1] - width / 2 + 0.285f * width,
137 | centerPoint[0] - width / 2 + 0.429f * width, centerPoint[1] - width / 2 + 0.226f * width,
138 | centerPoint[0] - width / 2 + 0.429f * width, centerPoint[1] - width / 2 + 0.226f * width
139 | );
140 | path.cubicTo(
141 | centerPoint[0] - width / 2 + 0.429f * width, centerPoint[1] - width / 2 + 0.226f * width,
142 | centerPoint[0] - width / 2 + 0.438f * width, centerPoint[1] - width / 2 + 0.315f * width,
143 | centerPoint[0] - width / 2 + 0.499f * width, centerPoint[1] - width / 2 + 0.311f * width
144 | );
145 | path.cubicTo(
146 | centerPoint[0] - width / 2 + 0.519f * width, centerPoint[1] - width / 2 + 0.326f * width,
147 | centerPoint[0] - width / 2 + 0.524f * width, centerPoint[1] - width / 2 + 0.346f * width,
148 | centerPoint[0] - width / 2 + 0.553f * width, centerPoint[1] - width / 2 + 0.354f * width
149 | );
150 | path.cubicTo(
151 | centerPoint[0] - width / 2 + 0.582f * width, centerPoint[1] - width / 2 + 0.361f * width,
152 | centerPoint[0] - width / 2 + 0.594f * width, centerPoint[1] - width / 2 + 0.418f * width,
153 | centerPoint[0] - width / 2 + 0.622f * width, centerPoint[1] - width / 2 + 0.426f * width
154 | );
155 | path.cubicTo(
156 | centerPoint[0] - width / 2 + 0.622f * width, centerPoint[1] - width / 2 + 0.426f * width,
157 | centerPoint[0] - width / 2 + 0.659f * width, centerPoint[1] - width / 2 + 0.648f * width,
158 | centerPoint[0] - width / 2 + 0.579f * width, centerPoint[1] - width / 2 + 0.594f * width
159 | );
160 | path.cubicTo(
161 | centerPoint[0] - width / 2 + 0.598f * width, centerPoint[1] - width / 2 + 0.617f * width,
162 | centerPoint[0] - width / 2 + 0.595f * width, centerPoint[1] - width / 2 + 0.62f * width,
163 | centerPoint[0] - width / 2 + 0.611f * width, centerPoint[1] - width / 2 + 0.621f * width
164 | );
165 | path.cubicTo(
166 | centerPoint[0] - width / 2 + 0.608f * width, centerPoint[1] - width / 2 + 0.627f * width,
167 | centerPoint[0] - width / 2 + 0.594f * width, centerPoint[1] - width / 2 + 0.626f * width,
168 | centerPoint[0] - width / 2 + 0.594f * width, centerPoint[1] - width / 2 + 0.626f * width
169 | );
170 | path.cubicTo(
171 | centerPoint[0] - width / 2 + 0.594f * width, centerPoint[1] - width / 2 + 0.626f * width,
172 | centerPoint[0] - width / 2 + 0.602f * width, centerPoint[1] - width / 2 + 0.641f * width,
173 | centerPoint[0] - width / 2 + 0.615f * width, centerPoint[1] - width / 2 + 0.634f * width
174 | );
175 | path.cubicTo(
176 | centerPoint[0] - width / 2 + 0.618f * width, centerPoint[1] - width / 2 + 0.666f * width,
177 | centerPoint[0] - width / 2 + 0.631f * width, centerPoint[1] - width / 2 + 0.67f * width,
178 | centerPoint[0] - width / 2 + 0.631f * width, centerPoint[1] - width / 2 + 0.67f * width
179 | );
180 | path.cubicTo(
181 | centerPoint[0] - width / 2 + 0.631f * width, centerPoint[1] - width / 2 + 0.67f * width,
182 | centerPoint[0] - width / 2 + 0.625f * width, centerPoint[1] - width / 2 + 0.679f * width,
183 | centerPoint[0] - width / 2 + 0.597f * width, centerPoint[1] - width / 2 + 0.693f * width
184 | );
185 | path.cubicTo(
186 | centerPoint[0] - width / 2 + 0.632f * width, centerPoint[1] - width / 2 + 0.692f * width,
187 | centerPoint[0] - width / 2 + 0.649f * width, centerPoint[1] - width / 2 + 0.687f * width,
188 | centerPoint[0] - width / 2 + 0.666f * width, centerPoint[1] - width / 2 + 0.659f * width
189 | );
190 | path.cubicTo(
191 | centerPoint[0] - width / 2 + 0.662f * width, centerPoint[1] - width / 2 + 0.678f * width,
192 | centerPoint[0] - width / 2 + 0.675f * width, centerPoint[1] - width / 2 + 0.708f * width,
193 | centerPoint[0] - width / 2 + 0.692f * width, centerPoint[1] - width / 2 + 0.721f * width
194 | );
195 | path.cubicTo(
196 | centerPoint[0] - width / 2 + 0.709f * width, centerPoint[1] - width / 2 + 0.734f * width,
197 | centerPoint[0] - width / 2 + 0.707f * width, centerPoint[1] - width / 2 + 0.747f * width,
198 | centerPoint[0] - width / 2 + 0.698f * width, centerPoint[1] - width / 2 + 0.768f * width
199 | );
200 | path.cubicTo(
201 | centerPoint[0] - width / 2 + 0.69f * width, centerPoint[1] - width / 2 + 0.789f * width,
202 | centerPoint[0] - width / 2 + 0.696f * width, centerPoint[1] - width / 2 + 0.811f * width,
203 | centerPoint[0] - width / 2 + 0.696f * width, centerPoint[1] - width / 2 + 0.811f * width
204 | );
205 | path.cubicTo(
206 | centerPoint[0] - width / 2 + 0.696f * width, centerPoint[1] - width / 2 + 0.811f * width,
207 | centerPoint[0] - width / 2 + 0.679f * width, centerPoint[1] - width / 2 + 0.823f * width,
208 | centerPoint[0] - width / 2 + 0.683f * width, centerPoint[1] - width / 2 + 0.862f * width
209 | );
210 | path.cubicTo(
211 | centerPoint[0] - width / 2 + 0.688f * width, centerPoint[1] - width / 2 + 0.9f * width,
212 | centerPoint[0] - width / 2 + 0.735f * width, centerPoint[1] - width / 2 + 0.919f * width,
213 | centerPoint[0] - width / 2 + 0.735f * width, centerPoint[1] - width / 2 + 0.9f * width
214 | );
215 | path.cubicTo(
216 | centerPoint[0] - width / 2 + 0.756f * width, centerPoint[1] - width / 2 + 0.926f * width,
217 | centerPoint[0] - width / 2 + 0.773f * width, centerPoint[1] - width / 2 + 0.902f * width,
218 | centerPoint[0] - width / 2 + 0.773f * width, centerPoint[1] - width / 2 + 0.902f * width
219 | );
220 | path.cubicTo(
221 | centerPoint[0] - width / 2 + 0.773f * width, centerPoint[1] - width / 2 + 0.902f * width,
222 | centerPoint[0] - width / 2 + 0.756f * width, centerPoint[1] - width / 2 + 0.915f * width,
223 | centerPoint[0] - width / 2 + 0.743f * width, centerPoint[1] - width / 2 + 0.892f * width
224 | );
225 | path.cubicTo(
226 | centerPoint[0] - width / 2 + 0.773f * width, centerPoint[1] - width / 2 + 0.902f * width,
227 | centerPoint[0] - width / 2 + 0.784f * width, centerPoint[1] - width / 2 + 0.864f * width,
228 | centerPoint[0] - width / 2 + 0.784f * width, centerPoint[1] - width / 2 + 0.864f * width
229 | );
230 | return path;
231 | }
232 |
233 | }
234 |
--------------------------------------------------------------------------------
/library/src/main/java/jp/co/recruit_lifestyle/android/widget/character/NinjaPath.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 RECRUIT LIFESTYLE CO., LTD.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package jp.co.recruit_lifestyle.android.widget.character;
18 |
19 | import android.graphics.Path;
20 |
21 | /**
22 | * @author amyu
23 | */
24 | public class NinjaPath {
25 |
26 | public static Path getNinjaPath(float width, float[] centerPoint){
27 | Path path = new Path();
28 |
29 | path.moveTo(centerPoint[0] - width / 2 + 0.476f * width,
30 | centerPoint[1] - width / 2 + 0.186f * width);
31 | path.cubicTo(
32 | centerPoint[0] - width / 2 + 0.472f * width, centerPoint[1] - width / 2 + 0.186f * width,
33 | centerPoint[0] - width / 2 + 0.464f * width, centerPoint[1] - width / 2 + 0.163f * width,
34 | centerPoint[0] - width / 2 + 0.463f * width, centerPoint[1] - width / 2 + 0.156f * width
35 | );
36 | path.cubicTo(
37 | centerPoint[0] - width / 2 + 0.462f * width, centerPoint[1] - width / 2 + 0.149f * width,
38 | centerPoint[0] - width / 2 + 0.464f * width, centerPoint[1] - width / 2 + 0.118f * width,
39 | centerPoint[0] - width / 2 + 0.464f * width, centerPoint[1] - width / 2 + 0.11f * width
40 | );
41 | path.cubicTo(
42 | centerPoint[0] - width / 2 + 0.464f * width, centerPoint[1] - width / 2 + 0.102f * width,
43 | centerPoint[0] - width / 2 + 0.472f * width, centerPoint[1] - width / 2 + 0.086f * width,
44 | centerPoint[0] - width / 2 + 0.479f * width, centerPoint[1] - width / 2 + 0.081f * width
45 | );
46 | path.cubicTo(
47 | centerPoint[0] - width / 2 + 0.486f * width, centerPoint[1] - width / 2 + 0.075f * width,
48 | centerPoint[0] - width / 2 + 0.517f * width, centerPoint[1] - width / 2 + 0.075f * width,
49 | centerPoint[0] - width / 2 + 0.53f * width, centerPoint[1] - width / 2 + 0.081f * width
50 | );
51 | path.cubicTo(
52 | centerPoint[0] - width / 2 + 0.542f * width, centerPoint[1] - width / 2 + 0.086f * width,
53 | centerPoint[0] - width / 2 + 0.549f * width, centerPoint[1] - width / 2 + 0.097f * width,
54 | centerPoint[0] - width / 2 + 0.551f * width, centerPoint[1] - width / 2 + 0.107f * width
55 | );
56 | path.cubicTo(
57 | centerPoint[0] - width / 2 + 0.554f * width, centerPoint[1] - width / 2 + 0.117f * width,
58 | centerPoint[0] - width / 2 + 0.554f * width, centerPoint[1] - width / 2 + 0.139f * width,
59 | centerPoint[0] - width / 2 + 0.553f * width, centerPoint[1] - width / 2 + 0.146f * width
60 | );
61 | path.cubicTo(
62 | centerPoint[0] - width / 2 + 0.551f * width, centerPoint[1] - width / 2 + 0.153f * width,
63 | centerPoint[0] - width / 2 + 0.547f * width, centerPoint[1] - width / 2 + 0.173f * width,
64 | centerPoint[0] - width / 2 + 0.543f * width, centerPoint[1] - width / 2 + 0.179f * width
65 | );
66 | path.cubicTo(
67 | centerPoint[0] - width / 2 + 0.54f * width, centerPoint[1] - width / 2 + 0.185f * width,
68 | centerPoint[0] - width / 2 + 0.546f * width, centerPoint[1] - width / 2 + 0.194f * width,
69 | centerPoint[0] - width / 2 + 0.546f * width, centerPoint[1] - width / 2 + 0.194f * width
70 | );
71 | path.cubicTo(
72 | centerPoint[0] - width / 2 + 0.546f * width, centerPoint[1] - width / 2 + 0.194f * width,
73 | centerPoint[0] - width / 2 + 0.559f * width, centerPoint[1] - width / 2 + 0.184f * width,
74 | centerPoint[0] - width / 2 + 0.564f * width, centerPoint[1] - width / 2 + 0.19f * width
75 | );
76 | path.cubicTo(
77 | centerPoint[0] - width / 2 + 0.569f * width, centerPoint[1] - width / 2 + 0.197f * width,
78 | centerPoint[0] - width / 2 + 0.569f * width, centerPoint[1] - width / 2 + 0.203f * width,
79 | centerPoint[0] - width / 2 + 0.575f * width, centerPoint[1] - width / 2 + 0.203f * width
80 | );
81 | path.cubicTo(
82 | centerPoint[0] - width / 2 + 0.582f * width, centerPoint[1] - width / 2 + 0.203f * width,
83 | centerPoint[0] - width / 2 + 0.599f * width, centerPoint[1] - width / 2 + 0.195f * width,
84 | centerPoint[0] - width / 2 + 0.601f * width, centerPoint[1] - width / 2 + 0.2f * width
85 | );
86 | path.cubicTo(
87 | centerPoint[0] - width / 2 + 0.602f * width, centerPoint[1] - width / 2 + 0.204f * width,
88 | centerPoint[0] - width / 2 + 0.618f * width, centerPoint[1] - width / 2 + 0.21f * width,
89 | centerPoint[0] - width / 2 + 0.621f * width, centerPoint[1] - width / 2 + 0.213f * width
90 | );
91 | path.cubicTo(
92 | centerPoint[0] - width / 2 + 0.625f * width, centerPoint[1] - width / 2 + 0.217f * width,
93 | centerPoint[0] - width / 2 + 0.644f * width, centerPoint[1] - width / 2 + 0.231f * width,
94 | centerPoint[0] - width / 2 + 0.646f * width, centerPoint[1] - width / 2 + 0.234f * width
95 | );
96 | path.cubicTo(
97 | centerPoint[0] - width / 2 + 0.649f * width, centerPoint[1] - width / 2 + 0.237f * width,
98 | centerPoint[0] - width / 2 + 0.66f * width, centerPoint[1] - width / 2 + 0.253f * width,
99 | centerPoint[0] - width / 2 + 0.662f * width, centerPoint[1] - width / 2 + 0.26f * width
100 | );
101 | path.cubicTo(
102 | centerPoint[0] - width / 2 + 0.665f * width, centerPoint[1] - width / 2 + 0.267f * width,
103 | centerPoint[0] - width / 2 + 0.661f * width, centerPoint[1] - width / 2 + 0.345f * width,
104 | centerPoint[0] - width / 2 + 0.654f * width, centerPoint[1] - width / 2 + 0.35f * width
105 | );
106 | path.cubicTo(
107 | centerPoint[0] - width / 2 + 0.648f * width, centerPoint[1] - width / 2 + 0.354f * width,
108 | centerPoint[0] - width / 2 + 0.633f * width, centerPoint[1] - width / 2 + 0.359f * width,
109 | centerPoint[0] - width / 2 + 0.633f * width, centerPoint[1] - width / 2 + 0.359f * width
110 | );
111 | path.cubicTo(
112 | centerPoint[0] - width / 2 + 0.633f * width, centerPoint[1] - width / 2 + 0.359f * width,
113 | centerPoint[0] - width / 2 + 0.617f * width, centerPoint[1] - width / 2 + 0.346f * width,
114 | centerPoint[0] - width / 2 + 0.617f * width, centerPoint[1] - width / 2 + 0.346f * width
115 | );
116 | path.cubicTo(
117 | centerPoint[0] - width / 2 + 0.617f * width, centerPoint[1] - width / 2 + 0.346f * width,
118 | centerPoint[0] - width / 2 + 0.604f * width, centerPoint[1] - width / 2 + 0.358f * width,
119 | centerPoint[0] - width / 2 + 0.598f * width, centerPoint[1] - width / 2 + 0.358f * width
120 | );
121 | path.cubicTo(
122 | centerPoint[0] - width / 2 + 0.593f * width, centerPoint[1] - width / 2 + 0.358f * width,
123 | centerPoint[0] - width / 2 + 0.58f * width, centerPoint[1] - width / 2 + 0.355f * width,
124 | centerPoint[0] - width / 2 + 0.58f * width, centerPoint[1] - width / 2 + 0.361f * width
125 | );
126 | path.cubicTo(
127 | centerPoint[0] - width / 2 + 0.58f * width, centerPoint[1] - width / 2 + 0.367f * width,
128 | centerPoint[0] - width / 2 + 0.582f * width, centerPoint[1] - width / 2 + 0.393f * width,
129 | centerPoint[0] - width / 2 + 0.586f * width, centerPoint[1] - width / 2 + 0.398f * width
130 | );
131 | path.cubicTo(
132 | centerPoint[0] - width / 2 + 0.589f * width, centerPoint[1] - width / 2 + 0.402f * width,
133 | centerPoint[0] - width / 2 + 0.62f * width, centerPoint[1] - width / 2 + 0.447f * width,
134 | centerPoint[0] - width / 2 + 0.622f * width, centerPoint[1] - width / 2 + 0.458f * width
135 | );
136 | path.cubicTo(
137 | centerPoint[0] - width / 2 + 0.625f * width, centerPoint[1] - width / 2 + 0.47f * width,
138 | centerPoint[0] - width / 2 + 0.625f * width, centerPoint[1] - width / 2 + 0.471f * width,
139 | centerPoint[0] - width / 2 + 0.621f * width, centerPoint[1] - width / 2 + 0.48f * width
140 | );
141 | path.cubicTo(
142 | centerPoint[0] - width / 2 + 0.618f * width, centerPoint[1] - width / 2 + 0.489f * width,
143 | centerPoint[0] - width / 2 + 0.614f * width, centerPoint[1] - width / 2 + 0.536f * width,
144 | centerPoint[0] - width / 2 + 0.617f * width, centerPoint[1] - width / 2 + 0.543f * width
145 | );
146 | path.cubicTo(
147 | centerPoint[0] - width / 2 + 0.619f * width, centerPoint[1] - width / 2 + 0.55f * width,
148 | centerPoint[0] - width / 2 + 0.62f * width, centerPoint[1] - width / 2 + 0.582f * width,
149 | centerPoint[0] - width / 2 + 0.621f * width, centerPoint[1] - width / 2 + 0.59f * width
150 | );
151 | path.cubicTo(
152 | centerPoint[0] - width / 2 + 0.622f * width, centerPoint[1] - width / 2 + 0.598f * width,
153 | centerPoint[0] - width / 2 + 0.627f * width, centerPoint[1] - width / 2 + 0.614f * width,
154 | centerPoint[0] - width / 2 + 0.625f * width, centerPoint[1] - width / 2 + 0.628f * width
155 | );
156 | path.cubicTo(
157 | centerPoint[0] - width / 2 + 0.622f * width, centerPoint[1] - width / 2 + 0.642f * width,
158 | centerPoint[0] - width / 2 + 0.621f * width, centerPoint[1] - width / 2 + 0.666f * width,
159 | centerPoint[0] - width / 2 + 0.613f * width, centerPoint[1] - width / 2 + 0.67f * width
160 | );
161 | path.cubicTo(
162 | centerPoint[0] - width / 2 + 0.605f * width, centerPoint[1] - width / 2 + 0.675f * width,
163 | centerPoint[0] - width / 2 + 0.603f * width, centerPoint[1] - width / 2 + 0.676f * width,
164 | centerPoint[0] - width / 2 + 0.601f * width, centerPoint[1] - width / 2 + 0.681f * width
165 | );
166 | path.cubicTo(
167 | centerPoint[0] - width / 2 + 0.598f * width, centerPoint[1] - width / 2 + 0.685f * width,
168 | centerPoint[0] - width / 2 + 0.596f * width, centerPoint[1] - width / 2 + 0.786f * width,
169 | centerPoint[0] - width / 2 + 0.595f * width, centerPoint[1] - width / 2 + 0.8f * width
170 | );
171 | path.cubicTo(
172 | centerPoint[0] - width / 2 + 0.594f * width, centerPoint[1] - width / 2 + 0.807f * width,
173 | centerPoint[0] - width / 2 + 0.596f * width, centerPoint[1] - width / 2 + 0.833f * width,
174 | centerPoint[0] - width / 2 + 0.599f * width, centerPoint[1] - width / 2 + 0.841f * width
175 | );
176 | path.cubicTo(
177 | centerPoint[0] - width / 2 + 0.603f * width, centerPoint[1] - width / 2 + 0.849f * width,
178 | centerPoint[0] - width / 2 + 0.617f * width, centerPoint[1] - width / 2 + 0.863f * width,
179 | centerPoint[0] - width / 2 + 0.634f * width, centerPoint[1] - width / 2 + 0.866f * width
180 | );
181 | path.cubicTo(
182 | centerPoint[0] - width / 2 + 0.651f * width, centerPoint[1] - width / 2 + 0.87f * width,
183 | centerPoint[0] - width / 2 + 0.657f * width, centerPoint[1] - width / 2 + 0.883f * width,
184 | centerPoint[0] - width / 2 + 0.651f * width, centerPoint[1] - width / 2 + 0.886f * width
185 | );
186 | path.cubicTo(
187 | centerPoint[0] - width / 2 + 0.645f * width, centerPoint[1] - width / 2 + 0.888f * width,
188 | centerPoint[0] - width / 2 + 0.621f * width, centerPoint[1] - width / 2 + 0.89f * width,
189 | centerPoint[0] - width / 2 + 0.61f * width, centerPoint[1] - width / 2 + 0.886f * width
190 | );
191 | path.cubicTo(
192 | centerPoint[0] - width / 2 + 0.598f * width, centerPoint[1] - width / 2 + 0.881f * width,
193 | centerPoint[0] - width / 2 + 0.568f * width, centerPoint[1] - width / 2 + 0.885f * width,
194 | centerPoint[0] - width / 2 + 0.562f * width, centerPoint[1] - width / 2 + 0.88f * width
195 | );
196 | path.cubicTo(
197 | centerPoint[0] - width / 2 + 0.555f * width, centerPoint[1] - width / 2 + 0.874f * width,
198 | centerPoint[0] - width / 2 + 0.55f * width, centerPoint[1] - width / 2 + 0.871f * width,
199 | centerPoint[0] - width / 2 + 0.556f * width, centerPoint[1] - width / 2 + 0.858f * width
200 | );
201 | path.cubicTo(
202 | centerPoint[0] - width / 2 + 0.559f * width, centerPoint[1] - width / 2 + 0.851f * width,
203 | centerPoint[0] - width / 2 + 0.557f * width, centerPoint[1] - width / 2 + 0.833f * width,
204 | centerPoint[0] - width / 2 + 0.556f * width, centerPoint[1] - width / 2 + 0.825f * width
205 | );
206 | path.cubicTo(
207 | centerPoint[0] - width / 2 + 0.555f * width, centerPoint[1] - width / 2 + 0.817f * width,
208 | centerPoint[0] - width / 2 + 0.542f * width, centerPoint[1] - width / 2 + 0.752f * width,
209 | centerPoint[0] - width / 2 + 0.54f * width, centerPoint[1] - width / 2 + 0.724f * width
210 | );
211 | path.cubicTo(
212 | centerPoint[0] - width / 2 + 0.538f * width, centerPoint[1] - width / 2 + 0.697f * width,
213 | centerPoint[0] - width / 2 + 0.541f * width, centerPoint[1] - width / 2 + 0.686f * width,
214 | centerPoint[0] - width / 2 + 0.541f * width, centerPoint[1] - width / 2 + 0.686f * width
215 | );
216 | path.cubicTo(
217 | centerPoint[0] - width / 2 + 0.541f * width, centerPoint[1] - width / 2 + 0.686f * width,
218 | centerPoint[0] - width / 2 + 0.526f * width, centerPoint[1] - width / 2 + 0.663f * width,
219 | centerPoint[0] - width / 2 + 0.526f * width, centerPoint[1] - width / 2 + 0.663f * width
220 | );
221 | path.cubicTo(
222 | centerPoint[0] - width / 2 + 0.526f * width, centerPoint[1] - width / 2 + 0.663f * width,
223 | centerPoint[0] - width / 2 + 0.516f * width, centerPoint[1] - width / 2 + 0.683f * width,
224 | centerPoint[0] - width / 2 + 0.509f * width, centerPoint[1] - width / 2 + 0.682f * width
225 | );
226 | path.cubicTo(
227 | centerPoint[0] - width / 2 + 0.502f * width, centerPoint[1] - width / 2 + 0.681f * width,
228 | centerPoint[0] - width / 2 + 0.517f * width, centerPoint[1] - width / 2 + 0.722f * width,
229 | centerPoint[0] - width / 2 + 0.511f * width, centerPoint[1] - width / 2 + 0.738f * width
230 | );
231 | path.cubicTo(
232 | centerPoint[0] - width / 2 + 0.506f * width, centerPoint[1] - width / 2 + 0.754f * width,
233 | centerPoint[0] - width / 2 + 0.509f * width, centerPoint[1] - width / 2 + 0.826f * width,
234 | centerPoint[0] - width / 2 + 0.512f * width, centerPoint[1] - width / 2 + 0.837f * width
235 | );
236 | path.cubicTo(
237 | centerPoint[0] - width / 2 + 0.516f * width, centerPoint[1] - width / 2 + 0.849f * width,
238 | centerPoint[0] - width / 2 + 0.527f * width, centerPoint[1] - width / 2 + 0.872f * width,
239 | centerPoint[0] - width / 2 + 0.515f * width, centerPoint[1] - width / 2 + 0.878f * width
240 | );
241 | path.cubicTo(
242 | centerPoint[0] - width / 2 + 0.502f * width, centerPoint[1] - width / 2 + 0.883f * width,
243 | centerPoint[0] - width / 2 + 0.455f * width, centerPoint[1] - width / 2 + 0.876f * width,
244 | centerPoint[0] - width / 2 + 0.445f * width, centerPoint[1] - width / 2 + 0.88f * width
245 | );
246 | path.cubicTo(
247 | centerPoint[0] - width / 2 + 0.435f * width, centerPoint[1] - width / 2 + 0.883f * width,
248 | centerPoint[0] - width / 2 + 0.419f * width, centerPoint[1] - width / 2 + 0.884f * width,
249 | centerPoint[0] - width / 2 + 0.423f * width, centerPoint[1] - width / 2 + 0.876f * width
250 | );
251 | path.cubicTo(
252 | centerPoint[0] - width / 2 + 0.428f * width, centerPoint[1] - width / 2 + 0.868f * width,
253 | centerPoint[0] - width / 2 + 0.44f * width, centerPoint[1] - width / 2 + 0.865f * width,
254 | centerPoint[0] - width / 2 + 0.448f * width, centerPoint[1] - width / 2 + 0.859f * width
255 | );
256 | path.cubicTo(
257 | centerPoint[0] - width / 2 + 0.456f * width, centerPoint[1] - width / 2 + 0.853f * width,
258 | centerPoint[0] - width / 2 + 0.472f * width, centerPoint[1] - width / 2 + 0.847f * width,
259 | centerPoint[0] - width / 2 + 0.473f * width, centerPoint[1] - width / 2 + 0.837f * width
260 | );
261 | path.cubicTo(
262 | centerPoint[0] - width / 2 + 0.475f * width, centerPoint[1] - width / 2 + 0.828f * width,
263 | centerPoint[0] - width / 2 + 0.444f * width, centerPoint[1] - width / 2 + 0.71f * width,
264 | centerPoint[0] - width / 2 + 0.447f * width, centerPoint[1] - width / 2 + 0.676f * width
265 | );
266 | path.cubicTo(
267 | centerPoint[0] - width / 2 + 0.451f * width, centerPoint[1] - width / 2 + 0.642f * width,
268 | centerPoint[0] - width / 2 + 0.431f * width, centerPoint[1] - width / 2 + 0.671f * width,
269 | centerPoint[0] - width / 2 + 0.422f * width, centerPoint[1] - width / 2 + 0.655f * width
270 | );
271 | path.cubicTo(
272 | centerPoint[0] - width / 2 + 0.413f * width, centerPoint[1] - width / 2 + 0.639f * width,
273 | centerPoint[0] - width / 2 + 0.404f * width, centerPoint[1] - width / 2 + 0.611f * width,
274 | centerPoint[0] - width / 2 + 0.403f * width, centerPoint[1] - width / 2 + 0.595f * width
275 | );
276 | path.cubicTo(
277 | centerPoint[0] - width / 2 + 0.401f * width, centerPoint[1] - width / 2 + 0.579f * width,
278 | centerPoint[0] - width / 2 + 0.415f * width, centerPoint[1] - width / 2 + 0.512f * width,
279 | centerPoint[0] - width / 2 + 0.415f * width, centerPoint[1] - width / 2 + 0.507f * width
280 | );
281 | path.cubicTo(
282 | centerPoint[0] - width / 2 + 0.415f * width, centerPoint[1] - width / 2 + 0.501f * width,
283 | centerPoint[0] - width / 2 + 0.407f * width, centerPoint[1] - width / 2 + 0.485f * width,
284 | centerPoint[0] - width / 2 + 0.407f * width, centerPoint[1] - width / 2 + 0.471f * width
285 | );
286 | path.cubicTo(
287 | centerPoint[0] - width / 2 + 0.407f * width, centerPoint[1] - width / 2 + 0.457f * width,
288 | centerPoint[0] - width / 2 + 0.407f * width, centerPoint[1] - width / 2 + 0.454f * width,
289 | centerPoint[0] - width / 2 + 0.414f * width, centerPoint[1] - width / 2 + 0.447f * width
290 | );
291 | path.cubicTo(
292 | centerPoint[0] - width / 2 + 0.421f * width, centerPoint[1] - width / 2 + 0.44f * width,
293 | centerPoint[0] - width / 2 + 0.444f * width, centerPoint[1] - width / 2 + 0.414f * width,
294 | centerPoint[0] - width / 2 + 0.445f * width, centerPoint[1] - width / 2 + 0.407f * width
295 | );
296 | path.cubicTo(
297 | centerPoint[0] - width / 2 + 0.446f * width, centerPoint[1] - width / 2 + 0.4f * width,
298 | centerPoint[0] - width / 2 + 0.446f * width, centerPoint[1] - width / 2 + 0.373f * width,
299 | centerPoint[0] - width / 2 + 0.446f * width, centerPoint[1] - width / 2 + 0.373f * width
300 | );
301 | path.cubicTo(
302 | centerPoint[0] - width / 2 + 0.446f * width, centerPoint[1] - width / 2 + 0.373f * width,
303 | centerPoint[0] - width / 2 + 0.43f * width, centerPoint[1] - width / 2 + 0.362f * width,
304 | centerPoint[0] - width / 2 + 0.427f * width, centerPoint[1] - width / 2 + 0.363f * width
305 | );
306 | path.cubicTo(
307 | centerPoint[0] - width / 2 + 0.423f * width, centerPoint[1] - width / 2 + 0.365f * width,
308 | centerPoint[0] - width / 2 + 0.381f * width, centerPoint[1] - width / 2 + 0.381f * width,
309 | centerPoint[0] - width / 2 + 0.373f * width, centerPoint[1] - width / 2 + 0.377f * width
310 | );
311 | path.cubicTo(
312 | centerPoint[0] - width / 2 + 0.365f * width, centerPoint[1] - width / 2 + 0.374f * width,
313 | centerPoint[0] - width / 2 + 0.343f * width, centerPoint[1] - width / 2 + 0.352f * width,
314 | centerPoint[0] - width / 2 + 0.343f * width, centerPoint[1] - width / 2 + 0.347f * width
315 | );
316 | path.cubicTo(
317 | centerPoint[0] - width / 2 + 0.343f * width, centerPoint[1] - width / 2 + 0.343f * width,
318 | centerPoint[0] - width / 2 + 0.338f * width, centerPoint[1] - width / 2 + 0.302f * width,
319 | centerPoint[0] - width / 2 + 0.341f * width, centerPoint[1] - width / 2 + 0.298f * width
320 | );
321 | path.cubicTo(
322 | centerPoint[0] - width / 2 + 0.343f * width, centerPoint[1] - width / 2 + 0.295f * width,
323 | centerPoint[0] - width / 2 + 0.369f * width, centerPoint[1] - width / 2 + 0.279f * width,
324 | centerPoint[0] - width / 2 + 0.369f * width, centerPoint[1] - width / 2 + 0.274f * width
325 | );
326 | path.cubicTo(
327 | centerPoint[0] - width / 2 + 0.369f * width, centerPoint[1] - width / 2 + 0.269f * width,
328 | centerPoint[0] - width / 2 + 0.361f * width, centerPoint[1] - width / 2 + 0.265f * width,
329 | centerPoint[0] - width / 2 + 0.369f * width, centerPoint[1] - width / 2 + 0.26f * width
330 | );
331 | path.cubicTo(
332 | centerPoint[0] - width / 2 + 0.377f * width, centerPoint[1] - width / 2 + 0.256f * width,
333 | centerPoint[0] - width / 2 + 0.408f * width, centerPoint[1] - width / 2 + 0.228f * width,
334 | centerPoint[0] - width / 2 + 0.408f * width, centerPoint[1] - width / 2 + 0.228f * width
335 | );
336 | path.cubicTo(
337 | centerPoint[0] - width / 2 + 0.408f * width, centerPoint[1] - width / 2 + 0.228f * width,
338 | centerPoint[0] - width / 2 + 0.411f * width, centerPoint[1] - width / 2 + 0.221f * width,
339 | centerPoint[0] - width / 2 + 0.416f * width, centerPoint[1] - width / 2 + 0.22f * width
340 | );
341 | path.cubicTo(
342 | centerPoint[0] - width / 2 + 0.422f * width, centerPoint[1] - width / 2 + 0.219f * width,
343 | centerPoint[0] - width / 2 + 0.444f * width, centerPoint[1] - width / 2 + 0.219f * width,
344 | centerPoint[0] - width / 2 + 0.447f * width, centerPoint[1] - width / 2 + 0.219f * width
345 | );
346 | path.cubicTo(
347 | centerPoint[0] - width / 2 + 0.45f * width, centerPoint[1] - width / 2 + 0.219f * width,
348 | centerPoint[0] - width / 2 + 0.429f * width, centerPoint[1] - width / 2 + 0.188f * width,
349 | centerPoint[0] - width / 2 + 0.417f * width, centerPoint[1] - width / 2 + 0.17f * width
350 | );
351 | path.cubicTo(
352 | centerPoint[0] - width / 2 + 0.413f * width, centerPoint[1] - width / 2 + 0.165f * width,
353 | centerPoint[0] - width / 2 + 0.411f * width, centerPoint[1] - width / 2 + 0.16f * width,
354 | centerPoint[0] - width / 2 + 0.411f * width, centerPoint[1] - width / 2 + 0.16f * width
355 | );
356 | path.cubicTo(
357 | centerPoint[0] - width / 2 + 0.413f * width, centerPoint[1] - width / 2 + 0.156f * width,
358 | centerPoint[0] - width / 2 + 0.417f * width, centerPoint[1] - width / 2 + 0.152f * width,
359 | centerPoint[0] - width / 2 + 0.423f * width, centerPoint[1] - width / 2 + 0.153f * width
360 | );
361 | path.cubicTo(
362 | centerPoint[0] - width / 2 + 0.423f * width, centerPoint[1] - width / 2 + 0.153f * width,
363 | centerPoint[0] - width / 2 + 0.464f * width, centerPoint[1] - width / 2 + 0.215f * width,
364 | centerPoint[0] - width / 2 + 0.464f * width, centerPoint[1] - width / 2 + 0.215f * width
365 | );
366 | path.cubicTo(
367 | centerPoint[0] - width / 2 + 0.464f * width, centerPoint[1] - width / 2 + 0.215f * width,
368 | centerPoint[0] - width / 2 + 0.471f * width, centerPoint[1] - width / 2 + 0.203f * width,
369 | centerPoint[0] - width / 2 + 0.471f * width, centerPoint[1] - width / 2 + 0.203f * width
370 | );
371 | path.cubicTo(
372 | centerPoint[0] - width / 2 + 0.471f * width, centerPoint[1] - width / 2 + 0.203f * width,
373 | centerPoint[0] - width / 2 + 0.463f * width, centerPoint[1] - width / 2 + 0.196f * width,
374 | centerPoint[0] - width / 2 + 0.467f * width, centerPoint[1] - width / 2 + 0.193f * width
375 | );
376 | path.cubicTo(
377 | centerPoint[0] - width / 2 + 0.47f * width, centerPoint[1] - width / 2 + 0.189f * width,
378 | centerPoint[0] - width / 2 + 0.476f * width, centerPoint[1] - width / 2 + 0.186f * width,
379 | centerPoint[0] - width / 2 + 0.476f * width, centerPoint[1] - width / 2 + 0.186f * width
380 | );
381 |
382 | return path;
383 | }
384 | }
385 |
--------------------------------------------------------------------------------
/library/src/main/java/jp/co/recruit_lifestyle/android/widget/character/ViolinPath.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 RECRUIT LIFESTYLE CO., LTD.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package jp.co.recruit_lifestyle.android.widget.character;
18 |
19 | import android.graphics.Path;
20 |
21 | /**
22 | * @author amyu
23 | */
24 | public class ViolinPath {
25 |
26 | public static Path getViolinPath(float width, float[] centerPoint){
27 | Path path = new Path();
28 |
29 | path.moveTo(centerPoint[0] - width / 2 + 0.97f * width, centerPoint[1] - width / 2 + 0.193f * width);
30 | path.cubicTo(
31 | centerPoint[0] - width / 2 + 0.968f * width, centerPoint[1] - width / 2 + 0.184f * width,
32 | centerPoint[0] - width / 2 + 0.962f * width, centerPoint[1] - width / 2 + 0.18f * width,
33 | centerPoint[0] - width / 2 + 0.957f * width, centerPoint[1] - width / 2 + 0.18f * width
34 | );
35 | path.cubicTo(
36 | centerPoint[0] - width / 2 + 0.952f * width, centerPoint[1] - width / 2 + 0.179f * width,
37 | centerPoint[0] - width / 2 + 0.947f * width, centerPoint[1] - width / 2 + 0.184f * width,
38 | centerPoint[0] - width / 2 + 0.945f * width, centerPoint[1] - width / 2 + 0.185f * width
39 | );
40 | path.cubicTo(
41 | centerPoint[0] - width / 2 + 0.942f * width, centerPoint[1] - width / 2 + 0.186f * width,
42 | centerPoint[0] - width / 2 + 0.927f * width, centerPoint[1] - width / 2 + 0.172f * width,
43 | centerPoint[0] - width / 2 + 0.927f * width, centerPoint[1] - width / 2 + 0.172f * width
44 | );
45 | path.cubicTo(
46 | centerPoint[0] - width / 2 + 0.934f * width, centerPoint[1] - width / 2 + 0.166f * width,
47 | centerPoint[0] - width / 2 + 0.941f * width, centerPoint[1] - width / 2 + 0.148f * width,
48 | centerPoint[0] - width / 2 + 0.941f * width, centerPoint[1] - width / 2 + 0.148f * width
49 | );
50 | path.cubicTo(
51 | centerPoint[0] - width / 2 + 0.941f * width, centerPoint[1] - width / 2 + 0.148f * width,
52 | centerPoint[0] - width / 2 + 0.946f * width, centerPoint[1] - width / 2 + 0.15f * width,
53 | centerPoint[0] - width / 2 + 0.952f * width, centerPoint[1] - width / 2 + 0.143f * width
54 | );
55 | path.cubicTo(
56 | centerPoint[0] - width / 2 + 0.959f * width, centerPoint[1] - width / 2 + 0.136f * width,
57 | centerPoint[0] - width / 2 + 0.956f * width, centerPoint[1] - width / 2 + 0.131f * width,
58 | centerPoint[0] - width / 2 + 0.951f * width, centerPoint[1] - width / 2 + 0.127f * width
59 | );
60 | path.cubicTo(
61 | centerPoint[0] - width / 2 + 0.954f * width, centerPoint[1] - width / 2 + 0.121f * width,
62 | centerPoint[0] - width / 2 + 0.956f * width, centerPoint[1] - width / 2 + 0.108f * width,
63 | centerPoint[0] - width / 2 + 0.956f * width, centerPoint[1] - width / 2 + 0.104f * width
64 | );
65 | path.cubicTo(
66 | centerPoint[0] - width / 2 + 0.956f * width, centerPoint[1] - width / 2 + 0.1f * width,
67 | centerPoint[0] - width / 2 + 0.953f * width, centerPoint[1] - width / 2 + 0.096f * width,
68 | centerPoint[0] - width / 2 + 0.951f * width, centerPoint[1] - width / 2 + 0.097f * width
69 | );
70 | path.cubicTo(
71 | centerPoint[0] - width / 2 + 0.948f * width, centerPoint[1] - width / 2 + 0.097f * width,
72 | centerPoint[0] - width / 2 + 0.945f * width, centerPoint[1] - width / 2 + 0.093f * width,
73 | centerPoint[0] - width / 2 + 0.944f * width, centerPoint[1] - width / 2 + 0.092f * width
74 | );
75 | path.cubicTo(
76 | centerPoint[0] - width / 2 + 0.943f * width, centerPoint[1] - width / 2 + 0.09f * width,
77 | centerPoint[0] - width / 2 + 0.94f * width, centerPoint[1] - width / 2 + 0.088f * width,
78 | centerPoint[0] - width / 2 + 0.934f * width, centerPoint[1] - width / 2 + 0.088f * width
79 | );
80 | path.cubicTo(
81 | centerPoint[0] - width / 2 + 0.934f * width, centerPoint[1] - width / 2 + 0.085f * width,
82 | centerPoint[0] - width / 2 + 0.928f * width, centerPoint[1] - width / 2 + 0.083f * width,
83 | centerPoint[0] - width / 2 + 0.922f * width, centerPoint[1] - width / 2 + 0.087f * width
84 | );
85 | path.cubicTo(
86 | centerPoint[0] - width / 2 + 0.917f * width, centerPoint[1] - width / 2 + 0.09f * width,
87 | centerPoint[0] - width / 2 + 0.907f * width, centerPoint[1] - width / 2 + 0.1f * width,
88 | centerPoint[0] - width / 2 + 0.907f * width, centerPoint[1] - width / 2 + 0.1f * width
89 | );
90 | path.cubicTo(
91 | centerPoint[0] - width / 2 + 0.907f * width, centerPoint[1] - width / 2 + 0.1f * width,
92 | centerPoint[0] - width / 2 + 0.903f * width, centerPoint[1] - width / 2 + 0.098f * width,
93 | centerPoint[0] - width / 2 + 0.903f * width, centerPoint[1] - width / 2 + 0.098f * width
94 | );
95 | path.cubicTo(
96 | centerPoint[0] - width / 2 + 0.903f * width, centerPoint[1] - width / 2 + 0.098f * width,
97 | centerPoint[0] - width / 2 + 0.899f * width, centerPoint[1] - width / 2 + 0.099f * width,
98 | centerPoint[0] - width / 2 + 0.895f * width, centerPoint[1] - width / 2 + 0.103f * width
99 | );
100 | path.cubicTo(
101 | centerPoint[0] - width / 2 + 0.892f * width, centerPoint[1] - width / 2 + 0.107f * width,
102 | centerPoint[0] - width / 2 + 0.89f * width, centerPoint[1] - width / 2 + 0.112f * width,
103 | centerPoint[0] - width / 2 + 0.889f * width, centerPoint[1] - width / 2 + 0.114f * width
104 | );
105 | path.cubicTo(
106 | centerPoint[0] - width / 2 + 0.888f * width, centerPoint[1] - width / 2 + 0.116f * width,
107 | centerPoint[0] - width / 2 + 0.891f * width, centerPoint[1] - width / 2 + 0.117f * width,
108 | centerPoint[0] - width / 2 + 0.892f * width, centerPoint[1] - width / 2 + 0.118f * width
109 | );
110 | path.cubicTo(
111 | centerPoint[0] - width / 2 + 0.893f * width, centerPoint[1] - width / 2 + 0.12f * width,
112 | centerPoint[0] - width / 2 + 0.891f * width, centerPoint[1] - width / 2 + 0.122f * width,
113 | centerPoint[0] - width / 2 + 0.89f * width, centerPoint[1] - width / 2 + 0.124f * width
114 | );
115 | path.cubicTo(
116 | centerPoint[0] - width / 2 + 0.888f * width, centerPoint[1] - width / 2 + 0.125f * width,
117 | centerPoint[0] - width / 2 + 0.887f * width, centerPoint[1] - width / 2 + 0.127f * width,
118 | centerPoint[0] - width / 2 + 0.889f * width, centerPoint[1] - width / 2 + 0.128f * width
119 | );
120 | path.cubicTo(
121 | centerPoint[0] - width / 2 + 0.891f * width, centerPoint[1] - width / 2 + 0.13f * width,
122 | centerPoint[0] - width / 2 + 0.899f * width, centerPoint[1] - width / 2 + 0.138f * width,
123 | centerPoint[0] - width / 2 + 0.899f * width, centerPoint[1] - width / 2 + 0.138f * width
124 | );
125 | path.cubicTo(
126 | centerPoint[0] - width / 2 + 0.899f * width, centerPoint[1] - width / 2 + 0.138f * width,
127 | centerPoint[0] - width / 2 + 0.897f * width, centerPoint[1] - width / 2 + 0.142f * width,
128 | centerPoint[0] - width / 2 + 0.896f * width, centerPoint[1] - width / 2 + 0.143f * width
129 | );
130 | path.cubicTo(
131 | centerPoint[0] - width / 2 + 0.894f * width, centerPoint[1] - width / 2 + 0.144f * width,
132 | centerPoint[0] - width / 2 + 0.889f * width, centerPoint[1] - width / 2 + 0.141f * width,
133 | centerPoint[0] - width / 2 + 0.878f * width, centerPoint[1] - width / 2 + 0.138f * width
134 | );
135 | path.cubicTo(
136 | centerPoint[0] - width / 2 + 0.868f * width, centerPoint[1] - width / 2 + 0.135f * width,
137 | centerPoint[0] - width / 2 + 0.852f * width, centerPoint[1] - width / 2 + 0.136f * width,
138 | centerPoint[0] - width / 2 + 0.852f * width, centerPoint[1] - width / 2 + 0.136f * width
139 | );
140 | path.cubicTo(
141 | centerPoint[0] - width / 2 + 0.852f * width, centerPoint[1] - width / 2 + 0.136f * width,
142 | centerPoint[0] - width / 2 + 0.848f * width, centerPoint[1] - width / 2 + 0.132f * width,
143 | centerPoint[0] - width / 2 + 0.847f * width, centerPoint[1] - width / 2 + 0.131f * width
144 | );
145 | path.cubicTo(
146 | centerPoint[0] - width / 2 + 0.845f * width, centerPoint[1] - width / 2 + 0.13f * width,
147 | centerPoint[0] - width / 2 + 0.843f * width, centerPoint[1] - width / 2 + 0.126f * width,
148 | centerPoint[0] - width / 2 + 0.843f * width, centerPoint[1] - width / 2 + 0.12f * width
149 | );
150 | path.cubicTo(
151 | centerPoint[0] - width / 2 + 0.844f * width, centerPoint[1] - width / 2 + 0.113f * width,
152 | centerPoint[0] - width / 2 + 0.834f * width, centerPoint[1] - width / 2 + 0.111f * width,
153 | centerPoint[0] - width / 2 + 0.827f * width, centerPoint[1] - width / 2 + 0.112f * width
154 | );
155 | path.cubicTo(
156 | centerPoint[0] - width / 2 + 0.82f * width, centerPoint[1] - width / 2 + 0.113f * width,
157 | centerPoint[0] - width / 2 + 0.815f * width, centerPoint[1] - width / 2 + 0.117f * width,
158 | centerPoint[0] - width / 2 + 0.812f * width, centerPoint[1] - width / 2 + 0.122f * width
159 | );
160 | path.cubicTo(
161 | centerPoint[0] - width / 2 + 0.808f * width, centerPoint[1] - width / 2 + 0.127f * width,
162 | centerPoint[0] - width / 2 + 0.809f * width, centerPoint[1] - width / 2 + 0.138f * width,
163 | centerPoint[0] - width / 2 + 0.809f * width, centerPoint[1] - width / 2 + 0.138f * width
164 | );
165 | path.cubicTo(
166 | centerPoint[0] - width / 2 + 0.809f * width, centerPoint[1] - width / 2 + 0.138f * width,
167 | centerPoint[0] - width / 2 + 0.807f * width, centerPoint[1] - width / 2 + 0.139f * width,
168 | centerPoint[0] - width / 2 + 0.805f * width, centerPoint[1] - width / 2 + 0.137f * width
169 | );
170 | path.cubicTo(
171 | centerPoint[0] - width / 2 + 0.804f * width, centerPoint[1] - width / 2 + 0.135f * width,
172 | centerPoint[0] - width / 2 + 0.805f * width, centerPoint[1] - width / 2 + 0.128f * width,
173 | centerPoint[0] - width / 2 + 0.805f * width, centerPoint[1] - width / 2 + 0.124f * width
174 | );
175 | path.cubicTo(
176 | centerPoint[0] - width / 2 + 0.805f * width, centerPoint[1] - width / 2 + 0.121f * width,
177 | centerPoint[0] - width / 2 + 0.787f * width, centerPoint[1] - width / 2 + 0.114f * width,
178 | centerPoint[0] - width / 2 + 0.781f * width, centerPoint[1] - width / 2 + 0.118f * width
179 | );
180 | path.cubicTo(
181 | centerPoint[0] - width / 2 + 0.77f * width, centerPoint[1] - width / 2 + 0.125f * width,
182 | centerPoint[0] - width / 2 + 0.774f * width, centerPoint[1] - width / 2 + 0.144f * width,
183 | centerPoint[0] - width / 2 + 0.778f * width, centerPoint[1] - width / 2 + 0.147f * width
184 | );
185 | path.cubicTo(
186 | centerPoint[0] - width / 2 + 0.781f * width, centerPoint[1] - width / 2 + 0.15f * width,
187 | centerPoint[0] - width / 2 + 0.787f * width, centerPoint[1] - width / 2 + 0.156f * width,
188 | centerPoint[0] - width / 2 + 0.792f * width, centerPoint[1] - width / 2 + 0.155f * width
189 | );
190 | path.cubicTo(
191 | centerPoint[0] - width / 2 + 0.797f * width, centerPoint[1] - width / 2 + 0.154f * width,
192 | centerPoint[0] - width / 2 + 0.795f * width, centerPoint[1] - width / 2 + 0.151f * width,
193 | centerPoint[0] - width / 2 + 0.798f * width, centerPoint[1] - width / 2 + 0.15f * width
194 | );
195 | path.cubicTo(
196 | centerPoint[0] - width / 2 + 0.8f * width, centerPoint[1] - width / 2 + 0.149f * width,
197 | centerPoint[0] - width / 2 + 0.8f * width, centerPoint[1] - width / 2 + 0.151f * width,
198 | centerPoint[0] - width / 2 + 0.811f * width, centerPoint[1] - width / 2 + 0.156f * width
199 | );
200 | path.cubicTo(
201 | centerPoint[0] - width / 2 + 0.806f * width, centerPoint[1] - width / 2 + 0.16f * width,
202 | centerPoint[0] - width / 2 + 0.691f * width, centerPoint[1] - width / 2 + 0.238f * width,
203 | centerPoint[0] - width / 2 + 0.628f * width, centerPoint[1] - width / 2 + 0.28f * width
204 | );
205 | path.cubicTo(
206 | centerPoint[0] - width / 2 + 0.574f * width, centerPoint[1] - width / 2 + 0.25f * width,
207 | centerPoint[0] - width / 2 + 0.515f * width, centerPoint[1] - width / 2 + 0.256f * width,
208 | centerPoint[0] - width / 2 + 0.487f * width, centerPoint[1] - width / 2 + 0.267f * width
209 | );
210 | path.cubicTo(
211 | centerPoint[0] - width / 2 + 0.458f * width, centerPoint[1] - width / 2 + 0.278f * width,
212 | centerPoint[0] - width / 2 + 0.425f * width, centerPoint[1] - width / 2 + 0.308f * width,
213 | centerPoint[0] - width / 2 + 0.415f * width, centerPoint[1] - width / 2 + 0.322f * width
214 | );
215 | path.cubicTo(
216 | centerPoint[0] - width / 2 + 0.406f * width, centerPoint[1] - width / 2 + 0.336f * width,
217 | centerPoint[0] - width / 2 + 0.394f * width, centerPoint[1] - width / 2 + 0.353f * width,
218 | centerPoint[0] - width / 2 + 0.385f * width, centerPoint[1] - width / 2 + 0.36f * width
219 | );
220 | path.cubicTo(
221 | centerPoint[0] - width / 2 + 0.377f * width, centerPoint[1] - width / 2 + 0.367f * width,
222 | centerPoint[0] - width / 2 + 0.362f * width, centerPoint[1] - width / 2 + 0.364f * width,
223 | centerPoint[0] - width / 2 + 0.362f * width, centerPoint[1] - width / 2 + 0.364f * width
224 | );
225 | path.cubicTo(
226 | centerPoint[0] - width / 2 + 0.362f * width, centerPoint[1] - width / 2 + 0.364f * width,
227 | centerPoint[0] - width / 2 + 0.359f * width, centerPoint[1] - width / 2 + 0.375f * width,
228 | centerPoint[0] - width / 2 + 0.359f * width, centerPoint[1] - width / 2 + 0.375f * width
229 | );
230 | path.cubicTo(
231 | centerPoint[0] - width / 2 + 0.359f * width, centerPoint[1] - width / 2 + 0.375f * width,
232 | centerPoint[0] - width / 2 + 0.364f * width, centerPoint[1] - width / 2 + 0.376f * width,
233 | centerPoint[0] - width / 2 + 0.367f * width, centerPoint[1] - width / 2 + 0.379f * width
234 | );
235 | path.cubicTo(
236 | centerPoint[0] - width / 2 + 0.37f * width, centerPoint[1] - width / 2 + 0.382f * width,
237 | centerPoint[0] - width / 2 + 0.373f * width, centerPoint[1] - width / 2 + 0.394f * width,
238 | centerPoint[0] - width / 2 + 0.372f * width, centerPoint[1] - width / 2 + 0.402f * width
239 | );
240 | path.cubicTo(
241 | centerPoint[0] - width / 2 + 0.372f * width, centerPoint[1] - width / 2 + 0.41f * width,
242 | centerPoint[0] - width / 2 + 0.371f * width, centerPoint[1] - width / 2 + 0.417f * width,
243 | centerPoint[0] - width / 2 + 0.362f * width, centerPoint[1] - width / 2 + 0.426f * width
244 | );
245 | path.cubicTo(
246 | centerPoint[0] - width / 2 + 0.353f * width, centerPoint[1] - width / 2 + 0.436f * width,
247 | centerPoint[0] - width / 2 + 0.318f * width, centerPoint[1] - width / 2 + 0.46f * width,
248 | centerPoint[0] - width / 2 + 0.296f * width, centerPoint[1] - width / 2 + 0.47f * width
249 | );
250 | path.cubicTo(
251 | centerPoint[0] - width / 2 + 0.273f * width, centerPoint[1] - width / 2 + 0.48f * width,
252 | centerPoint[0] - width / 2 + 0.256f * width, centerPoint[1] - width / 2 + 0.478f * width,
253 | centerPoint[0] - width / 2 + 0.245f * width, centerPoint[1] - width / 2 + 0.475f * width
254 | );
255 | path.cubicTo(
256 | centerPoint[0] - width / 2 + 0.235f * width, centerPoint[1] - width / 2 + 0.473f * width,
257 | centerPoint[0] - width / 2 + 0.23f * width, centerPoint[1] - width / 2 + 0.457f * width,
258 | centerPoint[0] - width / 2 + 0.23f * width, centerPoint[1] - width / 2 + 0.457f * width
259 | );
260 | path.cubicTo(
261 | centerPoint[0] - width / 2 + 0.23f * width, centerPoint[1] - width / 2 + 0.457f * width,
262 | centerPoint[0] - width / 2 + 0.213f * width, centerPoint[1] - width / 2 + 0.459f * width,
263 | centerPoint[0] - width / 2 + 0.213f * width, centerPoint[1] - width / 2 + 0.459f * width
264 | );
265 | path.cubicTo(
266 | centerPoint[0] - width / 2 + 0.213f * width, centerPoint[1] - width / 2 + 0.459f * width,
267 | centerPoint[0] - width / 2 + 0.212f * width, centerPoint[1] - width / 2 + 0.463f * width,
268 | centerPoint[0] - width / 2 + 0.212f * width, centerPoint[1] - width / 2 + 0.469f * width
269 | );
270 | path.cubicTo(
271 | centerPoint[0] - width / 2 + 0.213f * width, centerPoint[1] - width / 2 + 0.475f * width,
272 | centerPoint[0] - width / 2 + 0.195f * width, centerPoint[1] - width / 2 + 0.485f * width,
273 | centerPoint[0] - width / 2 + 0.178f * width, centerPoint[1] - width / 2 + 0.493f * width
274 | );
275 | path.cubicTo(
276 | centerPoint[0] - width / 2 + 0.097f * width, centerPoint[1] - width / 2 + 0.531f * width,
277 | centerPoint[0] - width / 2 + 0.078f * width, centerPoint[1] - width / 2 + 0.557f * width,
278 | centerPoint[0] - width / 2 + 0.069f * width, centerPoint[1] - width / 2 + 0.57f * width
279 | );
280 | path.cubicTo(
281 | centerPoint[0] - width / 2 + 0.069f * width, centerPoint[1] - width / 2 + 0.57f * width,
282 | centerPoint[0] - width / 2 + 0.061f * width, centerPoint[1] - width / 2 + 0.568f * width,
283 | centerPoint[0] - width / 2 + 0.056f * width, centerPoint[1] - width / 2 + 0.569f * width
284 | );
285 | path.cubicTo(
286 | centerPoint[0] - width / 2 + 0.048f * width, centerPoint[1] - width / 2 + 0.581f * width,
287 | centerPoint[0] - width / 2 + 0.029f * width, centerPoint[1] - width / 2 + 0.605f * width,
288 | centerPoint[0] - width / 2 + 0.03f * width, centerPoint[1] - width / 2 + 0.66f * width
289 | );
290 | path.cubicTo(
291 | centerPoint[0] - width / 2 + 0.032f * width, centerPoint[1] - width / 2 + 0.714f * width,
292 | centerPoint[0] - width / 2 + 0.069f * width, centerPoint[1] - width / 2 + 0.764f * width,
293 | centerPoint[0] - width / 2 + 0.069f * width, centerPoint[1] - width / 2 + 0.764f * width
294 | );
295 | path.cubicTo(
296 | centerPoint[0] - width / 2 + 0.069f * width, centerPoint[1] - width / 2 + 0.764f * width,
297 | centerPoint[0] - width / 2 + 0.066f * width, centerPoint[1] - width / 2 + 0.767f * width,
298 | centerPoint[0] - width / 2 + 0.065f * width, centerPoint[1] - width / 2 + 0.771f * width
299 | );
300 | path.cubicTo(
301 | centerPoint[0] - width / 2 + 0.064f * width, centerPoint[1] - width / 2 + 0.774f * width,
302 | centerPoint[0] - width / 2 + 0.085f * width, centerPoint[1] - width / 2 + 0.799f * width,
303 | centerPoint[0] - width / 2 + 0.085f * width, centerPoint[1] - width / 2 + 0.799f * width
304 | );
305 | path.cubicTo(
306 | centerPoint[0] - width / 2 + 0.085f * width, centerPoint[1] - width / 2 + 0.799f * width,
307 | centerPoint[0] - width / 2 + 0.093f * width, centerPoint[1] - width / 2 + 0.809f * width,
308 | centerPoint[0] - width / 2 + 0.093f * width, centerPoint[1] - width / 2 + 0.809f * width
309 | );
310 | path.cubicTo(
311 | centerPoint[0] - width / 2 + 0.093f * width, centerPoint[1] - width / 2 + 0.809f * width,
312 | centerPoint[0] - width / 2 + 0.094f * width, centerPoint[1] - width / 2 + 0.813f * width,
313 | centerPoint[0] - width / 2 + 0.092f * width, centerPoint[1] - width / 2 + 0.813f * width
314 | );
315 | path.cubicTo(
316 | centerPoint[0] - width / 2 + 0.089f * width, centerPoint[1] - width / 2 + 0.812f * width,
317 | centerPoint[0] - width / 2 + 0.088f * width, centerPoint[1] - width / 2 + 0.816f * width,
318 | centerPoint[0] - width / 2 + 0.091f * width, centerPoint[1] - width / 2 + 0.821f * width
319 | );
320 | path.cubicTo(
321 | centerPoint[0] - width / 2 + 0.095f * width, centerPoint[1] - width / 2 + 0.826f * width,
322 | centerPoint[0] - width / 2 + 0.106f * width, centerPoint[1] - width / 2 + 0.838f * width,
323 | centerPoint[0] - width / 2 + 0.11f * width, centerPoint[1] - width / 2 + 0.836f * width
324 | );
325 | path.cubicTo(
326 | centerPoint[0] - width / 2 + 0.114f * width, centerPoint[1] - width / 2 + 0.835f * width,
327 | centerPoint[0] - width / 2 + 0.113f * width, centerPoint[1] - width / 2 + 0.828f * width,
328 | centerPoint[0] - width / 2 + 0.115f * width, centerPoint[1] - width / 2 + 0.825f * width
329 | );
330 | path.cubicTo(
331 | centerPoint[0] - width / 2 + 0.115f * width, centerPoint[1] - width / 2 + 0.825f * width,
332 | centerPoint[0] - width / 2 + 0.121f * width, centerPoint[1] - width / 2 + 0.832f * width,
333 | centerPoint[0] - width / 2 + 0.121f * width, centerPoint[1] - width / 2 + 0.832f * width
334 | );
335 | path.cubicTo(
336 | centerPoint[0] - width / 2 + 0.121f * width, centerPoint[1] - width / 2 + 0.832f * width,
337 | centerPoint[0] - width / 2 + 0.12f * width, centerPoint[1] - width / 2 + 0.836f * width,
338 | centerPoint[0] - width / 2 + 0.12f * width, centerPoint[1] - width / 2 + 0.836f * width
339 | );
340 | path.cubicTo(
341 | centerPoint[0] - width / 2 + 0.12f * width, centerPoint[1] - width / 2 + 0.836f * width,
342 | centerPoint[0] - width / 2 + 0.151f * width, centerPoint[1] - width / 2 + 0.867f * width,
343 | centerPoint[0] - width / 2 + 0.151f * width, centerPoint[1] - width / 2 + 0.867f * width
344 | );
345 | path.cubicTo(
346 | centerPoint[0] - width / 2 + 0.151f * width, centerPoint[1] - width / 2 + 0.867f * width,
347 | centerPoint[0] - width / 2 + 0.152f * width, centerPoint[1] - width / 2 + 0.87f * width,
348 | centerPoint[0] - width / 2 + 0.154f * width, centerPoint[1] - width / 2 + 0.865f * width
349 | );
350 | path.cubicTo(
351 | centerPoint[0] - width / 2 + 0.259f * width, centerPoint[1] - width / 2 + 0.941f * width,
352 | centerPoint[0] - width / 2 + 0.317f * width, centerPoint[1] - width / 2 + 0.915f * width,
353 | centerPoint[0] - width / 2 + 0.372f * width, centerPoint[1] - width / 2 + 0.888f * width
354 | );
355 | path.cubicTo(
356 | centerPoint[0] - width / 2 + 0.426f * width, centerPoint[1] - width / 2 + 0.86f * width,
357 | centerPoint[0] - width / 2 + 0.457f * width, centerPoint[1] - width / 2 + 0.781f * width,
358 | centerPoint[0] - width / 2 + 0.467f * width, centerPoint[1] - width / 2 + 0.764f * width
359 | );
360 | path.cubicTo(
361 | centerPoint[0] - width / 2 + 0.476f * width, centerPoint[1] - width / 2 + 0.748f * width,
362 | centerPoint[0] - width / 2 + 0.493f * width, centerPoint[1] - width / 2 + 0.75f * width,
363 | centerPoint[0] - width / 2 + 0.493f * width, centerPoint[1] - width / 2 + 0.75f * width
364 | );
365 | path.cubicTo(
366 | centerPoint[0] - width / 2 + 0.493f * width, centerPoint[1] - width / 2 + 0.75f * width,
367 | centerPoint[0] - width / 2 + 0.499f * width, centerPoint[1] - width / 2 + 0.734f * width,
368 | centerPoint[0] - width / 2 + 0.499f * width, centerPoint[1] - width / 2 + 0.734f * width
369 | );
370 | path.cubicTo(
371 | centerPoint[0] - width / 2 + 0.499f * width, centerPoint[1] - width / 2 + 0.734f * width,
372 | centerPoint[0] - width / 2 + 0.491f * width, centerPoint[1] - width / 2 + 0.735f * width,
373 | centerPoint[0] - width / 2 + 0.491f * width, centerPoint[1] - width / 2 + 0.735f * width
374 | );
375 | path.cubicTo(
376 | centerPoint[0] - width / 2 + 0.491f * width, centerPoint[1] - width / 2 + 0.735f * width,
377 | centerPoint[0] - width / 2 + 0.49f * width, centerPoint[1] - width / 2 + 0.723f * width,
378 | centerPoint[0] - width / 2 + 0.49f * width, centerPoint[1] - width / 2 + 0.723f * width
379 | );
380 | path.cubicTo(
381 | centerPoint[0] - width / 2 + 0.49f * width, centerPoint[1] - width / 2 + 0.723f * width,
382 | centerPoint[0] - width / 2 + 0.493f * width, centerPoint[1] - width / 2 + 0.722f * width,
383 | centerPoint[0] - width / 2 + 0.493f * width, centerPoint[1] - width / 2 + 0.722f * width
384 | );
385 | path.cubicTo(
386 | centerPoint[0] - width / 2 + 0.493f * width, centerPoint[1] - width / 2 + 0.722f * width,
387 | centerPoint[0] - width / 2 + 0.494f * width, centerPoint[1] - width / 2 + 0.712f * width,
388 | centerPoint[0] - width / 2 + 0.496f * width, centerPoint[1] - width / 2 + 0.708f * width
389 | );
390 | path.cubicTo(
391 | centerPoint[0] - width / 2 + 0.485f * width, centerPoint[1] - width / 2 + 0.706f * width,
392 | centerPoint[0] - width / 2 + 0.477f * width, centerPoint[1] - width / 2 + 0.698f * width,
393 | centerPoint[0] - width / 2 + 0.475f * width, centerPoint[1] - width / 2 + 0.695f * width
394 | );
395 | path.cubicTo(
396 | centerPoint[0] - width / 2 + 0.473f * width, centerPoint[1] - width / 2 + 0.692f * width,
397 | centerPoint[0] - width / 2 + 0.474f * width, centerPoint[1] - width / 2 + 0.682f * width,
398 | centerPoint[0] - width / 2 + 0.48f * width, centerPoint[1] - width / 2 + 0.666f * width
399 | );
400 | path.cubicTo(
401 | centerPoint[0] - width / 2 + 0.487f * width, centerPoint[1] - width / 2 + 0.65f * width,
402 | centerPoint[0] - width / 2 + 0.518f * width, centerPoint[1] - width / 2 + 0.62f * width,
403 | centerPoint[0] - width / 2 + 0.531f * width, centerPoint[1] - width / 2 + 0.608f * width
404 | );
405 | path.cubicTo(
406 | centerPoint[0] - width / 2 + 0.543f * width, centerPoint[1] - width / 2 + 0.596f * width,
407 | centerPoint[0] - width / 2 + 0.567f * width, centerPoint[1] - width / 2 + 0.59f * width,
408 | centerPoint[0] - width / 2 + 0.576f * width, centerPoint[1] - width / 2 + 0.594f * width
409 | );
410 | path.cubicTo(
411 | centerPoint[0] - width / 2 + 0.586f * width, centerPoint[1] - width / 2 + 0.599f * width,
412 | centerPoint[0] - width / 2 + 0.592f * width, centerPoint[1] - width / 2 + 0.611f * width,
413 | centerPoint[0] - width / 2 + 0.592f * width, centerPoint[1] - width / 2 + 0.611f * width
414 | );
415 | path.cubicTo(
416 | centerPoint[0] - width / 2 + 0.592f * width, centerPoint[1] - width / 2 + 0.611f * width,
417 | centerPoint[0] - width / 2 + 0.608f * width, centerPoint[1] - width / 2 + 0.605f * width,
418 | centerPoint[0] - width / 2 + 0.608f * width, centerPoint[1] - width / 2 + 0.605f * width
419 | );
420 | path.cubicTo(
421 | centerPoint[0] - width / 2 + 0.608f * width, centerPoint[1] - width / 2 + 0.605f * width,
422 | centerPoint[0] - width / 2 + 0.607f * width, centerPoint[1] - width / 2 + 0.603f * width,
423 | centerPoint[0] - width / 2 + 0.608f * width, centerPoint[1] - width / 2 + 0.596f * width
424 | );
425 | path.cubicTo(
426 | centerPoint[0] - width / 2 + 0.608f * width, centerPoint[1] - width / 2 + 0.589f * width,
427 | centerPoint[0] - width / 2 + 0.627f * width, centerPoint[1] - width / 2 + 0.576f * width,
428 | centerPoint[0] - width / 2 + 0.659f * width, centerPoint[1] - width / 2 + 0.559f * width
429 | );
430 | path.cubicTo(
431 | centerPoint[0] - width / 2 + 0.725f * width, centerPoint[1] - width / 2 + 0.526f * width,
432 | centerPoint[0] - width / 2 + 0.737f * width, centerPoint[1] - width / 2 + 0.463f * width,
433 | centerPoint[0] - width / 2 + 0.736f * width, centerPoint[1] - width / 2 + 0.447f * width
434 | );
435 | path.cubicTo(
436 | centerPoint[0] - width / 2 + 0.746f * width, centerPoint[1] - width / 2 + 0.412f * width,
437 | centerPoint[0] - width / 2 + 0.734f * width, centerPoint[1] - width / 2 + 0.378f * width,
438 | centerPoint[0] - width / 2 + 0.726f * width, centerPoint[1] - width / 2 + 0.366f * width
439 | );
440 | path.cubicTo(
441 | centerPoint[0] - width / 2 + 0.718f * width, centerPoint[1] - width / 2 + 0.354f * width,
442 | centerPoint[0] - width / 2 + 0.695f * width, centerPoint[1] - width / 2 + 0.325f * width,
443 | centerPoint[0] - width / 2 + 0.695f * width, centerPoint[1] - width / 2 + 0.325f * width
444 | );
445 | path.cubicTo(
446 | centerPoint[0] - width / 2 + 0.695f * width, centerPoint[1] - width / 2 + 0.325f * width,
447 | centerPoint[0] - width / 2 + 0.708f * width, centerPoint[1] - width / 2 + 0.306f * width,
448 | centerPoint[0] - width / 2 + 0.714f * width, centerPoint[1] - width / 2 + 0.301f * width
449 | );
450 | path.cubicTo(
451 | centerPoint[0] - width / 2 + 0.719f * width, centerPoint[1] - width / 2 + 0.297f * width,
452 | centerPoint[0] - width / 2 + 0.803f * width, centerPoint[1] - width / 2 + 0.222f * width,
453 | centerPoint[0] - width / 2 + 0.815f * width, centerPoint[1] - width / 2 + 0.214f * width
454 | );
455 | path.cubicTo(
456 | centerPoint[0] - width / 2 + 0.819f * width, centerPoint[1] - width / 2 + 0.224f * width,
457 | centerPoint[0] - width / 2 + 0.837f * width, centerPoint[1] - width / 2 + 0.221f * width,
458 | centerPoint[0] - width / 2 + 0.843f * width, centerPoint[1] - width / 2 + 0.219f * width
459 | );
460 | path.cubicTo(
461 | centerPoint[0] - width / 2 + 0.85f * width, centerPoint[1] - width / 2 + 0.217f * width,
462 | centerPoint[0] - width / 2 + 0.868f * width, centerPoint[1] - width / 2 + 0.202f * width,
463 | centerPoint[0] - width / 2 + 0.875f * width, centerPoint[1] - width / 2 + 0.197f * width
464 | );
465 | path.cubicTo(
466 | centerPoint[0] - width / 2 + 0.883f * width, centerPoint[1] - width / 2 + 0.191f * width,
467 | centerPoint[0] - width / 2 + 0.89f * width, centerPoint[1] - width / 2 + 0.196f * width,
468 | centerPoint[0] - width / 2 + 0.89f * width, centerPoint[1] - width / 2 + 0.196f * width
469 | );
470 | path.cubicTo(
471 | centerPoint[0] - width / 2 + 0.89f * width, centerPoint[1] - width / 2 + 0.196f * width,
472 | centerPoint[0] - width / 2 + 0.902f * width, centerPoint[1] - width / 2 + 0.205f * width,
473 | centerPoint[0] - width / 2 + 0.902f * width, centerPoint[1] - width / 2 + 0.205f * width
474 | );
475 | path.cubicTo(
476 | centerPoint[0] - width / 2 + 0.902f * width, centerPoint[1] - width / 2 + 0.205f * width,
477 | centerPoint[0] - width / 2 + 0.904f * width, centerPoint[1] - width / 2 + 0.21f * width,
478 | centerPoint[0] - width / 2 + 0.907f * width, centerPoint[1] - width / 2 + 0.212f * width
479 | );
480 | path.cubicTo(
481 | centerPoint[0] - width / 2 + 0.909f * width, centerPoint[1] - width / 2 + 0.214f * width,
482 | centerPoint[0] - width / 2 + 0.927f * width, centerPoint[1] - width / 2 + 0.225f * width,
483 | centerPoint[0] - width / 2 + 0.93f * width, centerPoint[1] - width / 2 + 0.224f * width
484 | );
485 | path.cubicTo(
486 | centerPoint[0] - width / 2 + 0.932f * width, centerPoint[1] - width / 2 + 0.224f * width,
487 | centerPoint[0] - width / 2 + 0.934f * width, centerPoint[1] - width / 2 + 0.222f * width,
488 | centerPoint[0] - width / 2 + 0.938f * width, centerPoint[1] - width / 2 + 0.217f * width
489 | );
490 | path.cubicTo(
491 | centerPoint[0] - width / 2 + 0.967f * width, centerPoint[1] - width / 2 + 0.226f * width,
492 | centerPoint[0] - width / 2 + 0.971f * width, centerPoint[1] - width / 2 + 0.202f * width,
493 | centerPoint[0] - width / 2 + 0.97f * width, centerPoint[1] - width / 2 + 0.193f * width
494 | );
495 | return path;
496 |
497 | }
498 |
499 | }
500 |
--------------------------------------------------------------------------------
/library/src/main/java/jp/co/recruit_lifestyle/android/widget/character/DogezaPath.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 RECRUIT LIFESTYLE CO., LTD.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package jp.co.recruit_lifestyle.android.widget.character;
18 |
19 | import android.graphics.Path;
20 |
21 | /**
22 | * @author amyu
23 | */
24 | public class DogezaPath {
25 |
26 | public static Path getDogezaPath(float width, float[] centerPoint){
27 | Path path = new Path();
28 |
29 | path.moveTo(centerPoint[0] - width / 2 + 0.927f * width, centerPoint[1] - width / 2 + 0.519f * width);
30 | path.cubicTo(
31 | centerPoint[0] - width / 2 + 0.906f * width, centerPoint[1] - width / 2 + 0.511f * width,
32 | centerPoint[0] - width / 2 + 0.832f * width, centerPoint[1] - width / 2 + 0.476f * width,
33 | centerPoint[0] - width / 2 + 0.816f * width, centerPoint[1] - width / 2 + 0.471f * width
34 | );
35 | path.cubicTo(
36 | centerPoint[0] - width / 2 + 0.804f * width, centerPoint[1] - width / 2 + 0.467f * width,
37 | centerPoint[0] - width / 2 + 0.784f * width, centerPoint[1] - width / 2 + 0.46f * width,
38 | centerPoint[0] - width / 2 + 0.774f * width, centerPoint[1] - width / 2 + 0.456f * width
39 | );
40 | path.cubicTo(
41 | centerPoint[0] - width / 2 + 0.774f * width, centerPoint[1] - width / 2 + 0.445f * width,
42 | centerPoint[0] - width / 2 + 0.771f * width, centerPoint[1] - width / 2 + 0.433f * width,
43 | centerPoint[0] - width / 2 + 0.764f * width, centerPoint[1] - width / 2 + 0.424f * width
44 | );
45 | path.cubicTo(
46 | centerPoint[0] - width / 2 + 0.739f * width, centerPoint[1] - width / 2 + 0.394f * width,
47 | centerPoint[0] - width / 2 + 0.684f * width, centerPoint[1] - width / 2 + 0.306f * width,
48 | centerPoint[0] - width / 2 + 0.659f * width, centerPoint[1] - width / 2 + 0.265f * width
49 | );
50 | path.cubicTo(
51 | centerPoint[0] - width / 2 + 0.654f * width, centerPoint[1] - width / 2 + 0.253f * width,
52 | centerPoint[0] - width / 2 + 0.646f * width, centerPoint[1] - width / 2 + 0.244f * width,
53 | centerPoint[0] - width / 2 + 0.646f * width, centerPoint[1] - width / 2 + 0.244f * width
54 | );
55 | path.cubicTo(
56 | centerPoint[0] - width / 2 + 0.646f * width, centerPoint[1] - width / 2 + 0.244f * width,
57 | centerPoint[0] - width / 2 + 0.65f * width, centerPoint[1] - width / 2 + 0.235f * width,
58 | centerPoint[0] - width / 2 + 0.65f * width, centerPoint[1] - width / 2 + 0.235f * width
59 | );
60 | path.cubicTo(
61 | centerPoint[0] - width / 2 + 0.65f * width, centerPoint[1] - width / 2 + 0.235f * width,
62 | centerPoint[0] - width / 2 + 0.617f * width, centerPoint[1] - width / 2 + 0.174f * width,
63 | centerPoint[0] - width / 2 + 0.5f * width, centerPoint[1] - width / 2 + 0.173f * width
64 | );
65 | path.cubicTo(
66 | centerPoint[0] - width / 2 + 0.383f * width, centerPoint[1] - width / 2 + 0.174f * width,
67 | centerPoint[0] - width / 2 + 0.35f * width, centerPoint[1] - width / 2 + 0.235f * width,
68 | centerPoint[0] - width / 2 + 0.35f * width, centerPoint[1] - width / 2 + 0.235f * width
69 | );
70 | path.cubicTo(
71 | centerPoint[0] - width / 2 + 0.35f * width, centerPoint[1] - width / 2 + 0.235f * width,
72 | centerPoint[0] - width / 2 + 0.354f * width, centerPoint[1] - width / 2 + 0.244f * width,
73 | centerPoint[0] - width / 2 + 0.354f * width, centerPoint[1] - width / 2 + 0.244f * width
74 | );
75 | path.cubicTo(
76 | centerPoint[0] - width / 2 + 0.354f * width, centerPoint[1] - width / 2 + 0.244f * width,
77 | centerPoint[0] - width / 2 + 0.335f * width, centerPoint[1] - width / 2 + 0.265f * width,
78 | centerPoint[0] - width / 2 + 0.336f * width, centerPoint[1] - width / 2 + 0.291f * width
79 | );
80 | path.cubicTo(
81 | centerPoint[0] - width / 2 + 0.336f * width, centerPoint[1] - width / 2 + 0.293f * width,
82 | centerPoint[0] - width / 2 + 0.336f * width, centerPoint[1] - width / 2 + 0.294f * width,
83 | centerPoint[0] - width / 2 + 0.336f * width, centerPoint[1] - width / 2 + 0.296f * width
84 | );
85 | path.cubicTo(
86 | centerPoint[0] - width / 2 + 0.299f * width, centerPoint[1] - width / 2 + 0.338f * width,
87 | centerPoint[0] - width / 2 + 0.229f * width, centerPoint[1] - width / 2 + 0.42f * width,
88 | centerPoint[0] - width / 2 + 0.218f * width, centerPoint[1] - width / 2 + 0.459f * width
89 | );
90 | path.cubicTo(
91 | centerPoint[0] - width / 2 + 0.208f * width, centerPoint[1] - width / 2 + 0.463f * width,
92 | centerPoint[0] - width / 2 + 0.193f * width, centerPoint[1] - width / 2 + 0.467f * width,
93 | centerPoint[0] - width / 2 + 0.184f * width, centerPoint[1] - width / 2 + 0.471f * width
94 | );
95 | path.cubicTo(
96 | centerPoint[0] - width / 2 + 0.168f * width, centerPoint[1] - width / 2 + 0.476f * width,
97 | centerPoint[0] - width / 2 + 0.094f * width, centerPoint[1] - width / 2 + 0.511f * width,
98 | centerPoint[0] - width / 2 + 0.073f * width, centerPoint[1] - width / 2 + 0.519f * width
99 | );
100 | path.cubicTo(
101 | centerPoint[0] - width / 2 + 0.052f * width, centerPoint[1] - width / 2 + 0.526f * width,
102 | centerPoint[0] - width / 2 + 0.06f * width, centerPoint[1] - width / 2 + 0.542f * width,
103 | centerPoint[0] - width / 2 + 0.061f * width, centerPoint[1] - width / 2 + 0.555f * width
104 | );
105 | path.cubicTo(
106 | centerPoint[0] - width / 2 + 0.062f * width, centerPoint[1] - width / 2 + 0.568f * width,
107 | centerPoint[0] - width / 2 + 0.092f * width, centerPoint[1] - width / 2 + 0.622f * width,
108 | centerPoint[0] - width / 2 + 0.099f * width, centerPoint[1] - width / 2 + 0.633f * width
109 | );
110 | path.cubicTo(
111 | centerPoint[0] - width / 2 + 0.105f * width, centerPoint[1] - width / 2 + 0.644f * width,
112 | centerPoint[0] - width / 2 + 0.134f * width, centerPoint[1] - width / 2 + 0.706f * width,
113 | centerPoint[0] - width / 2 + 0.145f * width, centerPoint[1] - width / 2 + 0.725f * width
114 | );
115 | path.cubicTo(
116 | centerPoint[0] - width / 2 + 0.155f * width, centerPoint[1] - width / 2 + 0.744f * width,
117 | centerPoint[0] - width / 2 + 0.154f * width, centerPoint[1] - width / 2 + 0.734f * width,
118 | centerPoint[0] - width / 2 + 0.169f * width, centerPoint[1] - width / 2 + 0.729f * width
119 | );
120 | path.cubicTo(
121 | centerPoint[0] - width / 2 + 0.172f * width, centerPoint[1] - width / 2 + 0.729f * width,
122 | centerPoint[0] - width / 2 + 0.175f * width, centerPoint[1] - width / 2 + 0.727f * width,
123 | centerPoint[0] - width / 2 + 0.179f * width, centerPoint[1] - width / 2 + 0.725f * width
124 | );
125 | path.cubicTo(
126 | centerPoint[0] - width / 2 + 0.179f * width, centerPoint[1] - width / 2 + 0.725f * width,
127 | centerPoint[0] - width / 2 + 0.186f * width, centerPoint[1] - width / 2 + 0.734f * width,
128 | centerPoint[0] - width / 2 + 0.186f * width, centerPoint[1] - width / 2 + 0.734f * width
129 | );
130 | path.cubicTo(
131 | centerPoint[0] - width / 2 + 0.186f * width, centerPoint[1] - width / 2 + 0.734f * width,
132 | centerPoint[0] - width / 2 + 0.195f * width, centerPoint[1] - width / 2 + 0.733f * width,
133 | centerPoint[0] - width / 2 + 0.204f * width, centerPoint[1] - width / 2 + 0.729f * width
134 | );
135 | path.cubicTo(
136 | centerPoint[0] - width / 2 + 0.206f * width, centerPoint[1] - width / 2 + 0.732f * width,
137 | centerPoint[0] - width / 2 + 0.208f * width, centerPoint[1] - width / 2 + 0.734f * width,
138 | centerPoint[0] - width / 2 + 0.209f * width, centerPoint[1] - width / 2 + 0.736f * width
139 | );
140 | path.cubicTo(
141 | centerPoint[0] - width / 2 + 0.211f * width, centerPoint[1] - width / 2 + 0.743f * width,
142 | centerPoint[0] - width / 2 + 0.212f * width, centerPoint[1] - width / 2 + 0.767f * width,
143 | centerPoint[0] - width / 2 + 0.223f * width, centerPoint[1] - width / 2 + 0.78f * width
144 | );
145 | path.cubicTo(
146 | centerPoint[0] - width / 2 + 0.233f * width, centerPoint[1] - width / 2 + 0.792f * width,
147 | centerPoint[0] - width / 2 + 0.236f * width, centerPoint[1] - width / 2 + 0.797f * width,
148 | centerPoint[0] - width / 2 + 0.246f * width, centerPoint[1] - width / 2 + 0.806f * width
149 | );
150 | path.cubicTo(
151 | centerPoint[0] - width / 2 + 0.256f * width, centerPoint[1] - width / 2 + 0.816f * width,
152 | centerPoint[0] - width / 2 + 0.266f * width, centerPoint[1] - width / 2 + 0.816f * width,
153 | centerPoint[0] - width / 2 + 0.262f * width, centerPoint[1] - width / 2 + 0.808f * width
154 | );
155 | path.cubicTo(
156 | centerPoint[0] - width / 2 + 0.258f * width, centerPoint[1] - width / 2 + 0.801f * width,
157 | centerPoint[0] - width / 2 + 0.242f * width, centerPoint[1] - width / 2 + 0.775f * width,
158 | centerPoint[0] - width / 2 + 0.242f * width, centerPoint[1] - width / 2 + 0.775f * width
159 | );
160 | path.cubicTo(
161 | centerPoint[0] - width / 2 + 0.242f * width, centerPoint[1] - width / 2 + 0.775f * width,
162 | centerPoint[0] - width / 2 + 0.269f * width, centerPoint[1] - width / 2 + 0.804f * width,
163 | centerPoint[0] - width / 2 + 0.281f * width, centerPoint[1] - width / 2 + 0.817f * width
164 | );
165 | path.cubicTo(
166 | centerPoint[0] - width / 2 + 0.294f * width, centerPoint[1] - width / 2 + 0.83f * width,
167 | centerPoint[0] - width / 2 + 0.301f * width, centerPoint[1] - width / 2 + 0.829f * width,
168 | centerPoint[0] - width / 2 + 0.297f * width, centerPoint[1] - width / 2 + 0.82f * width
169 | );
170 | path.cubicTo(
171 | centerPoint[0] - width / 2 + 0.294f * width, centerPoint[1] - width / 2 + 0.812f * width,
172 | centerPoint[0] - width / 2 + 0.277f * width, centerPoint[1] - width / 2 + 0.784f * width,
173 | centerPoint[0] - width / 2 + 0.277f * width, centerPoint[1] - width / 2 + 0.784f * width
174 | );
175 | path.cubicTo(
176 | centerPoint[0] - width / 2 + 0.277f * width, centerPoint[1] - width / 2 + 0.784f * width,
177 | centerPoint[0] - width / 2 + 0.294f * width, centerPoint[1] - width / 2 + 0.802f * width,
178 | centerPoint[0] - width / 2 + 0.31f * width, centerPoint[1] - width / 2 + 0.813f * width
179 | );
180 | path.cubicTo(
181 | centerPoint[0] - width / 2 + 0.326f * width, centerPoint[1] - width / 2 + 0.823f * width,
182 | centerPoint[0] - width / 2 + 0.333f * width, centerPoint[1] - width / 2 + 0.813f * width,
183 | centerPoint[0] - width / 2 + 0.333f * width, centerPoint[1] - width / 2 + 0.813f * width
184 | );
185 | path.cubicTo(
186 | centerPoint[0] - width / 2 + 0.333f * width, centerPoint[1] - width / 2 + 0.813f * width,
187 | centerPoint[0] - width / 2 + 0.333f * width, centerPoint[1] - width / 2 + 0.813f * width,
188 | centerPoint[0] - width / 2 + 0.331f * width, centerPoint[1] - width / 2 + 0.807f * width
189 | );
190 | path.cubicTo(
191 | centerPoint[0] - width / 2 + 0.328f * width, centerPoint[1] - width / 2 + 0.802f * width,
192 | centerPoint[0] - width / 2 + 0.298f * width, centerPoint[1] - width / 2 + 0.776f * width,
193 | centerPoint[0] - width / 2 + 0.292f * width, centerPoint[1] - width / 2 + 0.768f * width
194 | );
195 | path.cubicTo(
196 | centerPoint[0] - width / 2 + 0.286f * width, centerPoint[1] - width / 2 + 0.759f * width,
197 | centerPoint[0] - width / 2 + 0.322f * width, centerPoint[1] - width / 2 + 0.789f * width,
198 | centerPoint[0] - width / 2 + 0.335f * width, centerPoint[1] - width / 2 + 0.798f * width
199 | );
200 | path.cubicTo(
201 | centerPoint[0] - width / 2 + 0.348f * width, centerPoint[1] - width / 2 + 0.806f * width,
202 | centerPoint[0] - width / 2 + 0.358f * width, centerPoint[1] - width / 2 + 0.798f * width,
203 | centerPoint[0] - width / 2 + 0.347f * width, centerPoint[1] - width / 2 + 0.788f * width
204 | );
205 | path.cubicTo(
206 | centerPoint[0] - width / 2 + 0.335f * width, centerPoint[1] - width / 2 + 0.778f * width,
207 | centerPoint[0] - width / 2 + 0.31f * width, centerPoint[1] - width / 2 + 0.749f * width,
208 | centerPoint[0] - width / 2 + 0.305f * width, centerPoint[1] - width / 2 + 0.741f * width
209 | );
210 | path.cubicTo(
211 | centerPoint[0] - width / 2 + 0.3f * width, centerPoint[1] - width / 2 + 0.734f * width,
212 | centerPoint[0] - width / 2 + 0.324f * width, centerPoint[1] - width / 2 + 0.749f * width,
213 | centerPoint[0] - width / 2 + 0.337f * width, centerPoint[1] - width / 2 + 0.751f * width
214 | );
215 | path.cubicTo(
216 | centerPoint[0] - width / 2 + 0.35f * width, centerPoint[1] - width / 2 + 0.753f * width,
217 | centerPoint[0] - width / 2 + 0.352f * width, centerPoint[1] - width / 2 + 0.742f * width,
218 | centerPoint[0] - width / 2 + 0.341f * width, centerPoint[1] - width / 2 + 0.739f * width
219 | );
220 | path.cubicTo(
221 | centerPoint[0] - width / 2 + 0.331f * width, centerPoint[1] - width / 2 + 0.736f * width,
222 | centerPoint[0] - width / 2 + 0.328f * width, centerPoint[1] - width / 2 + 0.729f * width,
223 | centerPoint[0] - width / 2 + 0.316f * width, centerPoint[1] - width / 2 + 0.721f * width
224 | );
225 | path.cubicTo(
226 | centerPoint[0] - width / 2 + 0.303f * width, centerPoint[1] - width / 2 + 0.712f * width,
227 | centerPoint[0] - width / 2 + 0.284f * width, centerPoint[1] - width / 2 + 0.713f * width,
228 | centerPoint[0] - width / 2 + 0.272f * width, centerPoint[1] - width / 2 + 0.713f * width
229 | );
230 | path.cubicTo(
231 | centerPoint[0] - width / 2 + 0.26f * width, centerPoint[1] - width / 2 + 0.713f * width,
232 | centerPoint[0] - width / 2 + 0.247f * width, centerPoint[1] - width / 2 + 0.705f * width,
233 | centerPoint[0] - width / 2 + 0.241f * width, centerPoint[1] - width / 2 + 0.696f * width
234 | );
235 | path.cubicTo(
236 | centerPoint[0] - width / 2 + 0.241f * width, centerPoint[1] - width / 2 + 0.696f * width,
237 | centerPoint[0] - width / 2 + 0.24f * width, centerPoint[1] - width / 2 + 0.696f * width,
238 | centerPoint[0] - width / 2 + 0.24f * width, centerPoint[1] - width / 2 + 0.696f * width
239 | );
240 | path.cubicTo(
241 | centerPoint[0] - width / 2 + 0.242f * width, centerPoint[1] - width / 2 + 0.693f * width,
242 | centerPoint[0] - width / 2 + 0.242f * width, centerPoint[1] - width / 2 + 0.692f * width,
243 | centerPoint[0] - width / 2 + 0.242f * width, centerPoint[1] - width / 2 + 0.692f * width
244 | );
245 | path.cubicTo(
246 | centerPoint[0] - width / 2 + 0.242f * width, centerPoint[1] - width / 2 + 0.692f * width,
247 | centerPoint[0] - width / 2 + 0.238f * width, centerPoint[1] - width / 2 + 0.689f * width,
248 | centerPoint[0] - width / 2 + 0.238f * width, centerPoint[1] - width / 2 + 0.689f * width
249 | );
250 | path.cubicTo(
251 | centerPoint[0] - width / 2 + 0.238f * width, centerPoint[1] - width / 2 + 0.689f * width,
252 | centerPoint[0] - width / 2 + 0.24f * width, centerPoint[1] - width / 2 + 0.687f * width,
253 | centerPoint[0] - width / 2 + 0.24f * width, centerPoint[1] - width / 2 + 0.687f * width
254 | );
255 | path.cubicTo(
256 | centerPoint[0] - width / 2 + 0.24f * width, centerPoint[1] - width / 2 + 0.687f * width,
257 | centerPoint[0] - width / 2 + 0.2f * width, centerPoint[1] - width / 2 + 0.622f * width,
258 | centerPoint[0] - width / 2 + 0.198f * width, centerPoint[1] - width / 2 + 0.617f * width
259 | );
260 | path.cubicTo(
261 | centerPoint[0] - width / 2 + 0.196f * width, centerPoint[1] - width / 2 + 0.612f * width,
262 | centerPoint[0] - width / 2 + 0.187f * width, centerPoint[1] - width / 2 + 0.6f * width,
263 | centerPoint[0] - width / 2 + 0.183f * width, centerPoint[1] - width / 2 + 0.596f * width
264 | );
265 | path.cubicTo(
266 | centerPoint[0] - width / 2 + 0.179f * width, centerPoint[1] - width / 2 + 0.591f * width,
267 | centerPoint[0] - width / 2 + 0.172f * width, centerPoint[1] - width / 2 + 0.586f * width,
268 | centerPoint[0] - width / 2 + 0.185f * width, centerPoint[1] - width / 2 + 0.585f * width
269 | );
270 | path.cubicTo(
271 | centerPoint[0] - width / 2 + 0.198f * width, centerPoint[1] - width / 2 + 0.584f * width,
272 | centerPoint[0] - width / 2 + 0.228f * width, centerPoint[1] - width / 2 + 0.579f * width,
273 | centerPoint[0] - width / 2 + 0.232f * width, centerPoint[1] - width / 2 + 0.579f * width
274 | );
275 | path.cubicTo(
276 | centerPoint[0] - width / 2 + 0.236f * width, centerPoint[1] - width / 2 + 0.579f * width,
277 | centerPoint[0] - width / 2 + 0.251f * width, centerPoint[1] - width / 2 + 0.577f * width,
278 | centerPoint[0] - width / 2 + 0.254f * width, centerPoint[1] - width / 2 + 0.571f * width
279 | );
280 | path.cubicTo(
281 | centerPoint[0] - width / 2 + 0.256f * width, centerPoint[1] - width / 2 + 0.565f * width,
282 | centerPoint[0] - width / 2 + 0.271f * width, centerPoint[1] - width / 2 + 0.566f * width,
283 | centerPoint[0] - width / 2 + 0.273f * width, centerPoint[1] - width / 2 + 0.569f * width
284 | );
285 | path.cubicTo(
286 | centerPoint[0] - width / 2 + 0.275f * width, centerPoint[1] - width / 2 + 0.572f * width,
287 | centerPoint[0] - width / 2 + 0.284f * width, centerPoint[1] - width / 2 + 0.601f * width,
288 | centerPoint[0] - width / 2 + 0.305f * width, centerPoint[1] - width / 2 + 0.603f * width
289 | );
290 | path.cubicTo(
291 | centerPoint[0] - width / 2 + 0.326f * width, centerPoint[1] - width / 2 + 0.605f * width,
292 | centerPoint[0] - width / 2 + 0.365f * width, centerPoint[1] - width / 2 + 0.613f * width,
293 | centerPoint[0] - width / 2 + 0.365f * width, centerPoint[1] - width / 2 + 0.613f * width
294 | );
295 | path.cubicTo(
296 | centerPoint[0] - width / 2 + 0.365f * width, centerPoint[1] - width / 2 + 0.613f * width,
297 | centerPoint[0] - width / 2 + 0.369f * width, centerPoint[1] - width / 2 + 0.63f * width,
298 | centerPoint[0] - width / 2 + 0.386f * width, centerPoint[1] - width / 2 + 0.628f * width
299 | );
300 | path.cubicTo(
301 | centerPoint[0] - width / 2 + 0.403f * width, centerPoint[1] - width / 2 + 0.626f * width,
302 | centerPoint[0] - width / 2 + 0.409f * width, centerPoint[1] - width / 2 + 0.629f * width,
303 | centerPoint[0] - width / 2 + 0.409f * width, centerPoint[1] - width / 2 + 0.629f * width
304 | );
305 | path.cubicTo(
306 | centerPoint[0] - width / 2 + 0.409f * width, centerPoint[1] - width / 2 + 0.629f * width,
307 | centerPoint[0] - width / 2 + 0.395f * width, centerPoint[1] - width / 2 + 0.666f * width,
308 | centerPoint[0] - width / 2 + 0.411f * width, centerPoint[1] - width / 2 + 0.711f * width
309 | );
310 | path.cubicTo(
311 | centerPoint[0] - width / 2 + 0.427f * width, centerPoint[1] - width / 2 + 0.758f * width,
312 | centerPoint[0] - width / 2 + 0.464f * width, centerPoint[1] - width / 2 + 0.764f * width,
313 | centerPoint[0] - width / 2 + 0.479f * width, centerPoint[1] - width / 2 + 0.755f * width
314 | );
315 | path.cubicTo(
316 | centerPoint[0] - width / 2 + 0.538f * width, centerPoint[1] - width / 2 + 0.778f * width,
317 | centerPoint[0] - width / 2 + 0.573f * width, centerPoint[1] - width / 2 + 0.754f * width,
318 | centerPoint[0] - width / 2 + 0.588f * width, centerPoint[1] - width / 2 + 0.711f * width
319 | );
320 | path.cubicTo(
321 | centerPoint[0] - width / 2 + 0.604f * width, centerPoint[1] - width / 2 + 0.666f * width,
322 | centerPoint[0] - width / 2 + 0.591f * width, centerPoint[1] - width / 2 + 0.629f * width,
323 | centerPoint[0] - width / 2 + 0.591f * width, centerPoint[1] - width / 2 + 0.629f * width
324 | );
325 | path.cubicTo(
326 | centerPoint[0] - width / 2 + 0.591f * width, centerPoint[1] - width / 2 + 0.629f * width,
327 | centerPoint[0] - width / 2 + 0.597f * width, centerPoint[1] - width / 2 + 0.626f * width,
328 | centerPoint[0] - width / 2 + 0.614f * width, centerPoint[1] - width / 2 + 0.628f * width
329 | );
330 | path.cubicTo(
331 | centerPoint[0] - width / 2 + 0.631f * width, centerPoint[1] - width / 2 + 0.63f * width,
332 | centerPoint[0] - width / 2 + 0.635f * width, centerPoint[1] - width / 2 + 0.613f * width,
333 | centerPoint[0] - width / 2 + 0.635f * width, centerPoint[1] - width / 2 + 0.613f * width
334 | );
335 | path.cubicTo(
336 | centerPoint[0] - width / 2 + 0.635f * width, centerPoint[1] - width / 2 + 0.613f * width,
337 | centerPoint[0] - width / 2 + 0.674f * width, centerPoint[1] - width / 2 + 0.605f * width,
338 | centerPoint[0] - width / 2 + 0.695f * width, centerPoint[1] - width / 2 + 0.603f * width
339 | );
340 | path.cubicTo(
341 | centerPoint[0] - width / 2 + 0.716f * width, centerPoint[1] - width / 2 + 0.601f * width,
342 | centerPoint[0] - width / 2 + 0.725f * width, centerPoint[1] - width / 2 + 0.572f * width,
343 | centerPoint[0] - width / 2 + 0.727f * width, centerPoint[1] - width / 2 + 0.569f * width
344 | );
345 | path.cubicTo(
346 | centerPoint[0] - width / 2 + 0.729f * width, centerPoint[1] - width / 2 + 0.566f * width,
347 | centerPoint[0] - width / 2 + 0.744f * width, centerPoint[1] - width / 2 + 0.565f * width,
348 | centerPoint[0] - width / 2 + 0.746f * width, centerPoint[1] - width / 2 + 0.571f * width
349 | );
350 | path.cubicTo(
351 | centerPoint[0] - width / 2 + 0.749f * width, centerPoint[1] - width / 2 + 0.577f * width,
352 | centerPoint[0] - width / 2 + 0.764f * width, centerPoint[1] - width / 2 + 0.579f * width,
353 | centerPoint[0] - width / 2 + 0.768f * width, centerPoint[1] - width / 2 + 0.579f * width
354 | );
355 | path.cubicTo(
356 | centerPoint[0] - width / 2 + 0.772f * width, centerPoint[1] - width / 2 + 0.579f * width,
357 | centerPoint[0] - width / 2 + 0.802f * width, centerPoint[1] - width / 2 + 0.584f * width,
358 | centerPoint[0] - width / 2 + 0.815f * width, centerPoint[1] - width / 2 + 0.585f * width
359 | );
360 | path.cubicTo(
361 | centerPoint[0] - width / 2 + 0.828f * width, centerPoint[1] - width / 2 + 0.586f * width,
362 | centerPoint[0] - width / 2 + 0.821f * width, centerPoint[1] - width / 2 + 0.591f * width,
363 | centerPoint[0] - width / 2 + 0.817f * width, centerPoint[1] - width / 2 + 0.596f * width
364 | );
365 | path.cubicTo(
366 | centerPoint[0] - width / 2 + 0.813f * width, centerPoint[1] - width / 2 + 0.6f * width,
367 | centerPoint[0] - width / 2 + 0.804f * width, centerPoint[1] - width / 2 + 0.612f * width,
368 | centerPoint[0] - width / 2 + 0.802f * width, centerPoint[1] - width / 2 + 0.617f * width
369 | );
370 | path.cubicTo(
371 | centerPoint[0] - width / 2 + 0.8f * width, centerPoint[1] - width / 2 + 0.622f * width,
372 | centerPoint[0] - width / 2 + 0.76f * width, centerPoint[1] - width / 2 + 0.687f * width,
373 | centerPoint[0] - width / 2 + 0.76f * width, centerPoint[1] - width / 2 + 0.687f * width
374 | );
375 | path.cubicTo(
376 | centerPoint[0] - width / 2 + 0.76f * width, centerPoint[1] - width / 2 + 0.687f * width,
377 | centerPoint[0] - width / 2 + 0.762f * width, centerPoint[1] - width / 2 + 0.689f * width,
378 | centerPoint[0] - width / 2 + 0.762f * width, centerPoint[1] - width / 2 + 0.689f * width
379 | );
380 | path.cubicTo(
381 | centerPoint[0] - width / 2 + 0.762f * width, centerPoint[1] - width / 2 + 0.689f * width,
382 | centerPoint[0] - width / 2 + 0.758f * width, centerPoint[1] - width / 2 + 0.692f * width,
383 | centerPoint[0] - width / 2 + 0.758f * width, centerPoint[1] - width / 2 + 0.692f * width
384 | );
385 | path.cubicTo(
386 | centerPoint[0] - width / 2 + 0.758f * width, centerPoint[1] - width / 2 + 0.692f * width,
387 | centerPoint[0] - width / 2 + 0.758f * width, centerPoint[1] - width / 2 + 0.693f * width,
388 | centerPoint[0] - width / 2 + 0.76f * width, centerPoint[1] - width / 2 + 0.696f * width
389 | );
390 | path.cubicTo(
391 | centerPoint[0] - width / 2 + 0.76f * width, centerPoint[1] - width / 2 + 0.696f * width,
392 | centerPoint[0] - width / 2 + 0.759f * width, centerPoint[1] - width / 2 + 0.696f * width,
393 | centerPoint[0] - width / 2 + 0.759f * width, centerPoint[1] - width / 2 + 0.696f * width
394 | );
395 | path.cubicTo(
396 | centerPoint[0] - width / 2 + 0.753f * width, centerPoint[1] - width / 2 + 0.705f * width,
397 | centerPoint[0] - width / 2 + 0.74f * width, centerPoint[1] - width / 2 + 0.713f * width,
398 | centerPoint[0] - width / 2 + 0.728f * width, centerPoint[1] - width / 2 + 0.713f * width
399 | );
400 | path.cubicTo(
401 | centerPoint[0] - width / 2 + 0.716f * width, centerPoint[1] - width / 2 + 0.713f * width,
402 | centerPoint[0] - width / 2 + 0.697f * width, centerPoint[1] - width / 2 + 0.712f * width,
403 | centerPoint[0] - width / 2 + 0.684f * width, centerPoint[1] - width / 2 + 0.721f * width
404 | );
405 | path.cubicTo(
406 | centerPoint[0] - width / 2 + 0.672f * width, centerPoint[1] - width / 2 + 0.729f * width,
407 | centerPoint[0] - width / 2 + 0.669f * width, centerPoint[1] - width / 2 + 0.736f * width,
408 | centerPoint[0] - width / 2 + 0.659f * width, centerPoint[1] - width / 2 + 0.739f * width
409 | );
410 | path.cubicTo(
411 | centerPoint[0] - width / 2 + 0.648f * width, centerPoint[1] - width / 2 + 0.742f * width,
412 | centerPoint[0] - width / 2 + 0.65f * width, centerPoint[1] - width / 2 + 0.753f * width,
413 | centerPoint[0] - width / 2 + 0.663f * width, centerPoint[1] - width / 2 + 0.751f * width
414 | );
415 | path.cubicTo(
416 | centerPoint[0] - width / 2 + 0.676f * width, centerPoint[1] - width / 2 + 0.749f * width,
417 | centerPoint[0] - width / 2 + 0.7f * width, centerPoint[1] - width / 2 + 0.734f * width,
418 | centerPoint[0] - width / 2 + 0.695f * width, centerPoint[1] - width / 2 + 0.741f * width
419 | );
420 | path.cubicTo(
421 | centerPoint[0] - width / 2 + 0.69f * width, centerPoint[1] - width / 2 + 0.749f * width,
422 | centerPoint[0] - width / 2 + 0.665f * width, centerPoint[1] - width / 2 + 0.778f * width,
423 | centerPoint[0] - width / 2 + 0.653f * width, centerPoint[1] - width / 2 + 0.788f * width
424 | );
425 | path.cubicTo(
426 | centerPoint[0] - width / 2 + 0.642f * width, centerPoint[1] - width / 2 + 0.798f * width,
427 | centerPoint[0] - width / 2 + 0.652f * width, centerPoint[1] - width / 2 + 0.806f * width,
428 | centerPoint[0] - width / 2 + 0.665f * width, centerPoint[1] - width / 2 + 0.798f * width
429 | );
430 | path.cubicTo(
431 | centerPoint[0] - width / 2 + 0.678f * width, centerPoint[1] - width / 2 + 0.789f * width,
432 | centerPoint[0] - width / 2 + 0.714f * width, centerPoint[1] - width / 2 + 0.759f * width,
433 | centerPoint[0] - width / 2 + 0.708f * width, centerPoint[1] - width / 2 + 0.768f * width
434 | );
435 | path.cubicTo(
436 | centerPoint[0] - width / 2 + 0.702f * width, centerPoint[1] - width / 2 + 0.776f * width,
437 | centerPoint[0] - width / 2 + 0.672f * width, centerPoint[1] - width / 2 + 0.802f * width,
438 | centerPoint[0] - width / 2 + 0.669f * width, centerPoint[1] - width / 2 + 0.807f * width
439 | );
440 | path.cubicTo(
441 | centerPoint[0] - width / 2 + 0.667f * width, centerPoint[1] - width / 2 + 0.813f * width,
442 | centerPoint[0] - width / 2 + 0.667f * width, centerPoint[1] - width / 2 + 0.813f * width,
443 | centerPoint[0] - width / 2 + 0.667f * width, centerPoint[1] - width / 2 + 0.813f * width
444 | );
445 | path.cubicTo(
446 | centerPoint[0] - width / 2 + 0.667f * width, centerPoint[1] - width / 2 + 0.813f * width,
447 | centerPoint[0] - width / 2 + 0.674f * width, centerPoint[1] - width / 2 + 0.823f * width,
448 | centerPoint[0] - width / 2 + 0.69f * width, centerPoint[1] - width / 2 + 0.813f * width
449 | );
450 | path.cubicTo(
451 | centerPoint[0] - width / 2 + 0.706f * width, centerPoint[1] - width / 2 + 0.802f * width,
452 | centerPoint[0] - width / 2 + 0.723f * width, centerPoint[1] - width / 2 + 0.784f * width,
453 | centerPoint[0] - width / 2 + 0.723f * width, centerPoint[1] - width / 2 + 0.784f * width
454 | );
455 | path.cubicTo(
456 | centerPoint[0] - width / 2 + 0.723f * width, centerPoint[1] - width / 2 + 0.784f * width,
457 | centerPoint[0] - width / 2 + 0.706f * width, centerPoint[1] - width / 2 + 0.812f * width,
458 | centerPoint[0] - width / 2 + 0.703f * width, centerPoint[1] - width / 2 + 0.82f * width
459 | );
460 | path.cubicTo(
461 | centerPoint[0] - width / 2 + 0.699f * width, centerPoint[1] - width / 2 + 0.829f * width,
462 | centerPoint[0] - width / 2 + 0.706f * width, centerPoint[1] - width / 2 + 0.83f * width,
463 | centerPoint[0] - width / 2 + 0.719f * width, centerPoint[1] - width / 2 + 0.817f * width
464 | );
465 | path.cubicTo(
466 | centerPoint[0] - width / 2 + 0.731f * width, centerPoint[1] - width / 2 + 0.804f * width,
467 | centerPoint[0] - width / 2 + 0.758f * width, centerPoint[1] - width / 2 + 0.775f * width,
468 | centerPoint[0] - width / 2 + 0.758f * width, centerPoint[1] - width / 2 + 0.775f * width
469 | );
470 | path.cubicTo(
471 | centerPoint[0] - width / 2 + 0.758f * width, centerPoint[1] - width / 2 + 0.775f * width,
472 | centerPoint[0] - width / 2 + 0.742f * width, centerPoint[1] - width / 2 + 0.801f * width,
473 | centerPoint[0] - width / 2 + 0.738f * width, centerPoint[1] - width / 2 + 0.808f * width
474 | );
475 | path.cubicTo(
476 | centerPoint[0] - width / 2 + 0.734f * width, centerPoint[1] - width / 2 + 0.816f * width,
477 | centerPoint[0] - width / 2 + 0.744f * width, centerPoint[1] - width / 2 + 0.816f * width,
478 | centerPoint[0] - width / 2 + 0.754f * width, centerPoint[1] - width / 2 + 0.806f * width
479 | );
480 | path.cubicTo(
481 | centerPoint[0] - width / 2 + 0.764f * width, centerPoint[1] - width / 2 + 0.797f * width,
482 | centerPoint[0] - width / 2 + 0.767f * width, centerPoint[1] - width / 2 + 0.792f * width,
483 | centerPoint[0] - width / 2 + 0.777f * width, centerPoint[1] - width / 2 + 0.78f * width
484 | );
485 | path.cubicTo(
486 | centerPoint[0] - width / 2 + 0.788f * width, centerPoint[1] - width / 2 + 0.767f * width,
487 | centerPoint[0] - width / 2 + 0.789f * width, centerPoint[1] - width / 2 + 0.743f * width,
488 | centerPoint[0] - width / 2 + 0.791f * width, centerPoint[1] - width / 2 + 0.736f * width
489 | );
490 | path.cubicTo(
491 | centerPoint[0] - width / 2 + 0.792f * width, centerPoint[1] - width / 2 + 0.734f * width,
492 | centerPoint[0] - width / 2 + 0.794f * width, centerPoint[1] - width / 2 + 0.732f * width,
493 | centerPoint[0] - width / 2 + 0.796f * width, centerPoint[1] - width / 2 + 0.729f * width
494 | );
495 | path.cubicTo(
496 | centerPoint[0] - width / 2 + 0.805f * width, centerPoint[1] - width / 2 + 0.733f * width,
497 | centerPoint[0] - width / 2 + 0.814f * width, centerPoint[1] - width / 2 + 0.734f * width,
498 | centerPoint[0] - width / 2 + 0.814f * width, centerPoint[1] - width / 2 + 0.734f * width
499 | );
500 | path.cubicTo(
501 | centerPoint[0] - width / 2 + 0.814f * width, centerPoint[1] - width / 2 + 0.734f * width,
502 | centerPoint[0] - width / 2 + 0.821f * width, centerPoint[1] - width / 2 + 0.725f * width,
503 | centerPoint[0] - width / 2 + 0.821f * width, centerPoint[1] - width / 2 + 0.725f * width
504 | );
505 | path.cubicTo(
506 | centerPoint[0] - width / 2 + 0.825f * width, centerPoint[1] - width / 2 + 0.727f * width,
507 | centerPoint[0] - width / 2 + 0.828f * width, centerPoint[1] - width / 2 + 0.729f * width,
508 | centerPoint[0] - width / 2 + 0.831f * width, centerPoint[1] - width / 2 + 0.729f * width
509 | );
510 | path.cubicTo(
511 | centerPoint[0] - width / 2 + 0.846f * width, centerPoint[1] - width / 2 + 0.734f * width,
512 | centerPoint[0] - width / 2 + 0.845f * width, centerPoint[1] - width / 2 + 0.744f * width,
513 | centerPoint[0] - width / 2 + 0.856f * width, centerPoint[1] - width / 2 + 0.725f * width
514 | );
515 | path.cubicTo(
516 | centerPoint[0] - width / 2 + 0.866f * width, centerPoint[1] - width / 2 + 0.706f * width,
517 | centerPoint[0] - width / 2 + 0.895f * width, centerPoint[1] - width / 2 + 0.644f * width,
518 | centerPoint[0] - width / 2 + 0.901f * width, centerPoint[1] - width / 2 + 0.633f * width
519 | );
520 | path.cubicTo(
521 | centerPoint[0] - width / 2 + 0.908f * width, centerPoint[1] - width / 2 + 0.622f * width,
522 | centerPoint[0] - width / 2 + 0.938f * width, centerPoint[1] - width / 2 + 0.568f * width,
523 | centerPoint[0] - width / 2 + 0.939f * width, centerPoint[1] - width / 2 + 0.555f * width
524 | );
525 | path.cubicTo(
526 | centerPoint[0] - width / 2 + 0.94f * width, centerPoint[1] - width / 2 + 0.542f * width,
527 | centerPoint[0] - width / 2 + 0.948f * width, centerPoint[1] - width / 2 + 0.526f * width,
528 | centerPoint[0] - width / 2 + 0.927f * width, centerPoint[1] - width / 2 + 0.519f * width
529 | );
530 | return path;
531 |
532 | }
533 |
534 | }
535 |
--------------------------------------------------------------------------------