Commit 53994bec authored by wanglei's avatar wanglei

...

parent 0cb52ffc
......@@ -28,7 +28,7 @@ class NativeView(context: Context, val layout: Int, attrs: AttributeSet? = null)
.inflate(layout, this, false) as NativeAdView
runCatching {
adView.advertiserView = adView.findViewById(R.id.ad_advertiser)
// adView.advertiserView = adView.findViewById(R.id.ad_advertiser)
}
adView.mediaView = adView.findViewById(R.id.ad_media)
adView.headlineView = adView.findViewById(R.id.ad_headline)
......
......@@ -54,6 +54,11 @@ object ConstObject {
const val NOTIFICATION_ACTION_APP_PROCESS = "notification_action_app_process"
const val NOTIFICATION_ACTION_CLEAN_JUNK = "notification_action_clean_junk"
const val NOTIFICATION_ACTION_WEATHER = "notification_action_weather"
const val NOTIFICATION_ACTION_SCREENSHOT = "notification_action_screenshot"
const val NOTIFICATION_ACTION_SIMILAR = "notification_action_similar"
const val NOTIFICATION_ACTION_WHATSAPP = "notification_action_whatsapp"
const val NOTIFICATION_ACTION_LARGEFILE = "notification_action_largefile"
const val NOTIFICATION_ACTION_ZODIAC = "notification_action_zodiac"
const val SHORTCUT_SCAN_PDF = "shortcut_scan_pdf"
const val SHORTCUT_SPLIT_PDF = "shortcut_split_pdf"
......
......@@ -16,11 +16,16 @@ import com.base.pdfviewerscannerwhite.R
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_IMPORTANT_DOCUMENT
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_LARGEFILE
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_NEW_IMAGE_PDF
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_READ_DOCUMENTS
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_READ_PDF
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_SCREENSHOT
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_SIMILAR
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_UN_VIEW_FILES
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_WEATHER
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_WHATSAPP
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_ZODIAC
import com.base.pdfviewerscannerwhite.bean.WeatherBean
import com.base.pdfviewerscannerwhite.fcm.PopupConstObject.POPUP_WHERE_FCM
import com.base.pdfviewerscannerwhite.fcm.PopupConstObject.POPUP_WHERE_LOCK
......@@ -210,6 +215,61 @@ object NotificationUiUtil {
sendCustomNotification(context, intent, bigRemoteViews, smallRemoteViews)
}
NOTIFICATION_ACTION_SCREENSHOT -> {
val tittle = context.getString(R.string.screenshot_clean)
val desc = context.getString(R.string.find_your_screenshot_clean_it)
bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
sendCustomNotification(context, intent, bigRemoteViews, smallRemoteViews)
}
NOTIFICATION_ACTION_SIMILAR -> {
val tittle = context.getString(R.string.similar_photos)
val desc = context.getString(R.string.find_your_similar_photos_to_clean_it)
bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
sendCustomNotification(context, intent, bigRemoteViews, smallRemoteViews)
}
NOTIFICATION_ACTION_WHATSAPP -> {
val tittle = context.getString(R.string.whatsapp_clean)
val desc = context.getString(R.string.whatsapp_pop)
bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
sendCustomNotification(context, intent, bigRemoteViews, smallRemoteViews)
}
NOTIFICATION_ACTION_LARGEFILE -> {
val tittle = context.getString(R.string.large_file_clean)
val desc = context.getString(R.string.find_your_large_file_to_clean_it)
bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
sendCustomNotification(context, intent, bigRemoteViews, smallRemoteViews)
}
NOTIFICATION_ACTION_ZODIAC->{
val tittle = context.getString(R.string.zodiac)
val content = arrayOf(
"Click to explore your horoscope!",
"Tap to reveal your horoscope's potential!",
"Click for today's transformative insights!",
"Click to follow your horoscope's guidance!"
).random()
val desc = content
bigRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
smallRemoteViews.setTextViewText(R.id.tv_tittle, tittle)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
sendCustomNotification(context, intent, bigRemoteViews, smallRemoteViews)
}
NOTIFICATION_ACTION_READ_DOCUMENTS -> {
val tittle = context.getString(R.string.read_more_phone_documents)
val desc = context.getString(R.string.click_to_read_and_edit_your_document)
......@@ -268,19 +328,19 @@ object NotificationUiUtil {
NOTIFICATION_ACTION_CLEAN_JUNK -> {
mainScope.launch {
var size = withContext(Dispatchers.IO){ fastGetJunkSize(context)}
if (size == 0L) {
size = Random.nextLong(1024 * 5, 1024 * 10)
}
val bigRemoteViewsVar =
RemoteViews(context.packageName, R.layout.notification_junk_big)
bigRemoteViewsVar.setTextViewText(R.id.tv_size, size.toFormatSize())
val smallRemoteViewsVar =
RemoteViews(context.packageName, R.layout.notification_junk_small)
smallRemoteViewsVar.setTextViewText(R.id.tv_size, size.toFormatSize())
sendCustomNotification(context, intent, bigRemoteViewsVar, smallRemoteViewsVar)
var size = withContext(Dispatchers.IO) { fastGetJunkSize(context) }
if (size == 0L) {
size = Random.nextLong(1024 * 5, 1024 * 10)
}
val bigRemoteViewsVar =
RemoteViews(context.packageName, R.layout.notification_junk_big)
bigRemoteViewsVar.setTextViewText(R.id.tv_size, size.toFormatSize())
val smallRemoteViewsVar =
RemoteViews(context.packageName, R.layout.notification_junk_small)
smallRemoteViewsVar.setTextViewText(R.id.tv_size, size.toFormatSize())
sendCustomNotification(context, intent, bigRemoteViewsVar, smallRemoteViewsVar)
}
}
......
......@@ -22,8 +22,13 @@ import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_APP_P
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_BOOKMARK
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_CLEAN_JUNK
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_DOCUMENT
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_LARGEFILE
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_NEW_IMAGE_PDF
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_SCREENSHOT
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_SIMILAR
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_WEATHER
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_WHATSAPP
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_ZODIAC
import com.base.pdfviewerscannerwhite.bean.ConstObject.RECENT_DATA_TYPE
import com.base.pdfviewerscannerwhite.bean.ConstObject.SHORTCUT_MERGE_PDF
import com.base.pdfviewerscannerwhite.bean.ConstObject.SHORTCUT_SCAN_PDF
......@@ -35,6 +40,10 @@ import com.base.pdfviewerscannerwhite.databinding.ActivityMainBinding
import com.base.pdfviewerscannerwhite.helper.BaseActivity
import com.base.pdfviewerscannerwhite.helper.EventUtils
import com.base.pdfviewerscannerwhite.helper.MyApplication
import com.base.pdfviewerscannerwhite.mix.LargeFileCleanActivity
import com.base.pdfviewerscannerwhite.mix.ScreenshotCleanActivity
import com.base.pdfviewerscannerwhite.mix.SimilarPhotosActivity
import com.base.pdfviewerscannerwhite.mix.WhatsappCleanActivity
import com.base.pdfviewerscannerwhite.ui.appprocess.AppProcessLoadingActivity
import com.base.pdfviewerscannerwhite.ui.cleanjunk.ScanJunkActivity
import com.base.pdfviewerscannerwhite.ui.document.excel.ExcelActivity
......@@ -51,6 +60,7 @@ import com.base.pdfviewerscannerwhite.ui.view.DialogView.showStoragePermission
import com.base.pdfviewerscannerwhite.ui.view.PdfDialog.showPdfPwdDialog
import com.base.pdfviewerscannerwhite.ui.view.RateDialog.showRateDialog
import com.base.pdfviewerscannerwhite.ui.weather.WeatherInterface
import com.base.pdfviewerscannerwhite.ui.webview.WebBrowserActivity
import com.base.pdfviewerscannerwhite.utils.AppPreferences
import com.base.pdfviewerscannerwhite.utils.BarUtils
import com.base.pdfviewerscannerwhite.utils.IntentShareUtils.shareMutDocuments
......@@ -169,6 +179,26 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), MainView {
startActivity(Intent(this, WeatherInterface::class.java))
return
}
if (actionId == NOTIFICATION_ACTION_SCREENSHOT) {
startActivity(Intent(this, ScreenshotCleanActivity::class.java))
return
}
if (actionId == NOTIFICATION_ACTION_SIMILAR) {
startActivity(Intent(this, SimilarPhotosActivity::class.java))
return
}
if (actionId == NOTIFICATION_ACTION_WHATSAPP) {
startActivity(Intent(this, WhatsappCleanActivity::class.java))
return
}
if (actionId == NOTIFICATION_ACTION_LARGEFILE) {
startActivity(Intent(this, LargeFileCleanActivity::class.java))
return
}
if (actionId == NOTIFICATION_ACTION_ZODIAC) {
startActivity(Intent(this, WebBrowserActivity::class.java))
return
}
}
......
......@@ -60,7 +60,7 @@
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/ad_advertiser"
android:id="@+id/ad_body"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
......
......@@ -288,7 +288,7 @@
<string name="exit_screenshot_cleaner_content">Exit Screenshot Clean? Unremoved screenshots may be taking up space.</string>
<string name="exit_similar_photos">Exit Similar Photos</string>
<string name="exit_similar_photos_content">Exit Similar Photos? Unremoved similar photos might be occupying space.</string>
<string name="notification_clean_junk">Clean out junk fles to free up space on your phone!</string>
<string name="notification_clean_junk">Clean out junk files to free up space on your phone!</string>
<string name="notification_whatsapp_clean">Free up space by cleaning up WhatsApp junk files!</string>
<string name="notification_screenshot_clean">Clear screenshot clutter to free up space!</string>
<string name="notification_installed">Installed successfully \nClean up files from your device!</string>
......@@ -367,13 +367,10 @@
<string name="exit_large_file_clean_content">Exit Large Files? Undeleted large files may be occupying valuable space.</string>
<string name="find_your_similar_photos_to_clean_it">Find your similar photos to clean it!</string>
<string name="discover_the_feature_of_smart_pdf_reader">Discover the feature of Smart PDF Reader</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="easy_and_immersive_to_read">Easy and immersive to read</string>
<string name="go_to_start">Go to start !</string>
<string name="supports_pdf_doc_excel_ppt">Supports PDF,DOC,EXCEL,PPT</string>
<string name="pdf_toolkit_solutions">PDF Toolkit Solutions</string>
<string name="convert_multiple_file_types">Convert multiple file types</string>
</resources>
\ No newline at end of file
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