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(){
|
public void run(){
|
||||||
super.run();
|
super.run();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
boolean isCountingUp = true;
|
boolean isCountingDown = false;
|
||||||
while (true) {
|
while (true) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (isAborted) {
|
if (isAborted) {
|
||||||
@@ -66,33 +66,39 @@ public abstract class UserOverlayBase extends Overlay implements GeoPointLocatio
|
|||||||
switch(index){
|
switch(index){
|
||||||
case 1:
|
case 1:
|
||||||
mUserArrow = R.drawable.user_arrow_animation_2;
|
mUserArrow = R.drawable.user_arrow_animation_2;
|
||||||
|
if(isCountingDown)
|
||||||
|
index--;
|
||||||
|
else
|
||||||
|
index++;
|
||||||
|
|
||||||
|
try {
|
||||||
|
sleep(100l);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
mUserArrow = R.drawable.user_arrow_animation_3;
|
mUserArrow = R.drawable.user_arrow_animation_3;
|
||||||
|
index--;
|
||||||
|
isCountingDown = true;
|
||||||
|
try {
|
||||||
|
sleep(200l);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mUserArrow = R.drawable.user_arrow_animation_1;
|
mUserArrow = R.drawable.user_arrow_animation_1;
|
||||||
|
index++;
|
||||||
|
isCountingDown = false;
|
||||||
try {
|
try {
|
||||||
sleep(300l);
|
sleep(700l);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
sleep(200l);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isCountingUp){
|
|
||||||
if(index++ == 2)
|
|
||||||
isCountingUp = false;
|
|
||||||
} else if(index-- == 0)
|
|
||||||
isCountingUp = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||