|
|
@@ -1,10 +1,8 @@
|
|
|
package com.sheep.gamegroup.view.activity;
|
|
|
|
|
|
-import android.app.AlertDialog;
|
|
|
import android.support.v4.view.ViewPager;
|
|
|
import android.util.SparseArray;
|
|
|
import android.view.View;
|
|
|
-import android.widget.ImageView;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
@@ -15,8 +13,10 @@ import com.sheep.gamegroup.di.components.DaggerAskGetMoneyComponent;
|
|
|
import com.sheep.gamegroup.di.modules.AskGetMoneyModule;
|
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
|
import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
|
|
|
+import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.presenter.AskGetMoneyContract;
|
|
|
import com.sheep.gamegroup.presenter.AskGetMoneyPresenter;
|
|
|
+import com.sheep.gamegroup.util.CommonUtil;
|
|
|
import com.sheep.gamegroup.util.StringUtils;
|
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
|
@@ -34,6 +34,7 @@ import javax.inject.Inject;
|
|
|
|
|
|
import butterknife.BindView;
|
|
|
import butterknife.OnClick;
|
|
|
+import rx.functions.Action1;
|
|
|
|
|
|
import static com.sheep.gamegroup.util.UMConfigUtils.Event.LINK_SHARE;
|
|
|
import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_COPY;
|
|
|
@@ -95,11 +96,18 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
|
|
|
public void initListener() {
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ private UserEntity userEntity;
|
|
|
@Override
|
|
|
public void initData() {
|
|
|
showProgress();
|
|
|
mPresenter.getTask(null);
|
|
|
+ CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
|
|
|
+ @Override
|
|
|
+ public void call(UserEntity result) {
|
|
|
+ if(result != null)
|
|
|
+ userEntity = result;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void shareToWX() {
|
|
|
@@ -111,8 +119,12 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
|
|
|
}
|
|
|
|
|
|
private void shareToOther(int code) {
|
|
|
+ if(userEntity == null){
|
|
|
+ G.showToast("数据正在加载中");
|
|
|
+ return;
|
|
|
+ }
|
|
|
UMImage thumb = new UMImage(this, R.drawable.icon);
|
|
|
- UMWeb web = new UMWeb(mEntity.getShare_link());
|
|
|
+ UMWeb web = new UMWeb(userEntity.getShareLink());
|
|
|
web.setTitle(mEntity.getShare_title());//标题
|
|
|
web.setThumb(thumb); //缩略图
|
|
|
web.setDescription(mEntity.getShare_desc());//描述
|
|
|
@@ -127,14 +139,18 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
|
|
|
|
|
|
|
|
|
private void shareToLink() {
|
|
|
+ if(userEntity == null){
|
|
|
+ G.showToast("数据正在加载中");
|
|
|
+ return;
|
|
|
+ }
|
|
|
LINK_SHARE.onEvent();
|
|
|
- ViewUtil.showMsgDialog(this, new DialogConfig().setTitle("分享链接").setMsg(mEntity.getShare_link())
|
|
|
+ ViewUtil.showMsgDialog(this, new DialogConfig().setTitle("分享链接").setMsg(userEntity.getShareLink())
|
|
|
.setMsgMore("通过连接加入小绵羊即可成为你的好友").setMsgMoreColor(R.color.txt_black_9e9c9c)
|
|
|
.setBtnLeftText("复制链接").setBtnLeftOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
QR_COPY.onEvent();
|
|
|
- StringUtils.CopyText(AskGetMoneyAct.this,mEntity.getShare_link());
|
|
|
+ StringUtils.CopyText(AskGetMoneyAct.this, userEntity.getShareLink());
|
|
|
G.showToast("复制链接成功");
|
|
|
}
|
|
|
}));
|
|
|
@@ -203,7 +219,11 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
|
|
|
SHARE_TO_QQ.onEvent();
|
|
|
break;
|
|
|
case R.id.rl_qr:
|
|
|
- ViewUtil.showQR(AskGetMoneyAct.this, mEntity.getShare_link());
|
|
|
+ if(userEntity == null){
|
|
|
+ G.showToast("数据正在加载中");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ ViewUtil.showQR(AskGetMoneyAct.this, userEntity.getShareLink());
|
|
|
break;
|
|
|
case R.id.rl_link:
|
|
|
shareToLink();
|