Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0

This commit is contained in:
wangcongtao
2020-02-16 20:59:47 +08:00
19 changed files with 326 additions and 125 deletions

View File

@@ -533,6 +533,18 @@ public class AMapNaviViewWrapper implements IMogoMapView,
return null;
}
@Override
public MogoLatLng getLocationMogoLatLngInScreen(Point point) {
if ( checkAMapView() ) {
try {
return ObjectUtils.fromAMap(mMapView.getMap().getProjection().fromScreenLocation( point ));
} catch ( Exception e ) {
return null;
}
}
return null;
}
@Override
public void startJumpAnimation( IMogoMarker marker, float high, Interpolator interpolator, long duration ) {
if ( marker == null || high <= 0.0f || interpolator == null || duration < 0 ) {

View File

@@ -1,14 +1,18 @@
package com.mogo.map.impl.amap.marker;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.view.View;
import android.view.animation.Interpolator;
import com.amap.api.maps.model.BitmapDescriptor;
import com.amap.api.maps.model.BitmapDescriptorFactory;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.Marker;
import com.amap.api.maps.model.MarkerOptions;
import com.amap.api.maps.model.animation.Animation;
import com.amap.api.maps.model.animation.TranslateAnimation;
import com.mogo.map.MogoLatLng;
import com.mogo.map.impl.amap.utils.ObjectUtils;
import com.mogo.map.marker.IMogoInfoWindowAdapter;
@@ -16,6 +20,8 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.IMogoMarkerIconViewCreator;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.utils.WindowUtils;
import com.mogo.utils.logger.Logger;
import java.util.ArrayList;
import java.util.Observable;
@@ -29,6 +35,8 @@ import java.util.Observer;
*/
public class AMapMarkerWrapper implements IMogoMarker, Observer {
private final String TAG = AMapMarkerWrapper.class.getName();
private Marker mMarker;
private Object mObject;
private IMogoMarkerClickListener mMogoMarkerClickListener;

View File

@@ -156,6 +156,14 @@ public class AMapUIController implements IMogoMapUIController {
return null;
}
@Override
public MogoLatLng getLocationMogoLatLngInScreen(Point point) {
if ( mClient != null ) {
return mClient.getLocationMogoLatLngInScreen( point );
}
return null;
}
@Override
public void startJumpAnimation( IMogoMarker marker, float high, Interpolator interpolator, long duration ) {
if ( mClient != null ) {

View File

@@ -1,7 +1,9 @@
package com.mogo.map.marker;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.view.animation.Interpolator;
import com.mogo.map.MogoLatLng;

View File

@@ -115,6 +115,14 @@ public interface IMogoMapUIController {
*/
Point getLocationPointInScreen( MogoLatLng latLng );
/**
* 获取像素点对应的经纬度
*
* @param point
* @return
*/
MogoLatLng getLocationMogoLatLngInScreen( Point point );
/**
* marker 跳跃动画
*

View File

@@ -149,6 +149,14 @@ public class MogoMapUIController implements IMogoMapUIController {
return null;
}
@Override
public MogoLatLng getLocationMogoLatLngInScreen(Point point) {
if (mDelegate != null) {
return mDelegate.getLocationMogoLatLngInScreen(point);
}
return null;
}
@Override
public void startJumpAnimation( IMogoMarker marker, float high, Interpolator interpolator, long duration ) {
if ( mDelegate != null ) {

View File

@@ -86,7 +86,7 @@ public interface WindowViewHandler {
if ( mWindowView == null ) {
return;
}
/* WindowManager wm = ( ( WindowManager ) mWindowView.getContext().getSystemService( Context.WINDOW_SERVICE ) );
WindowManager wm = ( ( WindowManager ) mWindowView.getContext().getSystemService( Context.WINDOW_SERVICE ) );
if ( mParams.x > WindowUtils.getScreenWidth( AbsMogoApplication.getApp() ) / 2 ) {
mParams.x = WindowUtils.getScreenWidth( AbsMogoApplication.getApp() ) - mWindowView.getMeasuredWidth();
@@ -94,7 +94,7 @@ public interface WindowViewHandler {
mParams.x = 0;
}
wm.updateViewLayout( mWindowView, alignLayoutParamsBoundary( mParams ) );*/
wm.updateViewLayout( mWindowView, alignLayoutParamsBoundary( mParams ) );
}
protected WindowManager.LayoutParams alignLayoutParamsBoundary( WindowManager.LayoutParams params ) {

View File

@@ -10,6 +10,8 @@
<item name="android:windowBackground">@color/module_main_window_background_color</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowAnimationStyle">@style/MainAnimation</item>
<item name="checkboxStyle">@style/noCheckboxStyle</item>
<item name="radioButtonStyle">@style/noCheckboxStyle</item>
</style>
<style name="MainAnimation">
@@ -26,4 +28,16 @@
<item name="android:taskToBackEnterAnimation">@null</item>
<item name="android:taskToBackExitAnimation">@null</item>
</style>
<style name="noCheckboxStyle" parent="Widget.AppCompat.CompoundButton.CheckBox">
<item name="buttonCompat">@null</item>
<item name="android:background">@null</item>
</style>
<style name="noRadioButtonStyle" parent="Widget.AppCompat.CompoundButton.RadioButton">
<item name="buttonCompat">@null</item>
<item name="android:background">@null</item>
</style>
</resources>

View File

@@ -18,10 +18,10 @@ import com.mogo.module.navi.ui.adapter.SearchCategoryAdapter
import com.mogo.module.navi.ui.base.BaseFragment
import com.mogo.module.navi.uitls.BitmapUtils
import kotlinx.android.synthetic.main.fragment_search_category.cv_search_result
import kotlinx.android.synthetic.main.fragment_search_category.et_navi_search
import kotlinx.android.synthetic.main.fragment_search_category.iv_navi_back
import kotlinx.android.synthetic.main.fragment_search_category.rv_search_result
import kotlinx.android.synthetic.main.fragment_search_category.tv_navi_navi
import kotlinx.android.synthetic.main.include_search_bar.et_navi_search
import kotlinx.android.synthetic.main.include_search_bar.iv_navi_back
/**
* @author zyz
@@ -134,7 +134,7 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
BitmapUtils.createWaterMask(
context, decodeResource, (index+1).toString(), R.color.white, 18
)
return createWaterMask
return decodeResource
}
override fun onActivityCreated(savedInstanceState: Bundle?) {

View File

@@ -15,6 +15,7 @@ import com.mogo.map.navi.MogoNaviInfo
import com.mogo.map.navi.MogoTraffic
import com.mogo.map.search.inputtips.MogoTip
import com.mogo.module.common.MogoModulePaths
import com.mogo.module.navi.BuildConfig
import com.mogo.module.navi.R
import com.mogo.module.navi.constants.AMapConstants
import com.mogo.module.navi.constants.SearchServiceHolder
@@ -123,15 +124,6 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT, true
)
AIAssist.getInstance(context)
.registerUnWakeupCommand("firstPath", arrayOf<String>(firstPath), this)
AIAssist.getInstance(context)
.registerUnWakeupCommand("secondPath", arrayOf<String>(secondPath), this)
AIAssist.getInstance(context)
.registerUnWakeupCommand("thirdPath", arrayOf<String>(thirdPath), this)
AIAssist.getInstance(context)
.registerUnWakeupCommand("startNavi", arrayOf<String>(startNavi), this)
}
// 是否开启导航
@@ -182,11 +174,24 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
SearchServiceHolder.getMarkerManger()
.removeMarkers()
AIAssist.getInstance(context)
.registerUnWakeupCommand("firstPath", arrayOf<String>(firstPath), this)
AIAssist.getInstance(context)
.registerUnWakeupCommand("secondPath", arrayOf<String>(secondPath), this)
AIAssist.getInstance(context)
.registerUnWakeupCommand("thirdPath", arrayOf<String>(thirdPath), this)
AIAssist.getInstance(context)
.registerUnWakeupCommand("startNavi", arrayOf<String>(startNavi), this)
}
private fun startNavi() {
SearchServiceHolder.getNavi()
.startNavi(false)
.startNavi(!BuildConfig.DEBUG)
SearchServiceHolder.getMapUIController()
.recoverLockMode()
isStartedNavi = true

View File

@@ -22,19 +22,27 @@ public class BitmapUtils {
//创建一个bitmap
Rect bounds = new Rect();
paint.getTextBounds(text, 0, text.length(), bounds);
// 创建一个新的和SRC长度宽度一样的位图
Bitmap newb = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
//将该图片作为画布
Canvas canvas = new Canvas(newb);
//在画布 00坐标上开始绘制原始图片
canvas.drawBitmap(src, 0, 0, null);
//// 创建一个新的和SRC长度宽度一样的位图
//Bitmap newb = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
////将该图片作为画布
//Canvas canvas = new Canvas(newb);
////在画布 00坐标上开始绘制原始图片
//canvas.drawBitmap(src, 0, 0, null);
// 绘制文字
Bitmap ret = src.copy(src.getConfig(), true);
//Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
Canvas canvas = new Canvas(ret);
canvas.drawText(text, (width-bounds.width())/2.0F, (float) ( bounds.height()*1.8), paint);
// 保存
canvas.save();
//canvas.save();
// 存储
canvas.restore();
return newb;
return ret;
}
public static int dp2px(Context context, float dp) {

View File

@@ -13,6 +13,7 @@
<androidx.cardview.widget.CardView
android:id="@+id/cv_search_result"
android:layout_width="@dimen/module_search_dp_838"
app:cardPreventCornerOverlap="false"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="@dimen/dp_32"
@@ -29,7 +30,6 @@
/>
<View
android:layout_width="match_parent"
android:layout_gravity="bottom"
@@ -56,6 +56,46 @@
/>
</androidx.cardview.widget.CardView>
<include layout="@layout/include_search_bar" />
<LinearLayout
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll_navi_search"
android:layout_width="@dimen/module_search_dp_838"
android:layout_height="@dimen/moudle_search_et_hight"
android:background="@drawable/shape_round_gray"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:showIn="@layout/fragment_search"
>
<ImageView
android:layout_width="@dimen/moudle_search_iv_back_hight"
android:id="@+id/iv_navi_back"
android:layout_height="@dimen/moudle_search_iv_back_hight"
android:layout_marginLeft="@dimen/moudle_search_iv_back_margin_left"
android:layout_marginRight="@dimen/moudle_search_iv_back_margin_right"
android:src="@mipmap/icon_back"
/>
<EditText
android:layout_width="0dp"
android:singleLine="true"
android:layout_marginRight="@dimen/module_search_btn_width"
android:id="@+id/et_navi_search"
android:background="@null"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:textSize="@dimen/module_search_et_text_size"
android:imeOptions="actionDone"
android:hint="@string/hint_map_search"
android:textColor="@color/white"
android:textColorHint="@color/white_60"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -29,7 +29,7 @@
<style name="rb_setting">
<item name="android:layout_width">@dimen/module_search_180dp</item>
<item name="android:button">@null</item>
<item name="android:button">@color/translate</item>
<item name="android:gravity">center</item>
<item name="android:textSize">@dimen/sp_40</item>
<item name="android:textColor">@color/selector_white_gray</item>

View File

@@ -1,12 +1,18 @@
package com.mogo.module.service.marker;
import android.content.Context;
import android.graphics.Point;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.view.View;
import android.view.animation.Interpolator;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.animation.Animation;
import com.amap.api.maps.model.animation.TranslateAnimation;
import com.mogo.map.MogoLatLng;
import com.mogo.map.impl.amap.marker.AMapMarkerWrapper;
import com.mogo.map.impl.amap.utils.ObjectUtils;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.MogoMarkerOptions;
@@ -27,6 +33,7 @@ import com.mogo.module.service.Utils;
import com.mogo.module.service.datamanager.MogoDataHandler;
import com.mogo.service.cardmanager.IMogoCardChangedListener;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.utils.WindowUtils;
import com.mogo.utils.logger.Logger;
import org.json.JSONArray;
@@ -49,7 +56,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, IMogoOnMessag
// 第一次请求到地图的Marker数据
private boolean isFirstMarker = true;
private boolean isOnLineCard = false;
private Context mContext;
private static Context mContext;
private static IMogoMarker lastMarker;
private static MapMarkerManager mMarkerManager;
@@ -191,30 +198,60 @@ public class MapMarkerManager implements IMogoMarkerClickListener, IMogoOnMessag
public synchronized static void highlightedMarker(final String typeTag) {
try {
if ( TextUtils.equals( mLastHighLightModule, typeTag ) ) {
if (TextUtils.equals(mLastHighLightModule, typeTag)) {
return;
}
// 上一次高亮的变暗
List<IMogoMarker> lastHighLightList = MarkerServiceHandler.getMarkerManager().getMarkers( mLastHighLightModule );
List<IMogoMarker> lastHighLightList = MarkerServiceHandler.getMarkerManager().getMarkers(mLastHighLightModule);
setMarkersAlpha(lastHighLightList, 0.7f);
// 将当前高亮
List<IMogoMarker> currentHighLightList = MarkerServiceHandler.getMarkerManager().getMarkers( typeTag );
List<IMogoMarker> currentHighLightList = MarkerServiceHandler.getMarkerManager().getMarkers(typeTag);
setMarkersAlpha(currentHighLightList, 1f);
} catch (Exception e) {
e.printStackTrace();
}
}
private static void setMarkersAlpha(List<IMogoMarker> markers,float alpha){
if ( markers == null || markers.isEmpty() ) {
private static void setMarkersAlpha(List<IMogoMarker> markers, float alpha) {
if (markers == null || markers.isEmpty()) {
return;
}
for ( IMogoMarker mogoMarker : markers ) {
if ( mogoMarker == null || mogoMarker.isDestroyed() ) {
for (IMogoMarker mogoMarker : markers) {
if (mogoMarker == null || mogoMarker.isDestroyed()) {
continue;
}
mogoMarker.setAlpha( alpha );
mogoMarker.setAlpha(alpha);
if (alpha == 1) {
try {
Point point = MarkerServiceHandler.getMapUIController().getLocationPointInScreen(mogoMarker.getPosition());
point.y -= WindowUtils.dip2px(mContext, 100f);
MogoLatLng targetMogoLatLng = MarkerServiceHandler.getMapUIController().getLocationMogoLatLngInScreen(point);
LatLng target = ObjectUtils.fromMogo2(targetMogoLatLng);
//使用TranslateAnimation,填写一个需要移动的目标点
Animation animation = new TranslateAnimation(target);
animation.setInterpolator(new Interpolator() {
@Override
public float getInterpolation(float input) {
if (input <= 0.5) {
return (float) (0.5f - 2.0 * (0.5 - input) * (0.5 - input));
} else {
return (float) (0.5f - Math.sqrt((double) ((input - 0.5f) * (1.5f - input))));
}
}
});
//整个移动所需要的时间
animation.setDuration(1000);
//设置动画
if (mogoMarker instanceof AMapMarkerWrapper) {
((AMapMarkerWrapper) mogoMarker).getMarker().setAnimation(animation);
((AMapMarkerWrapper) mogoMarker).getMarker().startAnimation();
}
} catch (Exception e) {
Logger.e(TAG, e, "error.");
}
}
}
}
@@ -475,7 +512,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, IMogoOnMessag
options.icon(markerView.getView());
IMogoMarker marker = MarkerServiceHandler.getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
markerView.setMarker( marker );
markerView.setMarker(marker);
marker.setOnMarkerClickListener(this);
return marker;
} else {

View File

@@ -107,6 +107,8 @@ public class LaucherShareDialog extends Dialog implements View.OnClickListener {
Logger.d("LaucherShareDialog", "LaucherShareDialog sendShareReceiver ---->");
Intent intent = new Intent();
intent.setAction("com.zhidao.roadcondition.share");
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
intent.addFlags(Intent.FLAG_EXCLUDE_STOPPED_PACKAGES);
intent.putExtra("type", type);
mContext.sendBroadcast(intent);
}

View File

@@ -94,6 +94,7 @@ import com.mogo.service.module.IMogoRegisterCenter;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.TipToast;
import com.mogo.utils.logger.Logger;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
import org.greenrobot.eventbus.EventBus;
@@ -124,7 +125,7 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
IMogoPoiSearchListener,
IMogoLocationListener,
View.OnClickListener,
IMogoDataChangedListener {
IMogoDataChangedListener{
private static final String TAG = "TanluCardViewFragment";
SimpleCoverVideoPlayer simpleCoverVideoPlayer;
@@ -228,77 +229,78 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
mIMogoFragmentManager = (IMogoFragmentManager) ARouter.getInstance().build(MogoServicePaths.PATH_FRAGMENT_MANAGER).navigation(getContext());
mIMogoGeoSearch.setGeoSearchListener(new IMogoGeoSearchListener() {
@Override
public void onRegeocodeSearched(MogoRegeocodeResult regeocodeResult) {
Logger.d(TAG, "onRegeocodeSearched -----> ");
}
@Override
public void onGeocodeSearched(MogoGeocodeResult geocodeResult) {
Logger.d(TAG, "onGeocodeSearched ------mKeywords =" + mKeywords);
if (geocodeResult != null) {
if (geocodeResult.getAddresses() != null && geocodeResult.getAddresses().size() != 0) {
MogoGeocodeAddress geocodeAddress = geocodeResult.getAddresses().get(0);
MogoLatLng latLon = geocodeAddress.getLatlng();
Double longit; //经度
Double lat; //
if (mKeywords.equals("附近")) {
Logger.d(TAG, "附近 ----1---");
longit = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
} else {
Logger.d(TAG, "其他 ---1----");
longit = latLon.lng;
lat = latLon.lat;
}
Log.d(TAG, "geoSearch keywords =" + mKeywords + ">>longitude= " + longit + "--latitude= " + lat);
getVoiceControlRoadData(mKeywords, lat, longit);
} else {
String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
MogoPoiSearchQuery poiSearchQuery = new MogoPoiSearchQuery(mKeywords, "", cityCode);
IMogoPoiSearch poiSearch = mMogoMapService.getPoiSearch(getContext(), poiSearchQuery);
poiSearch.setPoiSearchListener(new IMogoPoiSearchListener() {
@Override
public void onPoiSearched(MogoPoiResult p0, int p1) {
if (p1 == 1000) {
if (p0.getPois() != null && p0.getPois().size() != 0) {
MogoPoiItem poi = p0.getPois().get(0);
MogoLatLng latLon = poi.getPoint();
Double longit; //经度
Double lat; //
if (mKeywords.equals("附近")) {
Logger.d(TAG, "附近 ----2---");
longit = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
} else {
Logger.d(TAG, "其他 --2----");
longit = latLon.lng;
lat = latLon.lat;
}
getVoiceControlRoadData(mKeywords, lat, longit);
Log.d(TAG, "setOnPoiSearchListener keywords =" + mKeywords + ">>longitude= " + longit + "--latitude" + lat);
} else {
Logger.e(TAG, "poi == null");
}
} else {
Logger.e(TAG, "poi search result p1 = " + p1);
}
}
@Override
public void onPoiItemSearched(MogoPoiItem item, int errorCode) {
}
});
poiSearch.searchPOIAsyn();
}
} else {
Logger.e(TAG, "onGeocodeSearched -----geocodeResult == null");
speakFailVoice(searchfaileVoiceStrings[2]);
}
}
});
// mIMogoGeoSearch.setGeoSearchListener(new IMogoGeoSearchListener() {
// @Override
// public void onRegeocodeSearched(MogoRegeocodeResult regeocodeResult) {
// Logger.d(TAG, "onRegeocodeSearched -----> ");
// }
//
// @Override
// public void onGeocodeSearched(MogoGeocodeResult geocodeResult) {
// Logger.d(TAG, "onGeocodeSearched ------mKeywords =" + mKeywords);
// if (geocodeResult != null) {
// if (geocodeResult.getAddresses() != null && geocodeResult.getAddresses().size() > 0) {
// Log.d(TAG, "geocodeResult.getAddresses().size() = " + geocodeResult.getAddresses().size());
// MogoGeocodeAddress geocodeAddress = geocodeResult.getAddresses().get(0);
// MogoLatLng latLon = geocodeAddress.getLatlng();
// Double longit; //
// Double lat; //维度
// if (mKeywords.equals("附近")) {
// Logger.d(TAG, "附近 ----1---");
// longit = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
// lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
// } else {
// Logger.d(TAG, "其他 ---1----");
// longit = latLon.lng;
// lat = latLon.lat;
// }
// Log.d(TAG, "geoSearch keywords =" + mKeywords + ">>longitude= " + longit + "--latitude= " + lat);
// getVoiceControlRoadData(mKeywords, lat, longit);
// } else {
// String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
// MogoPoiSearchQuery poiSearchQuery = new MogoPoiSearchQuery(mKeywords, "", cityCode);
// IMogoPoiSearch poiSearch = mMogoMapService.getPoiSearch(getContext(), poiSearchQuery);
// poiSearch.setPoiSearchListener(new IMogoPoiSearchListener() {
// @Override
// public void onPoiSearched(MogoPoiResult p0, int p1) {
// if (p1 == 1000) {
// if (p0.getPois() != null && p0.getPois().size() != 0) {
// MogoPoiItem poi = p0.getPois().get(0);
// MogoLatLng latLon = poi.getPoint();
// Double longit; //
// Double lat; //维度
// if (mKeywords.equals("附近")) {
// Logger.d(TAG, "附近 ----2---");
// longit = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
// lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
// } else {
// Logger.d(TAG, "其他 --2----");
// longit = latLon.lng;
// lat = latLon.lat;
// }
// getVoiceControlRoadData(mKeywords, lat, longit);
// Log.d(TAG, "setOnPoiSearchListener keywords =" + mKeywords + ">>longitude= " + longit + "--latitude" + lat);
// } else {
// Logger.e(TAG, "poi == null");
// }
// } else {
// Logger.e(TAG, "poi search result p1 = " + p1);
// }
// }
//
// @Override
// public void onPoiItemSearched(MogoPoiItem item, int errorCode) {
//
// }
// });
// poiSearch.searchPOIAsyn();
// }
// } else {
// Logger.e(TAG, "onGeocodeSearched -----geocodeResult == null");
// speakFailVoice(searchfaileVoiceStrings[2]);
// }
// }
// });
DataSetChangedAdapter.getInstance().setDelegate( this );
}
@@ -404,19 +406,26 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
/**
* 处理关键词搜索
* 处理关键词搜索 TODO
*
* @return
*/
private void handleActionFoo(String keywords) {
speakSearchingVoice();
MogoGeocodeQuery geocodeQuery;
String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
// speakSearchingVoice();
// MogoGeocodeQuery geocodeQuery;
// String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
//
// geocodeQuery = new MogoGeocodeQuery();
// geocodeQuery.setLocationName(keywords);
// geocodeQuery.setCity(cityCode);
// mIMogoGeoSearch.getFromLocationNameAsyn(geocodeQuery);
geocodeQuery = new MogoGeocodeQuery();
geocodeQuery.setLocationName(keywords);
geocodeQuery.setCity(cityCode);
mIMogoGeoSearch.getFromLocationNameAsyn(geocodeQuery);
String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
MogoPoiSearchQuery poiSearchQuery = new MogoPoiSearchQuery(keywords, "", cityCode);
IMogoPoiSearch poiSearch = mMogoMapService.getPoiSearch(getContext(), poiSearchQuery);
poiSearch.setPoiSearchListener(this);
poiSearch.searchPOIAsyn();
}
/**
@@ -542,6 +551,8 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
Logger.d(TAG, "TanluCardViewFragment sendShareReceiver ---->");
Intent intent = new Intent();
intent.setAction("com.zhidao.roadcondition.share");
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
intent.addFlags(Intent.FLAG_EXCLUDE_STOPPED_PACKAGES);
intent.putExtra("type", type);
getContext().sendBroadcast(intent);
}
@@ -675,7 +686,7 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
.build(simpleCoverVideoPlayer);
simpleCoverVideoPlayer.getStartButton().performClick();
traceVideoPlayStatusData();
Log.d(TAG, "videoUrl = " + videoUrl);
if (mImageUrl == null) {
return;
}
@@ -714,12 +725,10 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
mogoImageloader.downloadImage(getActivity(), thumbnailUrl, new IMogoImageLoaderListener() {
@Override
public void onStart() {
Log.d(TAG, "onStart ------>");
}
@Override
public void onCompleted(Bitmap bitmap) {
Log.d(TAG, "onCompleted ------>bitmap = " + bitmap);
autoZoomInImageView.setImageBitmap(bitmap);
//动画
// handleImageAnimation();
@@ -883,9 +892,38 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
}
}
/**
* poi
* @param p0
* @param p1
*/
@Override
public void onPoiSearched(MogoPoiResult result, int errorCode) {
public void onPoiSearched(MogoPoiResult p0, int p1) {
if (p1 == 1000) {
if (p0.getPois() != null && p0.getPois().size() != 0) {
MogoPoiItem poi = p0.getPois().get(0);
MogoLatLng latLon = poi.getPoint();
Double longit; //经度
Double lat; //维度
if (mKeywords.equals("附近")) {
Logger.d(TAG, "附近 ----2---");
longit = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
} else {
Logger.d(TAG, "其他 --2----");
longit = latLon.lng;
lat = latLon.lat;
}
getVoiceControlRoadData(mKeywords, lat, longit);
Log.d(TAG, "setOnPoiSearchListener keywords =" + mKeywords + ">>longitude= " + longit + "--latitude" + lat);
} else {
Logger.e(TAG, "poi == null");
speakFailVoice(searchfaileVoiceStrings[2]);
}
} else {
Logger.e(TAG, "poi search result p1 = " + p1);
speakFailVoice(searchfaileVoiceStrings[2]);
}
}
@Override
@@ -927,6 +965,8 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
TanluServiceHandler.getLocationClient().removeLocationListener(this);
mMogoRegisterCenter.unregisterMogoNaviListener(TanluConstants.MODEL_NAME);
mogoIntentManager.unregisterIntentListener(MogoReceiver.ACTIION_ADAS);
Log.e(TAG, "onDestroyView --------> ");
GSYVideoManager.releaseAllVideos();
}
/**
@@ -1281,6 +1321,15 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
* 将探路的数据结构转换成 MarkerExploreWay的列表
*/
private void convertData(List<Information> informations) {
if (informations.size() == 1) {
mPreviousTv.setVisibility(View.GONE);
mNextTv.setVisibility(View.GONE);
} else {
mPreviousTv.setVisibility(View.VISIBLE);
mNextTv.setVisibility(View.VISIBLE);
}
for (int i = 0; i < informations.size(); i++) {
MarkerExploreWay markerExploreWay = new MarkerExploreWay();
markerExploreWay.setAddr(informations.get(i).addr);

View File

@@ -17,8 +17,8 @@
<string name="start_mogo_share">共享计划</string>
<string name="tanlu_previous">上一条</string>
<string name="tanlu_next">下一条</string>
<string name="tanlu_share_success">分享成功</string>
<string name="tanlu_share_failed">分享失败</string>
<string name="tanlu_share_success">上传成功</string>
<string name="tanlu_share_failed">上传失败</string>
<string name="tanlu_prepare_play">将为您播放</string>