UserOverlayBase.java
updated AnimationThread to make the animation more smooth
|
Before Width: | Height: | Size: 898 B |
|
Before Width: | Height: | Size: 760 B |
|
Before Width: | Height: | Size: 751 B |
|
Before Width: | Height: | Size: 466 B |
|
Before Width: | Height: | Size: 776 B |
|
Before Width: | Height: | Size: 527 B |
|
Before Width: | Height: | Size: 417 B |
|
Before Width: | Height: | Size: 473 B |
|
Before Width: | Height: | Size: 276 B |
|
Before Width: | Height: | Size: 410 B |
|
Before Width: | Height: | Size: 664 B |
|
Before Width: | Height: | Size: 567 B |
|
Before Width: | Height: | Size: 608 B |
|
Before Width: | Height: | Size: 359 B |
|
Before Width: | Height: | Size: 523 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 949 B |
|
Before Width: | Height: | Size: 943 B |
|
Before Width: | Height: | Size: 579 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 825 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -56,7 +56,7 @@ public abstract class UserOverlayBase extends Overlay implements GeoPointLocatio
|
||||
public void run(){
|
||||
super.run();
|
||||
int index = 0;
|
||||
boolean isCountingUp = true;
|
||||
boolean isCountingDown = false;
|
||||
while (true) {
|
||||
synchronized (this) {
|
||||
if (isAborted) {
|
||||
@@ -66,33 +66,39 @@ public abstract class UserOverlayBase extends Overlay implements GeoPointLocatio
|
||||
switch(index){
|
||||
case 1:
|
||||
mUserArrow = R.drawable.user_arrow_animation_2;
|
||||
if(isCountingDown)
|
||||
index--;
|
||||
else
|
||||
index++;
|
||||
|
||||
try {
|
||||
sleep(100l);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
mUserArrow = R.drawable.user_arrow_animation_3;
|
||||
index--;
|
||||
isCountingDown = true;
|
||||
try {
|
||||
sleep(200l);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
mUserArrow = R.drawable.user_arrow_animation_1;
|
||||
index++;
|
||||
isCountingDown = false;
|
||||
try {
|
||||
sleep(300l);
|
||||
sleep(700l);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
sleep(200l);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(isCountingUp){
|
||||
if(index++ == 2)
|
||||
isCountingUp = false;
|
||||
} else if(index-- == 0)
|
||||
isCountingUp = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||