• Stars
    star
    324
  • Rank 129,708 (Top 3 %)
  • Language
    Java
  • Created over 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fancy magic curve.

WJMagicCurveView

By setting several parameters simply, You'll get a fancy Magic Curve immediately.

中文介绍,来自Android-CJJ同学

Let's see what it is

Order Demo
1
2
3
4
5

How it works

By setting eight parameters (Of course you don't have to set every because they all have default value), WJMagicCurveView will draw a beautiful curve based on a math function.

First, we'll create two points and make them rotate in specified speed and specified radius revolving a same center; Second, whenever they reach a point during rotating, we'll draw a line connecting these two points; Thirds, continue rotate and draw lines, Bingo! You're creating a new beautiful curve!

How to create your own curve

We provide eight base parameters for normal users and more for developers from code level. Here are explaintion for these parameters:

  1. radiusAXradiusAY: A point is the outer rotating point, these two are the radius of A;
  2. radiusBXradiusBY: B point is the inner rotating point;
  3. speedOuterPointspeedInnerPoint: the rotating speed for A & B;
  4. loopTotalCount: the loop count for these two rotating points;
  5. durationSeconds: the durationg speed for rotating.

Playable apk

Download it from here and make a try!

How to use it

WJMagicCurveView wjMagicCurveView = (WJMagicCurveView) findViewById(R.id.wj_magic_curve_view);
// set parameters. of course it's not necessary to set all these parameters because they all have default value
wjMagicCurveView.setRadius(radiusAX, radiusAY, radiusBX, radiusBY)
                .setDurationSec(durationSeconds)
                .setLoopTotalCount(loopTotalCount)
                .setSpeed(speedOuterPoint, speedInnerPoint)
                .startDraw();
// stop Draw
wjMagicCurveView.stopDraw();
// destory and recycle bitmap
wjMagicCurveView.destory();
// Customize your own curve here
I create a enum called WJMagicCurveViewParameters, 
You can create your own WJMagicCurveViewParameters with eight parameters,
for empty fields, use -1 as default value.

Related resource

有趣的曲线在Android上的实现

Processing: 简单法则的魅力

###Reach me - wingjay

You can get information about me and reach me in my github page: https://github.com/wingjay

Blog: http://wingjay.com

Weibo: http://weibo.com/u/1625892654

Feel free to give me advices by mailto:[email protected]

Thanks!

More Repositories

1

jianshi

A Full-Stack mobile app, including Android & Server, Simple-Poem 简诗. You can write poem in graceful & traditional Chinese style.
Java
1,865
star
2

BlurImageView

BlurImageView, you can load your image progressively like Medium does.First show user a blurry image, At the same time, load the real image, once loaded, replace the blurry one automatically
Java
1,347
star
3

android-open-source-project-cracking

Analysis for Popular & Hot Android open-source Applications & Libraries will help you grow into a Senior Android developer. Follow us, do practice in the right and fast way. 通过对流行的优质android开源项目分析、学习、仿写,最终理解,不仅帮你掌握最新的android技术,更能让你理解开源项目的精华之处,这些都是你成为一名高级android developer必不可少的。
GCC Machine Description
1,119
star
4

HelloJava

Java basic learning
Java
22
star
5

AutoLifecycle

Make your Java class be aware of Android Lifecycle.
Java
22
star
6

wingjay.github.io

blog for wingjay.
HTML
16
star
7

Lego

A powerful Android library for building complex RecyclerView. Building a list is as simple as playing Lego game. List<Model> =>Lego=> List<View>. 像搭积木一样构建你的RecyclerView列表。
Java
9
star
8

InnoXYZ

This app is used by team members to manage project together.
Java
5
star
9

w2sm

超贴心导航
PHP
4
star
10

resume-latex-chinese-support

resume template complied by XeLaTeX , supporting Chinese.
TeX
2
star
11

Titan

cross-platform network framework, based on Mars
Java
2
star
12

jayAndroid

Learning android
Java
2
star
13

HelloDesignPattern

For Design Pattern practise.
Java
1
star
14

hacker_scripts

My personal hacker scripts (Shell + Python + NodeJS script)
JavaScript
1
star
15

ABot

An AI Bot who can understand natural language, execute your commands. Based on API.AI from Google.
Python
1
star