c88aR187">187
}
private void initBanner(){
+ if(TextUtils.isEmpty(images[0]) && TextUtils.isEmpty(images[1])){
+ banner.setVisibility(View.GONE);
+ return;
+ }
banner.setVisibility(View.VISIBLE);
+
banner.setPages(new CBViewHolderCreator<NetworkImageHolderView>() {
@Override
public NetworkImageHolderView createHolder() {
@@ -219,7 +230,6 @@ public class TabRecentPhotoFragment extends BaseFragment implements SwipeRefresh
protected void onPreExecute() {
super.onPreExecute();
scrollListener.setLoading(true);
-// swipeRefreshLayout.setRefreshing(true);
}
@Override
@@ -293,14 +303,13 @@ public class TabRecentPhotoFragment extends BaseFragment implements SwipeRefresh
@Override
public void onItemClick(int position) {
- new FullScreenImgPopup(getActivity(),bannerBeanList.get(position).url).showPopupWindow();
+ new FullScreenImgPopup(getActivity(),images[position]).showPopupWindow();
}
public class NetworkImageHolderView implements Holder<String> {
private ImageView imageView;
@Override
public View createView(Context context) {
- //你可以通过layout文件来创建,也可以像我一样用代码创建,不一定是Image,任何控件都可以进行翻页
imageView = new ImageView(context);
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
return imageView;
@@ -71,13 +71,7 @@ public class MyLocationService extends Service {
|
||
| 71 | 71 |
destroyLocation(); |
| 72 | 72 |
} |
| 73 | 73 |
|
| 74 |
- /** |
|
| 75 |
- * 初始化定位 |
|
| 76 |
- * |
|
| 77 |
- * @since 2.8.0 |
|
| 78 |
- * @author hongming.wang |
|
| 79 |
- * |
|
| 80 |
- */ |
|
| 74 |
+ |
|
| 81 | 75 |
private void initLocation(){
|
| 82 | 76 |
if(locationClient!=null){
|
| 83 | 77 |
return; |
@@ -91,12 +85,7 @@ public class MyLocationService extends Service {
|
||
| 91 | 85 |
status = 0; |
| 92 | 86 |
} |
| 93 | 87 |
|
| 94 |
- /** |
|
| 95 |
- * 默认的定位参数 |
|
| 96 |
- * @since 2.8.0 |
|
| 97 |
- * @author hongming.wang |
|
| 98 |
- * |
|
| 99 |
- */ |
|
| 88 |
+ |
|
| 100 | 89 |
private AMapLocationClientOption getDefaultOption(){
|
| 101 | 90 |
AMapLocationClientOption mOption = new AMapLocationClientOption(); |
| 102 | 91 |
mOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);//可选,设置定位模式,可选的模式有高精度、仅设备、仅网络。默认为高精度模式 |
@@ -112,9 +101,6 @@ public class MyLocationService extends Service {
|
||
| 112 | 101 |
return mOption; |
| 113 | 102 |
} |
| 114 | 103 |
|
| 115 |
- /** |
|
| 116 |
- * 定位监听 |
|
| 117 |
- */ |
|
| 118 | 104 |
AMapLocationListener locationListener = new AMapLocationListener() {
|
| 119 | 105 |
@Override |
| 120 | 106 |
public void onLocationChanged(AMapLocation loc) {
|
@@ -125,13 +111,6 @@ public class MyLocationService extends Service {
|
||
| 125 | 111 |
}; |
| 126 | 112 |
|
| 127 | 113 |
|
| 128 |
- /** |
|
| 129 |
- * 开始定位 |
|
| 130 |
- * |
|
| 131 |
- * @since 2.8.0 |
|
| 132 |
- * @author hongming.wang |
|
| 133 |
- * |
|
| 134 |
- */ |
|
| 135 | 114 |
private void startLocation(){
|
| 136 | 115 |
if(status==1){
|
| 137 | 116 |
return; |
@@ -144,13 +123,6 @@ public class MyLocationService extends Service {
|
||
| 144 | 123 |
status = 1; |
| 145 | 124 |
} |
| 146 | 125 |
|
| 147 |
- /** |
|
| 148 |
- * 停止定位 |
|
| 149 |
- * |
|
| 150 |
- * @since 2.8.0 |
|
| 151 |
- * @author hongming.wang |
|
| 152 |
- * |
|
| 153 |
- */ |
|
| 154 | 126 |
private void stopLocation(){
|
| 155 | 127 |
if(status == 2){
|
| 156 | 128 |
return; |
@@ -160,13 +132,6 @@ public class MyLocationService extends Service {
|
||
| 160 | 132 |
status = 2; |
| 161 | 133 |
} |
| 162 | 134 |
|
| 163 |
- /** |
|
| 164 |
- * 销毁定位 |
|
| 165 |
- * |
|
| 166 |
- * @since 2.8.0 |
|
| 167 |
- * @author hongming.wang |
|
| 168 |
- * |
|
| 169 |
- */ |
|
| 170 | 135 |
private void destroyLocation(){
|
| 171 | 136 |
if (null != locationClient) {
|
| 172 | 137 |
locationClient.onDestroy(); |
@@ -184,7 +149,7 @@ private void reportLocationWhenTourMode(double lat, double lon){
|
||
| 184 | 149 |
repeatTime = 0; |
| 185 | 150 |
lastLat = lat; |
| 186 | 151 |
lastLon = lon; |
| 187 |
- if(Preferences.getInstance(this).isTourMode()|| BuildConfig.DEBUG){
|
|
| 152 |
+ if(Preferences.getInstance(this).isTourMode()){
|
|
| 188 | 153 |
HashMap<String,String> params = new HashMap<String,String>(); |
| 189 | 154 |
String userId = Preferences.getInstance(this).getUserId(); |
| 190 | 155 |
if(userId.length()==0){
|
@@ -194,7 +159,7 @@ private void reportLocationWhenTourMode(double lat, double lon){
|
||
| 194 | 159 |
params.put("lon",String.valueOf(lon));
|
| 195 | 160 |
params.put("lat",String.valueOf(lat));
|
| 196 | 161 |
new HttpPostTask(this,params).executeOnExecutor(ThreadExecutor.getInstance().getExecutor(), UrlContainer.GEO_LOCATION_URL); |
| 197 |
- LogHelper.d("czy","reportLocationWhenTourMode lat = "+lat+"lon="+lon);
|
|
| 162 |
+ LogHelper.dfile("czy","上报经纬度位置 lat = "+lat+"lon="+lon);
|
|
| 198 | 163 |
} |
| 199 | 164 |
} |
| 200 | 165 |
|
@@ -84,5 +84,5 @@ public class UrlContainer {
|
||
| 84 | 84 |
|
| 85 | 85 |
public static final String GEO_LOCATION_URL = HOST_URL+"geo/submit"; |
| 86 | 86 |
//TODO |
| 87 |
- public static final String TOUR_INFO_URL = HOST_URL +"tg/info"; |
|
| 87 |
+ public static final String TOUR_INFO_URL = HOST_URL +"pai2/tginfo"; |
|
| 88 | 88 |
} |
@@ -137,7 +137,7 @@ class FileLog {
|
||
| 137 | 137 |
|
| 138 | 138 |
public FileLog() throws RuntimeException, IOException {
|
| 139 | 139 |
File sdcard = new File(SD_CARD); |
| 140 |
- String fileName = "上传测试"+new SimpleDateFormat("MM-dd-HH-mm").format(new Date()) + ".log";
|
|
| 140 |
+ String fileName = "paiai-"+new SimpleDateFormat("MM-dd-HH-mm").format(new Date()) + ".log";
|
|
| 141 | 141 |
File logFile = new File(LOG_PATH+fileName); |
| 142 | 142 |
|
| 143 | 143 |
if (!sdcard.exists()) {
|
@@ -1,6 +1,7 @@ |
||
| 1 | 1 |
package com.android.common.utils; |
| 2 | 2 |
|
| 3 | 3 |
import java.text.DateFormat; |
| 4 |
+import java.text.ParseException; |
|
| 4 | 5 |
import java.text.SimpleDateFormat; |
| 5 | 6 |
import java.util.Date; |
| 6 | 7 |
import java.util.TimeZone; |
@@ -53,6 +54,17 @@ public class TimeUtils {
|
||
| 53 | 54 |
return utc2Local(utcTime, "yyyy-MM-dd'T'HH:mm:ss'Z'", "yyyy-MM-dd HH:mm"); |
| 54 | 55 |
} |
| 55 | 56 |
|
| 57 |
+ public static long getStandardTimeInMiliSec(String utcTime){
|
|
| 58 |
+ long time = 0; |
|
| 59 |
+ String standardTimeStr = getStandardTime(utcTime); |
|
| 60 |
+ try {
|
|
| 61 |
+ Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(standardTimeStr);
|
|
| 62 |
+ time = date.getTime(); |
|
| 63 |
+ } catch (ParseException e) {
|
|
| 64 |
+ e.printStackTrace(); |
|
| 65 |
+ } |
|
| 66 |
+ return time; |
|
| 67 |
+ } |
|
| 56 | 68 |
|
| 57 | 69 |
public static String getFormattedTime(String utcTime) {
|
| 58 | 70 |
String formattedTime = utc2Local(utcTime, "yyyy-MM-dd'T'HH:mm:ss'Z'", "yyyy-MM-dd HH:mm"); |