update:2020.06.17

fix:优化没有信息时标签不显示
add:
This commit is contained in:
2020-06-17 16:53:52 +08:00
parent 780fb8561b
commit 988c1c9389
7 changed files with 82 additions and 65 deletions

View File

@@ -652,18 +652,22 @@ public class MainActivity extends AppCompatActivity {
layout_class.setVisibility(View.GONE);
} else {
tv_class.setText(info.getBatch());
layout_class.setVisibility(View.VISIBLE);
}
if (info.getSno().equals("")) {
tv_number.setText("暂无信息");
layout_number.setVisibility(View.GONE);
} else {
tv_number.setText(info.getSno());
layout_number.setVisibility(View.VISIBLE);
}
if (info.getRealname().equals("")) {
tv_name.setText("暂无信息");
layout_name.setVisibility(View.GONE);
} else {
tv_name.setText(info.getRealname());
layout_name.setVisibility(View.VISIBLE);
}
}
break;

View File

@@ -40,10 +40,10 @@ public class Network {
// public static final String ROOT_URL = "http://www.as.xueshibao.com.cn/api/"; 弃用
// public static final String ROOT_URL = "https://www.jiaoguanyi.com/api/";//正式 弃用
// public static final String ROOT_URL = "https://partner.jiaoguanyi.com/api/";//正式
// public static final String WebsocketURL = "ws://47.107.133.19:1234";
public static final String ROOT_URL = "http://www.jiaoguanyi.cn/api/";//测试
public static final String WebsocketURL = "ws://47.107.133.19:2345";
public static final String ROOT_URL = "https://partner.jiaoguanyi.com/api/";//正式
public static final String WebsocketURL = "ws://47.107.133.19:1234";
// public static final String ROOT_URL = "http://www.jiaoguanyi.cn/api/";//测试
// public static final String WebsocketURL = "ws://47.107.133.19:2345";
private static UploadAppInfoApi uploadAppInfoApi;
private static DeselectIDApi deselectIDApi;

View File

@@ -105,6 +105,42 @@ public class MyJPushReceiver extends BroadcastReceiver {
return 0;
}
@Override
public void onReceive(Context context, Intent intent) {
mContext = context;
Bundle bundle = intent.getExtras();
if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) {
String regId = bundle.getString(JPushInterface.EXTRA_REGISTRATION_ID);
Log.e(TAG, "[MyReceiver] 接收Registration Id : " + regId);
//send the Registration Id to your server...
} else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) {
// ToastTool.show("[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE)
// + "---" + bundle.getString(JPushInterface.EXTRA_TITLE) + "---" + bundle.getString(JPushInterface.EXTRA_CONTENT_TYPE)
// + "---" + bundle.getString(JPushInterface.EXTRA_EXTRA) + "----" + bundle.getString("package_name"));
// Log.e(TAG, "[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE)
// + "---" + bundle.getString(JPushInterface.EXTRA_TITLE) + "---" + bundle.getString(JPushInterface.EXTRA_CONTENT_TYPE)
// + "---" + bundle.getString(JPushInterface.EXTRA_EXTRA) + "----" + bundle.getString("package_name"));
processCustomMessage(context, bundle);//屏蔽推送
} else if (JPushInterface.ACTION_NOTIFICATION_RECEIVED.equals(intent.getAction())) {
Log.e(TAG, "[MyReceiver] 接收到推送下来的通知" + bundle.getString(JPushInterface.EXTRA_EXTRA));
// doDownloadAndInstall(bundle.getString(JPushInterface.EXTRA_EXTRA));
// LogUtils.e(getBatteryLevel()+"-0-iweroiwerewefeerer-----------");
int notifactionId = bundle.getInt(JPushInterface.EXTRA_NOTIFICATION_ID);
Log.e(TAG, "[MyReceiver] 接收到推送下来的通知的ID: " + notifactionId);
} else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
Log.e(TAG, "[MyReceiver] 用户点击打开了通知");
} else if (JPushInterface.ACTION_RICHPUSH_CALLBACK.equals(intent.getAction())) {
Log.e(TAG, "[MyReceiver] 用户收到到RICH PUSH CALLBACK: " + bundle.getString(JPushInterface.EXTRA_EXTRA));
//在这里根据 JPushInterface.EXTRA_EXTRA 的内容处理代码比如打开新的Activity 打开一个网页等..
} else if (JPushInterface.ACTION_CONNECTION_CHANGE.equals(intent.getAction())) {
boolean connected = intent.getBooleanExtra(JPushInterface.EXTRA_CONNECTION_CHANGE, false);
Log.e(TAG, "[MyReceiver]" + intent.getAction() + " connected state change to " + connected);
} else {
Log.e(TAG, "[MyReceiver] Unhandled intent - " + intent.getAction());
}
}
private void processCustomMessage(final Context context, Bundle bundle) {
String message = bundle.getString(JPushInterface.EXTRA_MESSAGE);
String title = bundle.getString(JPushInterface.EXTRA_TITLE);
@@ -178,15 +214,22 @@ public class MyJPushReceiver extends BroadcastReceiver {
MyApplication.sendAppUsedTime(random, sendType);
break;
case GET_FORCEDOWNLOADURL:
com.alibaba.fastjson.JSONObject URI = JSON.parseObject(extras);
String versionCode = URI.getString("version_code");
String url = URI.getString("url");
if (TextUtils.isEmpty(extras)) {
Log.e("mjsheng", "settingNetControl extras is null");
return;
}
com.alibaba.fastjson.JSONObject extra = JSON.parseObject(extras);
String app_name=extra.getString("app_name");
String app_package=extra.getString("package");
String url = extra.getString("url");
int versionCode = extra.getInteger("version_code");
com.alibaba.fastjson.JSONObject packageObj = new com.alibaba.fastjson.JSONObject();
packageObj.put("app_name", "教管易");
packageObj.put("app_package", "com.jiaoguanyi.store");
packageObj.put("app_name", app_name);
packageObj.put("app_package", app_package);
Aria.download(this)
.load(url) //读取下载地址
.setFilePath(PathUtils.getExternalDownloadsPath() + "/ygj/" + EncryptUtils.encryptMD5ToString("com.jiaoguanyi.store") + ".apk", true)
.setFilePath(PathUtils.getExternalDownloadsPath() + "/ygj/" + EncryptUtils.encryptMD5ToString(url) + ".apk", true)
.setExtendField(packageObj.toJSONString())
.create(); //启动下载}
@@ -862,46 +905,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
}
}
@Override
public void onReceive(Context context, Intent intent) {
mContext = context;
Bundle bundle = intent.getExtras();
if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) {
String regId = bundle.getString(JPushInterface.EXTRA_REGISTRATION_ID);
Log.e(TAG, "[MyReceiver] 接收Registration Id : " + regId);
//send the Registration Id to your server...
} else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) {
// ToastTool.show("[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE)
// + "---" + bundle.getString(JPushInterface.EXTRA_TITLE) + "---" + bundle.getString(JPushInterface.EXTRA_CONTENT_TYPE)
// + "---" + bundle.getString(JPushInterface.EXTRA_EXTRA) + "----" + bundle.getString("package_name"));
// Log.e(TAG, "[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE)
// + "---" + bundle.getString(JPushInterface.EXTRA_TITLE) + "---" + bundle.getString(JPushInterface.EXTRA_CONTENT_TYPE)
// + "---" + bundle.getString(JPushInterface.EXTRA_EXTRA) + "----" + bundle.getString("package_name"));
processCustomMessage(context, bundle);//屏蔽推送
} else if (JPushInterface.ACTION_NOTIFICATION_RECEIVED.equals(intent.getAction())) {
Log.e(TAG, "[MyReceiver] 接收到推送下来的通知" + bundle.getString(JPushInterface.EXTRA_EXTRA));
// doDownloadAndInstall(bundle.getString(JPushInterface.EXTRA_EXTRA));
// LogUtils.e(getBatteryLevel()+"-0-iweroiwerewefeerer-----------");
int notifactionId = bundle.getInt(JPushInterface.EXTRA_NOTIFICATION_ID);
Log.e(TAG, "[MyReceiver] 接收到推送下来的通知的ID: " + notifactionId);
} else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
Log.e(TAG, "[MyReceiver] 用户点击打开了通知");
} else if (JPushInterface.ACTION_RICHPUSH_CALLBACK.equals(intent.getAction())) {
Log.e(TAG, "[MyReceiver] 用户收到到RICH PUSH CALLBACK: " + bundle.getString(JPushInterface.EXTRA_EXTRA));
//在这里根据 JPushInterface.EXTRA_EXTRA 的内容处理代码比如打开新的Activity 打开一个网页等..
} else if (JPushInterface.ACTION_CONNECTION_CHANGE.equals(intent.getAction())) {
boolean connected = intent.getBooleanExtra(JPushInterface.EXTRA_CONNECTION_CHANGE, false);
Log.e(TAG, "[MyReceiver]" + intent.getAction() + " connected state change to " + connected);
} else {
Log.e(TAG, "[MyReceiver] Unhandled intent - " + intent.getAction());
}
}
public void settingLock(String s) {
if (TextUtils.isEmpty(s)) {

View File

@@ -130,6 +130,8 @@ public class StepService extends Service {
public void onClose(int code, String reason, boolean remote) {
super.onClose(code, reason, remote);
Log.i("JWebSocketClientService", "websocket连接关闭");
client = null;
initSocketClient();
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
}
@@ -138,6 +140,8 @@ public class StepService extends Service {
public void onError(Exception ex) {
super.onError(ex);
Log.i("JWebSocketClientService", "websocket连接错误");
client = null;
initSocketClient();
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
}