dev
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.mogo.service;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
@@ -11,15 +13,26 @@ package com.mogo.service;
|
||||
* <p>
|
||||
* Arouter.getInstance().path("").navigate()
|
||||
*/
|
||||
@Keep
|
||||
public class MogoServicePaths {
|
||||
|
||||
/**
|
||||
* 地图服务接口路径
|
||||
*/
|
||||
public static final String PATH_MAP_SERVICE = "/mogo/services/map";
|
||||
@Keep
|
||||
public static final String PATH_SERVICES_MAP = "/services/map";
|
||||
|
||||
/**
|
||||
* 图片接口
|
||||
*/
|
||||
public static final String PATH_IMAGE_LOADER = "/mogo/utils/imageloader";
|
||||
@Keep
|
||||
public static final String PATH_UTILS_IMAGE_LOADER = "/utils/imageloader";
|
||||
|
||||
/**
|
||||
* 埋点接口
|
||||
*/
|
||||
@Keep
|
||||
public static final String PATH_UTILS_ANALYTICS = "/utils/analytics";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.mogo.service.analytics;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Keep
|
||||
public interface IMogoAnalytics extends IProvider {
|
||||
|
||||
/**
|
||||
* 埋点
|
||||
*
|
||||
* @param event 事件名称
|
||||
* @param properties 埋点参数
|
||||
*/
|
||||
@Keep
|
||||
void track( String event, Map< String, Object > properties );
|
||||
}
|
||||
@@ -2,19 +2,24 @@ package com.mogo.service.imageloader;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 图片下载接口
|
||||
*/
|
||||
@Keep
|
||||
public interface IMogoImageLoaderListener {
|
||||
|
||||
@Keep
|
||||
void onStart();
|
||||
|
||||
// void onProcess( int completedSize, int totalSize );
|
||||
|
||||
// void onProcess( int completedSize, int totalSize );
|
||||
@Keep
|
||||
void onCompleted( Bitmap bitmap );
|
||||
|
||||
@Keep
|
||||
void onFailure( Exception e );
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.mogo.service.imageloader;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/**
|
||||
@@ -10,19 +12,27 @@ import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
* <p>
|
||||
* 图片接口
|
||||
*/
|
||||
@Keep
|
||||
public interface IMogoImageloader extends IProvider {
|
||||
|
||||
@Keep
|
||||
void init( Context context );
|
||||
|
||||
@Keep
|
||||
void displayImage( String url, MogoImageView imageView );
|
||||
|
||||
@Keep
|
||||
void displayImage( String url, MogoImageView imageView, int width, int height );
|
||||
|
||||
@Keep
|
||||
void displayImage( String url, MogoImageView imageView, int width, int height, final IMogoImageLoaderListener listener );
|
||||
|
||||
@Keep
|
||||
void displayImage( String url, MogoImageView imageView, final IMogoImageLoaderListener listener );
|
||||
|
||||
@Keep
|
||||
void downloadImage( Context context, String url, IMogoImageLoaderListener listener );
|
||||
|
||||
@Keep
|
||||
void destroy();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.graphics.Matrix;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
import com.facebook.drawee.view.GenericDraweeView;
|
||||
import com.mogo.service.R;
|
||||
@@ -17,6 +18,7 @@ import com.mogo.service.R;
|
||||
* <p>
|
||||
* 封装 facebook GenericDraweeView,实现占位图、失败占位图、形状、边框、模糊等效果
|
||||
*/
|
||||
@Keep
|
||||
public class MogoImageView extends GenericDraweeView {
|
||||
|
||||
private int mPlaceHolder;
|
||||
@@ -48,19 +50,19 @@ public class MogoImageView extends GenericDraweeView {
|
||||
public MogoImageView( Context context, AttributeSet attrs, int theme ) {
|
||||
super( context, attrs, theme );
|
||||
TypedArray arrays = context.obtainStyledAttributes( attrs, R.styleable.MogoImageView );
|
||||
mPlaceHolder = arrays.getResourceId( R.styleable.MogoImageView_placeHolder, 0 );
|
||||
mFailureHolder = arrays.getResourceId( R.styleable.MogoImageView_failureHolder, 0 );
|
||||
mOverlayImageId = arrays.getResourceId( R.styleable.MogoImageView_overlayImageId, 0 );
|
||||
mShape = arrays.getInt( R.styleable.MogoImageView_shape, SHAPE_NORMAL );
|
||||
mRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_radius, 0 );
|
||||
mTopLeftRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_topLeftRadius, 0 );
|
||||
mTopRightRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_topRightRadius, 0 );
|
||||
mBottomLeftRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_bottomLeftRadius, 0 );
|
||||
mBottomRightRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_bottomRightRadius, 0 );
|
||||
mBorderWidth = arrays.getDimensionPixelSize( R.styleable.MogoImageView_shapeBorderWidth, 0 );
|
||||
mBorderColor = arrays.getColor( R.styleable.MogoImageView_borderColor, Color.WHITE );
|
||||
mIsBlur = arrays.getBoolean( R.styleable.MogoImageView_isBlur, false );
|
||||
mBlurRadius = arrays.getInt( R.styleable.MogoImageView_blurRadius, 25 );
|
||||
mPlaceHolder = arrays.getResourceId( R.styleable.MogoImageView_miv_placeHolder, 0 );
|
||||
mFailureHolder = arrays.getResourceId( R.styleable.MogoImageView_miv_failureHolder, 0 );
|
||||
mOverlayImageId = arrays.getResourceId( R.styleable.MogoImageView_miv_overlayImageId, 0 );
|
||||
mShape = arrays.getInt( R.styleable.MogoImageView_miv_shape, SHAPE_NORMAL );
|
||||
mRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_radius, 0 );
|
||||
mTopLeftRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_topLeftRadius, 0 );
|
||||
mTopRightRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_topRightRadius, 0 );
|
||||
mBottomLeftRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_bottomLeftRadius, 0 );
|
||||
mBottomRightRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_bottomRightRadius, 0 );
|
||||
mBorderWidth = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_shapeBorderWidth, 0 );
|
||||
mBorderColor = arrays.getColor( R.styleable.MogoImageView_miv_borderColor, Color.WHITE );
|
||||
mIsBlur = arrays.getBoolean( R.styleable.MogoImageView_miv_isBlur, false );
|
||||
mBlurRadius = arrays.getInt( R.styleable.MogoImageView_miv_blurRadius, 25 );
|
||||
arrays.recycle();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,17 @@ package com.mogo.service.map;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.IMogoMapListenerRegister;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.search.IMogoGeoSearch;
|
||||
import com.mogo.map.search.IMogoInputtipsSearch;
|
||||
import com.mogo.map.search.query.MogoInputtipsQuery;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.inputtips.IMogoInputtipsSearch;
|
||||
import com.mogo.map.search.inputtips.query.MogoInputtipsQuery;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.MogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -19,7 +24,7 @@ import java.util.List;
|
||||
* <p>
|
||||
* 地图对外地接口
|
||||
*/
|
||||
public interface IMogoMapService extends IProvider {
|
||||
public interface IMogoMapService extends IProvider, IMogoMapListenerRegister {
|
||||
|
||||
/**
|
||||
* 获取定位服务实例
|
||||
@@ -61,4 +66,25 @@ public interface IMogoMapService extends IProvider {
|
||||
* @return
|
||||
*/
|
||||
IMogoGeoSearch getGeoSearch( Context context );
|
||||
|
||||
/**
|
||||
* 注册地图事件
|
||||
*
|
||||
* @param listener 回调事件
|
||||
*/
|
||||
void registerHostMapListener( IMogoMapListener listener );
|
||||
|
||||
/**
|
||||
* 反注册注册地图事件
|
||||
*/
|
||||
void unregisterHostMapListener();
|
||||
|
||||
/**
|
||||
* poi搜索服务
|
||||
*
|
||||
* @param context
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
IMogoPoiSearch getPoiSearch( Context context, MogoPoiSearchQuery query );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.service.module;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 卡片生命周期
|
||||
*/
|
||||
public interface IMogoModuleLifecycle {
|
||||
|
||||
/**
|
||||
* 卡片在最前面,可操作地图
|
||||
*/
|
||||
void onPerform();
|
||||
|
||||
/**
|
||||
* 卡片不可用,任何卡片的操作都会被launcher忽略
|
||||
*/
|
||||
void onDisable();
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.mogo.service.module;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 模块 UI 接口
|
||||
*/
|
||||
public interface IMogoModuleProvider extends IProvider {
|
||||
|
||||
/**
|
||||
* fragment 提供者
|
||||
*/
|
||||
int TYPE_FRAGMENT = 1;
|
||||
|
||||
/**
|
||||
* view 提供者
|
||||
*/
|
||||
int TYPE_VIEW = 2;
|
||||
|
||||
/**
|
||||
* 创建卡片
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
Fragment createFragment( Context context, Bundle data );
|
||||
|
||||
/**
|
||||
* 创建view
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
View createView( Context context );
|
||||
|
||||
/**
|
||||
* 唯一标识
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@NonNull
|
||||
String getModuleName();
|
||||
|
||||
/**
|
||||
* 生命周期控制方法
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoModuleLifecycle getCardLifecycle();
|
||||
|
||||
/**
|
||||
* 地图监听对象
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoMapListener getMapListener();
|
||||
|
||||
/**
|
||||
* 是哪种类型的提供者
|
||||
* <p>
|
||||
* {@link #TYPE_FRAGMENT}
|
||||
* {@link #TYPE_VIEW}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int getType();
|
||||
}
|
||||
Reference in New Issue
Block a user