加入Start和About界面
This commit is contained in:
parent
3bc78884f7
commit
c725760339
|
@ -12,7 +12,7 @@
|
|||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="IlGRxo6vRXn8lxA7nA0LAoeS" />
|
||||
<activity
|
||||
android:name="org.by.lbs.app.MainActivity"
|
||||
android:name="org.by.lbs.app.StartActivity"
|
||||
android:label="@string/app_name" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
@ -65,6 +65,18 @@
|
|||
android:screenOrientation="portrait" >
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
android:screenOrientation="portrait" >
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".AboutActivity"
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
android:screenOrientation="portrait" >
|
||||
</activity>
|
||||
|
||||
|
||||
|
||||
<service
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package org.by.lbs.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
* Created by yiang on 2014/5/23.
|
||||
*/
|
||||
public class AboutActivity extends Activity{
|
||||
|
||||
private TextView mVersion;
|
||||
private Button mUpdate;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.about);
|
||||
|
||||
//获取客户端版本信息
|
||||
try {
|
||||
PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||
mVersion = (TextView)findViewById(R.id.about_version);
|
||||
mVersion.setText("版本:"+info.versionName);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace(System.err);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -86,8 +86,10 @@ public class MainActivity extends ActionBarActivity
|
|||
Intent i=new Intent(MainActivity.this,OfflineFragment.class);
|
||||
startActivity(i);
|
||||
|
||||
} else {
|
||||
|
||||
} else if(position==2) {
|
||||
|
||||
Intent i=new Intent(MainActivity.this,AboutActivity.class);
|
||||
startActivity(i);
|
||||
/*fragmentManager.beginTransaction()
|
||||
.replace(R.id.container, PlaceholderFragment.newInstance(position + 1))
|
||||
.commit();
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
package org.by.lbs.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
import android.view.animation.Animation;
|
||||
|
||||
/**
|
||||
* Created by yiang on 2014/5/23.
|
||||
*/
|
||||
public class StartActivity extends Activity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
final View view = View.inflate(this, R.layout.start, null);
|
||||
setContentView(view);
|
||||
|
||||
//渐变展示启动屏
|
||||
AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
|
||||
aa.setDuration(2000);
|
||||
view.startAnimation(aa);
|
||||
aa.setAnimationListener(new Animation.AnimationListener()
|
||||
{
|
||||
@Override
|
||||
public void onAnimationEnd(Animation arg0) {
|
||||
redirectTo();
|
||||
}
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation animation) {}
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳转到...
|
||||
*/
|
||||
private void redirectTo(){
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 169 KiB |
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/about"
|
||||
android:scaleType="fitStart"/>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/welcome"
|
||||
android:scaleType="fitStart"/>
|
Binary file not shown.
After Width: | Height: | Size: 280 KiB |
|
@ -0,0 +1,37 @@
|
|||
<?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:orientation="vertical"
|
||||
android:background="@drawable/about_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|bottom"
|
||||
android:layout_marginBottom="200dip"
|
||||
android:textSize="@dimen/text_size_16"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
android:text="OPEN LBS"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/about_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|bottom"
|
||||
android:layout_marginBottom="160dip"
|
||||
android:textColor="@color/black"
|
||||
android:text="版本:1.0.0"/>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|bottom"
|
||||
android:layout_marginBottom="30dip"
|
||||
android:textColor="@color/black"
|
||||
android:text="基于Android平台的开放式LBS应用 ©2014"/>
|
||||
|
||||
</FrameLayout>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="bottom"
|
||||
android:background="@drawable/start_background">
|
||||
|
||||
</LinearLayout>
|
|
@ -43,4 +43,5 @@
|
|||
<dimen name="sapi_verifycodeimg_height">40.0dip</dimen>
|
||||
<dimen name="standard_padding">8.0dip</dimen>
|
||||
<dimen name="half_padding">4.0dip</dimen>
|
||||
<dimen name="text_size_16">16.0dip</dimen>
|
||||
</resources>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<string name="title_section2">路线规划</string>
|
||||
<string name="title_section3">POI搜索</string>
|
||||
<string name="title_section4">离线地图</string>
|
||||
<string name="title_section5">设置</string>
|
||||
<string name="title_section5">关于</string>
|
||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||
<string name="navigation_drawer_close">Close navigation drawer</string>
|
||||
<string name="action_action">action</string>
|
||||
|
|
Loading…
Reference in New Issue