opt
This commit is contained in:
@@ -123,8 +123,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mUploadRoadCondition = findViewById( R.id.module_entrance_id_upload_road_condition );
|
||||
mUploadRoadCondition.setOnClickListener( view -> {
|
||||
ShareControl shareControl = new ShareControl();
|
||||
shareControl.showDialog( getActivity() );
|
||||
ShareControl.getInstance(getActivity()).showDialog();
|
||||
} );
|
||||
|
||||
mVRMode = findViewById( R.id.module_entrance_id_vr_mode );
|
||||
|
||||
@@ -15,11 +15,11 @@ public interface IShareControl {
|
||||
* 显示对话框
|
||||
*/
|
||||
@Keep
|
||||
void showDialog(Context context);
|
||||
void showDialog(/*Context context*/);
|
||||
|
||||
/**
|
||||
* 对话框消失
|
||||
*/
|
||||
@Keep
|
||||
void dismissDialog(Context context);
|
||||
void dismissDialog();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.mogo.module.share;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.MogoNavi;
|
||||
import com.mogo.map.impl.amap.navi.NaviClient;
|
||||
import com.mogo.module.share.dialog.LaucherShareDialog;
|
||||
|
||||
/**
|
||||
@@ -9,16 +12,36 @@ import com.mogo.module.share.dialog.LaucherShareDialog;
|
||||
* @since 2020-01-10
|
||||
*/
|
||||
public class ShareControl implements IShareControl {
|
||||
|
||||
private static volatile ShareControl sInstance;
|
||||
private Context mContext;
|
||||
|
||||
private ShareControl(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public static ShareControl getInstance(Context context) {
|
||||
if (sInstance == null) {
|
||||
synchronized (ShareControl.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new ShareControl(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void showDialog(Context context) {
|
||||
LaucherShareDialog shareDialog = new LaucherShareDialog(context);
|
||||
public void showDialog() {
|
||||
LaucherShareDialog shareDialog = new LaucherShareDialog(mContext);
|
||||
shareDialog.setCanceledOnTouchOutside(true);
|
||||
shareDialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismissDialog(Context context) {
|
||||
LaucherShareDialog shareDialog = new LaucherShareDialog(context);
|
||||
public void dismissDialog() {
|
||||
LaucherShareDialog shareDialog = new LaucherShareDialog(mContext);
|
||||
shareDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,6 +441,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
sendShareReceiver("1");
|
||||
Logger.d(TAG, "mogoIntentListener 上报路况 ----> ");
|
||||
traceTypeData("1");
|
||||
ShareControl.getInstance(getActivity()).dismissDialog();
|
||||
} else if (intentStr.equals(TanluConstants.SHARE_ROAD_CLOSURE)) { //分享封路(封路了) --ok
|
||||
traceData("2");
|
||||
sendShareReceiver("3");
|
||||
@@ -452,8 +453,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
Logger.d(TAG, "mogoIntentListener 分享交通检查 ----> ");
|
||||
traceTypeData("3");
|
||||
} else if (intentStr.equals(TanluConstants.GO_TO_SHARE)) { //我要分享 --ok
|
||||
ShareControl shareControl = new ShareControl();
|
||||
shareControl.showDialog(getActivity());
|
||||
ShareControl.getInstance(getActivity()).showDialog();
|
||||
Logger.d(TAG, "mogoIntentListener 我要分享 ----> ");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user