This commit is contained in:
wangmi 2017-01-03 23:39:23 +08:00
parent 2374123012
commit 25b9a6f630
13 changed files with 120 additions and 131 deletions

View File

@ -1,34 +0,0 @@
/**
*
*/
package com.qiyou.mb.android.test;
import org.junit.Test;
import android.util.Log;
import com.qiyou.mb.android.beans.basic.Track_bean;
import com.qiyou.mb.android.utils.Utils;
import com.qiyou.mb.android.utils.enums.TrackType;
import junit.framework.TestCase;
/**
* @author wangmi
*
*/
public class TestGsonEnum extends TestCase {
@Test
public void testToJson() {
Track_bean tb = new Track_bean();
tb.setType(TrackType.DIVE);
Log.d("test", "json is" + Utils.getGsonString(tb));
}
}

View File

@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.qiyou.mb.android"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="45"
android:versionName="1.29.1" >
android:versionCode="46"
android:versionName="1.29.2" >
<uses-sdk
android:minSdkVersion="8"
@ -72,15 +72,11 @@
<!-- home -->
<!--<meta-data-->
<!--android:name="com.baidu.lbsapi.API_KEY" -->
<!--android:value="4lcFzBPFbukDG9DulM4qjjaI" -->
<!--/> -->
<!--android:name="com.baidu.lbsapi.API_KEY"-->
<!--android:value="4lcFzBPFbukDG9DulM4qjjaI"-->
<!--/>-->
<!-- office -->
<!-- <meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:value="NMVsIZxN3EGO1Zn5PKtyCFAG"
/> -->
<activity

View File

@ -3072,8 +3072,10 @@ public TypeStatistics getTracksStat(int trackType,long startDate,long endDate)
* km/h
* @return
*/
public float getAVS(){
return mStatistics==null?0:mStatistics.getAVS();
public float getAVS(){
float avspeed = mStatistics==null?0:mStatistics.getAVS();
avspeed =Float.isNaN(avspeed)||avspeed==0?15:avspeed;
return avspeed;
}
/**

View File

@ -15,7 +15,7 @@ public final static String BASE_MD_URL = BASE_URL;//+"upload/";
public final static String BASE_STATIC_URL = BASE_URL +"staticmap/";
public final static String TENCENT_APP_ID = "1104563148";
// TODO Turn off when deploying.
public static boolean DEVELOPER_MODE = true;
public static boolean DEVELOPER_MODE = false;
public static boolean PLAYBACK_CAN_RECORD = false /*DEVELOPER_MODE*/ ;

View File

@ -1575,12 +1575,12 @@ public void showNoteDetail(Note note,NoteMessage noteMsg) {
}.start();
// }
return true;
case R.id.action_settings:
/* case R.id.action_settings:
startPrefActivity();
return true;
case R.id.action_offline:
showOffline();
return true;
return true;*/
case R.id.action_about:
showAbout();
return true;
@ -1591,9 +1591,9 @@ public void showNoteDetail(Note note,NoteMessage noteMsg) {
case R.id.action_route:
showRoute(0);
return true;
case R.id.action_login:
/*case R.id.action_login:
showLogin();
return true;
return true;*/
case R.id.menu_item_share:
doShare();
@ -1601,9 +1601,9 @@ public void showNoteDetail(Note note,NoteMessage noteMsg) {
case R.id.action_main:
isTabHome();
return true;
case R.id.action_history:
/* case R.id.action_history:
this.showLocalTrackList();
return true;
return true; */
/*case R.id.action_regist:
showRegist();
@ -1646,13 +1646,13 @@ public void showNoteDetail(Note note,NoteMessage noteMsg) {
// MenuItem mainItem=menu.findItem( R.id.action_main);
// mainItem.setShowAsAction(app.currentActiveFragment.equalsIgnoreCase(tabHome)?notShow:alwaysShow);
MenuItem loginItem=menu.findItem( R.id.action_login);
/*MenuItem loginItem=menu.findItem( R.id.action_login);
String loginTitle ="登录";//loginItem.getTitle().toString();
String loginUser =/* app.user.getUserbean().getAccount();*/app.user.getUserbean().getUserName();
String loginUser =*//* app.user.getUserbean().getAccount();*//*app.user.getUserbean().getUserName();
if(TextUtils.isEmpty(loginUser))return true;
loginUser=loginUser.length()>20?loginUser.substring(0, 20):loginUser;
loginTitle += ( app.user.getUserbean().getId()<=0?"":" ( " + loginUser +" )");
loginItem.setTitle(loginTitle);
loginItem.setTitle(loginTitle);*/
return true;

View File

@ -83,7 +83,7 @@ public class TrackStatics_fragment extends TrackMap_fragment implements Ilocatio
private TextView mftNoteText;
private TextView mdetailNoteText;
private ImageView imgBtnEditUser;
private Button btnMoreHistory,btnMoreConfigure,btnMoreOffline;
// private GraphicsOverlay gpFootPointsOverlay = null;
@ -1247,8 +1247,13 @@ public class TrackStatics_fragment extends TrackMap_fragment implements Ilocatio
void setUserInfo(){
if(activity.app.user.getUserbean().getId()<=0)return;
((LinearLayout)vContainer.findViewById(R.id.ll_user_info)).setVisibility(View.VISIBLE);
((LinearLayout)vContainer.findViewById(R.id.ll_user_info)).setVisibility(View.VISIBLE);
if(activity.app.user.getUserbean().getId()<=0){
setUserLinkSpanTxt(((TextView) vContainer.findViewById(R.id.textview_user_name)),-1,"登录");
((TextView) vContainer.findViewById(R.id.textView_user_score)).setVisibility(View.GONE);
return;
}
setUserLinkSpanTxt(((TextView) vContainer.findViewById(R.id.textview_user_name)),activity.app.user.getUserbean().getId(),activity.app.user.getUserbean().getUserName());
// ((TextView) vContainer.findViewById(R.id.textview_user_name)).setText(activity.app.user.getUserbean().getUserName()/*.getAccount()*/);
((TextView) vContainer.findViewById(R.id.textView_user_score)).setText(activity.app.user.getUserbean().getScore()+"");
@ -1270,6 +1275,24 @@ public class TrackStatics_fragment extends TrackMap_fragment implements Ilocatio
imgBtnEditUser= (ImageView)vContainer.findViewById(R.id.img_btnEdituser);
imgBtnEditUser.setOnClickListener(ButtonOnClickListener);
btnMoreHistory =(Button)vContainer.findViewById(R.id.btn_more_history);
btnMoreHistory.setOnClickListener(ButtonOnClickListener);
btnMoreConfigure =(Button)vContainer.findViewById(R.id.btn_more_configure);
btnMoreConfigure.setOnClickListener(ButtonOnClickListener);
btnMoreOffline =(Button)vContainer.findViewById(R.id.btn_more_offlinemap);
btnMoreOffline.setOnClickListener(ButtonOnClickListener);
// ll_myinfo= (LinearLayout)vContainer.findViewById(R.id.ll_myinfo);
// ll_myinfo.setOnClickListener(ButtonOnClickListener);
/* ll_newact= (LinearLayout)vContainer.findViewById(R.id.ll_newact);
@ -1328,15 +1351,21 @@ public class TrackStatics_fragment extends TrackMap_fragment implements Ilocatio
if(tv==null){
continue;
}
tv.setPadding(2,0,0,5);
if(i>0){
// tv.setTextColor( getResources().getColorStateList(R.color.lightslategrey));
tv.setTextColor( getResources().getColorStateList(R.color.darkgray));
// tv.setTextSize(unSelectedSize);
// tv.setTextSize(14);
// tabWidget.getChildAt(i).setBackgroundResource(R.color.lightgray);
// tv.setGravity(Gravity.CENTER_VERTICAL);
// tv.setBackgroundColor(Color.BLUE);
ImageView iv = new ImageView(activity);
iv.setScaleType(ImageView.ScaleType.CENTER);
if(i==1){
ImageView iv = new ImageView(activity);
iv.setBackgroundResource(R.drawable.icon_chart);
// iv.setBackgroundResource(R.drawable.icon_chart);
iv.setImageResource(R.drawable.icon_chart);
try{
((LinearLayout)tabWidget.getChildAt(i)).setGravity(Gravity.CENTER_VERTICAL);
((LinearLayout)tabWidget.getChildAt(i)).addView(iv,0);
@ -1344,26 +1373,27 @@ public class TrackStatics_fragment extends TrackMap_fragment implements Ilocatio
}
}else if(i==2){
ImageView iv = new ImageView(activity);
iv.setBackgroundResource(R.drawable.icon_footmark);
// ImageView iv = new ImageView(activity);
// iv.setBackgroundResource(R.drawable.icon_footmark);
iv.setImageResource(R.drawable.icon_footmark);
try{
((LinearLayout)tabWidget.getChildAt(i)).setGravity(Gravity.CENTER_VERTICAL);
((LinearLayout)tabWidget.getChildAt(i)).addView(iv,0);
}catch(ClassCastException e){
}
}/*else if(i==3){
ImageView iv = new ImageView(activity);
iv.setBackgroundResource(R.drawable.icon_light);
} else if(i==3){
// ImageView iv = new ImageView(activity);
// iv.setBackgroundResource(R.drawable.icon_wall);
iv.setPadding(0,0,4,0);
iv.setImageResource(R.drawable.icon_wall);
try{
((LinearLayout)tabWidget.getChildAt(i)).setGravity(Gravity.CENTER_VERTICAL);
((LinearLayout)tabWidget.getChildAt(i)).addView(iv,0);
}catch(ClassCastException e){
}
}*/
}
}else{

View File

@ -682,6 +682,9 @@ mBaiduMap.setMyLocationData(locData);*/
case R.id.user_abulm: { showPicPicker(); break; }
case R.id.act_btn_share: { shareObj(); break; }
case R.id.usr_btn_logout: { logout(); break; }
case R.id.btn_more_history:{activity.showLocalTrackList();break; }
case R.id.btn_more_configure:{activity. startPrefActivity(); break; }
case R.id.btn_more_offlinemap:{activity.showOffline();break;}
}
}
@ -2177,8 +2180,9 @@ mBaiduMap.setMyLocationData(locData);*/
float avspeed=3600f*activity.app.mStatistics.getSumDist()/activity.app.mStatistics.getSumSportTime();
avspeed =Float.isNaN(avspeed)||avspeed==0?15:avspeed;
// float avspeed=3600f*activity.app.mStatistics.getSumDist()/activity.app.mStatistics.getSumSportTime();
// avspeed =Float.isNaN(avspeed)||avspeed==0?15:avspeed;
float avspeed= activity.app.getAVS();
/* float hours=mTrack_bean.getDistance()/1000/avspeed;
float totalHours= (float) (hours*1.2f +((int)(hours*1.2/12))*12) ;

View File

@ -1001,9 +1001,19 @@ public class WebList_fragment extends TrackMap_fragment/* TrackList_fragment *//
String.format("%.2f", tb.getDistance() / 1000));
// t.put("sportime", Utils.getTimeCnt(tb.getSportTime(),
// true));
t.put("sportime", Utils.getTimeCnt(tb.getTotalTime(), true));
float avs = tb.getType() == TrackType.GPX ? activity.app.getAVS() : tb.getAvs();
long sptime = tb.getType() ==TrackType.GPX ? (long)( tb.getDistance() / avs *3600) : tb.getTotalTime();
t.put("sportime", Utils.getTimeCnt(sptime, true));
// t.put("avs", String.format("%.2f",tb.getAvs()));
t.put("avs", String.format("%.2f", tb.getTavs()));
t.put("avs", String.format("%.2f", avs));
// t.put("sportime", Utils.getTimeCnt(tb.getTotalTime(), true));
// // t.put("avs", String.format("%.2f",tb.getAvs()));
// t.put("avs", String.format("%.2f", tb.getTavs()));
t.put("cal", String.format("%.2f", tb.getBurn()));
t.put("comment", tb.getComment());
t.put("desc",

View File

@ -30,27 +30,23 @@ android:padding="0dp"
<LinearLayout
style="@style/ll_line_1"
android:orientation="vertical"
android:layout_marginLeft="-3dp"
>
<LinearLayout
style="@style/ll_line_1"
android:layout_height="100dp"
android:layout_marginTop="-3dp"
>
<LinearLayout style="@style/ll_line_small_l.v" >
<!-- <ImageButton
style="@style/more_button"
android:src="@drawable/icon_databse"
android:id="@+id/imageButton4"
android:layout_weight="1"
android:elevation="5dp"
android:visibility="visible" />-->
<Button
style="@style/more_button"
android:id="@+id/btn_more_history"
android:text="@string/frg_list"
android:drawableTop="@drawable/icon_databse"
android:drawableTop="@drawable/icon_archive"
/>
</LinearLayout>
@ -59,16 +55,18 @@ android:padding="0dp"
<Button
style="@style/more_button"
android:text="@string/frg_list"
android:drawableTop="@drawable/icon_databse"
android:id="@+id/btn_more_configure"
android:text="@string/action_settings"
android:drawableTop="@drawable/icon_gear"
/>
</LinearLayout>
<LinearLayout style="@style/ll_line_small_l.v" >
<Button
style="@style/more_button"
android:text="@string/frg_list"
android:drawableTop="@drawable/icon_databse"
android:id="@+id/btn_more_offlinemap"
android:text="@string/action_offline"
android:drawableTop="@drawable/icon_puzzle"
/>
</LinearLayout>
@ -77,39 +75,22 @@ android:padding="0dp"
<LinearLayout
style="@style/ll_line_1"
android:layout_height="100dp"
android:layout_marginTop="-3dp"
>
<LinearLayout style="@style/ll_line_small_l.v" >
<!-- <ImageButton
style="@style/more_button"
android:src="@drawable/icon_databse"
android:id="@+id/imageButton4"
android:layout_weight="1"
android:elevation="5dp"
android:visibility="visible" />-->
<Button
style="@style/more_button"
android:text="@string/frg_list"
/>
</LinearLayout>
<LinearLayout style="@style/ll_line_small_l.v" >
<Button
style="@style/more_button"
android:text="@string/frg_list"
/>
</LinearLayout>
<LinearLayout style="@style/ll_line_small_l.v" >
<Button
style="@style/more_button"
android:text="@string/frg_list"
/>
</LinearLayout>
</LinearLayout>
@ -118,7 +99,7 @@ android:padding="0dp"
<LinearLayout
style="@style/ll_line_1"
android:layout_height="100dp"
android:layout_marginTop="-3dp"
>
<LinearLayout style="@style/ll_line_small_l.v" >
@ -139,7 +120,7 @@ android:padding="0dp"
<LinearLayout
style="@style/ll_line_1"
android:layout_height="100dp"
android:layout_marginTop="-3dp"
>
<LinearLayout style="@style/ll_line_small_l.v" >

View File

@ -7,7 +7,8 @@
android:paddingBottom="2dp"
android:paddingTop="5dp" >
<!-- android:background="@color/lightcyan" -->
<!-- android:background="@color/lightcyan"
-->
<LinearLayout
style="@style/item_head"
@ -37,7 +38,7 @@
<TextView
style="@style/ll_fill_unit"
android:layout_width="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginRight="0dp"
android:layout_weight="0"
android:gravity="bottom"
android:text="@string/web_number" />

View File

@ -1,10 +1,10 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
<!-- <item
android:id="@+id/action_history"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_history"/>
android:title="@string/action_history"/>-->
<item
android:id="@+id/action_route"
android:orderInCategory="100"
@ -15,27 +15,27 @@
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_main"/>
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
<item
android:id="@+id/action_login"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_login"/>
<!--<item-->
<!--android:id="@+id/action_settings"-->
<!--android:orderInCategory="100"-->
<!--android:showAsAction="never"-->
<!--android:title="@string/action_settings"/>-->
<!--<item-->
<!--android:id="@+id/action_login"-->
<!--android:orderInCategory="100"-->
<!--android:showAsAction="never"-->
<!--android:title="@string/action_login"/>-->
<item
android:id="@+id/menu_item_share"
android:actionProviderClass="android.widget.ShareActionProvider"
android:orderInCategory="100"
android:showAsAction="never"
android:title="分享"/>
<item
<!-- <item
android:id="@+id/action_offline"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_offline"/>
android:title="@string/action_offline"/>-->
<!--
<item

View File

@ -105,7 +105,7 @@
<string name="tracking_auto_pause">自动暂停</string>
<string name="tracking_pause">已暂停记录</string>
<string name="no_sat_singal">定位中</string>
<string name="web_number">云编号</string>
<string name="web_number">#</string>
<!-- track editor -->
<string name="track_edit_save">保存修改</string>
<!-- <string name="track_edit_del">删除</string> -->
@ -160,7 +160,7 @@
<string name="frg_noteEdit">编辑说说</string>
<!-- action menu -->
<string name="action_settings" translatable="false">设置</string>
<string name="action_settings" translatable="false">偏好设置</string>
<string name="action_offline" translatable="false">离线地图</string>
<string name="action_main" translatable="false">首页</string>
<string name="action_about" translatable="false">关于爱骑驴</string>

View File

@ -662,10 +662,9 @@
<item name="android:paddingTop">20dp</item>
<item name="android:background">@drawable/button_simple_style</item>
<item name="android:layout_margin">1dp </item>
<item name="android:textSize">@dimen/button_size</item>
<item name="android:textSize">@dimen/button_s_size</item>
<item name="android:textStyle">normal</item>
</style>
</style>
<style name="ll_button_top_left" parent="ll_button">