Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0
This commit is contained in:
@@ -1,131 +0,0 @@
|
||||
package com.mogo.tanlu.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.map.marker.IMogoInfoWindowAdapter;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.service.imageloader.IMogoImageLoaderListener;
|
||||
import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.tanlu.R;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class TanluInfoWindowAdapter implements IMogoInfoWindowAdapter {
|
||||
|
||||
private static final String TAG = "DemoInfoWindowAdapter";
|
||||
|
||||
private Context mContext;
|
||||
private IMogoNavi mNavi;
|
||||
private IMogoImageloader mImageloader;
|
||||
|
||||
public TanluInfoWindowAdapter(Context mContext, IMogoNavi mNavi, IMogoImageloader iMogoImageloader ) {
|
||||
this.mContext = mContext;
|
||||
this.mNavi = mNavi;
|
||||
this.mImageloader = iMogoImageloader;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getInfoWindow( IMogoMarker marker ) {
|
||||
if ( marker.getObject() instanceof MogoPoiItem ) {
|
||||
View view = LayoutInflater.from( mContext ).inflate( R.layout.tanlu_poi_info_window, null );
|
||||
renderPoiVew( view, marker, ( ( MogoPoiItem ) marker.getObject() ) );
|
||||
return view;
|
||||
} else {
|
||||
View view = LayoutInflater.from( mContext ).inflate( R.layout.tanlu_info_window, null );
|
||||
renderView( view, marker );
|
||||
return view;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void renderView( View view, final IMogoMarker marker ) {
|
||||
final TextView time = view.findViewById( R.id.demo_module_id_iw_time );
|
||||
Button refresh = view.findViewById( R.id.demo_module_id_iw_refresh );
|
||||
time.setText( new SimpleDateFormat( "yyyyMMdd HHMMSS" ).format( new Date() ) );
|
||||
refresh.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
marker.showInfoWindow();
|
||||
}
|
||||
} );
|
||||
Button navi2 = view.findViewById( R.id.demo_module_id_iw_navito );
|
||||
navi2.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
if ( mNavi != null ) {
|
||||
mNavi.naviTo( marker.getPosition(), new MogoNaviConfig() );
|
||||
}
|
||||
}
|
||||
} );
|
||||
Button stopNavi = view.findViewById( R.id.demo_module_id_iw_navi_stop );
|
||||
stopNavi.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
if ( mNavi != null ) {
|
||||
mNavi.stopNavi();
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
private void renderPoiVew( View view, final IMogoMarker marker, MogoPoiItem item ) {
|
||||
final TextView time = view.findViewById( R.id.demo_module_id_iw_poi_title );
|
||||
time.setText( item.getTitle() );
|
||||
Button navi2 = view.findViewById( R.id.demo_module_id_iw_poi_navito );
|
||||
navi2.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
if ( mNavi != null ) {
|
||||
mNavi.naviTo( marker.getPosition(), new MogoNaviConfig() );
|
||||
}
|
||||
marker.hideInfoWindow();
|
||||
marker.remove();
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
public View getMarkerView( final MogoMarkerOptions options ) {
|
||||
final View view = LayoutInflater.from( mContext ).inflate( R.layout.tanlu_bubble_marker, null );
|
||||
final MogoImageView icon = view.findViewById( R.id.icon );
|
||||
mImageloader.displayImage( "http://imgnews.gmw.cn/attachement/jpg/site2/20191229/00d86176ed0b1f71f4580f.jpg", icon, WindowUtils.dip2px( mContext, 50 ), WindowUtils.dip2px( mContext, 50 ),
|
||||
new IMogoImageLoaderListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted( Bitmap bitmap ) {
|
||||
// 刷新图标
|
||||
Logger.d( TAG, "loaded." );
|
||||
options.icon( view );
|
||||
options.notifyObservers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure( Exception e ) {
|
||||
|
||||
}
|
||||
} );
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.mogo.tanlu.net;
|
||||
|
||||
import com.mogo.commons.data.BaseData;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 探路相关接口定义
|
||||
* @since 2020-01-07
|
||||
*/
|
||||
public interface TanluApiService {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST( "" )
|
||||
Observable<BaseData> refreshData(@QueryMap Map< String, Object > params,
|
||||
@FieldMap Map< String, Object > parameters );
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:miv_shape="circle" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_search_poi_location"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/icon" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_1F7FFF"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/demo_module_id_loc_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_add_marker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="上一个" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_add_markers"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="下一个" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_clear"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="播放" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_loc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="定位" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_current"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="当前位置" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ff0000">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/demo_module_id_iw_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_iw_refresh"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="点击刷新当前时间"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_iw_navito"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="70dp"
|
||||
android:text="导航去这里"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_iw_navi_stop"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="120dp"
|
||||
android:text="停止导航"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ff0000">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/demo_module_id_iw_poi_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_iw_poi_navito"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="70dp"
|
||||
android:text="导航去这里"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user