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