Commit e285469a authored by wanglei's avatar wanglei

...

parent bf55de0f
......@@ -110,12 +110,28 @@ class StayNotificationService : Service() {
contentView.setOnClickPendingIntent(R.id.ll_3, pendingIntent3)
expendView.setOnClickPendingIntent(R.id.ll_3, pendingIntent3)
val requestCode4 = Random.nextInt(1800)
val intent4 = Intent(context, SplashActivity::class.java).apply {
putExtra("actionId", ConstObject.NOTIFICATION_ACTION_NEW_IMAGE_PDF)
}
val pendingIntent4 =
PendingIntent.getActivity(
context,
requestCode4,
intent4,
PendingIntent.FLAG_IMMUTABLE
)
contentView.setOnClickPendingIntent(R.id.ll_4, pendingIntent4)
expendView.setOnClickPendingIntent(R.id.ll_4, pendingIntent4)
val builder = NotificationCompat.Builder(context, channelId)
val smallIcon = IconCompat.createFromIcon(
context, Icon.createWithResource(
MyApplication.context, R.mipmap.logo
)
)
smallIcon?.let {
builder.setSmallIcon(smallIcon) //设置状态栏内的小图标
}
......
......@@ -17,6 +17,7 @@ import com.base.pdfviewerscannerwhite.bean.ConstObject.BOOKMARK_DATA_TYPE
import com.base.pdfviewerscannerwhite.bean.ConstObject.DOCUMENT_DATA_TYPE
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_BOOKMARK
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_DOCUMENT
import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_NEW_IMAGE_PDF
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
......@@ -104,23 +105,30 @@ class MainActivity : BaseActivity<ActivityMain2Binding>(), MainView {
private fun actionIdOperation() {
if (actionId == SHORTCUT_SCAN_PDF) {
mainPresenter.starAdGmsScan(this)
useGmsScanFunction()
}
if (actionId == SHORTCUT_SPLIT_PDF) {
startActivity(Intent(this, PdfSelectActivity::class.java).apply {
putExtra("doWhat", ConstObject.DO_SPLIT_PDF)
})
return
}
if (actionId == SHORTCUT_MERGE_PDF) {
startActivity(Intent(this, PdfSelectActivity::class.java).apply {
putExtra("doWhat", ConstObject.DO_MERGE_PDF)
})
return
}
if (actionId == NOTIFICATION_ACTION_DOCUMENT) {
binding.llDocument.callOnClick()
return
}
if (actionId == NOTIFICATION_ACTION_BOOKMARK) {
binding.llBookmark.callOnClick()
return
}
if (actionId == NOTIFICATION_ACTION_NEW_IMAGE_PDF) {
useGmsScanFunction()
}
}
......@@ -179,11 +187,11 @@ class MainActivity : BaseActivity<ActivityMain2Binding>(), MainView {
return
}
val restUmpCount = AppPreferences.getInstance().getString("restUmpCount", "50").toInt()
//ump请求重置
if (mainStartTimes % restUmpCount == 0) {
UmpUtils.umpCalled = false
}
// val restUmpCount = AppPreferences.getInstance().getString("restUmpCount", "50").toInt()
// //ump请求重置
// if (mainStartTimes % restUmpCount == 0) {
// UmpUtils.umpCalled = false
// }
mainPresenter.initAllDocumentData()
......
......@@ -16,6 +16,7 @@ import com.base.pdfviewerscannerwhite.bean.ConstObject.isFirstStart
import com.base.pdfviewerscannerwhite.databinding.ActivitySplash2Binding
import com.base.pdfviewerscannerwhite.fcm.NotificationHoverUtils
import com.base.pdfviewerscannerwhite.helper.BaseActivity
import com.base.pdfviewerscannerwhite.helper.EventUtils
import com.base.pdfviewerscannerwhite.helper.MyApplication
import com.base.pdfviewerscannerwhite.service.StayNotificationService.Companion.startStayNotification
import com.base.pdfviewerscannerwhite.ui.main.MainActivity
......@@ -118,6 +119,7 @@ class SplashActivity : BaseActivity<ActivitySplash2Binding>(), SplashView {
LogEx.logDebug(TAG, "UmpUtils.callback $it")
(application as MyApplication).initSolarEngine(it)
agreePrivacy()
EventUtils.event("ump", "umpCanAd=$umpCanAd")
}
requestUMP(this)
} else {
......
......@@ -80,4 +80,32 @@
</LinearLayout>
<LinearLayout
android:id="@+id/ll_4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/imagepdf_notifi"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="2dp"
android:includeFontPadding="false"
android:text="Image PDF"
android:textColor="@color/black"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
\ 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