diff --git a/common/src/main/java/com/yunbao/common/CommonAppContext.java b/common/src/main/java/com/yunbao/common/CommonAppContext.java index 269464e41..9fec97fe8 100644 --- a/common/src/main/java/com/yunbao/common/CommonAppContext.java +++ b/common/src/main/java/com/yunbao/common/CommonAppContext.java @@ -55,9 +55,11 @@ public class CommonAppContext extends MultiDexApplication { // RongPushClient.setPushConfig(config); //将推送相关配置设置到 SDK //设置新加坡融云服务器 有时候国内收不到推送是因为这个 RongIMClient.setServerInfo("navsg01.cn.ronghub.com", null); - //谷歌推送 - PushConfig gconfig = new PushConfig.Builder().enableFCM(true).build(); - RongPushClient.setPushConfig(gconfig); + if (CommonAppConfig.IS_GOOGLE_PLAY == 1) { + //谷歌推送 + PushConfig gconfig = new PushConfig.Builder().enableFCM(true).build(); + RongPushClient.setPushConfig(gconfig); + } //初始化友盟统计 // UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null); FacebookSdk.sdkInitialize(getApplicationContext()); diff --git a/common/src/main/java/com/yunbao/common/fragment/LoadingDialog.java b/common/src/main/java/com/yunbao/common/fragment/LoadingDialog.java index 275574fe3..a0abccd54 100644 --- a/common/src/main/java/com/yunbao/common/fragment/LoadingDialog.java +++ b/common/src/main/java/com/yunbao/common/fragment/LoadingDialog.java @@ -46,6 +46,13 @@ public class LoadingDialog extends AbsDialogFragment { hint.setText(showText); } + public void setHintText(String text) { + if (hint != null) { + hint.setText(text); + } + } + + @Override public void onDestroy() { super.onDestroy(); @@ -56,7 +63,7 @@ public class LoadingDialog extends AbsDialogFragment { protected void setWindowAttributes(Window window) { window.setWindowAnimations(R.style.bottomToTopAnim); WindowManager.LayoutParams params = window.getAttributes(); - params.width = DeviceUtils.getScreenWidth(getActivity())/2; + params.width = DeviceUtils.getScreenWidth(getActivity()) / 2; params.height = WindowManager.LayoutParams.WRAP_CONTENT; params.gravity = Gravity.CENTER; window.setAttributes(params); diff --git a/config.gradle b/config.gradle index 852408633..6a55ef543 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - //serverHost : "https://napi.yaoulive.com", + serverHost : "https://napi.yaoulive.com", // 测试 - serverHost : " https://ceshi.yaoulive.com", + //serverHost : " https://ceshi.yaoulive.com", //百度语音识别 diff --git a/lib_huawei/src/main/java/com/shayu/lib_huawei/utils/HuaWeiPayManage.java b/lib_huawei/src/main/java/com/shayu/lib_huawei/utils/HuaWeiPayManage.java index 4ea0d17ec..15afa1d7c 100644 --- a/lib_huawei/src/main/java/com/shayu/lib_huawei/utils/HuaWeiPayManage.java +++ b/lib_huawei/src/main/java/com/shayu/lib_huawei/utils/HuaWeiPayManage.java @@ -69,7 +69,11 @@ public class HuaWeiPayManage { }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { - Toast.makeText(mContext, e.getMessage(), Toast.LENGTH_SHORT).show(); + if (e.getMessage() != null) { + if (!e.getMessage().contains("60004")) { + Toast.makeText(mContext, e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } } }).addOnCanceledListener(new OnCanceledListener() { @Override diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 3438b3684..e5f1dd1c1 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -147,8 +147,6 @@ import io.rong.imkit.config.RongConfigCenter; import io.rong.imkit.notification.NotificationConfig; import io.rong.imlib.RongIMClient; import io.rong.imlib.model.Message; -import io.rong.push.PushManager; -import io.rong.push.PushType; import kotlin.Unit; @Route(path = RouteUtil.PATH_MAIN) @@ -292,13 +290,13 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene } if (CommonAppConfig.IS_GOOGLE_PLAY == 1) { - GoogleUtils.newInstance(MainActivity.this).setFirebaseTokenListener(MainActivity.this, new GoogleUtils.FirebaseTokenListener() { + /* GoogleUtils.newInstance(MainActivity.this).setFirebaseTokenListener(MainActivity.this, new GoogleUtils.FirebaseTokenListener() { @Override public void onResultToken(String token) { L.e("GoogleUtils.newInstance:onResultToken:" + token); PushManager.getInstance().onReceiveToken(MainActivity.this, PushType.GOOGLE_FCM, token); } - }); + });*/ GoogleUtils.newInstance(MainActivity.this).initFireToken(MainActivity.this); } diff --git a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java index 5e63630c0..3660b589f 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java @@ -99,10 +99,9 @@ public class MyWalletActivity extends AbsActivity { try { int code = obj.getInt("querySize"); if (code == 0) { - loadingDialog.setShowText(getString(R.string.order_query_success)); + payHandler.post(() -> loadingDialog.setHintText(getString(R.string.order_query_success))); payHandler.postDelayed(() -> loadingDialog.dismiss(), 2000); } else { - JSONArray tokenList = obj.getJSONArray("tokenList"); JSONArray orderList = obj.getJSONArray("orderList"); String tradeNo = obj.getString("tradeNo"); @@ -140,7 +139,7 @@ public class MyWalletActivity extends AbsActivity { googleUtils.queryPurchasesAsync(); } else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) { hwBuilder.consume(); - loadingDialog.setShowText(getString(R.string.order_query_success)); + payHandler.postDelayed(() -> loadingDialog.setHintText(getString(R.string.order_query_success)), 1000); payHandler.postDelayed(() -> loadingDialog.dismiss(), 2000); } else { loadingDialog.setShowText(getString(R.string.order_query_success));