Road Runner

Additional

Language
Java
Version
N/A
Created
Mar 20, 2016
Updated
Jun 3, 2017 (Retired)
Owner
Adrián Lomas (glomadrian)
Contributors
Adrián Lomas (glomadrian)
Yahya Bayramoğlu (yayaa)
ade
3
Activity
Badge
Generate
Download
Source code
APK file

Announcement

Road Runner

Road Runner is a library for android which allow you to make your own loading animation using a SVG image



Material

<com.github.glomadrian.roadrunner.IndeterminateRoadRunner
     android:id="@+id/material"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     lib:movement_direction="counter_clockwise"
     lib:path_color="#FFFFFF"
     lib:stroke_width="3sp"
     lib:path_data="@string/twitter"
     lib:path_original_width="@integer/twitter_original_width"
     lib:path_original_height="@integer/twitter_original_height"
     lib:path_animation_type="material"
     />

Determinate Two way

<com.github.glomadrian.roadrunner.DeterminateRoadRunner
    android:id="@+id/determinate"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    lib:min="0"
    lib:max="100"
    lib:movement_direction="counter_clockwise"
    lib:path_color="@color/colorAccent"
    lib:stroke_width="2sp"
    lib:movement_loop_time="1500"
    lib:path_data="@string/clip"
    lib:path_original_width="@integer/clip_original_width"
    lib:path_original_height="@integer/clip_original_height"
    lib:animate_on_start="false"
    />

Custom attributes

Common

  • movement_direction: clockwise or counter_clockwise
  • path_color: color of the painted path
  • stroke_width: width of the painted path
  • path_data: String with the path information
  • path_original_width: The original with defined in the SVG
  • path_original_height: The original height defined in the SVG
  • animate_on_start: true or false, init the animation on first paint (true by default)

Indeterminate

  • path_animation_type: Select indetermina animation type, can be:
    • material
    • twoWay

Indeterminate Material

  • Dont have any custom attributes

Indeterminate Two way

  • movement_loop_time:** Time take to do a complete loop
  • line_size:* The size of the base line
  • left_line_animation_time: Time take to do a complete animation to the left line
  • right_line_animation_time: Time take to do a complete animation to the right line
  • left_line_max_size:* The max size that the left line can research in the animation
  • right_line_max_size:* The max size that the right line can research in the animation
  • left_line_animation_start_delay: Time to wait to start the left line animation (in milliseconds)
  • right_line_animation_start_delay: Time to wait to start the right line animation (in milliseconds)

* From 0f to 1f, 1f is all the path

Determinate

  • min: Min value for the progress
  • max: Max value for the progress
  • movement_loop_time: Time take to do a complete loop
  • movement_line_size:* The size of the line

* From 0f to 1f, 1f is all the path

Attributions

For Gradle

Add repository

repositories {
  maven {
    url "http://dl.bintray.com/glomadrian/maven"
  }
}

Add dependency

compile 'com.github.glomadrian:roadrunner:1.0@aar'

Developed By

Adrián García Lomas - glomadrian@gmail.com

License

Copyright 2016 Adrián García Lomas

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.