根据测试反馈修改帮助反馈问题
新增小游戏跳一跳回血和必中的回调 新增关闭发红包页面后自动打开礼物栏的功能 调整小游戏跳一跳回调防抖
This commit is contained in:
parent
1c9493d7c8
commit
1f12187766
@ -454,7 +454,7 @@ public class CommonHttpUtil {
|
|||||||
* 上传文件 获取七牛云token的接口
|
* 上传文件 获取七牛云token的接口
|
||||||
*/
|
*/
|
||||||
public static void getUploadQiNiuToken(HttpCallback callback, boolean isImg) {
|
public static void getUploadQiNiuToken(HttpCallback callback, boolean isImg) {
|
||||||
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken", "Pdluserhome.getQiNiuToken")
|
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken2", "Pdluserhome.getQiNiuToken2")
|
||||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||||
.params("token", CommonAppConfig.getInstance().getToken())
|
.params("token", CommonAppConfig.getInstance().getToken())
|
||||||
.params("ext", isImg ? ".jpeg" : ".mp4")
|
.params("ext", isImg ? ".jpeg" : ".mp4")
|
||||||
|
@ -1210,4 +1210,26 @@ public interface PDLiveApi {
|
|||||||
|
|
||||||
@GET("/api/public/?service=User.userFeedbackRestrict")
|
@GET("/api/public/?service=User.userFeedbackRestrict")
|
||||||
Observable<ResponseModel<List<BaseModel>>> checkFeedback();
|
Observable<ResponseModel<List<BaseModel>>> checkFeedback();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param roomId 房间ID
|
||||||
|
* @param cmd 事件名称 生命值:addHeart 自动跳:hit
|
||||||
|
* @param value 价格
|
||||||
|
* @param gameId 游戏ID
|
||||||
|
* @param fromUid 付费用户uid
|
||||||
|
* @param toUid 目标用户uid
|
||||||
|
* @param payload 附加值
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Sudgameserver.createOrder")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> createGameOrder(
|
||||||
|
@Query("room_id")String roomId,
|
||||||
|
@Query("cmd")String cmd,
|
||||||
|
@Query("value")String value,
|
||||||
|
@Query("mg_id")String gameId,
|
||||||
|
@Query("from_uid")String fromUid,
|
||||||
|
@Query("to_uid")String toUid,
|
||||||
|
@Query("payload")String payload
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -95,6 +95,7 @@ import io.reactivex.schedulers.Schedulers;
|
|||||||
import okhttp3.MediaType;
|
import okhttp3.MediaType;
|
||||||
import okhttp3.MultipartBody;
|
import okhttp3.MultipartBody;
|
||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3245,6 +3246,40 @@ public class LiveNetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void createGameOrder(
|
||||||
|
String roomId,
|
||||||
|
String cmd,
|
||||||
|
String value,
|
||||||
|
String gameId,
|
||||||
|
String fromUid,
|
||||||
|
String toUid,
|
||||||
|
String roundId,
|
||||||
|
String payload
|
||||||
|
, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.createGameOrder(roomId, cmd, value, gameId, fromUid, toUid,payload)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<BaseModel>> responseModel) {
|
||||||
|
if (callback != null) {
|
||||||
|
HttpCallbackModel model = new HttpCallbackModel();
|
||||||
|
model.setCode(responseModel.getData().getCode());
|
||||||
|
model.setMsg(responseModel.getData().getMsg());
|
||||||
|
callback.onSuccess(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
private MultipartBody.Part createUploadFile(File file) {
|
private MultipartBody.Part createUploadFile(File file) {
|
||||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||||
|
@ -47,7 +47,7 @@ public abstract class ImageResultCallback {
|
|||||||
UploadQnImpl mUploadStrategy = new UploadQnImpl(mContext);
|
UploadQnImpl mUploadStrategy = new UploadQnImpl(mContext);
|
||||||
List<UploadBean> beans = new ArrayList<>();
|
List<UploadBean> beans = new ArrayList<>();
|
||||||
beans.add(new UploadBean(file, UploadBean.IMG));
|
beans.add(new UploadBean(file, UploadBean.IMG));
|
||||||
mUploadStrategy.upload(beans, false, new UploadCallback() {
|
mUploadStrategy.upload(beans, true, new UploadCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onFinish(List<UploadBean> list, boolean success) {
|
public void onFinish(List<UploadBean> list, boolean success) {
|
||||||
if (success) {
|
if (success) {
|
||||||
|
@ -142,7 +142,10 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
|||||||
|
|
||||||
// 给装饰类设置回调
|
// 给装饰类设置回调
|
||||||
sudFSMMGDecorator.setSudFSMMGListener(this);
|
sudFSMMGDecorator.setSudFSMMGListener(this);
|
||||||
|
sudFSMMGDecorator.setGameId(gameId);
|
||||||
|
sudFSMMGDecorator.setRoomId(gameRoomId);
|
||||||
|
sudFSMMGDecorator.setUserId(getUserId());
|
||||||
|
Log.i("游戏回调",code+" "+gameId+" "+gameRoomId+" ");
|
||||||
// 调用游戏sdk加载游戏
|
// 调用游戏sdk加载游戏
|
||||||
ISudFSTAPP iSudFSTAPP = SudMGP.loadMG(activity, getUserId(), gameRoomId, code, gameId, getLanguageCode(), sudFSMMGDecorator);
|
ISudFSTAPP iSudFSTAPP = SudMGP.loadMG(activity, getUserId(), gameRoomId, code, gameId, getLanguageCode(), sudFSMMGDecorator);
|
||||||
|
|
||||||
|
@ -23,6 +23,10 @@ import tech.sud.mgp.core.ISudFSMStateHandle;
|
|||||||
*/
|
*/
|
||||||
public class SudFSMMGDecorator implements ISudFSMMG {
|
public class SudFSMMGDecorator implements ISudFSMMG {
|
||||||
|
|
||||||
|
private static final String TAG = "游戏回调";
|
||||||
|
private long gameId;
|
||||||
|
private String gameRoomId;
|
||||||
|
private String userId;
|
||||||
// 回调
|
// 回调
|
||||||
private SudFSMMGListener sudFSMMGListener;
|
private SudFSMMGListener sudFSMMGListener;
|
||||||
|
|
||||||
@ -227,10 +231,10 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_GAME_STATE: // 10. 游戏状态
|
case SudMGPMGState.MG_COMMON_GAME_STATE: // 10. 游戏状态
|
||||||
Log.e("onGameStateChange", "mg_common_game_state:::::" + "dataJson:::::"+dataJson);
|
Log.e("onGameStateChange", "mg_common_game_state:::::" + "dataJson:::::" + dataJson);
|
||||||
SudMGPMGState.MGCommonGameState mgCommonGameState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameState.class);
|
SudMGPMGState.MGCommonGameState mgCommonGameState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameState.class);
|
||||||
sudFSMMGCache.onGameMGCommonGameState(mgCommonGameState);
|
sudFSMMGCache.onGameMGCommonGameState(mgCommonGameState);
|
||||||
if (mgCommonGameState.gameState==2){
|
if (mgCommonGameState.gameState == 2) {
|
||||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE));
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE));
|
||||||
}
|
}
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
@ -354,6 +358,13 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_GAME_CREATE_ORDER: // 25. 创建订单
|
case SudMGPMGState.MG_COMMON_GAME_CREATE_ORDER: // 25. 创建订单
|
||||||
SudMGPMGState.MGCommonGameCreateOrder mgCommonGameCreateOrder = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameCreateOrder.class);
|
SudMGPMGState.MGCommonGameCreateOrder mgCommonGameCreateOrder = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameCreateOrder.class);
|
||||||
|
if (mgCommonGameCreateOrder != null) {
|
||||||
|
mgCommonGameCreateOrder.gameId = gameId;
|
||||||
|
mgCommonGameCreateOrder.gameRoomId = gameRoomId;
|
||||||
|
mgCommonGameCreateOrder.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.i(TAG, "onGameStateChange: " + dataJson);
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
} else {
|
} else {
|
||||||
@ -1021,4 +1032,15 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
return sudFSMMGCache;
|
return sudFSMMGCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setGameId(long gameId) {
|
||||||
|
this.gameId = gameId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomId(String gameRoomId) {
|
||||||
|
this.gameRoomId = gameRoomId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(String userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package com.yunbao.common.sud.decorator;
|
package com.yunbao.common.sud.decorator;
|
||||||
|
|
||||||
|
import com.yunbao.common.sud.decorator.game.JumpEvent;
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
||||||
|
|
||||||
@ -271,8 +272,14 @@ public interface SudFSMMGListener {
|
|||||||
* mg_common_game_create_order
|
* mg_common_game_create_order
|
||||||
*/
|
*/
|
||||||
default void onGameMGCommonGameCreateOrder(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameCreateOrder model) {
|
default void onGameMGCommonGameCreateOrder(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameCreateOrder model) {
|
||||||
|
if ("addHeart".equals(model.cmd)) {
|
||||||
|
JumpEvent.addHeart(model);
|
||||||
|
} else if ("hit".equals(model.cmd)) {
|
||||||
|
JumpEvent.hit(model);
|
||||||
|
} else {
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 26. 游戏通知app玩家角色(仅对狼人杀有效)
|
* 26. 游戏通知app玩家角色(仅对狼人杀有效)
|
||||||
|
@ -0,0 +1,47 @@
|
|||||||
|
package com.yunbao.common.sud.decorator.game;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
import com.yunbao.common.utils.AppManager;
|
||||||
|
|
||||||
|
public class JumpEvent {
|
||||||
|
private static long clickTimer = 0;
|
||||||
|
|
||||||
|
public static void addHeart(SudMGPMGState.MGCommonGameCreateOrder order) {
|
||||||
|
createOrder(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void hit(SudMGPMGState.MGCommonGameCreateOrder order) {
|
||||||
|
createOrder(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized static void createOrder(SudMGPMGState.MGCommonGameCreateOrder order) {
|
||||||
|
if (System.currentTimeMillis() - clickTimer < 1000) {
|
||||||
|
//TODO 防止重复点击
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
clickTimer = System.currentTimeMillis();
|
||||||
|
LiveNetManager.get(AppManager.getInstance().getLastActivity())
|
||||||
|
.createGameOrder(order.gameRoomId,
|
||||||
|
order.cmd,
|
||||||
|
order.value + "",
|
||||||
|
order.gameId + "",
|
||||||
|
order.fromUid,
|
||||||
|
order.toUid,
|
||||||
|
order.gameRoomId,
|
||||||
|
order.payload,
|
||||||
|
new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -496,6 +496,10 @@ public class SudMGPMGState implements Serializable {
|
|||||||
public String toUid; // 目标用户uid
|
public String toUid; // 目标用户uid
|
||||||
public long value; // 所属的游戏价值
|
public long value; // 所属的游戏价值
|
||||||
public String payload; // 扩展数据 json 字符串, 特殊可选
|
public String payload; // 扩展数据 json 字符串, 特殊可选
|
||||||
|
|
||||||
|
public long gameId;
|
||||||
|
public String gameRoomId;
|
||||||
|
public String userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,20 +1,12 @@
|
|||||||
package com.yunbao.common.utils;
|
package com.yunbao.common.utils;
|
||||||
|
|
||||||
import static com.yalantis.ucrop.util.FileUtils.getDataColumn;
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.ContentUris;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Environment;
|
|
||||||
import android.provider.DocumentsContract;
|
|
||||||
import android.provider.DocumentsProvider;
|
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
|
|
||||||
import androidx.documentfile.provider.DocumentFile;
|
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
@ -46,6 +38,11 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
private File mCorpResult;//裁剪后得到的图片
|
private File mCorpResult;//裁剪后得到的图片
|
||||||
private ImageResultCallback mResultCallback;
|
private ImageResultCallback mResultCallback;
|
||||||
private boolean mNeedCrop;//是否需要裁剪
|
private boolean mNeedCrop;//是否需要裁剪
|
||||||
|
private boolean mNeedGif;//允许gif图
|
||||||
|
|
||||||
|
public void setNeedGif(boolean mNeedGif) {
|
||||||
|
this.mNeedGif = mNeedGif;
|
||||||
|
}
|
||||||
|
|
||||||
public ProcessImageUtil(FragmentActivity activity) {
|
public ProcessImageUtil(FragmentActivity activity) {
|
||||||
super(activity);
|
super(activity);
|
||||||
@ -103,6 +100,9 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure() {
|
public void onFailure() {
|
||||||
ToastUtil.show(mContext.getString(R.string.img_camera_cancel));
|
ToastUtil.show(mContext.getString(R.string.img_camera_cancel));
|
||||||
|
if (mResultCallback != null) {
|
||||||
|
mResultCallback.onFailure();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mAlumbResultCallback = new ActivityResultCallback() {
|
mAlumbResultCallback = new ActivityResultCallback() {
|
||||||
@ -221,9 +221,14 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
* 打开相册,选择文件
|
* 打开相册,选择文件
|
||||||
*/
|
*/
|
||||||
private void chooseFile() {
|
private void chooseFile() {
|
||||||
|
String[] mimeTypes = {"image/png", "image/jpg", "image/jpeg"};
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
intent.setType("image/*");
|
intent.setType("*/*");
|
||||||
|
if (mNeedGif) {
|
||||||
|
mimeTypes = new String[]{"image/png", "image/jpg", "image/jpeg", "image/gif"};
|
||||||
|
}
|
||||||
|
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
|
||||||
if (Build.VERSION.SDK_INT < 19) {
|
if (Build.VERSION.SDK_INT < 19) {
|
||||||
intent.setAction(Intent.ACTION_GET_CONTENT);
|
intent.setAction(Intent.ACTION_GET_CONTENT);
|
||||||
} else {
|
} else {
|
||||||
|
@ -21,7 +21,7 @@ ext {
|
|||||||
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
||||||
|
|
||||||
// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 3 samsung包
|
// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 3 samsung包
|
||||||
isGooglePlay : 3,
|
isGooglePlay : 0,
|
||||||
//是否上报异常日志
|
//是否上报异常日志
|
||||||
isUploadLog : true,
|
isUploadLog : true,
|
||||||
//是否打包成插件包模式
|
//是否打包成插件包模式
|
||||||
|
@ -2,7 +2,9 @@ package com.yunbao.live.dialog;
|
|||||||
|
|
||||||
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
|
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@ -19,10 +21,12 @@ import com.lxj.xpopup.core.CenterPopupView;
|
|||||||
import com.umeng.analytics.MobclickAgent;
|
import com.umeng.analytics.MobclickAgent;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
|
|
||||||
public class SendRendPacketPopup extends CenterPopupView {
|
public class SendRendPacketPopup extends CenterPopupView {
|
||||||
private Button thereIsNo, followingAnchor, joinFansGroup;
|
private Button thereIsNo, followingAnchor, joinFansGroup;
|
||||||
@ -31,6 +35,8 @@ public class SendRendPacketPopup extends CenterPopupView {
|
|||||||
private FrameLayout redPacketIllustrate;
|
private FrameLayout redPacketIllustrate;
|
||||||
private ImageView iconInstructions, illustrateClose;
|
private ImageView iconInstructions, illustrateClose;
|
||||||
private String mLiveID, conditions = "0";
|
private String mLiveID, conditions = "0";
|
||||||
|
private DialogInterface onDismissListener;
|
||||||
|
private boolean sendSuccess;
|
||||||
|
|
||||||
public SendRendPacketPopup(@NonNull Context context, String liveID) {
|
public SendRendPacketPopup(@NonNull Context context, String liveID) {
|
||||||
super(context);
|
super(context);
|
||||||
@ -51,6 +57,23 @@ public class SendRendPacketPopup extends CenterPopupView {
|
|||||||
initView();
|
initView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOnDismissListener(DialogInterface onDismissListener) {
|
||||||
|
this.onDismissListener = onDismissListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDismiss() {
|
||||||
|
super.onDismiss();
|
||||||
|
|
||||||
|
if (sendSuccess) {
|
||||||
|
// onDismissListener.dismiss();
|
||||||
|
} else {
|
||||||
|
// onDismissListener.cancel();
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void initView() {
|
private void initView() {
|
||||||
thereIsNo = findViewById(R.id.there_is_no);
|
thereIsNo = findViewById(R.id.there_is_no);
|
||||||
followingAnchor = findViewById(R.id.following_anchor);
|
followingAnchor = findViewById(R.id.following_anchor);
|
||||||
@ -222,6 +245,7 @@ public class SendRendPacketPopup extends CenterPopupView {
|
|||||||
|
|
||||||
MobclickAgent.onEvent(getContext(), "gif_list_redpk_seed", "用户发送红包");
|
MobclickAgent.onEvent(getContext(), "gif_list_redpk_seed", "用户发送红包");
|
||||||
ToastUtil.show(getContext().getString(R.string.red_envelope_released_successfully));
|
ToastUtil.show(getContext().getString(R.string.red_envelope_released_successfully));
|
||||||
|
sendSuccess = true;
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
package com.yunbao.main.activity;
|
package com.yunbao.main.activity;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
import com.yunbao.common.bean.HttpCallbackModel;
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
@ -25,17 +28,29 @@ public class FeedbackActivity extends AbsActivity {
|
|||||||
setTitle(WordUtil.getNewString(R.string.activity_feedback_top_title));
|
setTitle(WordUtil.getNewString(R.string.activity_feedback_top_title));
|
||||||
setTitleBold(true);
|
setTitleBold(true);
|
||||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.btn_cs), new ViewClicksAntiShake.ViewClicksCallBack() {
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.btn_cs), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
Dialog loading;
|
||||||
@Override
|
@Override
|
||||||
public void onViewClicks() {
|
public void onViewClicks() {
|
||||||
//TODO 客服
|
//TODO 客服
|
||||||
|
loading= DialogUitl.loadingDialog(mContext);
|
||||||
|
loading.show();
|
||||||
MainHttpUtil.getCustomerService(new HttpCallback() {
|
MainHttpUtil.getCustomerService(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
loading.dismiss();
|
||||||
|
loading=null;
|
||||||
if (info.length == 1) {
|
if (info.length == 1) {
|
||||||
String url = info[0];
|
String url = info[0];
|
||||||
RouteUtil.forwardCustomerService(url);
|
RouteUtil.forwardCustomerService(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError() {
|
||||||
|
super.onError();
|
||||||
|
loading.dismiss();
|
||||||
|
loading=null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import android.app.Dialog;
|
|||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.InputFilter;
|
import android.text.InputFilter;
|
||||||
|
import android.text.Spanned;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -32,6 +33,8 @@ import com.yunbao.main.R;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@Route(path = RouteUtil.PATH_FEEDBACK_EDIT_ACTIVITY)
|
@Route(path = RouteUtil.PATH_FEEDBACK_EDIT_ACTIVITY)
|
||||||
public class FeedbackEditActivity extends AbsActivity {
|
public class FeedbackEditActivity extends AbsActivity {
|
||||||
@ -58,8 +61,20 @@ public class FeedbackEditActivity extends AbsActivity {
|
|||||||
setTitleBold(true);
|
setTitleBold(true);
|
||||||
initView();
|
initView();
|
||||||
imageUtil = new ProcessImageUtil(this);
|
imageUtil = new ProcessImageUtil(this);
|
||||||
feedbackEdit.setFilters(new InputFilter[]{new InputFilter.LengthFilter(500)});
|
feedbackEdit.setFilters(new InputFilter[]{new InputFilter.LengthFilter(501)});
|
||||||
ciEdit.setFilters(new InputFilter[]{new InputFilter.LengthFilter(30)});
|
ciEdit.setFilters(new InputFilter[]{new InputFilter.LengthFilter(30), new InputFilter() {
|
||||||
|
@Override
|
||||||
|
public CharSequence filter(CharSequence charSequence, int i, int i1, Spanned spanned, int i2, int i3) {
|
||||||
|
/* String regex = "[A-Za-z0-9]+"; // 正则表达式
|
||||||
|
Pattern pattern = Pattern.compile(regex);
|
||||||
|
Matcher matcher = pattern.matcher(charSequence.toString());
|
||||||
|
if (matcher.matches()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return "";*/
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}});
|
||||||
feedbackEdit.addTextChangedListener(new TextWatcher() {
|
feedbackEdit.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||||
@ -68,18 +83,22 @@ public class FeedbackEditActivity extends AbsActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||||
if (charSequence.length() == 500) {
|
if (charSequence.length() >= 500) {
|
||||||
ToastUtil.show(R.string.activity_feedback_edit_submit_tip2);
|
|
||||||
editNumber.setTextColor(Color.parseColor("#FF5656"));
|
editNumber.setTextColor(Color.parseColor("#FF5656"));
|
||||||
} else {
|
} else {
|
||||||
editNumber.setTextColor(Color.parseColor("#333333"));
|
editNumber.setTextColor(Color.parseColor("#333333"));
|
||||||
}
|
}
|
||||||
|
|
||||||
editNumber.setText(String.format(Locale.getDefault(), "%d", charSequence.length()));
|
editNumber.setText(String.format(Locale.getDefault(), "%d", charSequence.length()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable editable) {
|
public void afterTextChanged(Editable editable) {
|
||||||
|
if (editable.length() > 500) {
|
||||||
|
ToastUtil.show(R.string.activity_feedback_edit_submit_tip2);
|
||||||
|
feedbackEdit.setText(editable.toString().substring(0, 500));
|
||||||
|
feedbackEdit.setSelection(feedbackEdit.getText().length());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ViewClicksAntiShake.clicksAntiShake(img1, () -> {
|
ViewClicksAntiShake.clicksAntiShake(img1, () -> {
|
||||||
@ -122,13 +141,13 @@ public class FeedbackEditActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
JSONArray images = new JSONArray();
|
JSONArray images = new JSONArray();
|
||||||
if (img1.getTag() != null) {
|
if (img1.getTag() != null) {
|
||||||
images.add((String) img1.getTag());
|
images.add(((String) img1.getTag()).replace("https://downs.yaoulive.com/" ,""));
|
||||||
}
|
}
|
||||||
if (img2.getTag() != null) {
|
if (img2.getTag() != null) {
|
||||||
images.add((String) img2.getTag());
|
images.add(((String) img2.getTag()).replace("https://downs.yaoulive.com/" ,""));
|
||||||
}
|
}
|
||||||
if (img3.getTag() != null) {
|
if (img3.getTag() != null) {
|
||||||
images.add((String) img3.getTag());
|
images.add(((String) img3.getTag()).replace("https://downs.yaoulive.com/" ,""));
|
||||||
}
|
}
|
||||||
LiveNetManager.get(mContext)
|
LiveNetManager.get(mContext)
|
||||||
.feedback(feedbackEdit.getText().toString(),
|
.feedback(feedbackEdit.getText().toString(),
|
||||||
@ -150,15 +169,15 @@ public class FeedbackEditActivity extends AbsActivity {
|
|||||||
|
|
||||||
});
|
});
|
||||||
img1.setOnLongClickListener(view -> {
|
img1.setOnLongClickListener(view -> {
|
||||||
ToastUtil.show("1");
|
ToastUtil.showDebug("1");
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
img2.setOnLongClickListener(view -> {
|
img2.setOnLongClickListener(view -> {
|
||||||
ToastUtil.show("2");
|
ToastUtil.showDebug("2");
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
img3.setOnLongClickListener(view -> {
|
img3.setOnLongClickListener(view -> {
|
||||||
ToastUtil.show("3");
|
ToastUtil.showDebug("3");
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
imageUtil.setImageResultCallback(new ImageResultCallback() {
|
imageUtil.setImageResultCallback(new ImageResultCallback() {
|
||||||
@ -166,7 +185,7 @@ public class FeedbackEditActivity extends AbsActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(File file) {
|
public void onSuccess(File file) {
|
||||||
ToastUtil.show("图片地址:" + file.getAbsolutePath());
|
ToastUtil.showDebug("图片地址:" + file.getAbsolutePath());
|
||||||
onSuccessToQiNiuUrl(mContext, file, new OnItemClickListener<String>() {
|
onSuccessToQiNiuUrl(mContext, file, new OnItemClickListener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(String bean, int position) {
|
public void onItemClick(String bean, int position) {
|
||||||
@ -177,7 +196,7 @@ public class FeedbackEditActivity extends AbsActivity {
|
|||||||
switch (clickImage) {
|
switch (clickImage) {
|
||||||
case 101:
|
case 101:
|
||||||
case 112:
|
case 112:
|
||||||
setShowImage(img1,img1Del,bean);
|
setShowImage(img1, img1Del, bean);
|
||||||
if (img2.getTag() == null) {
|
if (img2.getTag() == null) {
|
||||||
setDefImage(img2, img2Del, img2Layout);
|
setDefImage(img2, img2Del, img2Layout);
|
||||||
} else if (img3.getTag() == null) {
|
} else if (img3.getTag() == null) {
|
||||||
@ -186,14 +205,14 @@ public class FeedbackEditActivity extends AbsActivity {
|
|||||||
break;
|
break;
|
||||||
case 201:
|
case 201:
|
||||||
case 212:
|
case 212:
|
||||||
setShowImage(img2,img2Del,bean);
|
setShowImage(img2, img2Del, bean);
|
||||||
if (img3.getTag() == null) {
|
if (img3.getTag() == null) {
|
||||||
setDefImage(img3, img3Del, img3Layout);
|
setDefImage(img3, img3Del, img3Layout);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 301:
|
case 301:
|
||||||
case 312:
|
case 312:
|
||||||
setShowImage(img3,img3Del,bean);
|
setShowImage(img3, img3Del, bean);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -271,9 +290,22 @@ public class FeedbackEditActivity extends AbsActivity {
|
|||||||
loadingDialog.dismiss();
|
loadingDialog.dismiss();
|
||||||
loadingDialog = null;
|
loadingDialog = null;
|
||||||
}
|
}
|
||||||
|
SparseArray<String> array = new SparseArray<>();
|
||||||
|
array.put(1, WordUtil.getNewString(R.string.activity_feedback_edit_img_select));
|
||||||
|
array.put(2, WordUtil.getNewString(R.string.activity_feedback_edit_img_camera));
|
||||||
|
DialogUitl.showStringArrayDialog(mContext, array, new DialogUitl.StringArrayDialogCallback() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(String text, int tag) {
|
||||||
loadingDialog = DialogUitl.loadingDialog(mContext);
|
loadingDialog = DialogUitl.loadingDialog(mContext);
|
||||||
loadingDialog.show();
|
loadingDialog.show();
|
||||||
|
if (tag == 1) {
|
||||||
imageUtil.getImageByAlumb(false);
|
imageUtil.getImageByAlumb(false);
|
||||||
|
} else {
|
||||||
|
imageUtil.getImageByCamera(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteImage(int index) {
|
private void deleteImage(int index) {
|
||||||
|
@ -285,9 +285,9 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener<
|
|||||||
} else {
|
} else {
|
||||||
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_on, studioRideEffects);
|
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_on, studioRideEffects);
|
||||||
}
|
}
|
||||||
if(IMLoginManager.get(mContext).isLiveNotifySettings()){
|
if (IMLoginManager.get(mContext).isLiveNotifySettings()) {
|
||||||
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_on, liveNotifySettings);
|
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_on, liveNotifySettings);
|
||||||
}else{
|
} else {
|
||||||
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_off, liveNotifySettings);
|
ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_off, liveNotifySettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -316,15 +316,16 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener<
|
|||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(bean.getId()==17){
|
} else if (bean.getId() == 17 || bean.getId() == 26) {
|
||||||
RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY);
|
RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (bean.getId() == 17) {//意见反馈要在url上加版本号和设备号
|
if (bean.getId() == 17 || bean.getId() == 26) {//意见反馈要在url上加版本号和设备号
|
||||||
href += "&version=" + android.os.Build.VERSION.RELEASE + "&model=" + android.os.Build.MODEL;
|
href += "&version=" + android.os.Build.VERSION.RELEASE + "&model=" + android.os.Build.MODEL;
|
||||||
}
|
|
||||||
// WebViewActivity.forward(mContext, href,false);
|
|
||||||
RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY);
|
RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY);
|
||||||
|
} else {
|
||||||
|
WebViewActivity.forward(mContext, href, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
|||||||
if (bean.getId() == 24) {
|
if (bean.getId() == 24) {
|
||||||
MobclickAgent.onEvent(mContext, "my_pack", "个人中心点包裹");
|
MobclickAgent.onEvent(mContext, "my_pack", "个人中心点包裹");
|
||||||
}
|
}
|
||||||
if (bean.getId() == 17) {
|
if (bean.getId() == 17 || bean.getId() == 26) {
|
||||||
RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY);
|
RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY);
|
||||||
} else
|
} else
|
||||||
WebViewActivity.forward(mContext, url, false);
|
WebViewActivity.forward(mContext, url, false);
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
android:layout_width="165dp"
|
android:layout_width="165dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:textAllCaps="false"
|
||||||
android:background="#F7F7F7"
|
android:background="#F7F7F7"
|
||||||
android:text="@string/activity_feedback_feedback"
|
android:text="@string/activity_feedback_feedback"
|
||||||
android:textColor="#333333"
|
android:textColor="#333333"
|
||||||
|
@ -239,7 +239,13 @@
|
|||||||
android:layout_marginBottom="130dp"
|
android:layout_marginBottom="130dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="*"
|
||||||
|
android:textColor="#FF5656"
|
||||||
|
android:textSize="11sp" />
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -248,13 +254,6 @@
|
|||||||
android:textColor="#777777"
|
android:textColor="#777777"
|
||||||
android:textSize="11sp" />
|
android:textSize="11sp" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="*"
|
|
||||||
android:textColor="#FF5656"
|
|
||||||
android:textSize="11sp" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
@ -39,4 +39,6 @@
|
|||||||
<string name="activity_feedback_edit_submit_tip1">請描述您的問題</string>
|
<string name="activity_feedback_edit_submit_tip1">請描述您的問題</string>
|
||||||
<string name="activity_feedback_edit_submit_tip2">超過字數要求</string>
|
<string name="activity_feedback_edit_submit_tip2">超過字數要求</string>
|
||||||
<string name="activity_feedback_edit_submit_tip3">今日反饋次數已用完</string>
|
<string name="activity_feedback_edit_submit_tip3">今日反饋次數已用完</string>
|
||||||
|
<string name="activity_feedback_edit_img_select">從相冊選取</string>
|
||||||
|
<string name="activity_feedback_edit_img_camera">拍照</string>
|
||||||
</resources>
|
</resources>
|
@ -39,4 +39,6 @@
|
|||||||
<string name="activity_feedback_edit_submit_tip1">Please describe your problem</string>
|
<string name="activity_feedback_edit_submit_tip1">Please describe your problem</string>
|
||||||
<string name="activity_feedback_edit_submit_tip2">Exceeding the word count requirement</string>
|
<string name="activity_feedback_edit_submit_tip2">Exceeding the word count requirement</string>
|
||||||
<string name="activity_feedback_edit_submit_tip3">Today\'s feedback count has been used up</string>
|
<string name="activity_feedback_edit_submit_tip3">Today\'s feedback count has been used up</string>
|
||||||
|
<string name="activity_feedback_edit_img_select">Select from album</string>
|
||||||
|
<string name="activity_feedback_edit_img_camera">Photo shoot</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user