项目作者: iglaweb

项目描述 :
Simple android library to present an animated ferris wheel
高级语言: Kotlin
项目地址: git://github.com/iglaweb/Ferris-Wheel.git
创建时间: 2018-01-12T21:18:47Z
项目社区:https://github.com/iglaweb/Ferris-Wheel

开源协议:Apache License 2.0

下载


Ferris Wheel View

Android Arsenal
Build Status
Download
License

image

Overview

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

Preview-demo Monochrome-sample

Inspired by the one-color Planet Coaster loading screen

Mentions

Sample Project

For more information how to use the library in Kotlin/Java checkout Sample App in repository.

Quick Setup

Include library

Using Gradle

FerrisWheelView is distributed using jcenter.

  1. repositories {
  2. jcenter()
  3. }
  4. dependencies {
  5. implementation 'ru.github.igla:ferriswheel:1.2'
  6. }

Or Maven

  1. <dependency>
  2. <groupId>ru.github.igla</groupId>
  3. <artifactId>ferriswheel</artifactId>
  4. <version>1.2</version>
  5. <type>pom</type>
  6. </dependency>

Usage

Add widget in your xml layout like this:

  1. <ru.github.igla.ferriswheel.FerrisWheelView
  2. android:id="@+id/ferrisWheelView"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:layout_gravity="center"
  6. app:fwv_cabinsNumber="8"
  7. app:fwv_rotateSpeed="6" ></ru.github.igla.ferriswheel.FerrisWheelView>

To start animation you need only call this method:

  1. ferrisWheelView.startAnimation()

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

  1. ferrisWheelView.stopAnimation()
  2. ferrisWheelView.pauseAnimation()
  3. ferrisWheelView.resumeAnimation()

Attributes

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 #73302b with this color the wheel will be filled
fwv_baseStrokeColor color #666666 #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 #000000 with this color the cabin line will be filled

Issues

If you find any problems or would like to suggest a feature, please
feel free to file an issue

License

  1. Copyright 2018 Igor Lashkov
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.