问题详情与邀请回答优化(完成)

This commit is contained in:
kehaoyuan
2018-03-22 16:31:02 +08:00
parent 5d0ccb9a34
commit 38bf17c932
30 changed files with 747 additions and 240 deletions

View File

@ -147,6 +147,7 @@ public class ShareUtils {
public void showShareWindows(Activity activity, View view, String url, String icon, String shareTitle, String shareSummary, ShareType shareType) {
if (activity.isFinishing()) return;
this.mActivity = activity;
this.shareIcon = icon;
this.shareUrl = url;
@ -154,7 +155,7 @@ public class ShareUtils {
this.mTitle = shareTitle;
this.mShareType = shareType;
View contentView = View.inflate(mContext, R.layout.share_popup_layout, null);
View contentView = View.inflate(mActivity, R.layout.share_popup_layout, null);
contentView.setFocusable(true);
contentView.setFocusableInTouchMode(true);
RecyclerView shareRecyclerView = (RecyclerView) contentView.findViewById(R.id.share_rv);
@ -190,7 +191,11 @@ public class ShareUtils {
popupWindow = new PopupWindow(contentView, LinearLayout.LayoutParams.MATCH_PARENT
, LinearLayout.LayoutParams.MATCH_PARENT, true);
popupWindow.setAnimationStyle(R.style.mypopwindow_anim_style);
popupWindow.showAtLocation(view, Gravity.BOTTOM, 0, 0);
try {
popupWindow.showAtLocation(view, Gravity.BOTTOM, 0, 0);
} catch (Exception e) {
e.printStackTrace();
}
contentView.setOnClickListener(new View.OnClickListener() {
@Override