From f54cb905f9cc1e3d6d0726c1ddd3bd480dcfad34 Mon Sep 17 00:00:00 2001 From: renhaoting <370797079@qq.com> Date: Fri, 19 Dec 2025 16:08:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=81=E4=B9=85=E5=8C=96=E9=80=9A=E7=9F=A5+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gamedog/vididin/main/MainActivity.kt | 40 ++++++++----------- .../layout/layout_notification_resident.xml | 1 + .../layout_notification_resident_12.xml | 1 + 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/com/gamedog/vididin/main/MainActivity.kt b/app/src/main/java/com/gamedog/vididin/main/MainActivity.kt index b51e495..35ac6b6 100644 --- a/app/src/main/java/com/gamedog/vididin/main/MainActivity.kt +++ b/app/src/main/java/com/gamedog/vididin/main/MainActivity.kt @@ -69,6 +69,8 @@ class MainActivity : AppViewsActivity(), OnTabS override fun ViewBinding.initViews() { + activityLauncher = ActivityLauncher(this@MainActivity) + navigatorAdapter = MainTabsAdapter( this@MainActivity, viewPager2, fragmentStateAdapter, magicIndicator ) @@ -132,19 +134,7 @@ class MainActivity : AppViewsActivity(), OnTabS } override fun ViewBinding.initObservers() { - activityLauncher = ActivityLauncher(this@MainActivity) - - NotificationController.requestNotificationPermissionAsAsync( - context = this@MainActivity, - lifecycleScope = lifecycleScope, - activityLauncher = activityLauncher!!, - position = "Appstart", - onGrantedOnlyUnauthorized = { isGranted-> - if(isGranted){ - NotificationKeepAliveServiceManager.startKeepAliveService(this@MainActivity) - } - }) - + checkNotifyPermissionAndStartService() handleNotificationAction() reportStatistics(intent, true) } @@ -183,17 +173,6 @@ class MainActivity : AppViewsActivity(), OnTabS private fun handleNotificationAction() { if (NotificationLandingController.isFromNotification(intent)) { when (intent.getIntExtra(LANDING_NOTIFICATION_ACTION, -1)) { - PushContent.ACTION_TYPE_SCREENSHOT_CLEAN -> { - //TYPE_PHOTO_SHOT.jumpTo(this@HomeActivity) - } - - PushContent.ACTION_TYPE_RECOVERED_FILES -> { - /*checkPermissionAndExecute(activityLauncher!!) { - val intent = Intent(this, TabLayoutActivity::class.java) - startActivity(intent) - }*/ - } - PushContent.ACTION_TYPE_GAME -> { AndroidUtil.openUrl(VidiConst.URL_GAME) } @@ -215,6 +194,19 @@ class MainActivity : AppViewsActivity(), OnTabS } } + private fun checkNotifyPermissionAndStartService() { + NotificationController.requestNotificationPermissionAsAsync( + context = this, + lifecycleScope = lifecycleScope, + activityLauncher = activityLauncher!!, + position = "Appstart", + onGrantedOnlyUnauthorized = { isGranted-> + if(isGranted){ + NotificationKeepAliveServiceManager.startKeepAliveService(this) + } + }) + } + private fun reportStatistics(intent: Intent, isFromNewIntent: Boolean) { // AppOpen diff --git a/notification/src/main/res/layout/layout_notification_resident.xml b/notification/src/main/res/layout/layout_notification_resident.xml index f748b33..a1a0a30 100644 --- a/notification/src/main/res/layout/layout_notification_resident.xml +++ b/notification/src/main/res/layout/layout_notification_resident.xml @@ -53,6 +53,7 @@ android:layout_gravity="top" android:scaleType="fitCenter" android:src="@drawable/vidi_icon_close" + android:visibility="gone" /> diff --git a/notification/src/main/res/layout/layout_notification_resident_12.xml b/notification/src/main/res/layout/layout_notification_resident_12.xml index 68de98f..1c1cb4a 100644 --- a/notification/src/main/res/layout/layout_notification_resident_12.xml +++ b/notification/src/main/res/layout/layout_notification_resident_12.xml @@ -59,6 +59,7 @@ android:layout_gravity="top" android:scaleType="fitCenter" android:src="@drawable/vidi_icon_close" + android:visibility="gone" />