|
@@ -18,7 +18,6 @@ import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.bumptech.glide.Glide;
|
|
import com.bumptech.glide.Glide;
|
|
|
import com.bumptech.glide.load.DataSource;
|
|
import com.bumptech.glide.load.DataSource;
|
|
|
import com.bumptech.glide.load.engine.GlideException;
|
|
import com.bumptech.glide.load.engine.GlideException;
|
|
@@ -37,7 +36,6 @@ import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.transformer.ScaleTransformer;
|
|
import com.sheep.gamegroup.transformer.ScaleTransformer;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
import com.sheep.gamegroup.util.DataUtil;
|
|
import com.sheep.gamegroup.util.DataUtil;
|
|
|
-import com.sheep.gamegroup.util.FastJsonUtils;
|
|
|
|
|
import com.sheep.gamegroup.util.GlideImageLoader;
|
|
import com.sheep.gamegroup.util.GlideImageLoader;
|
|
|
import com.sheep.gamegroup.util.ListUtil;
|
|
import com.sheep.gamegroup.util.ListUtil;
|
|
|
import com.sheep.gamegroup.util.StringUtils;
|
|
import com.sheep.gamegroup.util.StringUtils;
|
|
@@ -104,6 +102,7 @@ public class ActInvitation extends BaseActivity {
|
|
|
protected int getLayoutId() {
|
|
protected int getLayoutId() {
|
|
|
return R.layout.act_invitation;
|
|
return R.layout.act_invitation;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
private List<PictureInvitationEntity> mPictureList = new ArrayList<>();
|
|
private List<PictureInvitationEntity> mPictureList = new ArrayList<>();
|
|
|
private List<View> viewArrayList = new ArrayList<>();
|
|
private List<View> viewArrayList = new ArrayList<>();
|
|
|
|
|
|
|
@@ -111,7 +110,7 @@ public class ActInvitation extends BaseActivity {
|
|
|
@Override
|
|
@Override
|
|
|
public void initView() {
|
|
public void initView() {
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
- main_layout.setPadding(0, 0, 0, G.getHasVirtualKey(this) -G.getNoHasVirtualKey(this) );
|
|
|
|
|
|
|
+ main_layout.setPadding(0, 0, 0, G.getHasVirtualKey(this) - G.getNoHasVirtualKey(this));
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -128,7 +127,7 @@ public class ActInvitation extends BaseActivity {
|
|
|
@Override
|
|
@Override
|
|
|
public void initData() {
|
|
public void initData() {
|
|
|
showProgress();
|
|
showProgress();
|
|
|
- if(userEntity == null) {
|
|
|
|
|
|
|
+ if (userEntity == null) {
|
|
|
CommonUtil.getInstance().callActionWithUserInfo(new Action1<UserEntity>() {
|
|
CommonUtil.getInstance().callActionWithUserInfo(new Action1<UserEntity>() {
|
|
|
@Override
|
|
@Override
|
|
|
public void call(UserEntity userEntity) {
|
|
public void call(UserEntity userEntity) {
|
|
@@ -188,15 +187,17 @@ public class ActInvitation extends BaseActivity {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
private int load = 0;
|
|
private int load = 0;
|
|
|
|
|
+
|
|
|
private void checkLoadLinkAndDesFinish() {
|
|
private void checkLoadLinkAndDesFinish() {
|
|
|
- if(userEntity != null && friendAndAwardEntity != null){
|
|
|
|
|
|
|
+ if (userEntity != null && friendAndAwardEntity != null) {
|
|
|
init(userEntity.getShareLink(), friendAndAwardEntity.getShare_desc());
|
|
init(userEntity.getShareLink(), friendAndAwardEntity.getShare_desc());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void checkLoadFinish() {
|
|
private void checkLoadFinish() {
|
|
|
- if(load == 3){
|
|
|
|
|
|
|
+ if (load == 3) {
|
|
|
hideProgress();
|
|
hideProgress();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -223,7 +224,7 @@ public class ActInvitation extends BaseActivity {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- .apply(new RequestOptions().centerCrop().transform(new RoundedCorners((int) getResources().getDimension(R.dimen.content_padding_8))))
|
|
|
|
|
|
|
+ .apply(new RequestOptions().transform(new RoundedCorners((int) getResources().getDimension(R.dimen.content_padding_8))).fitCenter())
|
|
|
.into(image_full);
|
|
.into(image_full);
|
|
|
GlideImageLoader.saveAndSetRqImage(image_bottom, item.getLink(), 800);
|
|
GlideImageLoader.saveAndSetRqImage(image_bottom, item.getLink(), 800);
|
|
|
viewArrayList.add(itemView);
|
|
viewArrayList.add(itemView);
|
|
@@ -250,9 +251,10 @@ public class ActInvitation extends BaseActivity {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- if(size > 2)
|
|
|
|
|
- viewPager.setCurrentItem((size-1) / 2, false);
|
|
|
|
|
|
|
+ if (size > 2)
|
|
|
|
|
+ viewPager.setCurrentItem((size - 1) / 2, false);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
private int curPosition = 0;
|
|
private int curPosition = 0;
|
|
|
private SparseArray<View> viewList = new SparseArray<>();
|
|
private SparseArray<View> viewList = new SparseArray<>();
|
|
|
|
|
|
|
@@ -297,11 +299,11 @@ public class ActInvitation extends BaseActivity {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
public void onClick(View view) {
|
|
|
File file = null;
|
|
File file = null;
|
|
|
- switch (position){
|
|
|
|
|
|
|
+ switch (position) {
|
|
|
case 2://qq
|
|
case 2://qq
|
|
|
case 1://wx
|
|
case 1://wx
|
|
|
PictureInvitationEntity picItem = ListUtil.getItem(mPictureList, curPosition);
|
|
PictureInvitationEntity picItem = ListUtil.getItem(mPictureList, curPosition);
|
|
|
- if(picItem != null && picItem.isLoaded()) {
|
|
|
|
|
|
|
+ if (picItem != null && picItem.isLoaded()) {
|
|
|
try {
|
|
try {
|
|
|
String fileName = String.format(Locale.CHINA, "share%d%s%d.jpg", position, BuildConfig.FLAVOR, picItem.getPicture().hashCode());
|
|
String fileName = String.format(Locale.CHINA, "share%d%s%d.jpg", position, BuildConfig.FLAVOR, picItem.getPicture().hashCode());
|
|
|
file = new File(ClassFileHelper.DIR, fileName);
|
|
file = new File(ClassFileHelper.DIR, fileName);
|
|
@@ -392,7 +394,7 @@ public class ActInvitation extends BaseActivity {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
UMImage umImage;
|
|
UMImage umImage;
|
|
|
- switch (type){
|
|
|
|
|
|
|
+ switch (type) {
|
|
|
case DialogShare.QQ:
|
|
case DialogShare.QQ:
|
|
|
case DialogShare.WX:
|
|
case DialogShare.WX:
|
|
|
umImage = new UMImage(activity, file);
|
|
umImage = new UMImage(activity, file);
|
|
@@ -405,7 +407,7 @@ public class ActInvitation extends BaseActivity {
|
|
|
umWeb.setTitle(activity.getResources().getString(R.string.app_name));
|
|
umWeb.setTitle(activity.getResources().getString(R.string.app_name));
|
|
|
umWeb.setThumb(umImage);
|
|
umWeb.setThumb(umImage);
|
|
|
umWeb.setDescription(TextUtils.isEmpty(description) ? activity.getResources().getString(R.string.app_name) : description);
|
|
umWeb.setDescription(TextUtils.isEmpty(description) ? activity.getResources().getString(R.string.app_name) : description);
|
|
|
- switch (type){
|
|
|
|
|
|
|
+ switch (type) {
|
|
|
case DialogShare.QQ:
|
|
case DialogShare.QQ:
|
|
|
case DialogShare.WX:
|
|
case DialogShare.WX:
|
|
|
new ShareAction(activity)
|
|
new ShareAction(activity)
|
|
@@ -423,6 +425,7 @@ public class ActInvitation extends BaseActivity {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@OnClick(R.id.img_baseactivity_title)
|
|
@OnClick(R.id.img_baseactivity_title)
|
|
|
public void onViewClicked(View view) {
|
|
public void onViewClicked(View view) {
|
|
|
switch (view.getId()) {
|
|
switch (view.getId()) {
|