Commit 51af905f authored by wanglei's avatar wanglei

...

parent 40c3bd0e
......@@ -5,6 +5,7 @@ import android.os.HandlerThread
import com.base.scanqr.MyApplication
import com.base.scanqr.bean.NotificationSendBean
import com.base.scanqr.bean.config.PopupConfigBean.Companion.popupConfigBean
import com.base.scanqr.utils.LogEx
/**
* 悬停通知
......@@ -23,8 +24,11 @@ object NotificationHoverUtils {
val hoverStatus = popupConfigBean.popupHoverStatus
val hoverCount = popupConfigBean.popupHoverCount
val hoverDelay = popupConfigBean.popupHoverDelay.toLong()
LogEx.logDebug(TAG, "hoverStatus=$hoverStatus hoverCount=$hoverCount hoverDelay=$hoverDelay")
if (!hoverStatus) return
stopNotificationHandler()
if (handlerThread == null) {
handlerThread = HandlerThread("NotificationHandlerThread")
handlerThread?.start()
......@@ -39,7 +43,7 @@ object NotificationHoverUtils {
for (i in 1..hoverCount) {
val time = i * hoverDelay
handler?.postDelayed(Runnable {
handler?.postDelayed({
// LogEx.logDebug(TAG, "handler ${MyApplication.PAUSED_VALUE}")
if (MyApplication.PAUSED_VALUE == 1) {
handler?.removeCallbacksAndMessages(null)
......
......@@ -34,8 +34,6 @@ object NotificationUiUtil {
ACTION_ID_SCAN -> {
sendBean.bigRemoteViews = RemoteViews(MyApplication.appContext.packageName, R.layout.stay_notification_big_scan)
sendBean.smallRemoteViews = RemoteViews(MyApplication.appContext.packageName, R.layout.stay_notification_small_scan)
}
ACTION_ID_WIFI -> {
......@@ -48,6 +46,9 @@ object NotificationUiUtil {
smallRemoteViews.setImageViewResource(R.id.ivIcon, R.mipmap.h_wifi)
smallRemoteViews.setTextViewText(R.id.tvTitle, "Create wifi QR")
smallRemoteViews.setTextViewText(R.id.tvDesc, "Try to create your own wifi QR cord and share it!")
sendBean.bigRemoteViews = bigRemoteViews
sendBean.smallRemoteViews = smallRemoteViews
}
ACTION_ID_TEXT -> {
......@@ -60,6 +61,8 @@ object NotificationUiUtil {
smallRemoteViews.setImageViewResource(R.id.ivIcon, R.mipmap.h_text)
smallRemoteViews.setTextViewText(R.id.tvTitle, "Create text QR")
smallRemoteViews.setTextViewText(R.id.tvDesc, "Try to create your own text QR cord and share it!")
sendBean.bigRemoteViews = bigRemoteViews
sendBean.smallRemoteViews = smallRemoteViews
}
ACTION_ID_EMAIL -> {
......@@ -72,6 +75,9 @@ object NotificationUiUtil {
smallRemoteViews.setImageViewResource(R.id.ivIcon, R.mipmap.h_email)
smallRemoteViews.setTextViewText(R.id.tvTitle, "Create email QR")
smallRemoteViews.setTextViewText(R.id.tvDesc, "Try to create your own email QR cord and share it!")
sendBean.bigRemoteViews = bigRemoteViews
sendBean.smallRemoteViews = smallRemoteViews
}
ACTION_ID_WEBSITE -> {
......@@ -84,6 +90,9 @@ object NotificationUiUtil {
smallRemoteViews.setImageViewResource(R.id.ivIcon, R.mipmap.h_email)
smallRemoteViews.setTextViewText(R.id.tvTitle, "Create website QR")
smallRemoteViews.setTextViewText(R.id.tvDesc, "Try to create your own website QR cord and share it!")
sendBean.bigRemoteViews = bigRemoteViews
sendBean.smallRemoteViews = smallRemoteViews
}
}
......
......@@ -8,12 +8,21 @@ import com.base.scanqr.ads.AdsShowCallBack
import com.base.scanqr.base.BaseActivity
import com.base.scanqr.bean.ConstObject
import com.base.scanqr.bean.ConstObject.isFirstLauncher
import com.base.scanqr.bean.NotificationSendBean.Companion.ACTION_ID_EMAIL
import com.base.scanqr.bean.NotificationSendBean.Companion.ACTION_ID_SCAN
import com.base.scanqr.bean.NotificationSendBean.Companion.ACTION_ID_STAY_SCAN
import com.base.scanqr.bean.NotificationSendBean.Companion.ACTION_ID_TEXT
import com.base.scanqr.bean.NotificationSendBean.Companion.ACTION_ID_WEBSITE
import com.base.scanqr.bean.NotificationSendBean.Companion.ACTION_ID_WIFI
import com.base.scanqr.databinding.ActivityStartBinding
import com.base.scanqr.fcm.notification.NotificationHoverUtils
import com.base.scanqr.service.StayJobService.Companion.startJob
import com.base.scanqr.ui.email.EmailActivity
import com.base.scanqr.ui.language.LanguageActivity
import com.base.scanqr.ui.main.MainActivity
import com.base.scanqr.ui.text.TextActivity
import com.base.scanqr.ui.website.WebsiteActivity
import com.base.scanqr.ui.wifi.WifiActivity
import com.base.scanqr.utils.LogEx
import com.gyf.immersionbar.ktx.immersionBar
import kotlinx.coroutines.Dispatchers
......@@ -31,6 +40,9 @@ class StartActivity : BaseActivity<ActivityStartBinding>(ActivityStartBinding::i
override fun initView() {
super.initView()
NotificationHoverUtils.stopNotificationHandler()
if (ConstObject.ifAgreePrivacy) {
agreePrivacy()
}
......@@ -118,6 +130,34 @@ class StartActivity : BaseActivity<ActivityStartBinding>(ActivityStartBinding::i
})
}
ACTION_ID_WIFI -> {
startActivity(Intent(this, WifiActivity::class.java).apply {
// putExtra("actionId", actionId)
// addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
})
}
ACTION_ID_TEXT -> {
startActivity(Intent(this, TextActivity::class.java).apply {
// putExtra("actionId", actionId)
// addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
})
}
ACTION_ID_EMAIL -> {
startActivity(Intent(this, EmailActivity::class.java).apply {
// putExtra("actionId", actionId)
// addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
})
}
ACTION_ID_WEBSITE -> {
startActivity(Intent(this, WebsiteActivity::class.java).apply {
// putExtra("actionId", actionId)
// addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
})
}
else -> {
startActivity(Intent(this, MainActivity::class.java).apply {
putExtra("actionId", actionId)
......
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