Merge remote-tracking branch 'origin/feature/v1.0.5' into feature/v1.0.5
This commit is contained in:
@@ -168,6 +168,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
private int mCurrentUploadFrame = 0;
|
||||
private Handler mUploadFrameAnimHandler;
|
||||
public static final int MSG_FRAME_ANIM = 307;
|
||||
public static final int MSG_STOP_ANIM = 308;
|
||||
public static final long TIME_FRAME_INTERVAL_TIME = 80;
|
||||
|
||||
@Override
|
||||
@@ -513,6 +514,10 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
if ( isTrue ) {
|
||||
mUploading.setVisibility( View.VISIBLE );
|
||||
mUpload.setVisibility( View.GONE );
|
||||
if ( mUploadFrameAnimHandler != null ) {
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_STOP_ANIM );
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
}
|
||||
doFrameAnimOnUploadButton();
|
||||
} else {
|
||||
mCurrentUploadFrame = 0;
|
||||
@@ -552,10 +557,14 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mUploading.setImageResource( mUploadingFrameRes[mCurrentUploadFrame++%mUploadingFrameRes.length] );
|
||||
}
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_FRAME_ANIM, TIME_FRAME_INTERVAL_TIME );
|
||||
} else if( msg.what == MSG_STOP_ANIM ){
|
||||
mStatusManager.setUploadingStatus( TAG, false );
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
mUploadFrameAnimHandler.sendEmptyMessage( MSG_FRAME_ANIM );
|
||||
// 30s 后无论成功与否,停止动画
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_STOP_ANIM, 30_000 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
private boolean mIsMarkerClicked = false;
|
||||
private RefreshModel mRefreshModel;
|
||||
private MogoLatLng mCarLatLng;
|
||||
private int mCarSmoothDuration = 15;
|
||||
// 平滑移动事件间隔(单位:秒)
|
||||
private static final int SMOOTH_DURATION = 15;
|
||||
|
||||
private MapMarkerManager() {
|
||||
}
|
||||
@@ -490,17 +491,20 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
try {
|
||||
// 在ACC on 之后第一次获取到了在线车辆数据,选中最近的一个Marker
|
||||
if (mIsAISearchOnlineData) {
|
||||
if (mNearlyMarker != null) {
|
||||
Logger.d(TAG, "语音搜索触发,默认选中最近的在线车辆:" + mNearlyMarker);
|
||||
// 移动地图到指定位置
|
||||
MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus(ServiceConst.TYPE, true, false);
|
||||
MarkerServiceHandler.getMapUIController().moveToCenter(mNearlyMarker.getPosition());
|
||||
onMarkerClicked(mNearlyMarker);
|
||||
MogoMarkersHandler.getInstance().onMarkerClicked(mNearlyMarker);
|
||||
mIsAISearchOnlineData = false;
|
||||
}
|
||||
if ( !mIsAISearchOnlineData ) {
|
||||
return;
|
||||
}
|
||||
if ( mNearlyMarker == null ) {
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "语音搜索触发,默认选中最近的在线车辆:" + mNearlyMarker);
|
||||
// 移动地图到指定位置
|
||||
MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus(ServiceConst.TYPE, true, false);
|
||||
MarkerServiceHandler.getMapUIController().moveToCenter(mNearlyMarker.getPosition());
|
||||
onMarkerClicked(mNearlyMarker);
|
||||
MogoMarkersHandler.getInstance().onMarkerClicked(mNearlyMarker);
|
||||
mIsAISearchOnlineData = false;
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -701,12 +705,9 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
// List<MarkerOnlineCar> onlineCarList = mLastDataResult.getOnlineCar();
|
||||
List<MarkerExploreWay> exploreWayList = mLastDataResult.getExploreWay();
|
||||
List<MarkerNoveltyInfo> noveltyInfoList = mLastDataResult.getNoveltyInfo();
|
||||
// dispatchDataToBis(ServiceConst.CARD_TYPE_USER_DATA, onlineCarList == null ?
|
||||
// new ArrayList<>() : onlineCarList);
|
||||
dispatchDataToBis(ServiceConst.CARD_TYPE_ROAD_CONDITION, exploreWayList == null ?
|
||||
new ArrayList<>() : exploreWayList);
|
||||
dispatchDataToBis(ServiceConst.CARD_TYPE_NOVELTY, noveltyInfoList == null ?
|
||||
new ArrayList<>() : noveltyInfoList);
|
||||
// dispatchDataToBis(ServiceConst.CARD_TYPE_USER_DATA, onlineCarList == null ?new ArrayList<>() : onlineCarList);
|
||||
dispatchDataToBis(ServiceConst.CARD_TYPE_ROAD_CONDITION, exploreWayList == null ? new ArrayList<>() : exploreWayList);
|
||||
dispatchDataToBis(ServiceConst.CARD_TYPE_NOVELTY, noveltyInfoList == null ? new ArrayList<>() : noveltyInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -829,14 +830,14 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
mCarLatLng = latlng;
|
||||
getOnlineCarList();
|
||||
UiThreadHandler.removeCallbacks(runnable);
|
||||
UiThreadHandler.postDelayed(runnable, mCarSmoothDuration * 1000);
|
||||
UiThreadHandler.postDelayed( runnable, SMOOTH_DURATION * 1000 );
|
||||
}
|
||||
|
||||
private Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getOnlineCarList();
|
||||
UiThreadHandler.postDelayed(this, mCarSmoothDuration * 1000);
|
||||
UiThreadHandler.postDelayed( this, SMOOTH_DURATION * 1000 );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -863,7 +864,9 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
if (MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ){
|
||||
return;
|
||||
}
|
||||
drawOnlineCarMarkers(onlineCarList, ServiceConst.MAX_AMOUNT_SINGLE_CARD);
|
||||
runOnTargetThread( () -> {
|
||||
drawOnlineCarMarkers( onlineCarList, ServiceConst.MAX_AMOUNT_SINGLE_CARD );
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -899,28 +902,56 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
// 平滑移动
|
||||
private void startSmooth(IMogoMarker iMogoMarker, MarkerOnlineCar markerOnlineCar,
|
||||
MarkerLocation markerLocation) {
|
||||
List<MarkerCarPois> poisList = markerOnlineCar.getPois();
|
||||
|
||||
if (poisList != null && poisList.size() > 0) {
|
||||
// Logger.d(TAG, "坐标------"+markerLocation.getLon()+", "+markerLocation.getLat());
|
||||
List< MarkerCarPois > poiList = markerOnlineCar.getPois();
|
||||
if ( filterErrorPoint( poiList ) ) {
|
||||
return;
|
||||
}
|
||||
if ( poiList == null || poiList.size() < 2 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<MogoLatLng> points = new ArrayList<>();
|
||||
for (int j = 0; j < poisList.size(); j++) {
|
||||
MarkerCarPois pois = poisList.get(j);
|
||||
if (pois != null && pois.getCoordinates() != null && pois.getCoordinates().size() >= 2) {
|
||||
// Logger.d(TAG, "坐标点:" + pois.getCoordinates().toString());
|
||||
double lat = Double.valueOf(pois.getCoordinates().get(1) + "");
|
||||
double lng = Double.valueOf(pois.getCoordinates().get(0) + "");
|
||||
for ( int j = 0; j < poiList.size(); j++ ) {
|
||||
MarkerCarPois poi = poiList.get( j );
|
||||
if ( poi == null || poi.getCoordinates() == null && poi.getCoordinates().size() != 2 ) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
double lat = Double.valueOf( poi.getCoordinates().get( 1 ) + "" );
|
||||
double lng = Double.valueOf( poi.getCoordinates().get( 0 ) + "" );
|
||||
points.add(new MogoLatLng(lat, lng));
|
||||
} catch ( Exception e ) {
|
||||
}
|
||||
}
|
||||
if (points.size() >= 1){
|
||||
points.add(new MogoLatLng(markerLocation.getLat(), markerLocation.getLon()));
|
||||
iMogoMarker.startSmooth(points, mCarSmoothDuration);
|
||||
iMogoMarker.startSmooth( points, SMOOTH_DURATION );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 有可能出现终点到起点跳跃的情况,需要用"500M"约束起点和终点
|
||||
* @param poiList
|
||||
*/
|
||||
private boolean filterErrorPoint(List< MarkerCarPois > poiList){
|
||||
if ( poiList == null || poiList.size() < 2 ) {
|
||||
return false;
|
||||
}
|
||||
MarkerCarPois start = poiList.get( 0 );
|
||||
MarkerCarPois end = poiList.get( poiList.size() - 1 );
|
||||
|
||||
try {
|
||||
double lat1 = Double.valueOf( start.getCoordinates().get( 1 ) + "" );
|
||||
double lng1 = Double.valueOf( start.getCoordinates().get( 0 ) + "" );
|
||||
double lat2 = Double.valueOf( end.getCoordinates().get( 1 ) + "" );
|
||||
double lng2 = Double.valueOf( end.getCoordinates().get( 0 ) + "" );
|
||||
if ( Utils.calculateLineDistance( new MogoLatLng( lat1, lng1 ), new MogoLatLng( lat2, lng2 ) ) >= 500 ) {
|
||||
return true;
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean ignoreDrawRequest() {
|
||||
return MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() || MarkerServiceHandler.getMogoStatusManager().isADASShow();
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.share.R;
|
||||
import com.mogo.module.share.ShareControl;
|
||||
import com.mogo.module.share.constant.ShareConstants;
|
||||
@@ -199,8 +200,14 @@ public class LaucherShareDialog implements View.OnClickListener {
|
||||
// mWindowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
// FLAG_LAYOUT_IN_SCREEN:将window放置在整个屏幕之内,无视其他的装饰(比如状态栏); FLAG_NOT_TOUCH_MODAL:不阻塞事件传递到后面的窗口
|
||||
layoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
layoutParams.width = WindowUtils.getScreenWidth(mContext);
|
||||
layoutParams.height = WindowUtils.getScreenHeight(mContext);
|
||||
if (CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X) {
|
||||
layoutParams.width = 1920;
|
||||
layoutParams.height = 1080;
|
||||
}else {
|
||||
layoutParams.width = WindowUtils.getScreenWidth(mContext);
|
||||
layoutParams.height = WindowUtils.getScreenHeight(mContext);
|
||||
}
|
||||
Logger.d("ShareDialog", "width: " + layoutParams.width + " height: " + layoutParams.height);
|
||||
//后面变暗区域透明...
|
||||
layoutParams.dimAmount = 0;
|
||||
layoutParams.x = 0;
|
||||
|
||||
Reference in New Issue
Block a user