add velcom animation

git-svn-id: https://osmand.googlecode.com/svn/trunk@532 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-09-28 22:23:14 +00:00
parent 99b96ab7c0
commit 8b8cf4e519
7 changed files with 156 additions and 5 deletions

View file

@ -14,14 +14,14 @@ public class ToDoConstants {
// ! 89. Transport redesign UI (enable run from context menu, switch go to goal/not) !
// ! 95. Show progress while map rendered and loaded (Issue)
// +!_1 . VELCOM animation
// !_25. Add all attributes needed for routing (highway attributes, turn_restrictions)
// !_22. Verify all POI has a point_type (in order to search them)
// !_1 . VELCOM
// !_28. Rotate crash (progress dialog)
// !_29. Fix memory for netherlands map creator
// _30. About screen (Issue)
// _18. Fix loading map data in rotated mode (check properly boundaries) +/-
// _30. About screen
/// PROFILE AND REVIEW Rendering !!!
// - Review Ref on the road on low zooms
@ -31,11 +31,13 @@ public class ToDoConstants {
// highway (?), traffic_calming (?), barrier(?), military(?-), landuse (?), office(?), man_made(?), power(?),
// railway( station, subway?) - issue 17
// ! 87. Use network availability for defining loading tiles from internet.
// 96. Introduce settings for MPH, imperial units
// _19. colors for road trunk and motorway
// _12. Fix : find proper location for streets ! centralize them (when create index)?
// _28. Fix freeze while map downloading (?)
// Outside base 0.4 release
// 86. Allow to add/edit custom tags to POI objects.
// 91. Invent binary format (minimize disk space, maximize speed)

View file

@ -7,4 +7,6 @@ public class Version {
public static final String APP_NAME_VERSION = APP_NAME + " " + APP_VERSION; //$NON-NLS-1$
public static final boolean VELCOM_EDITION = true;
}

View file

@ -51,7 +51,7 @@ public class MapRenderingTypes {
public final static int MASK_10 = (1 << 10) - 1;
public final static char REF_CHAR = ((char)0x0019);
public final static char DELIM_CHAR = ((char)0x0020);
public final static char DELIM_CHAR = ((char)0x0018);
public final static int HIGHWAY = 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View file

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@drawable/background">
<ImageView android:layout_height="wrap_content" android:layout_width="fill_parent" android:adjustViewBounds="true"
android:scaleType="fitXY" android:src="@drawable/velcom_line" android:layout_gravity="bottom|center"/>
<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
<LinearLayout android:layout_weight="0.25" android:layout_height="0dp" android:layout_width="wrap_content" android:gravity="center_vertical"
android:orientation="horizontal" android:layout_marginTop="5dp" android:layout_marginLeft="25dp">
<ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center"
android:src="@drawable/velcom_mini" android:id="@+id/VelcomMini"/>
<TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_gravity="center" android:layout_marginLeft="15dp"
android:textColor="#FFFFFF" android:textStyle="normal" android:typeface="serif" android:text="Навигация" android:textSize="32sp" android:id="@+id/TextVelcom"/>
</LinearLayout>
<TableLayout android:layout_width="fill_parent" android:layout_weight="0.4" android:layout_height="0dp">
<LinearLayout android:layout_height="fill_parent" android:layout_weight="0.5">
<Button
android:id="@+id/MapButton"
android:text="@string/map_Button"
android:background="@drawable/btn_orange"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:layout_weight="0.5"
android:layout_marginLeft="1dp"
android:layout_marginRight="2dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawableLeft="@drawable/map"/>
<Button
android:id="@+id/SearchButton"
android:text="@string/search_button"
android:background="@drawable/btn_orange"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:layout_weight="0.5"
android:layout_marginLeft="1dp"
android:layout_marginRight="2dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawableLeft="@drawable/find"/>
</LinearLayout>
<LinearLayout android:layout_height="fill_parent" android:layout_weight="0.5">
<Button
android:id="@+id/FavoritesButton"
android:text="@string/favorites_Button"
android:background="@drawable/btn_orange"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:layout_marginLeft="1dp"
android:layout_weight="0.5"
android:layout_marginRight="2dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawableLeft="@drawable/favorites"/>
<Button
android:id="@+id/SettingsButton"
android:text="@string/settings_Button"
android:background="@drawable/btn_orange"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:layout_weight="0.5"
android:layout_marginLeft="2dp"
android:layout_marginRight="1dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawableLeft="@drawable/settings"/>
</LinearLayout>
</TableLayout>
<LinearLayout android:layout_weight="0.35" android:layout_height="0dp" android:layout_width="fill_parent" android:orientation="vertical"/>
</LinearLayout>
</FrameLayout>

View file

@ -14,6 +14,8 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.Camera;
import android.graphics.Matrix;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
@ -22,7 +24,11 @@ import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.Transformation;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
public class MainMenuActivity extends Activity {
@ -89,7 +95,70 @@ public class MainMenuActivity extends Activity {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.menu);
setContentView(Version.VELCOM_EDITION ? R.layout.menu_velcom : R.layout.menu);
if(Version.VELCOM_EDITION){
final ImageView imgView = (ImageView) findViewById(R.id.VelcomMini);
final Camera camera = new Camera();
final float firstRotate = 0.3f;
final float invisibleText = 0.7f;
final int animationTime = 3600;
Animation ra = new Animation(){
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
final Matrix matrix = t.getMatrix();
int centerY = imgView.getHeight() / 2;
int centerX = imgView.getWidth() / 2;
camera.save();
if (interpolatedTime < firstRotate) {
camera.rotateY(360 * (firstRotate - interpolatedTime) / firstRotate);
} else if (interpolatedTime < 2 * firstRotate) {
camera.rotateY(360 * (2 * firstRotate - interpolatedTime) / firstRotate);
} else {
camera.rotateY(360 * (interpolatedTime - 2 * firstRotate) / (1 - 2 * firstRotate));
}
camera.getMatrix(matrix);
matrix.preTranslate(-centerX, -centerY);
matrix.postTranslate(centerX, centerY);
camera.restore();
}
};
ra.setDuration(animationTime);
imgView.startAnimation(ra);
final TextView textView = (TextView) findViewById(R.id.TextVelcom);
Animation alphaAnimation = new Animation(){
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
if(interpolatedTime < invisibleText){
t.setAlpha(0);
} else {
t.setAlpha((interpolatedTime - invisibleText) / (1 - invisibleText));
}
}
};
alphaAnimation.setAnimationListener(new Animation.AnimationListener(){
@Override
public void onAnimationEnd(Animation animation) {
textView.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationStart(Animation animation) {
textView.setVisibility(View.VISIBLE);
}
});
alphaAnimation.setDuration(animationTime);
textView.startAnimation(alphaAnimation);
textView.setVisibility(View.INVISIBLE);
}
showMap = (Button) findViewById(R.id.MapButton);
showMap.setOnClickListener(new OnClickListener() {