This commit is contained in:
wangcongtao
2020-01-06 19:49:05 +08:00
parent 9ad9722cd2
commit 09053f4a0b
106 changed files with 691 additions and 36 deletions

View File

@@ -44,6 +44,11 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
@@ -55,8 +60,8 @@ dependencies {
releaseImplementation rootProject.ext.dependencies.leakcanarynoop
releaseImplementation rootProject.ext.dependencies.androidxmultidex
implementation rootProject.ext.dependencies.moduledemo
implementation rootProject.ext.dependencies.moduledemo2
// implementation rootProject.ext.dependencies.moduledemo
// implementation rootProject.ext.dependencies.moduledemo2
if (Boolean.valueOf(RELEASE)) {
api rootProject.ext.dependencies.modulemain

View File

@@ -5,9 +5,6 @@ import android.content.Context;
import androidx.multidex.MultiDex;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.demo.module.map.DemoConstants;
import com.mogo.demo.module.map2.Demo2Constants;
import com.mogo.module.common.ModuleType;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.tanlu.constant.TanluConstants;
@@ -23,8 +20,8 @@ public class MogoApplication extends AbsMogoApplication {
@Override
public void onCreate() {
super.onCreate();
MogoModulePaths.addModule( new MogoModule( DemoConstants.TAG, "CARD_DEMO" ) );
MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) );
// MogoModulePaths.addModule( new MogoModule( DemoConstants.TAG, "CARD_DEMO" ) );
// MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) );
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, "CARD_TYPE_ROAD_CODITION" ) );
}

View File

@@ -408,7 +408,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
style.strokeColor( Color.TRANSPARENT );
style.strokeWidth( 0 );
style.radiusFillColor( Color.TRANSPARENT );
style.myLocationIcon( BitmapDescriptorFactory.fromResource( R.drawable.ic_current_location_cursor ) );
style.myLocationIcon( BitmapDescriptorFactory.fromResource( R.drawable.map_api_ic_current_location ) );
mMapView.getMap().setMyLocationStyle( style );
}
}

View File

@@ -80,8 +80,16 @@ public interface IMogoMarker {
*/
void setMarkerOptions( MogoMarkerOptions opt );
/**
* 可以存储业务相关的数据
*
* @param object
*/
void setObject( Object object );
/**
* @return 用户设置的 object 对象
*/
Object getObject();
/**

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -102,4 +102,10 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
mWeatherDesc.setText( desc );
mWeatherContainer.setVisibility( hidden ? View.GONE : View.VISIBLE );
}
@Override
public void renderMsgInfo( boolean hasMsg, int amount ) {
mMsgContainer.setVisibility( hasMsg ? View.VISIBLE : View.GONE );
mMsgCounter.setText( amount > 99 ? getString( R.string.module_ext_str_dots ) : String.valueOf( amount ) );
}
}

View File

@@ -8,11 +8,15 @@ import android.content.IntentFilter;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.Presenter;
import com.mogo.module.extensions.weather.Phenomena;
import com.mogo.module.extensions.weather.WeatherCallback;
import com.mogo.module.extensions.weather.WeatherInfo;
import com.mogo.module.extensions.weather.WeatherModel;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.statusmanager.IMogoMsgCenter;
import com.mogo.service.statusmanager.IMogoMsgCenterListener;
import com.mogo.utils.logger.Logger;
import java.util.Calendar;
@@ -24,7 +28,7 @@ import java.util.Calendar;
* <p>
* 描述
*/
public class ExtensionsPresenter extends Presenter< ExtensionsView > implements WeatherCallback {
public class ExtensionsPresenter extends Presenter< ExtensionsView > implements WeatherCallback, IMogoMsgCenterListener {
private static final String TAG = "ExtensionsPresenter";
@@ -46,6 +50,8 @@ public class ExtensionsPresenter extends Presenter< ExtensionsView > implements
}
};
private IMogoMsgCenter mMsgCenter;
public ExtensionsPresenter( ExtensionsView view ) {
super( view );
@@ -60,6 +66,8 @@ public class ExtensionsPresenter extends Presenter< ExtensionsView > implements
mWeatherModel.init( this );
mWeatherModel.queryWeatherInformation();
refreshTimeAndDate();
mMsgCenter = ( IMogoMsgCenter ) ARouter.getInstance().build( MogoServicePaths.PATH_MSG_CENTER ).navigation();
mMsgCenter.registerMsgCenterListener( this );
}
/**
@@ -100,12 +108,21 @@ public class ExtensionsPresenter extends Presenter< ExtensionsView > implements
mView.renderWeatherInfo( temp, desc, resId );
}
@Override
public void onMsgChanged( boolean hasMsg, int amount ) {
if ( mView != null ) {
}
}
@Override
public void onDestroy( @NonNull LifecycleOwner owner ) {
super.onDestroy( owner );
if ( mWeatherModel != null ) {
mWeatherModel.destroy();
}
if ( mMsgCenter != null ) {
mMsgCenter.unregisterMsgCenterListener( this );
}
}
}

View File

@@ -27,4 +27,12 @@ public interface ExtensionsView extends IView {
* @param iconId 图标
*/
void renderWeatherInfo( String temp, String desc, int iconId );
/**
* 刷新消息信息
*
* @param hasMsg 是否有消息
* @param amount 消息数量
*/
void renderMsgInfo( boolean hasMsg, int amount );
}

View File

@@ -101,6 +101,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_28"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@+id/module_ext_id_weather_container"
app:layout_constraintTop_toTopOf="parent">
@@ -119,7 +120,6 @@
android:gravity="center"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_20"
android:visibility="invisible"
tools:text="···" />
</FrameLayout>

View File

@@ -13,4 +13,5 @@
<item>周五</item>
<item>周六</item>
</string-array>
<string name="module_ext_str_dots">···</string>
</resources>

View File

@@ -27,6 +27,11 @@ android {
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

View File

@@ -1,14 +1,21 @@
package com.mogo.module.map;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.map.IMogoMap;
import com.mogo.map.IMogoUiSettings;
import com.mogo.map.MogoLatLng;
import com.mogo.map.MogoMapView;
import com.mogo.map.location.IMogoLocationClient;
import com.mogo.map.location.MogoLocation;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.map.IMogoMapService;
/**
@@ -24,6 +31,20 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
private MogoMapView mMogoMapView;
private IMogoMap mMogoMap;
private View mSearch;
private View mHome;
private View mCompany;
private View mUploadRoadCondition;
private View mVRMode;
private View mMove2CurrentLocation;
private IMogoMapService mService;
private IMogoMapUIController mMApUIController;
private IMogoLocationClient mMogoLocationClient;
@Override
protected int getLayoutId() {
return R.layout.module_map_fragment_map;
@@ -31,9 +52,38 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
@Override
protected void initViews() {
mMogoMapView = findViewById( R.id.module_map_id_map );
mMogoMap = mMogoMapView.getMap();
mMogoMap.getUIController().showMyLocation( true );
mSearch = findViewById( R.id.module_map_id_search );
mSearch.setOnClickListener( view -> {
} );
mHome = findViewById( R.id.module_map_id_home );
mHome.setOnClickListener( view -> {
} );
mCompany = findViewById( R.id.module_map_id_company );
mCompany.setOnClickListener( view -> {
} );
mUploadRoadCondition = findViewById( R.id.module_map_id_upload_road_condition );
mUploadRoadCondition.setOnClickListener( view -> {
} );
mVRMode = findViewById( R.id.module_map_id_vr_mode );
mVRMode.setOnClickListener( view -> {
} );
mMove2CurrentLocation = findViewById( R.id.module_map_id_move2_current_location );
mMove2CurrentLocation.setOnClickListener( view -> {
final MogoLocation location = mMogoLocationClient.getLastKnowLocation();
if ( location != null ) {
mMApUIController.moveToCenter( new MogoLatLng( location.getLatitude(), location.getLongitude() ) );
}
} );
}
@NonNull
@@ -49,6 +99,9 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
mMogoMapView.onCreate( savedInstanceState );
}
initMapView();
mService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getContext() );
mMApUIController = mService.getMapUIController();
mMogoLocationClient = mService.getLocationClient( getContext() );
}
@Override

View File

@@ -8,7 +8,7 @@ package com.mogo.module.service;
*/
public class AutoRefreshStrategy {
public static final long ONE_MINUTE = 5 * 1_000L;
public static final long ONE_MINUTE = 60 * 1_000L;
/**
* 距离(米)

View File

@@ -2,7 +2,6 @@ package com.mogo.module.service;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
@@ -19,9 +18,7 @@ import com.mogo.map.MogoLatLng;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.location.MogoLocation;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.model.MogoPoi;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.map.navi.MogoNaviInfo;
@@ -59,7 +56,6 @@ public class MogoServiceProvider implements IMogoModuleProvider,
*/
private AutoRefreshStrategy mAutoRefreshStrategy = new AutoRefreshStrategy();
private MogoLatLng mLastAutoRefreshLocation = null;
private long mLastRefreshTime = 0;
private IMogoMarkerManager mMarkerManager;
private IMogoMapUIController mUiController;
@@ -85,7 +81,6 @@ public class MogoServiceProvider implements IMogoModuleProvider,
private MogoLatLng mLastCustomRefreshCenterLocation;
private IMogoMapService mMogoMapService;
private IMogoMarker mCameraCenterMarker = null;
private IMogoStatusManager mStatusManager;
/**
@@ -315,18 +310,6 @@ public class MogoServiceProvider implements IMogoModuleProvider,
return;
}
if ( mCameraCenterMarker == null ) {
mCameraCenterMarker = mMarkerManager.addMarker( ServiceConst.TYPE,
new MogoMarkerOptions()
.icon( BitmapFactory.decodeResource( mContext.getResources(), R.drawable.ic_search_poi_location ) )
.latitude( latLng.lat )
.longitude( latLng.lng )
.owner( ServiceConst.TYPE )
);
} else {
mCameraCenterMarker.setPosition( latLng.lat, latLng.lng );
}
if ( mLastZoomLevel != zoom ) {
refreshCameraPosition();
}

View File

@@ -21,7 +21,7 @@ import retrofit2.http.QueryMap;
public interface RefreshApiService {
@FormUrlEncoded
@POST( "" )
@POST( "/yycp-launcherSnapshot/launcherSnapshot/querySnapshotAsync" )
Observable< BaseData > refreshData( @QueryMap Map< String, Object > params,
@FieldMap Map< String, Object > parameters );
}

View File

@@ -38,10 +38,6 @@ public class RefreshModel {
}
public void refreshData( MogoLatLng latLng, int radius, final RefreshCallback callback ) {
if ( callback != null ) {
callback.onSuccess();
return;
}
if ( mRefreshApiService != null ) {
final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build();
final Map< String, Object > field = new HashMap<>();

View File

@@ -10,7 +10,6 @@
android:layout_height="50dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:miv_placeHolder="@drawable/ic_amap_app_main_current_location_bkg"
app:miv_shape="circle" />
<ImageView

View File

@@ -50,4 +50,14 @@ public class MogoServicePaths {
* 状态管理接口
*/
public static final String PATH_STATUS_MANAGER = "/statusmanager/api";
/**
* 消息中心
*/
public static final String PATH_MSG_CENTER = "/msgcenter/api";
/**
* 消息中心
*/
public static final String PATH_WINDOW_MANAGER = "/windowmanger/api";
}

View File

@@ -0,0 +1,34 @@
package com.mogo.service.statusmanager;
import com.alibaba.android.arouter.facade.template.IProvider;
/**
* @author congtaowang
* @since 2020-01-06
* <p>
* 消息管控
*/
public interface IMogoMsgCenter extends IProvider {
/**
* 设置消息状态
*
* @param hasMsg 是否有未读消息
* @param msgAmount 未读消息数量
*/
void setMsgStatus( boolean hasMsg, int msgAmount );
/**
* 注册消息监听
*
* @param listener
*/
void registerMsgCenterListener( IMogoMsgCenterListener listener );
/**
* 注册消息监听
*
* @param listener
*/
void unregisterMsgCenterListener( IMogoMsgCenterListener listener );
}

View File

@@ -0,0 +1,18 @@
package com.mogo.service.statusmanager;
/**
* @author congtaowang
* @since 2020-01-06
* <p>
* 消息管控
*/
public interface IMogoMsgCenterListener {
/**
* 消息变更
*
* @param hasMsg 是否有消息
* @param amount 消息数量
*/
void onMsgChanged( boolean hasMsg, int amount );
}

View File

@@ -0,0 +1,32 @@
package com.mogo.service.windowview;
import android.view.View;
import com.alibaba.android.arouter.facade.template.IProvider;
/**
* @author congtaowang
* @since 2020-01-06
* <p>
* 根据优先级控制显示 window view.
*/
public interface IMogoWindowManager extends IProvider {
/**
* 向window中添加指定的布局
*
* @param priority 优先级
* @param view 添加的实例
* @param x 左上角x坐标
* @param y 左上角y坐标
* @param movable 是否可移动(无效)
*/
void addView( int priority, View view, int x, int y, boolean movable );
/**
* 移除对应的 view
*
* @param view
*/
void removeView( View view );
}

Some files were not shown because too many files have changed in this diff Show More