Commit 57632ec3 authored by leichao.gao's avatar leichao.gao

update

parent 1042e555
...@@ -16,6 +16,7 @@ import com.test.easy.easycleanerjunk.R ...@@ -16,6 +16,7 @@ import com.test.easy.easycleanerjunk.R
import com.test.easy.easycleanerjunk.bean.DeviceItemBean import com.test.easy.easycleanerjunk.bean.DeviceItemBean
import com.test.easy.easycleanerjunk.databinding.ItemDeviceInfoItemBinding import com.test.easy.easycleanerjunk.databinding.ItemDeviceInfoItemBinding
import com.test.easy.easycleanerjunk.helps.BaseApplication import com.test.easy.easycleanerjunk.helps.BaseApplication
import com.test.easy.easycleanerjunk.helps.LogEx
import com.test.easy.easycleanerjunk.utils.DeviceUtilsEx.getDeviceName import com.test.easy.easycleanerjunk.utils.DeviceUtilsEx.getDeviceName
import com.test.easy.easycleanerjunk.utils.SPUtils import com.test.easy.easycleanerjunk.utils.SPUtils
import com.test.easy.easycleanerjunk.view.XmlEx.inflate import com.test.easy.easycleanerjunk.view.XmlEx.inflate
...@@ -99,6 +100,7 @@ class DeviceScanAdapter( ...@@ -99,6 +100,7 @@ class DeviceScanAdapter(
SPUtils.getInstance().put("gid", gid) SPUtils.getInstance().put("gid", gid)
data.content = gid data.content = gid
anim.end() anim.end()
LogEx.logDebug("glc",gid)
} }
} }
}) })
......
...@@ -81,8 +81,21 @@ public class NotificationUtil { ...@@ -81,8 +81,21 @@ public class NotificationUtil {
private static HandlerThread handlerThread; private static HandlerThread handlerThread;
private static Handler handler; private static Handler handler;
private fun incrementNotification() {
val key = "showNotificationCount_" + AdDisplayUtils.getInstance().getCurrentDate()
var s = AppPreferences.getInstance().getInt(key, 0)
s++
AppPreferences.getInstance().put(key, s)
}
public static void sendNotification(Context context) { public static void sendNotification(Context context) {
val currentNum = AppPreferences.getInstance().getInt("showNotificationCount_" + AdDisplayUtils.getInstance().getCurrentDate(), 0)
val maxNum = AppPreferences.getInstance().getString("maxShowNotificationCount", "156").toIntOrNull()?:156
if (currentNum >= maxNum) {
LogEx.logDebug("glc","currentNum >= maxNum")
return
}
int actionId = getNextNotificationId(); int actionId = getNextNotificationId();
EventUtils.INSTANCE.event("showNotification",null,null,false); EventUtils.INSTANCE.event("showNotification",null,null,false);
...@@ -99,7 +112,7 @@ public class NotificationUtil { ...@@ -99,7 +112,7 @@ public class NotificationUtil {
} }
sendNotification(context, actionId); sendNotification(context, actionId);
incrementNotification()
int open = SPUtils.getInstance().getInt("open", 0); int open = SPUtils.getInstance().getInt("open", 0);
if (open == 1) { if (open == 1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment