This is a fork of iglaweb/Ferris-Wheel which had its most recent release in 2018 (until now) and its distribution repository was JCenter which was recently shutdown completely. This fork aims to fill the gap and provide a ferris wheel with updated dependencies and distribution via JitPack.
An Android Library used to implement an animated Ferris Wheel in android.
- API SDK 15+
- Written in Kotlin
- Supports landscape mode
- Lightweight view with 1 drawable inside, uses canvas 2D drawing technique
Inspired by the one-color Planet Coaster loading screen
- Featured in 25 new Android libraries, projects and tools worthy to check in Spring 2018
- Mentioned in Android Weekly issue 332
- Featured in 12 New Android Libraries - Full HD
Using Gradle
FerrisWheelView is distributed using JitPack.
repositories {
jcenter()
}
dependencies {
implementation 'com.github.meikpiep:Ferris-Wheel:1.3.2'
}
Or Maven
<dependency>
<groupId>com.github.meikpiep</groupId>
<artifactId>Ferris-Wheel</artifactId>
<version>1.3.2</version>
<type>pom</type>
</dependency>
Add widget in your xml layout like this:
<ru.github.igla.ferriswheel.FerrisWheelView
android:id="@+id/ferrisWheelView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
app:fwv_cabinsNumber="8"
app:fwv_rotateSpeed="6" />
To start animation you need only call this method:
ferrisWheelView.startAnimation()
Or you can stop/pause/resume animation by the following methods:
ferrisWheelView.stopAnimation()
ferrisWheelView.pauseAnimation()
ferrisWheelView.resumeAnimation()
attr | format | default | description |
---|---|---|---|
fwv_cabinSize | dimension | 42dp | the size of each cabin |
fwv_cabinsNumber | integer | 8 | the number of cabins on the wheel |
fwv_isClockwise | boolean | true | toogle the rotate direction |
fwv_isAutoRotate | boolean | true | start rotating wheel automatically after initialization |
fwv_rotateSpeed | integer | 6 | wheel speed rotation measured in degrees |
fwv_startAngle | float | 0 | angle at which wheel will start to rotate |
fwv_wheelStrokeColor | color | #73302b |
with this color the wheel will be filled |
fwv_baseStrokeColor | color | #666666 |
with this color the wheel base will be filled |
fwv_cabinFillColor | color | array | with this color the cabin will be filled |
fwv_cabinLineStrokeColor | color | #000000 |
with this color the cabin line will be filled |
If you find any problems or would like to suggest a feature, please feel free to file an issue
Copyright 2018 Igor Lashkov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.