Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show icon blinking on google map

I want to show current location of user on Google map. Every thing is working fine for me . I am just using marker to show current Location on map. Now I want to make that marker to be blink as in original google maps app on android mobile. I think I have to use animation for this purpose,But I dont know how to use it. I am searching it in internet but I am not getting any solutions . Anyone help me please.....

like image 317
Prabhu M Avatar asked Oct 10 '22 12:10

Prabhu M


1 Answers

Android GPS icon on the status bar blinks using the below logic. Keep two drawables one with dull image and one with bright image. Change them at certain duration and it will look like the image is blinking.

<animation-list
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:oneshot="false">
    <item android:drawable="@drawable/dull" android:duration="10000" />
    <item android:drawable="@drawable/bright" android:duration="10000" />
</animation-list>
like image 185
Vinoth Avatar answered Nov 10 '22 16:11

Vinoth