Giter Site home page Giter Site logo

tintinscorpion / dual-color-polyline-animation Goto Github PK

View Code? Open in Web Editor NEW
80.0 6.0 30.0 13.01 MB

This library will help to show the polyline in dual color similar as Uber.

License: MIT License

Java 26.65% HTML 0.52% Kotlin 72.83%
polyline animation uber android android-library maps google-maps navigation dual-color polyline-animation

dual-color-polyline-animation's Introduction

Dual-color-Polyline-Animation

Android Arsenal 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.

dual-color-polyline-animation's People

Contributors

pritam-quantum-inventions avatar tintinscorpion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dual-color-polyline-animation's Issues

Polyline path wasn't drawn

I have passed decoded path to your Class. But no path or no animation was showing.

But in general path is drawn by this below code.

mMap.addPolyline( PolylineOptions() .addAll(decodedPath) )

polyline trembles

In your example the foreground animated polyline trembles. What is the reason for this?

App Crasheing

MapAnimator.getInstance().animateRoute(mMap, polylineList); generates this error in my emulator any help ?

android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@57da9ab is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:679)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
at android.widget.Toast$TN.handleShow(Toast.java:467)
at android.widget.Toast$TN$2.handleMessage(Toast.java:350)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6125)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)

Colors do not change.

Unable to change the color of line using the given method.
Steps to reproduce the behavior:

  1. Add a route
  2. Draw Polyline
  3. Line is drawn and animated
  4. Try changing color. It just doesn't work. May be due to Singleton Pattern?

get the example like demo

Hi

Thanks for you library, I need to ask favour from you can you able to share the Android UI which you have shown in the readme doc because I m not good at developing android UI applications so if you can share code with me that would be good help for me (Specially origin and destination picker and label on origin and destination )

Thanks

No polyline is drawn

mMap.addPolyline(points); draws polyline but MapAnimator.getInstance().animateRoute(googleMap, points); does NOT draw. Pleas help

Sample app is empty

Hi,
I was excited to see you demo app. But when I try to install it in my phone, the sample app was empty. Could you please share the code of your sample app?

Thanks

I/Counters: exceeded sample count in FrameTime

Hi. When using the library, it constantly drops into the console:

I/Counters: exceeded sample count in FrameTime
I/Counters: exceeded sample count in FrameTime
I/Counters: exceeded sample count in FrameTime
I/Counters: exceeded sample count in FrameTime
I/Counters: exceeded sample count in FrameTime
I/Counters: exceeded sample count in FrameTime

I do not know what it means. Maybe you know why this is happening.
And you tell me, since I didn't find any information about this error on stackoverflow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.