opt
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user