Merge branch 'dev' into 'dev_4.1.0'
# Conflicts: # app/src/main/java/com/gh/common/DefaultUrlHandler.kt # app/src/main/java/com/gh/common/util/ShareUtils.java # dependencies.gradle
This commit is contained in:
@ -27,6 +27,10 @@ import android.widget.TextView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.facebook.common.references.CloseableReference;
|
||||
import com.facebook.datasource.DataSource;
|
||||
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
|
||||
import com.facebook.imagepipeline.image.CloseableImage;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.WeiBoShareActivity;
|
||||
@ -243,17 +247,17 @@ public class ShareUtils {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
contentView.setOnClickListener(v -> popupWindow.get().dismiss());
|
||||
contentView.setOnClickListener(v -> safelyDismiss());
|
||||
|
||||
contentView.setOnKeyListener((v, keyCode, event) -> {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK
|
||||
&& event.getRepeatCount() == 0
|
||||
&& popupWindow != null
|
||||
&& popupWindow.get() != null
|
||||
&& popupWindow.get().isShowing()) {
|
||||
if (callBack != null) {
|
||||
callBack.onCancel();
|
||||
}
|
||||
popupWindow.get().dismiss();
|
||||
safelyDismiss();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
@ -294,7 +298,7 @@ public class ShareUtils {
|
||||
}
|
||||
|
||||
if (mShareEntrance != ShareEntrance.shareGh) {
|
||||
popupWindow.get().dismiss();
|
||||
safelyDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@ -334,7 +338,7 @@ public class ShareUtils {
|
||||
|
||||
loadBitmapAndShare(shareIcon, msg, req);
|
||||
if (mShareEntrance != ShareEntrance.shareGh) {
|
||||
popupWindow.get().dismiss();
|
||||
safelyDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@ -449,7 +453,7 @@ public class ShareUtils {
|
||||
}
|
||||
|
||||
if (mShareEntrance != ShareEntrance.shareGh) {
|
||||
popupWindow.get().dismiss();
|
||||
safelyDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@ -494,7 +498,7 @@ public class ShareUtils {
|
||||
|
||||
loadBitmapAndShare(shareIcon, msg, req);
|
||||
if (mShareEntrance != ShareEntrance.shareGh) {
|
||||
popupWindow.get().dismiss();
|
||||
safelyDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@ -515,7 +519,7 @@ public class ShareUtils {
|
||||
|
||||
|
||||
if (mShareEntrance != ShareEntrance.shareGh) {
|
||||
popupWindow.get().dismiss();
|
||||
safelyDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@ -557,8 +561,8 @@ public class ShareUtils {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (mShareEntrance != ShareEntrance.shareGh) {
|
||||
popupWindow.get().dismiss();
|
||||
if (mShareEntrance != ShareEntrance.shareGh ) {
|
||||
safelyDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@ -570,7 +574,7 @@ public class ShareUtils {
|
||||
cmb.setText(copyContent);
|
||||
if (mShareEntrance != ShareEntrance.shareGh) {
|
||||
Utils.toast(mContext, "复制成功");
|
||||
popupWindow.get().dismiss();
|
||||
safelyDismiss();
|
||||
} else {
|
||||
Utils.toast(mContext, "复制成功,请到微信/QQ粘贴分享");
|
||||
}
|
||||
@ -656,7 +660,7 @@ public class ShareUtils {
|
||||
break;
|
||||
case 7:
|
||||
if (mShareEntrance != ShareEntrance.shareGh) {
|
||||
popupWindow.get().dismiss();
|
||||
safelyDismiss();
|
||||
} else {
|
||||
shareType = "copy_link";
|
||||
LogUtils.uploadShareType(shareType, shareEntrance.getName(), shareUrl, mTitle, mSummary, resourceId);
|
||||
@ -684,6 +688,12 @@ public class ShareUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void safelyDismiss() {
|
||||
if (popupWindow.get() != null) {
|
||||
popupWindow.get().dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
interface OnItemClickListener {
|
||||
void onItemClick(int position);
|
||||
|
||||
Reference in New Issue
Block a user