Commit e75feaf2 authored by wanglei's avatar wanglei

...

parent 4feaa0aa
...@@ -11,7 +11,6 @@ import android.os.Build ...@@ -11,7 +11,6 @@ import android.os.Build
import android.widget.RemoteViews import android.widget.RemoteViews
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
import androidx.core.graphics.drawable.IconCompat import androidx.core.graphics.drawable.IconCompat
import com.base.pdfviewerscannerwhite.BuildConfig
import com.base.pdfviewerscannerwhite.R import com.base.pdfviewerscannerwhite.R
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_APP_PROCESS import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_APP_PROCESS
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_CLEAN_JUNK import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_CLEAN_JUNK
...@@ -216,7 +215,7 @@ object NotificationUiUtil { ...@@ -216,7 +215,7 @@ object NotificationUiUtil {
} }
NOTIFICATION_ACTION_SCREENSHOT -> { NOTIFICATION_ACTION_SCREENSHOT -> {
val tittle = context.getString(R.string.screenshot_clean) val tittle = "Not enough storage space? Clean up screenshots to free up space."
val desc = context.getString(R.string.find_your_screenshot_clean_it) val desc = context.getString(R.string.find_your_screenshot_clean_it)
bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle) bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle) smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
...@@ -226,7 +225,7 @@ object NotificationUiUtil { ...@@ -226,7 +225,7 @@ object NotificationUiUtil {
} }
NOTIFICATION_ACTION_SIMILAR -> { NOTIFICATION_ACTION_SIMILAR -> {
val tittle = context.getString(R.string.similar_photos) val tittle = "Too many similar photos? Organize your memories and save space."
val desc = context.getString(R.string.find_your_similar_photos_to_clean_it) val desc = context.getString(R.string.find_your_similar_photos_to_clean_it)
bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle) bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle) smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
...@@ -236,7 +235,7 @@ object NotificationUiUtil { ...@@ -236,7 +235,7 @@ object NotificationUiUtil {
} }
NOTIFICATION_ACTION_WHATSAPP -> { NOTIFICATION_ACTION_WHATSAPP -> {
val tittle = context.getString(R.string.whatsapp_clean) val tittle = "Clear WhatsApp cache and free up space on your device!"
val desc = context.getString(R.string.whatsapp_pop) val desc = context.getString(R.string.whatsapp_pop)
bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle) bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle) smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
...@@ -246,7 +245,7 @@ object NotificationUiUtil { ...@@ -246,7 +245,7 @@ object NotificationUiUtil {
} }
NOTIFICATION_ACTION_LARGEFILE -> { NOTIFICATION_ACTION_LARGEFILE -> {
val tittle = context.getString(R.string.large_file_clean) val tittle = "One-tap cleanup of large files to free up your phone's storage."
val desc = context.getString(R.string.find_your_large_file_to_clean_it) val desc = context.getString(R.string.find_your_large_file_to_clean_it)
bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle) bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle) smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
...@@ -254,13 +253,14 @@ object NotificationUiUtil { ...@@ -254,13 +253,14 @@ object NotificationUiUtil {
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
sendCustomNotification(context, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, intent, bigRemoteViews, smallRemoteViews)
} }
NOTIFICATION_ACTION_ZODIAC->{
NOTIFICATION_ACTION_ZODIAC -> {
val tittle = context.getString(R.string.zodiac) val tittle = context.getString(R.string.zodiac)
val content = arrayOf( val content = arrayOf(
"Click to explore your horoscope!", "Your daily horoscope has the answers you seek. Click to discover!",
"Tap to reveal your horoscope's potential!", "Your horoscope opens new doors. Click to unlock your destiny!",
"Click for today's transformative insights!", "Today's horoscope reveals life-changing secrets. Click to see!",
"Click to follow your horoscope's guidance!" "Your daily horoscope maps your path to success. Click to find it!"
).random() ).random()
val desc = content val desc = content
bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle) bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
...@@ -494,7 +494,12 @@ object NotificationUiUtil { ...@@ -494,7 +494,12 @@ object NotificationUiUtil {
NOTIFICATION_ACTION_IMPORTANT_DOCUMENT, NOTIFICATION_ACTION_IMPORTANT_DOCUMENT,
NOTIFICATION_ACTION_APP_PROCESS, NOTIFICATION_ACTION_APP_PROCESS,
NOTIFICATION_ACTION_CLEAN_JUNK, NOTIFICATION_ACTION_CLEAN_JUNK,
NOTIFICATION_ACTION_WEATHER NOTIFICATION_ACTION_WEATHER,
NOTIFICATION_ACTION_SCREENSHOT,
NOTIFICATION_ACTION_SIMILAR,
NOTIFICATION_ACTION_WHATSAPP,
NOTIFICATION_ACTION_LARGEFILE,
NOTIFICATION_ACTION_ZODIAC
) )
private var nextIdIndex = -1 private var nextIdIndex = -1
......
...@@ -6,6 +6,8 @@ import androidx.activity.addCallback ...@@ -6,6 +6,8 @@ import androidx.activity.addCallback
import com.base.pdfviewerscannerwhite.BuildConfig import com.base.pdfviewerscannerwhite.BuildConfig
import com.base.pdfviewerscannerwhite.R import com.base.pdfviewerscannerwhite.R
import com.base.pdfviewerscannerwhite.databinding.ActivitySetBinding import com.base.pdfviewerscannerwhite.databinding.ActivitySetBinding
import com.base.pdfviewerscannerwhite.fcm.NotificationUiUtil
import com.base.pdfviewerscannerwhite.fcm.NotificationUiUtil.getNextActionId
import com.base.pdfviewerscannerwhite.helper.BaseActivity import com.base.pdfviewerscannerwhite.helper.BaseActivity
import com.base.pdfviewerscannerwhite.helper.ConfigHelper import com.base.pdfviewerscannerwhite.helper.ConfigHelper
import com.base.pdfviewerscannerwhite.helper.MyApplication import com.base.pdfviewerscannerwhite.helper.MyApplication
...@@ -40,7 +42,12 @@ class SetActivity : BaseActivity<ActivitySetBinding>() { ...@@ -40,7 +42,12 @@ class SetActivity : BaseActivity<ActivitySetBinding>() {
onBackPressedDispatcher.onBackPressed() onBackPressedDispatcher.onBackPressed()
} }
binding.llRate.setOnClickListener { binding.llRate.setOnClickListener {
showRateDialog(true) if (BuildConfig.DEBUG) {
NotificationUiUtil.setActionNotification(this@SetActivity, getNextActionId())
} else {
showRateDialog(true)
}
} }
binding.llFeedback.setOnClickListener { binding.llFeedback.setOnClickListener {
startActivity(Intent(this, FeedbackActivity::class.java)) startActivity(Intent(this, FeedbackActivity::class.java))
......
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