Popularity
2.6
Stable
Activity
2.9
-
80
6
30

Description

Dual color polyline animation similar as Uber.

Programming language: Kotlin
License: MIT License
Tags: Android     Animations     Navigation     Maps     Android Developers     Polyline    
Latest version: v1.0

Dual-color-Polyline-Animation alternatives and similar packages

Based on the "Navigation" category.
Alternatively, view Dual-color-Polyline-Animation alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Dual-color-Polyline-Animation or a related project?

Add another 'Navigation' Package

README

Dual-color-Polyline-Animation

Android Arsenal BCH compliance Platform This library will help to show the polyline in dual color similar as Uber with animation in the demo.

Demo

Dependency

App Level:
implementation 'com.github.tintinscorpion:Dual-color-Polyline-Animation:{latest_version}'
Project Level:
maven { url 'https://jitpack.io' }

Steps:

Pass the googlemap context and Latlng points stored in arraylist.

   In Kotlin:

   MapAnimator.animateRoute(googleMap, polyLineList)

   In Java:

   MapAnimator.INSTANCE.animateRoute(googleMap, polyLineList);

polyLineList refers to the List of LatLng, the coordinates which is to be decoded from the directions api of google.

Additional:

You can change the color and animation time and the width of the polyline by passing :


   MapAnimator.setPrimaryLineColor(color)
   MapAnimator.setSecondaryLineColor(color) 
   MapAnimator.setPercentCompletion(@IntegerRes time: Int) default is 2500 //amount of time to draw the initial polyline 
   MapAnimator.setColorFillCompletion(@IntegerRes time: Int) default is 1800 //amount of time to refill the primary color
   MapAnimator.setDelayTime(@IntegerRes time: Int) default is 200 //amount of time for delaying to run the sequenceof animation
   MapAnimator.setPrimaryLineCompletion(@IntegerRes time: Int) default is 2000 //amount of time required for the animation to reach from point A to B
   MapAnimator.setPolylineWidth(width: Float) default is 8f 

If you are calling these methods, call it before animateRoute() method call else it won't reflect.

Note:

If you are using proguard then, write this in proguard-rules.pro

   //For android studio 4.0 and above- 
   -keepclassmembers class com.logicbeanzs.uberpolylineanimation.* {
     <fields>;
     <init>();
     <methods>;
   }


   //For android studio below 4.0-
   -keep class com.logicbeanzs.uberpolylineanimation.**

Developers

Pritam Dasgupta

License

MIT License Copyright (c) 2018 Pritam Dasgupta

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


*Note that all licence references and agreements mentioned in the Dual-color-Polyline-Animation README section above are relevant to that project's source code only.