Ni3Narale / Ferris-Wheel

Simple android library to present an animated ferris wheel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ferris Wheel View

Android Arsenal Build Status Download License

Overview

An Android Library used to implement an animated Ferris Wheel in android.

  • API SDK 15+
  • Written in Kotlin
  • Lightweight view with 1 drawable inside, uses canvas 2D drawing technique

Alt text

Sample Project

For information : checkout Sample App Code in repository.

Quick Setup

Include library

Using Gradle

dependencies {
    compile 'ru.github.igla:ferriswheel:1.0.0'
}

Using Maven

<dependency>
  <groupId>ru.github.igla</groupId>
  <artifactId>ferriswheel</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Usage

Use the built in Widget in your XML 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_isClockwise="true"
        app:fwv_rotateSpeed="6"
        app:fwv_startAngle="10" />

To run initialization and start animation you need only call this methods:

    ferrisWheelView.apply {
        build()
        startAnimation()
    }

Or you can stop/pause/resume animation by the following methods:

    ferrisWheelView.stopAnimation()
    ferrisWheelView.pauseAnimation()
    ferrisWheelView.resumeAnimation()

Attributes

attr format description
fwv_cabinSize dimension the size of each cabin
fwv_cabinsNumber integer the number of cabins on the wheel
fwv_isClockwise boolean toogle the rotate direction
fwv_rotateSpeed integer wheel speed rotation measured in degrees
fwv_startAngle float angle at which wheel will start to rotate
fwv_wheelStrokeColor color with this color the wheel will be filled
fwv_baseStrokeColor color with this color the base will be filled

Issues

If you find any problems or would like to suggest a feature, please feel free to file an issue on github at https://github.com/iglaweb/Ferris-Wheel/issues

License

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.

About

Simple android library to present an animated ferris wheel

License:Apache License 2.0


Languages

Language:Kotlin 100.0%