Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
SuperEasyClean
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songjianyu
SuperEasyClean
Commits
97a304e2
Commit
97a304e2
authored
Jun 03, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
1f4fded5
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
265 additions
and
790 deletions
+265
-790
build.gradle.kts
app/build.gradle.kts
+83
-31
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+7
-42
ConstObject.kt
app/src/main/java/com/base/appzxhy/ConstObject.kt
+7
-16
MyApplication.kt
app/src/main/java/com/base/appzxhy/MyApplication.kt
+15
-20
BaseActivity.kt
app/src/main/java/com/base/appzxhy/base/BaseActivity.kt
+7
-6
FunctionUIBean.kt
app/src/main/java/com/base/appzxhy/bean/FunctionUIBean.kt
+0
-8
HomeTabUIBean.kt
app/src/main/java/com/base/appzxhy/bean/HomeTabUIBean.kt
+0
-6
LanguageBean.kt
app/src/main/java/com/base/appzxhy/bean/LanguageBean.kt
+0
-29
NotificationInfoBean.kt
...c/main/java/com/base/appzxhy/bean/NotificationInfoBean.kt
+16
-0
NotificationSendBean.kt
...c/main/java/com/base/appzxhy/bean/NotificationSendBean.kt
+1
-2
AdsMgr.kt
app/src/main/java/com/base/appzxhy/business/ads/AdsMgr.kt
+31
-29
NativeParentView.kt
...in/java/com/base/appzxhy/business/ads/NativeParentView.kt
+18
-5
AdBannerMgr.kt
...n/java/com/base/appzxhy/business/ads/admob/AdBannerMgr.kt
+2
-3
AdInterMgr.kt
...in/java/com/base/appzxhy/business/ads/admob/AdInterMgr.kt
+6
-6
AdNativeMgr.kt
...n/java/com/base/appzxhy/business/ads/admob/AdNativeMgr.kt
+3
-3
AdOpenMgr.kt
...ain/java/com/base/appzxhy/business/ads/admob/AdOpenMgr.kt
+6
-6
AdmobEvent.kt
...in/java/com/base/appzxhy/business/ads/admob/AdmobEvent.kt
+5
-5
AdMaxEvent.kt
...java/com/base/appzxhy/business/ads/applovin/AdMaxEvent.kt
+3
-3
MaxInsertMgr.kt
...va/com/base/appzxhy/business/ads/applovin/MaxInsertMgr.kt
+6
-6
MaxNativeMgr.kt
...va/com/base/appzxhy/business/ads/applovin/MaxNativeMgr.kt
+3
-3
MaxOpenMgr.kt
...java/com/base/appzxhy/business/ads/applovin/MaxOpenMgr.kt
+5
-5
FcmReceiver.kt
...in/java/com/base/appzxhy/business/push/fcm/FcmReceiver.kt
+1
-1
MessagingService.kt
...va/com/base/appzxhy/business/push/fcm/MessagingService.kt
+1
-1
MyNotificationManager.kt
...pzxhy/business/push/notification/MyNotificationManager.kt
+5
-10
NotificationBeanUtils.kt
...pzxhy/business/push/notification/NotificationBeanUtils.kt
+1
-2
NotificationUiUtil.kt
.../appzxhy/business/push/notification/NotificationUiUtil.kt
+9
-23
StayNotification.kt
...ava/com/base/appzxhy/business/service/StayNotification.kt
+2
-2
LanguageAdapter.kt
.../main/java/com/base/appzxhy/ui/adapter/LanguageAdapter.kt
+0
-40
HomeFragment.kt
app/src/main/java/com/base/appzxhy/ui/main/HomeFragment.kt
+0
-10
MainActivity.kt
app/src/main/java/com/base/appzxhy/ui/main/MainActivity.kt
+1
-129
StartActivity.kt
app/src/main/java/com/base/appzxhy/ui/start/StartActivity.kt
+0
-70
StartViewModel.kt
...src/main/java/com/base/appzxhy/ui/start/StartViewModel.kt
+0
-42
NotificationDialog.kt
...main/java/com/base/appzxhy/ui/views/NotificationDialog.kt
+0
-53
activity_start.xml
app/src/main/res/layout/activity_start.xml
+0
-21
dialog_notification_turn_on.xml
app/src/main/res/layout/dialog_notification_turn_on.xml
+0
-69
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+0
-14
item_home_tab.xml
app/src/main/res/layout/item_home_tab.xml
+0
-27
item_language.xml
app/src/main/res/layout/item_language.xml
+0
-17
stay_notification_big.xml
app/src/main/res/layout/stay_notification_big.xml
+0
-0
stay_notification_small.xml
app/src/main/res/layout/stay_notification_small.xml
+0
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-6
build.gradle.kts
build.gradle.kts
+3
-3
debug-release-key.keystore
debug-release-key.keystore
+0
-0
libs.versions.toml
gradle/libs.versions.toml
+4
-15
gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+1
-1
settings.gradle.kts
settings.gradle.kts
+12
-0
No files found.
app/build.gradle.kts
View file @
97a304e2
...
...
@@ -6,43 +6,81 @@ plugins {
alias
(
libs
.
plugins
.
kotlin
.
android
)
id
(
"com.google.gms.google-services"
)
id
(
"com.google.firebase.crashlytics"
)
id
(
"com.google.devtools.ksp"
)
// id("com.google.devtools.ksp")
id
(
"org.jetbrains.kotlin.kapt"
)
}
android
{
namespace
=
"com.base.appzxhy"
compileSdk
=
3
4
compileSdk
=
3
5
defaultConfig
{
applicationId
=
"com.base.appzxhy"
applicationId
=
"com.base.appzxhy"
// "com.link.play.fit.ai.test1"
minSdk
=
24
targetSdk
=
3
4
targetSdk
=
3
5
versionCode
=
1
versionName
=
"1.0"
testInstrumentationRunner
=
"androidx.test.runner.AndroidJUnitRunner"
fun
Long
.
toFormatTime3
():
String
{
return
SimpleDateFormat
(
"yyyy-MM-dd-HH-mm-ss"
,
Locale
.
ENGLISH
).
format
(
this
)
}
setProperty
(
"archivesBaseName"
,
"appzxhy-v$versionName($versionCode)-${System.currentTimeMillis().toFormatTime3()}"
)
signingConfigs
{
create
(
"release"
)
{
//E6:A2:DD:0A:E6:73:22:32:4E:98:08:78:73:29:01:C4:8D:A0:38:DB:D8:B2:DD:B9:AC:55:69:B2:6B:DF:B0:B4
storeFile
=
file
(
"../smartcl.jks"
)
storePassword
=
"123456"
keyAlias
=
"key0"
keyPassword
=
"123456"
}
ndk
{
// 设置支持的 ABI 架构
abiFilters
.
add
(
"x86"
)
abiFilters
.
add
(
"x86_64"
)
abiFilters
.
add
(
"armeabi-v7a"
)
abiFilters
.
add
(
"arm64-v8a"
)
//最常用
}
}
signingConfigs
{
getByName
(
"debug"
)
{
storeFile
=
file
(
"../debug-release-key.keystore"
)
storePassword
=
"123456"
keyPassword
=
"123456"
keyAlias
=
"my_alias"
enableV1Signing
=
true
enableV2Signing
=
true
enableV3Signing
=
true
}
create
(
"release"
)
{
storeFile
=
file
(
"../debug-release-key.keystore"
)
storePassword
=
"123456"
keyPassword
=
"123456"
keyAlias
=
"my_alias"
enableV1Signing
=
true
enableV2Signing
=
true
enableV3Signing
=
true
}
}
buildTypes
{
release
{
isMinifyEnabled
=
true
proguardFiles
(
getDefaultProguardFile
(
"proguard-android-optimize.txt"
),
"proguard-rules.pro"
)
isDebuggable
=
false
isShrinkResources
=
true
isJniDebuggable
=
false
proguardFiles
(
getDefaultProguardFile
(
"proguard-android-optimize.txt"
),
"proguard-rules.pro"
)
signingConfig
=
signingConfigs
.
getByName
(
"release"
)
}
debug
{
// applicationIdSuffix = ".debug"
isMinifyEnabled
=
false
isDebuggable
=
true
isShrinkResources
=
false
proguardFiles
(
getDefaultProguardFile
(
"proguard-android-optimize.txt"
),
"proguard-rules.pro"
)
signingConfig
=
signingConfigs
.
getByName
(
"debug"
)
}
}
compileOptions
{
sourceCompatibility
=
JavaVersion
.
VERSION_1_8
...
...
@@ -56,6 +94,14 @@ android {
viewBinding
=
true
buildConfig
=
true
}
// splits {
// abi {
// isEnable = true // 启用 ABI 分包
// reset() // 清空默认列表
// include("x86", "x86_64", "armeabi-v7a", "arm64-v8a") // 指定包含的 ABI
// isUniversalApk = true // 是否生成通用 APK(包含所有 ABI)
// }
// }
}
...
...
@@ -67,9 +113,10 @@ gradle.taskGraph.whenReady {
}
}
dependencies
{
implementation
(
fileTree
(
mapOf
(
"dir"
to
"libs"
,
"include"
to
listOf
(
"*.jar"
))))
implementation
(
libs
.
androidx
.
core
.
ktx
)
implementation
(
libs
.
androidx
.
appcompat
)
implementation
(
libs
.
material
)
...
...
@@ -81,40 +128,43 @@ dependencies {
androidTestImplementation
(
libs
.
androidx
.
junit
)
androidTestImplementation
(
libs
.
androidx
.
espresso
.
core
)
//网络请求
implementation
(
"com.google.code.gson:gson:2.11.0"
)
// 语种切换框架:https://github.com/getActivity/MultiLanguages
implementation
(
"com.github.getActivity:MultiLanguages:9.3"
)
// 沉浸式状态栏,基础依赖包,必须要依赖
api
(
libs
.
immersionbar
)
// 沉浸式状态栏kotlin扩展(可选)
api
(
libs
.
immersionbar
.
ktx
)
//solar 归因
implementation
(
"com.reyun.solar.engine.oversea:solar-engine-core:1.2.8.3"
)
//网络
implementation
(
"com.squareup.okhttp3:okhttp:4.9.0"
)
implementation
(
"com.squareup.okhttp3:logging-interceptor:4.9.0"
)
implementation
(
"com.google.code.gson:gson:2.10.1"
)
//第三方UI控件
implementation
(
"io.github.cymchad:BaseRecyclerViewAdapterHelper4:4.1.4"
)
implementation
(
"com.github.angcyo.DslTablayout:TabLayout:3.7.1"
)
//lottie
implementation
(
"com.airbnb.android:lottie:6.4.0"
)
implementation
(
"com.github.bumptech.glide:glide:4.16.0"
)
// annotationProcessor("com.github.bumptech.glide:compiler:4.16.0")
ksp
(
"com.github.bumptech.glide:compiler:4.16.0"
)
kapt
(
"com.github.bumptech.glide:compiler:4.16.0"
)
implementation
(
"jp.wasabeef:glide-transformations:4.3.0"
)
//可选
// implementation("com.github.angcyo.DslTablayout:ViewPager1Delegate:3.7.1")
//可选
implementation
(
"com.github.angcyo.DslTablayout:ViewPager2Delegate:3.7.1"
)
implementation
(
"io.supercharge:shimmerlayout:2.1.0"
)
//solar 归因
implementation
(
"com.reyun.solar.engine.oversea:solar-engine-core:1.2.8.3"
)
//facebook
implementation
(
"com.facebook.android:facebook-android-sdk:[8,9)"
)
//firebase
implementation
(
platform
(
"com.google.firebase:firebase-bom:32.3.1"
))
implementation
(
"com.google.firebase:firebase-messaging"
)
implementation
(
"com.google.firebase:firebase-messaging-directboot"
)
implementation
(
"com.google.firebase:firebase-analytics-ktx"
)
implementation
(
"com.google.firebase:firebase-crashlytics"
)
implementation
(
"com.google.firebase:firebase-config"
)
//facebook
implementation
(
"com.facebook.android:facebook-android-sdk:[8,9)"
)
//广告
//admob渠道
implementation
(
libs
.
vungle
)
...
...
@@ -131,10 +181,12 @@ dependencies {
implementation
(
libs
.
applovin
.
pangle
)
//pangle
implementation
(
libs
.
applovin
.
vungle
)
//vungle
//work
implementation
(
"androidx.work:work-runtime-ktx:
2.7.1"
)
// 请使用最新版本
val
work_version
=
"2.8.1"
implementation
(
"androidx.work:work-runtime-ktx:
$work_version"
)
val
billing_version
=
"7.1.1"
implementation
(
"com.android.billingclient:billing:$billing_version"
)
implementation
(
"com.android.billingclient:billing-ktx:$billing_version"
)
}
\ No newline at end of file
app/src/main/AndroidManifest.xml
View file @
97a304e2
...
...
@@ -17,22 +17,16 @@
android:supportsRtl=
"true"
android:theme=
"@style/Theme.LocalWeatherWhite"
tools:targetApi=
"31"
>
<activity
android:name=
".ui.start.StartActivity"
android:exported=
"true"
android:launchMode=
"singleTask"
android:theme=
"@style/splash.theme"
>
android:name=
".ui.main.MainActivity"
android:exported=
"true"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".ui.main.MainActivity"
android:exported=
"true"
>
</activity>
<provider
android:name=
"androidx.core.content.FileProvider"
...
...
@@ -45,7 +39,7 @@
</provider>
<receiver
android:name=
".
fcm.alarm
.AlarmReceiver"
android:name=
".
push.receiver
.AlarmReceiver"
android:enabled=
"true"
android:exported=
"true"
android:permission=
"android.permission.RECEIVE_BOOT_COMPLETED"
>
...
...
@@ -73,44 +67,14 @@
<data
android:scheme=
"file"
/>
</intent-filter>
</receiver>
<receiver
android:name=
".fcm.receiver.FileJobReceiver"
android:enabled=
"true"
android:exported=
"true"
>
<intent-filter>
<action
android:name=
"android.intent.action.USER_PRESENT"
/>
<action
android:name=
"android.intent.action.TIMEZONE_CHANGED"
/>
<action
android:name=
"android.intent.action.MY_PACKAGE_REPLACED"
/>
<action
android:name=
"android.intent.action.ACTION_POWER_CONNECTED"
/>
<action
android:name=
"android.intent.action.ACTION_POWER_DISCONNECTED"
/>
</intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.PACKAGE_ADDED"
/>
<action
android:name=
"android.intent.action.PACKAGE_REMOVED"
/>
<action
android:name=
"android.intent.action.PACKAGE_REPLACED"
/>
<data
android:scheme=
"package"
/>
</intent-filter>
<intent-filter>
<action
android:name=
"android.net.wifi.WIFI_STATE_CHANGED"
/>
<action
android:name=
"android.net.wifi.STATE_CHANGE"
/>
</intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MEDIA_EJECT"
/>
<action
android:name=
"android.intent.action.MEDIA_MOUNTED"
/>
<data
android:scheme=
"file"
/>
</intent-filter>
</receiver>
<service
android:name=
".business.service.StayJobService"
android:exported=
"false"
android:foregroundServiceType=
"dataSync"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".fcm.MessagingService"
android:name=
".
business.push.
fcm.MessagingService"
android:exported=
"false"
>
<intent-filter>
<action
android:name=
"com.google.firebase.MESSAGING_EVENT"
/>
...
...
@@ -118,7 +82,7 @@
</service>
<receiver
android:name=
".fcm.FcmReceiver"
android:name=
".
business.push.
fcm.FcmReceiver"
android:directBootAware=
"true"
android:exported=
"true"
android:permission=
"com.google.android.c2dm.permission.SEND"
>
...
...
@@ -136,6 +100,7 @@
<meta-data
android:name=
"com.facebook.sdk.ApplicationId"
android:value=
"@string/facebook_app_id"
/>
</application>
</manifest>
\ No newline at end of file
app/src/main/java/com/base/appzxhy/
bean/
ConstObject.kt
→
app/src/main/java/com/base/appzxhy/ConstObject.kt
View file @
97a304e2
package
com.base.appzxhy
.bean
package
com.base.appzxhy
import
com.base.appzxhy.utils.AppPreferences
import
java.util.Locale
object
ConstObject
{
var
is
FirstLauncher
=
tru
e
var
is
Guided
=
fals
e
get
()
{
return
AppPreferences
.
getInstance
().
getBoolean
(
"is
FirstLauncher
"
,
field
)
return
AppPreferences
.
getInstance
().
getBoolean
(
"is
Guided
"
,
field
)
}
set
(
value
)
{
field
=
value
AppPreferences
.
getInstance
().
put
(
"is
FirstLauncher
"
,
value
,
true
)
AppPreferences
.
getInstance
().
put
(
"is
Guided
"
,
value
,
true
)
}
var
appLanguageSp
=
Locale
.
getDefault
().
language
var
appLanguageSp
:
String
=
Locale
.
getDefault
().
language
get
()
{
return
AppPreferences
.
getInstance
().
getString
(
"languageSp"
,
field
)
}
...
...
@@ -25,7 +23,7 @@ object ConstObject {
AppPreferences
.
getInstance
().
put
(
"languageSp"
,
value
,
true
)
}
var
appLanguageCountrySp
=
Locale
.
getDefault
().
country
var
appLanguageCountrySp
:
String
=
Locale
.
getDefault
().
country
get
()
{
return
AppPreferences
.
getInstance
().
getString
(
"languageCountrySp"
,
field
)
}
...
...
@@ -34,12 +32,5 @@ object ConstObject {
AppPreferences
.
getInstance
().
put
(
"languageCountrySp"
,
value
,
true
)
}
var
noShowFriendsShareGuide
=
false
get
()
{
return
AppPreferences
.
getInstance
().
getBoolean
(
"noShowFriendsShareGuide"
,
field
)
}
set
(
value
)
{
field
=
value
AppPreferences
.
getInstance
().
put
(
"noShowFriendsShareGuide"
,
value
,
true
)
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/MyApplication.kt
View file @
97a304e2
package
com.base.appzxhy
import
AlarmUtils.startAlarm
import
android.app.Activity
import
android.app.Application
import
android.content.Context
import
android.os.Bundle
import
android.text.TextUtils
import
android.util.Log
import
com.base.appzxhy.ads.AdsMgr
import
com.base.appzxhy.bean.ConstObject.appLanguageCountrySp
import
com.base.appzxhy.bean.ConstObject.appLanguageSp
import
com.base.appzxhy.bean.config.AdConfigBean
import
com.base.appzxhy.bean.config.ConfigBean
import
com.base.appzxhy.bean.config.PopupConfigBean
import
com.base.appzxhy.fcm.FCMManager
import
com.base.appzxhy.fcm.notification.MyNotificationManager
import
com.base.appzxhy.fcm.timer.TimerManager.Companion.changeTimer
import
com.base.appzxhy.fcm.receiver.BatteryStatusReceiver
import
com.base.appzxhy.fcm.receiver.PackageStatusReceiver
import
com.base.appzxhy.fcm.receiver.ScreenStatusReceiver
import
com.base.appzxhy.fcm.work.RepeatingWorker.Companion.schedulePeriodicWork
import
com.base.appzxhy.business.helper.EventUtils
import
com.base.appzxhy.business.helper.InstallHelps
import
com.base.appzxhy.business.helper.NewComUtils
import
com.base.appzxhy.business.service.StayJobService.Companion.startJob
import
com.base.appzxhy.ui.start.StartActivity
import
com.base.appzxhy.utils.ActivityManagerUtils
import
com.base.appzxhy.utils.AppPreferences
import
com.base.appzxhy.utils.LogEx
import
com.base.appzxhy.utils.SolarEngineUtils.initSolarEngine
import
com.base.appzxhy.utils.SolarEngineUtils.solarkey
import
com.didi.drouter.api.DRouter
import
com.facebook.FacebookSdk
import
com.google.android.gms.ads.identifier.AdvertisingIdClient
import
com.google.gson.Gson
...
...
@@ -40,6 +24,18 @@ import com.reyun.solar.engine.SolarEngineManager
import
org.json.JSONObject
import
java.util.Locale
import
java.util.UUID
import
com.base.appzxhy.ConstObject.appLanguageSp
import
com.base.appzxhy.ConstObject.appLanguageCountrySp
import
com.base.appzxhy.bean.config.AdConfigBean
import
com.base.appzxhy.bean.config.ConfigBean
import
com.base.appzxhy.bean.config.PopupConfigBean
import
com.base.appzxhy.business.ads.AdsMgr
import
com.base.appzxhy.push.fcm.FCMManager
import
com.base.appzxhy.push.notification.MyNotificationManager
import
com.base.appzxhy.push.receiver.AlarmReceiver.Companion.startAlarm
import
com.base.appzxhy.push.receiver.ScreenStatusReceiver
import
com.base.appzxhy.push.timer.TimerManager.Companion.changeTimer
import
com.base.appzxhy.push.work.RepeatingWorker.Companion.schedulePeriodicWork
class
MyApplication
:
Application
()
{
...
...
@@ -59,7 +55,7 @@ class MyApplication : Application() {
"adActivity"
,
"AdActivity"
,
"AppLovinFullscreenActivity"
,
StartActivity
::
class
.
java
.
simpleName
,
//
StartActivity::class.java.simpleName,
// 返回前台时不跳转启动页的 activity
)
}
...
...
@@ -69,7 +65,6 @@ class MyApplication : Application() {
super
.
onCreate
()
appContext
=
this
DRouter
.
init
(
this
)
initUUid
()
initGid
()
...
...
@@ -140,8 +135,8 @@ class MyApplication : Application() {
initLifeListener
()
ScreenStatusReceiver
.
registerScreenStatusReceiver
(
this
)
PackageStatusReceiver
.
registerPackageStatusReceiver
(
this
)
BatteryStatusReceiver
.
registerBatteryStatusReceiver
(
this
)
//
PackageStatusReceiver.registerPackageStatusReceiver(this)
//
BatteryStatusReceiver.registerBatteryStatusReceiver(this)
//workManager
schedulePeriodicWork
(
appContext
)
...
...
app/src/main/java/com/base/appzxhy/base/BaseActivity.kt
View file @
97a304e2
...
...
@@ -15,9 +15,9 @@ import androidx.core.view.ViewCompat
import
androidx.core.view.WindowInsetsCompat
import
androidx.lifecycle.lifecycleScope
import
androidx.viewbinding.ViewBinding
import
com.base.appzxhy.ConstObject.appLanguageCountrySp
import
com.base.appzxhy.ConstObject.appLanguageSp
import
com.base.appzxhy.R
import
com.base.appzxhy.bean.ConstObject.appLanguageCountrySp
import
com.base.appzxhy.bean.ConstObject.appLanguageSp
import
com.base.appzxhy.business.helper.EventUtils
import
com.base.appzxhy.ui.main.MainActivity
import
com.base.appzxhy.utils.ActivityLauncher
...
...
@@ -32,13 +32,16 @@ import kotlinx.coroutines.flow.collectLatest
import
kotlinx.coroutines.launch
import
java.util.Locale
import
java.util.concurrent.atomic.AtomicBoolean
import
kotlin.apply
import
kotlin.jvm.java
import
kotlin.jvm.javaClass
import
kotlin.random.Random
import
kotlin.text.contains
abstract
class
BaseActivity
<
VB
:
ViewBinding
>(
bindingInflater
:
(
LayoutInflater
)
->
VB
)
:
AppCompatActivity
()
{
open
val
TAG
=
javaClass
.
simpleName
private
val
tagNo
=
Random
.
nextInt
(
500
)
val
binding
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
...
...
@@ -69,7 +72,6 @@ abstract class BaseActivity<VB : ViewBinding>(
}
}
protected
open
fun
actionVpn
(
isVpn
:
Boolean
)
{
// if (configBean.vpnCanUse) return
// if (isVpn) {
...
...
@@ -123,7 +125,6 @@ abstract class BaseActivity<VB : ViewBinding>(
super
.
attachBaseContext
(
MultiLanguages
.
attach
(
newBase
))
}
fun
changeLanguage
(
currentActivity
:
Activity
,
bundle
:
Bundle
=
Bundle
()):
Boolean
{
val
spLanguage
=
Locale
(
appLanguageSp
,
appLanguageCountrySp
)
val
flag
=
currentLocale
!=
spLanguage
...
...
@@ -171,7 +172,6 @@ abstract class BaseActivity<VB : ViewBinding>(
return
TAG
.
contains
(
"MainActivity"
)
}
/**
* 避免在onResume--onPause周期内,多次调用
* 在onStop中重置标志
...
...
@@ -234,4 +234,5 @@ abstract class BaseActivity<VB : ViewBinding>(
}
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/bean/FunctionUIBean.kt
deleted
100644 → 0
View file @
1f4fded5
package
com.base.appzxhy.bean
class
FunctionUIBean
(
val
key
:
String
=
""
,
val
icon
:
Int
=
0
,
val
desc
:
String
=
""
)
{
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/bean/HomeTabUIBean.kt
deleted
100644 → 0
View file @
1f4fded5
package
com.base.appzxhy.bean
data class
HomeTabUIBean
(
val
icon
:
Int
,
val
tab
:
String
)
\ No newline at end of file
app/src/main/java/com/base/appzxhy/bean/LanguageBean.kt
deleted
100644 → 0
View file @
1f4fded5
package
com.base.appzxhy.bean
data class
LanguageBean
(
val
key
:
String
,
val
language
:
String
,
val
country
:
String
,
)
{
var
isSelect
:
Boolean
=
false
companion
object
{
const
val
English
=
"English"
const
val
简体中文 = "简体中文"
const
val
português
=
"português"
const
val
Español
=
"Español "
const
val
Français
=
"Français"
const
val
Deutsch
=
"Deutsch"
const
val
ไทย = "ไทย"
const
val
Bahasa_Indonesia
=
"Bahasa Indonesia"
const
val
Melayu
=
"Melayu"
const
val
Tiếng_Việt
=
"Tiếng Việt"
const
val
日本語 = "日本語"
const
val
Italiano
=
"Italiano"
const
val
한국인 = "한국인"
const
val
Nederlands
=
"Nederlands"
const
val
繁體中文 = "繁體中文"
const
val
Türk
=
"Türk"
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/bean/NotificationInfoBean.kt
0 → 100644
View file @
97a304e2
package
com.base.appzxhy.bean
import
android.graphics.Bitmap
import
kotlinx.serialization.Serializable
@Serializable
data class
NotificationInfoBean
(
val
id
:
Int
,
val
title
:
String
,
val
content
:
String
,
val
imageUrl
:
String
,
val
linkUrl
:
String
,
)
{
@Transient
var
bitmap
:
Bitmap
?
=
null
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/bean/NotificationSendBean.kt
View file @
97a304e2
...
...
@@ -30,7 +30,6 @@ class NotificationSendBean(
const
val
POPUP_WHERE_TIMER
=
"Timer"
const
val
ACTION_ID_STAY_SCAN
=
"action_id_scan_1"
const
val
ACTION_ID_SCAN
=
"action_id_scan_2"
const
val
ACTION_ID_TEST
=
"action_id_test"
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/business/ads/AdsMgr.kt
View file @
97a304e2
...
...
@@ -9,18 +9,19 @@ import com.applovin.sdk.AppLovinSdk
import
com.applovin.sdk.AppLovinSdkInitializationConfiguration
import
com.base.appzxhy.BuildConfig
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.ads.admob.AdBannerMgr
import
com.base.appzxhy.ads.admob.AdInterMgr
import
com.base.appzxhy.ads.admob.AdNativeMgr
import
com.base.appzxhy.ads.admob.AdOpenMgr
import
com.base.appzxhy.ads.admob.AdmobEvent
import
com.base.appzxhy.ads.applovin.AdMaxEvent
import
com.base.appzxhy.ads.applovin.MaxInsertMgr
import
com.base.appzxhy.ads.applovin.MaxNativeMgr
import
com.base.appzxhy.ads.applovin.MaxOpenMgr
import
com.base.appzxhy.MyApplication
import
com.base.appzxhy.bean.config.AdConfigBean
import
com.base.appzxhy.bean.config.AdConfigBean.Companion.adsConfigBean
import
com.base.appzxhy.bean.config.ConfigBean.Companion.configBean
import
com.base.appzxhy.business.ads.admob.AdBannerMgr
import
com.base.appzxhy.business.ads.admob.AdInterMgr
import
com.base.appzxhy.business.ads.admob.AdNativeMgr
import
com.base.appzxhy.business.ads.admob.AdOpenMgr
import
com.base.appzxhy.business.ads.admob.AdmobEvent
import
com.base.appzxhy.business.ads.applovin.AdMaxEvent
import
com.base.appzxhy.business.ads.applovin.MaxInsertMgr
import
com.base.appzxhy.business.ads.applovin.MaxNativeMgr
import
com.base.appzxhy.business.ads.applovin.MaxOpenMgr
import
com.base.appzxhy.business.helper.EventUtils
import
com.base.appzxhy.utils.AppPreferences
import
com.base.appzxhy.utils.LogEx
...
...
@@ -42,11 +43,9 @@ object AdsMgr {
private
val
adInterMgr
by
lazy
{
AdInterMgr
()
}
private
val
adNativeMgr
by
lazy
{
AdNativeMgr
()
}
private
val
adBannerMgr
by
lazy
{
AdBannerMgr
()
}
...
...
@@ -57,7 +56,6 @@ object AdsMgr {
private
val
maxInsertMgr
by
lazy
{
MaxInsertMgr
()
}
private
val
maxNativeMgr
by
lazy
{
MaxNativeMgr
()
}
...
...
@@ -74,7 +72,6 @@ object AdsMgr {
var
isMaxInit
=
false
private
set
/**
* Init 初始化
*
...
...
@@ -83,7 +80,7 @@ object AdsMgr {
fun
init
(
context
:
Context
)
{
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
configBean
.
isInBlackList
.
toString
()
)
EventUtils
.
event
(
"isInBlackList"
,
value
=
"isInBlackList=${configBean.isInBlackList}"
)
return
}
initAdmob
(
context
)
...
...
@@ -100,9 +97,10 @@ object AdsMgr {
EventUtils
.
event
(
"AdmobInit"
,
"AdmobInit=$isAdmobInit"
)
// context.toast("admob init")
if
(
AdConfigBean
.
adsConfigBean
.
adSwitch
)
{
if
(
adsConfigBean
.
adSwitch
)
{
admobInitCallBack
?.
invoke
()
admobInitCallBack
=
null
adNativeMgr
.
loadAd
(
MyApplication
.
appContext
,
AdmobEvent
(
"nativeAd"
,
"preload"
),
null
)
// adOpenMgr.loadAd(context, true, AdmobEvent("openAd", context::class.java.simpleName))
adInterMgr
.
loadAd
(
context
,
AdmobEvent
(
"interAd"
,
context
::
class
.
java
.
simpleName
))
}
...
...
@@ -121,7 +119,7 @@ object AdsMgr {
val
build
=
AppLovinSdkInitializationConfiguration
.
builder
(
GlobalConfig
.
KEY_MAX
,
context
)
build
.
setMediationProvider
(
AppLovinMediationProvider
.
MAX
)
build
.
mediationProvider
=
AppLovinMediationProvider
.
MAX
if
(
BuildConfig
.
DEBUG
)
{
build
.
testDeviceAdvertisingIds
=
Collections
.
singletonList
(
currentGaid
)
}
...
...
@@ -143,9 +141,8 @@ object AdsMgr {
}
private
var
admobInitCallBack
:
(()
->
Unit
)?
=
null
private
var
maxInitCallBack
:
(()
->
Unit
)?
=
null
var
admobInitCallBack
:
(()
->
Unit
)?
=
null
var
maxInitCallBack
:
(()
->
Unit
)?
=
null
/**
...
...
@@ -156,8 +153,8 @@ object AdsMgr {
*/
fun
showOpen
(
activity
:
Activity
,
showCallBack
:
AdsShowCallBack
?
=
null
,
isUnLimit
:
Boolean
=
false
,
showCallBack
:
AdsShowCallBack
?
=
null
,
)
{
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
"isInBlackList=${configBean.isInBlackList}"
)
...
...
@@ -166,7 +163,7 @@ object AdsMgr {
}
val
from
=
activity
::
class
.
java
.
simpleName
if
(
AdConfigBean
.
adsConfigBean
.
adSwitch
)
{
if
(
adsConfigBean
.
adSwitch
)
{
if
(
isAdmobInit
)
{
adOpenMgr
.
show
(
activity
,
isUnLimit
,
AdmobEvent
(
"openAd"
,
from
),
showCallBack
)
}
else
{
...
...
@@ -195,8 +192,8 @@ object AdsMgr {
*/
fun
showInsert
(
activity
:
Activity
,
showCallBack
:
AdsShowCallBack
?
=
null
,
isUnLimit
:
Boolean
=
false
,
showCallBack
:
AdsShowCallBack
?
=
null
,
)
{
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
configBean
.
isInBlackList
.
toString
())
...
...
@@ -228,16 +225,21 @@ object AdsMgr {
return
}
if
(!
isAdmobInit
)
return
val
showNative
=
{
if
(
adsConfigBean
.
adSwitch
)
{
adNativeMgr
.
show
(
AdmobEvent
(
"nativeAd"
,
"nativeAd"
),
nativeView
,
layout
,
nativeCallBack
)
}
else
{
maxNativeMgr
.
show
(
AdMaxEvent
(
"nativeAd"
,
"nativeAd"
),
nativeView
,
layout
,
nativeCallBack
)
}
}
if
(
AdConfigBean
.
adsConfigBean
.
adSwitch
)
{
adNativeMgr
.
show
(
AdmobEvent
(
"nativeAd"
,
"nativeAd"
),
nativeView
,
layout
,
nativeCallBack
)
if
(
isAdmobInit
)
{
showNative
.
invoke
(
)
}
else
{
maxNativeMgr
.
show
(
AdMaxEvent
(
"nativeAd"
,
"nativeAd"
),
nativeView
,
layout
,
nativeCallBack
)
admobInitCallBack
=
{
showNative
.
invoke
()
}
}
}
}
/**
* 展示banner广告
...
...
@@ -249,7 +251,7 @@ object AdsMgr {
EventUtils
.
event
(
"isInBlackList"
,
configBean
.
isInBlackList
.
toString
())
return
}
if
(
AdConfigBean
.
adsConfigBean
.
adSwitch
)
{
if
(
adsConfigBean
.
adSwitch
)
{
adBannerMgr
.
show
(
parent
,
collapsible
,
adClose
)
}
}
...
...
app/src/main/java/com/base/appzxhy/business/ads/NativeParentView.kt
View file @
97a304e2
...
...
@@ -21,6 +21,7 @@ import androidx.core.content.withStyledAttributes
@SuppressLint
(
"ViewConstructor"
)
class
NativeParentView
(
context
:
Context
,
attrs
:
AttributeSet
?
=
null
)
:
FrameLayout
(
context
,
attrs
)
{
private
val
TAG
=
"NativeParentView"
private
var
removeAll
=
true
var
isAdShowed
=
false
...
...
@@ -29,7 +30,6 @@ class NativeParentView(context: Context, attrs: AttributeSet? = null) :
// 获取XML属性
context
.
withStyledAttributes
(
attrs
,
R
.
styleable
.
NativeParentView
,
0
,
0
)
{
// 从XML中读取属性值
// 例如,如果你的XML中有自定义属性 `app:customAttribute="value"`
removeAll
=
getBoolean
(
R
.
styleable
.
NativeParentView_removeAll
,
true
)
...
...
@@ -43,6 +43,7 @@ class NativeParentView(context: Context, attrs: AttributeSet? = null) :
nativeAd
:
NativeAd
,
@LayoutRes
resource
:
Int
?
=
null
,
)
{
val
layout
=
resource
?:
R
.
layout
.
layout_admob_native_custom
val
adView
=
layout
.
let
{
LayoutInflater
.
from
(
context
).
inflate
(
it
,
null
)
}
as
NativeAdView
...
...
@@ -78,8 +79,14 @@ class NativeParentView(context: Context, attrs: AttributeSet? = null) :
if
(
removeAll
)
{
removeAllViews
()
}
addView
(
adView
)
isAdShowed
=
true
val
params
=
LayoutParams
(
LayoutParams
.
MATCH_PARENT
,
LayoutParams
.
WRAP_CONTENT
)
params
.
gravity
=
android
.
view
.
Gravity
.
CENTER
addView
(
adView
,
params
)
}
fun
setNativeAd
(
...
...
@@ -103,7 +110,13 @@ class NativeParentView(context: Context, attrs: AttributeSet? = null) :
nativeAdLoader
.
render
(
adView
,
nativeAd
)
setBackgroundResource
(
0
)
removeAllViews
()
addView
(
adView
)
isAdShowed
=
true
val
params
=
LayoutParams
(
LayoutParams
.
MATCH_PARENT
,
LayoutParams
.
WRAP_CONTENT
)
params
.
gravity
=
android
.
view
.
Gravity
.
CENTER
addView
(
adView
,
params
)
}
}
app/src/main/java/com/base/appzxhy/business/ads/admob/AdBannerMgr.kt
View file @
97a304e2
...
...
@@ -4,10 +4,9 @@ import android.os.Bundle
import
android.view.ViewGroup
import
android.view.ViewTreeObserver
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.ads.AdsMgr
import
com.base.appzxhy.ads.AdsType
import
com.base.appzxhy.ads.LimitUtils
import
com.base.appzxhy.bean.config.AdConfigBean
import
com.base.appzxhy.business.ads.AdsType
import
com.base.appzxhy.business.ads.LimitUtils
import
com.google.ads.mediation.admob.AdMobAdapter
import
com.google.android.gms.ads.AdListener
import
com.google.android.gms.ads.AdRequest
...
...
app/src/main/java/com/base/appzxhy/business/ads/admob/AdInterMgr.kt
View file @
97a304e2
...
...
@@ -4,12 +4,12 @@ import android.app.Activity
import
android.content.Context
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.MyApplication
import
com.base.appzxhy.ads.AdCountDownDialog.showAdCountDownDialog
import
com.base.appzxhy.ads.AdEvent
import
com.base.appzxhy.ads.AdState
import
com.base.appzxhy.ads.AdsShowCallBack
import
com.base.appzxhy.ads.AdsType
import
com.base.appzxhy.ads.LimitUtils
import
com.base.appzxhy.
business.
ads.AdCountDownDialog.showAdCountDownDialog
import
com.base.appzxhy.
business.
ads.AdEvent
import
com.base.appzxhy.
business.
ads.AdState
import
com.base.appzxhy.
business.
ads.AdsShowCallBack
import
com.base.appzxhy.
business.
ads.AdsType
import
com.base.appzxhy.
business.
ads.LimitUtils
import
com.google.android.gms.ads.AdError
import
com.google.android.gms.ads.AdRequest
import
com.google.android.gms.ads.FullScreenContentCallback
...
...
app/src/main/java/com/base/appzxhy/business/ads/admob/AdNativeMgr.kt
View file @
97a304e2
...
...
@@ -4,9 +4,9 @@ import android.content.Context
import
android.util.Log
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.MyApplication
import
com.base.appzxhy.ads.AdsType
import
com.base.appzxhy.ads.LimitUtils
import
com.base.appzxhy.ads.NativeParentView
import
com.base.appzxhy.
business.
ads.AdsType
import
com.base.appzxhy.
business.
ads.LimitUtils
import
com.base.appzxhy.
business.
ads.NativeParentView
import
com.google.android.gms.ads.AdListener
import
com.google.android.gms.ads.AdLoader
import
com.google.android.gms.ads.AdRequest
...
...
app/src/main/java/com/base/appzxhy/business/ads/admob/AdOpenMgr.kt
View file @
97a304e2
...
...
@@ -4,12 +4,11 @@ import android.app.Activity
import
android.content.Context
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.MyApplication
import
com.base.appzxhy.ads.AdCountDownDialog.createUICountdownTimer
import
com.base.appzxhy.ads.AdsType
import
com.base.appzxhy.ads.AdEvent
import
com.base.appzxhy.ads.AdState
import
com.base.appzxhy.ads.AdsShowCallBack
import
com.base.appzxhy.ads.LimitUtils
import
com.base.appzxhy.business.ads.AdEvent
import
com.base.appzxhy.business.ads.AdState
import
com.base.appzxhy.business.ads.AdsShowCallBack
import
com.base.appzxhy.business.ads.AdsType
import
com.base.appzxhy.business.ads.LimitUtils
import
com.google.android.gms.ads.AdError
import
com.google.android.gms.ads.AdRequest
import
com.google.android.gms.ads.FullScreenContentCallback
...
...
@@ -62,6 +61,7 @@ class AdOpenMgr {
}
private
fun
showReadyAd
(
adEvent
:
AdEvent
)
{
adState
.
currentAd
?.
run
{
fullScreenContentCallback
=
object
:
FullScreenContentCallback
()
{
override
fun
onAdShowedFullScreenContent
()
{
...
...
app/src/main/java/com/base/appzxhy/business/ads/admob/AdmobEvent.kt
View file @
97a304e2
...
...
@@ -3,11 +3,11 @@ package com.base.appzxhy.business.ads.admob
import
android.app.Activity
import
android.os.Bundle
import
com.base.appzxhy.MyApplication
import
com.base.appzxhy.ads.AdEvent
import
com.base.appzxhy.ads.SolarEngineEvent
import
com.base.appzxhy.ads.taichiPref
import
com.base.appzxhy.ads.taichiSharedPreferencesEditor
import
com.base.appzxhy.bean.config.AdConfigBean
import
com.base.appzxhy.business.ads.AdEvent
import
com.base.appzxhy.business.ads.SolarEngineEvent
import
com.base.appzxhy.business.ads.taichiPref
import
com.base.appzxhy.business.ads.taichiSharedPreferencesEditor
import
com.base.appzxhy.business.helper.EventUtils
import
com.base.appzxhy.utils.LogEx
import
com.facebook.appevents.AppEventsConstants
...
...
@@ -28,7 +28,6 @@ import com.google.firebase.ktx.Firebase
import
org.json.JSONObject
import
kotlin.Any
import
kotlin.random.Random
import
kotlin.text.toFloat
class
AdmobEvent
:
AdEvent
{
...
...
@@ -123,6 +122,7 @@ class AdmobEvent : AdEvent {
class
EventOnPaidEventListener
(
private
val
ad
:
Any
?)
:
OnPaidEventListener
{
override
fun
onPaidEvent
(
adValue
:
AdValue
)
{
ad
?:
return
SolarEngineEvent
.
eventSolar
(
ad
,
adValue
.
valueMicros
)
val
adRatio
=
AdConfigBean
.
adsConfigBean
.
adRatio
val
random
=
Random
.
Default
.
nextInt
(
1
,
100
)
...
...
app/src/main/java/com/base/appzxhy/business/ads/applovin/AdMaxEvent.kt
View file @
97a304e2
...
...
@@ -6,9 +6,9 @@ import com.applovin.mediation.MaxAdRevenueListener
import
com.applovin.mediation.MaxError
import
com.applovin.sdk.AppLovinSdk
import
com.base.appzxhy.MyApplication
import
com.base.appzxhy.ads.AdEvent
import
com.base.appzxhy.ads.taichiPref
import
com.base.appzxhy.ads.taichiSharedPreferencesEditor
import
com.base.appzxhy.
business.
ads.AdEvent
import
com.base.appzxhy.
business.
ads.taichiPref
import
com.base.appzxhy.
business.
ads.taichiSharedPreferencesEditor
import
com.base.appzxhy.business.helper.EventUtils
import
com.base.appzxhy.utils.LogEx.logDebug
import
com.facebook.appevents.AppEventsConstants
...
...
app/src/main/java/com/base/appzxhy/business/ads/applovin/MaxInsertMgr.kt
View file @
97a304e2
...
...
@@ -7,12 +7,12 @@ import com.applovin.mediation.MaxAdListener
import
com.applovin.mediation.MaxError
import
com.applovin.mediation.ads.MaxInterstitialAd
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.ads.AdCountDownDialog.showAdCountDownDialog
import
com.base.appzxhy.
ads.AdsType
import
com.base.appzxhy.
ads.AdEvent
import
com.base.appzxhy.
ads.AdState
import
com.base.appzxhy.
ads.AdsShowCallBack
import
com.base.appzxhy.ads.LimitUtils
import
com.base.appzxhy.
business.
ads.AdCountDownDialog.showAdCountDownDialog
import
com.base.appzxhy.
business.ads.AdEvent
import
com.base.appzxhy.
business.ads.AdState
import
com.base.appzxhy.
business.ads.AdsShowCallBack
import
com.base.appzxhy.
business.ads.AdsType
import
com.base.appzxhy.
business.
ads.LimitUtils
import
java.lang.ref.WeakReference
/**
...
...
app/src/main/java/com/base/appzxhy/business/ads/applovin/MaxNativeMgr.kt
View file @
97a304e2
...
...
@@ -7,9 +7,9 @@ import com.applovin.mediation.nativeAds.MaxNativeAdListener
import
com.applovin.mediation.nativeAds.MaxNativeAdLoader
import
com.applovin.mediation.nativeAds.MaxNativeAdView
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.ads.AdsType
import
com.base.appzxhy.ads.LimitUtils
import
com.base.appzxhy.ads.NativeParentView
import
com.base.appzxhy.
business.
ads.AdsType
import
com.base.appzxhy.
business.
ads.LimitUtils
import
com.base.appzxhy.
business.
ads.NativeParentView
import
com.base.appzxhy.business.helper.EventUtils
import
org.json.JSONObject
import
java.util.UUID
...
...
app/src/main/java/com/base/appzxhy/business/ads/applovin/MaxOpenMgr.kt
View file @
97a304e2
...
...
@@ -7,11 +7,11 @@ import com.applovin.mediation.MaxAdListener
import
com.applovin.mediation.MaxError
import
com.applovin.mediation.ads.MaxAppOpenAd
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.
ads.AdsType
import
com.base.appzxhy.
ads.AdEvent
import
com.base.appzxhy.
ads.AdState
import
com.base.appzxhy.
ads.AdsShowCallBack
import
com.base.appzxhy.ads.LimitUtils
import
com.base.appzxhy.
business.ads.AdEvent
import
com.base.appzxhy.
business.ads.AdState
import
com.base.appzxhy.
business.ads.AdsShowCallBack
import
com.base.appzxhy.
business.ads.AdsType
import
com.base.appzxhy.
business.
ads.LimitUtils
import
java.lang.ref.WeakReference
/**
...
...
app/src/main/java/com/base/appzxhy/business/push/fcm/FcmReceiver.kt
View file @
97a304e2
package
com.base.appzxhy.push.fcm
package
com.base.appzxhy.
business.
push.fcm
import
android.content.BroadcastReceiver
import
android.content.Context
...
...
app/src/main/java/com/base/appzxhy/business/push/fcm/MessagingService.kt
View file @
97a304e2
package
com.base.appzxhy.push.fcm
package
com.base.appzxhy.
business.
push.fcm
import
android.annotation.SuppressLint
import
com.base.appzxhy.bean.NotificationSendBean
...
...
app/src/main/java/com/base/appzxhy/business/push/notification/MyNotificationManager.kt
View file @
97a304e2
...
...
@@ -4,7 +4,7 @@ import android.content.Context
import
com.base.appzxhy.BuildConfig
import
com.base.appzxhy.MyApplication
import
com.base.appzxhy.bean.NotificationSendBean
import
com.base.appzxhy.bean.NotificationSendBean.Companion.ACTION_ID_
BEAN_MEDIA
import
com.base.appzxhy.bean.NotificationSendBean.Companion.ACTION_ID_
TEST
import
com.base.appzxhy.bean.NotificationSendBean.Companion.POPUP_WHERE_WORK_MANAGER
import
com.base.appzxhy.bean.config.PopupConfigBean.Companion.popupConfigBean
import
com.base.appzxhy.push.notification.NotificationBeanUtils.nextNotificationInfoBean
...
...
@@ -82,13 +82,8 @@ object MyNotificationManager {
}
//提前准备数据
if
(
bean
.
actionId
==
ACTION_ID_BEAN_MEDIA
)
{
val
uiBean
=
nextNotificationInfoBean
()
if
(
uiBean
==
null
)
{
LogEx
.
logDebug
(
TAG
,
"sendNotification no bean"
)
continue
}
bean
.
valueMap
[
"bean"
]
=
uiBean
when
(
bean
.
actionId
){
}
bean
=
async
(
Dispatchers
.
Main
)
{
...
...
@@ -192,13 +187,13 @@ object MyNotificationManager {
POPUP_WHERE_WORK_MANAGER
)
private
val
looper_actionId
=
listOf
(
ACTION_ID_
BEAN_MEDIA
,
ACTION_ID_
TEST
,
)
private
var
actionIdList
=
arrayListOf
<
String
>()
private
fun
getNextActionId
():
String
{
if
(
BuildConfig
.
DEBUG
)
{
return
ACTION_ID_
BEAN_MEDIA
return
ACTION_ID_
TEST
}
if
(
actionIdList
.
isEmpty
())
{
...
...
app/src/main/java/com/base/appzxhy/business/push/notification/NotificationBeanUtils.kt
View file @
97a304e2
...
...
@@ -10,7 +10,6 @@ import android.graphics.RectF
import
android.graphics.Shader
import
androidx.core.graphics.createBitmap
import
com.base.appzxhy.bean.NotificationInfoBean
import
com.base.appzxhy.helper.PushApiUtils
import
com.google.gson.Gson
import
com.google.gson.reflect.TypeToken
import
com.mbridge.msdk.thrid.okhttp.OkHttpClient
...
...
@@ -32,7 +31,7 @@ object NotificationBeanUtils {
try
{
val
gson
=
Gson
()
val
type
=
object
:
TypeToken
<
List
<
NotificationInfoBean
>>()
{}.
type
val
list
=
gson
.
fromJson
<
List
<
NotificationInfoBean
>>(
PushApiUtils
.
notificationInfoJson
,
type
)
val
list
=
gson
.
fromJson
<
List
<
NotificationInfoBean
>>(
""
,
type
)
notificationQueue
.
addAll
(
list
)
}
catch
(
e
:
Exception
)
{
}
...
...
app/src/main/java/com/base/appzxhy/business/push/notification/NotificationUiUtil.kt
View file @
97a304e2
...
...
@@ -13,9 +13,8 @@ import androidx.core.graphics.drawable.IconCompat
import
com.base.appzxhy.R
import
com.base.appzxhy.bean.NotificationInfoBean
import
com.base.appzxhy.bean.NotificationSendBean
import
com.base.appzxhy.bean.NotificationSendBean.Companion.ACTION_ID_
BEAN_MEDIA
import
com.base.appzxhy.bean.NotificationSendBean.Companion.ACTION_ID_
TEST
import
com.base.appzxhy.bean.config.PopupConfigBean
import
com.base.appzxhy.ui.splash.SplashActivity
import
kotlin.random.Random
/**
...
...
@@ -32,33 +31,20 @@ object NotificationUiUtil {
fun
setNotification
(
sendBean
:
NotificationSendBean
):
NotificationSendBean
{
val
context
=
sendBean
.
context
when
(
sendBean
.
actionId
)
{
ACTION_ID_BEAN_MEDIA
->
{
val
bean
=
sendBean
.
valueMap
.
get
(
"bean"
)
as
NotificationInfoBean
val
smallRemoteViews
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_small
).
apply
{
setTextViewText
(
R
.
id
.
tvTitle
,
bean
.
title
)
setTextViewText
(
R
.
id
.
tvContent
,
bean
.
content
)
setImageViewBitmap
(
R
.
id
.
ivImage
,
bean
.
bitmap
)
}
val
bigRemoteViews
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_big
).
apply
{
setTextViewText
(
R
.
id
.
tvTitle
,
bean
.
title
)
setTextViewText
(
R
.
id
.
tvContent
,
bean
.
content
)
setImageViewBitmap
(
R
.
id
.
ivImage
,
bean
.
bitmap
)
}
sendBean
.
smallRemoteViews
=
smallRemoteViews
sendBean
.
bigRemoteViews
=
bigRemoteViews
ACTION_ID_TEST
->
{
}
}
if
(
PopupConfigBean
.
popupConfigBean
.
isDifferNotificationId
)
{
sendBean
.
notificationId
=
Random
.
nextInt
(
1000
,
2000
)
}
val
intent
=
Intent
(
sendBean
.
context
,
SplashActivity
::
class
.
java
)
val
bean
=
sendBean
.
valueMap
[
"bean"
]
as
NotificationInfoBean
intent
.
putExtra
(
"actionId"
,
sendBean
.
actionId
)
intent
.
putExtra
(
"linkUrl"
,
bean
.
linkUrl
)
//
val intent = Intent(sendBean.context, SplashActivity::class.java)
//
val bean = sendBean.valueMap["bean"] as NotificationInfoBean
//
intent.putExtra("actionId", sendBean.actionId)
//
intent.putExtra("linkUrl", bean.linkUrl)
// intent.putExtra("notificationId", sendBean.notificationId)
sendBean
.
intent
=
intent
//
sendBean.intent = intent
sendCustomNotification
(
sendBean
)
return
sendBean
}
...
...
@@ -87,7 +73,7 @@ object NotificationUiUtil {
//设置状态栏内的小图标
val
smallIcon
=
IconCompat
.
createFromIcon
(
context
,
Icon
.
createWithResource
(
context
,
R
.
mipmap
.
logo_r
context
,
R
.
drawable
.
log_svg
)
)
smallIcon
?.
let
{
...
...
app/src/main/java/com/base/appzxhy/business/service/StayNotification.kt
View file @
97a304e2
...
...
@@ -51,8 +51,8 @@ object StayNotification {
val
channelName
=
"Permanent Foreground Service Channel"
val
channelId
=
"permanent_channel"
val
contentView
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
stay_notification_small
_location
)
val
expendView
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
stay_notification_big
_location
)
val
contentView
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
stay_notification_small
)
val
expendView
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
stay_notification_big
)
customRemoteViews
(
contentView
,
expendView
)
...
...
app/src/main/java/com/base/appzxhy/ui/adapter/LanguageAdapter.kt
deleted
100644 → 0
View file @
1f4fded5
package
com.base.appzxhy.ui.adapter
import
android.annotation.SuppressLint
import
android.content.Context
import
android.view.View
import
android.view.ViewGroup
import
androidx.recyclerview.widget.RecyclerView
import
com.base.appzxhy.R
import
com.base.appzxhy.bean.LanguageBean
import
com.base.appzxhy.databinding.ItemLanguageBinding
import
com.base.appzxhy.utils.XmlEx.inflate
import
com.chad.library.adapter4.BaseQuickAdapter
class
LanguageAdapter
(
val
click
:
(
item
:
LanguageBean
)
->
Unit
)
:
BaseQuickAdapter
<
LanguageBean
,
LanguageAdapter
.
LanguageViewHolder
>()
{
inner
class
LanguageViewHolder
(
view
:
View
)
:
RecyclerView
.
ViewHolder
(
view
)
@SuppressLint
(
"NotifyDataSetChanged"
)
override
fun
onBindViewHolder
(
holder
:
LanguageViewHolder
,
position
:
Int
,
item
:
LanguageBean
?)
{
item
?:
return
val
binding
=
ItemLanguageBinding
.
bind
(
holder
.
itemView
)
binding
.
tv
.
text
=
item
.
key
binding
.
fl
.
isSelected
=
item
.
isSelect
binding
.
root
.
setOnClickListener
{
items
.
map
{
it
.
isSelect
=
false
}
item
.
isSelect
=
true
notifyDataSetChanged
()
click
.
invoke
(
item
)
}
}
override
fun
onCreateViewHolder
(
context
:
Context
,
parent
:
ViewGroup
,
viewType
:
Int
):
LanguageViewHolder
{
return
LanguageViewHolder
(
R
.
layout
.
item_language
.
inflate
(
parent
))
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/ui/main/HomeFragment.kt
deleted
100644 → 0
View file @
1f4fded5
package
com.base.appzxhy.ui.main
import
com.base.appzxhy.databinding.FragmentHomeBinding
import
com.koko.drouter.base.BaseFragment
class
HomeFragment
:
BaseFragment
<
FragmentHomeBinding
>(
FragmentHomeBinding
::
inflate
)
{
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/ui/main/MainActivity.kt
View file @
97a304e2
package
com.base.appzxhy.ui.main
import
android.graphics.Color
import
android.view.LayoutInflater
import
android.widget.TextView
import
androidx.fragment.app.Fragment
import
androidx.lifecycle.ViewModelProvider
import
androidx.viewpager2.adapter.FragmentStateAdapter
import
androidx.viewpager2.widget.ViewPager2
import
com.base.appzxhy.R
import
com.base.appzxhy.bean.HomeTabUIBean
import
com.base.appzxhy.base.BaseActivity
import
com.base.appzxhy.databinding.ActivityMainBinding
import
com.base.appzxhy.databinding.ItemHomeTabBinding
import
com.base.appzxhy.utils.LogEx
import
com.google.android.material.tabs.TabLayout
import
com.google.android.material.tabs.TabLayout.OnTabSelectedListener
import
com.koko.drouter.base.BaseActivity
class
MainActivity
:
BaseActivity
<
ActivityMainBinding
>(
ActivityMainBinding
::
inflate
)
{
private
val
viewModel
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
ViewModelProvider
(
this
)[
MainViewModel
::
class
.
java
]
}
private
val
homeTabs
by
lazy
{
arrayOf
(
HomeTabUIBean
(
R
.
drawable
.
bg_selector_home
,
getString
(
R
.
string
.
home
)),
)
}
private
val
homeFragment
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
HomeFragment
()
}
private
val
fragments
=
arrayOf
(
homeFragment
)
private
var
pageAdapter
:
FragmentStateAdapter
?
=
null
override
fun
initView
()
{
super
.
initView
()
initViewPager2
()
initTab
()
}
private
fun
initViewPager2
()
{
pageAdapter
=
object
:
FragmentStateAdapter
(
this
)
{
override
fun
getItemCount
():
Int
{
return
fragments
.
size
}
override
fun
createFragment
(
position
:
Int
):
Fragment
{
return
fragments
[
position
]
}
}
binding
.
viewPager2
.
run
{
isUserInputEnabled
=
false
//https://www.jianshu.com/p/f69bd30cf5b0
//FragmentStateAdapter 这里必须传人fragment
adapter
=
pageAdapter
offscreenPageLimit
=
3
}
binding
.
viewPager2
.
registerOnPageChangeCallback
(
object
:
ViewPager2
.
OnPageChangeCallback
()
{
override
fun
onPageScrolled
(
position
:
Int
,
positionOffset
:
Float
,
positionOffsetPixels
:
Int
)
{
super
.
onPageScrolled
(
position
,
positionOffset
,
positionOffsetPixels
)
}
override
fun
onPageSelected
(
position
:
Int
)
{
val
defaultTab
=
binding
.
tabLayout
.
getTabAt
(
position
)
defaultTab
?.
select
()
defaultTab
?.
setSelected
()
}
})
}
private
fun
initTab
()
{
homeTabs
.
forEachIndexed
{
index
,
homeTab
->
val
tab
=
binding
.
tabLayout
.
newTab
()
val
view
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
item_home_tab
,
null
)
val
tabBinding
=
ItemHomeTabBinding
.
bind
(
view
)
tabBinding
.
ivIcon
.
setImageResource
(
homeTab
.
icon
)
tabBinding
.
tvTab
.
text
=
homeTab
.
tab
// tabBinding.tvTab.setTextColor(ContextCompat.getColor(this, R.color.color_tab_home))
tab
.
customView
=
tabBinding
.
root
tab
.
id
=
index
binding
.
tabLayout
.
addTab
(
tab
)
}
binding
.
tabLayout
.
addOnTabSelectedListener
(
object
:
OnTabSelectedListener
{
override
fun
onTabSelected
(
tab
:
TabLayout
.
Tab
?)
{
tab
?.
let
{
it
.
setSelected
()
naviFragment
(
tab
.
id
)
}
}
override
fun
onTabUnselected
(
tab
:
TabLayout
.
Tab
?)
{
tab
?.
setUnselected
()
}
override
fun
onTabReselected
(
tab
:
TabLayout
.
Tab
?)
{
}
})
val
defaultTab
=
binding
.
tabLayout
.
getTabAt
(
0
)
defaultTab
?.
select
()
defaultTab
?.
setSelected
()
}
private
fun
naviFragment
(
id
:
Int
)
{
if
(
binding
.
viewPager2
.
currentItem
==
id
)
return
binding
.
viewPager2
.
setCurrentItem
(
id
,
false
)
when
(
id
)
{
0
->
{
}
1
->
{
}
2
->
{
}
}
}
fun
TabLayout
.
Tab
.
setUnselected
()
{
val
textView
=
customView
?.
findViewById
<
TextView
>(
R
.
id
.
tv_tab
)
LogEx
.
logDebug
(
TAG
,
"setUnselected ${textView?.text}"
)
textView
?.
setTextColor
(
Color
.
parseColor
(
"#838383"
))
}
fun
TabLayout
.
Tab
.
setSelected
()
{
val
textView
=
customView
?.
findViewById
<
TextView
>(
R
.
id
.
tv_tab
)
LogEx
.
logDebug
(
TAG
,
"setSelected ${textView?.text}"
)
textView
?.
setTextColor
(
Color
.
parseColor
(
"#FF0000"
))
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/ui/start/StartActivity.kt
deleted
100644 → 0
View file @
1f4fded5
package
com.base.appzxhy.ui.start
import
android.annotation.SuppressLint
import
android.content.Intent
import
android.graphics.Color
import
androidx.activity.SystemBarStyle
import
androidx.activity.enableEdgeToEdge
import
androidx.core.view.ViewCompat
import
androidx.core.view.WindowInsetsCompat
import
androidx.lifecycle.ViewModelProvider
import
com.base.appzxhy.R
import
com.base.appzxhy.ads.AdsMgr
import
com.base.appzxhy.databinding.ActivityStartBinding
import
com.koko.batteryinfo.BatteryInfoActivity
import
com.koko.drouter.base.BaseActivity
class
StartActivity
:
BaseActivity
<
ActivityStartBinding
>(
ActivityStartBinding
::
inflate
)
{
private
val
viewModel
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
ViewModelProvider
(
this
)[
StartViewModel
::
class
.
java
]
}
override
fun
initView
()
{
super
.
initView
()
}
@SuppressLint
(
"SetTextI18n"
)
override
fun
initListener
()
{
super
.
initListener
()
binding
.
tv
.
setOnClickListener
{
// if (isContinuousTimesClick()) {
// val sb = StringBuilder()
// val gson = Gson()
// sb.append("ut:${ConfigBean.configBean.ut}").append("\n")
// val adLog = gson.toJson(ConfigBean.configBean.adConfigBean).replace(",", ",\n")
// sb.append(adLog).append("\n")
// val popupLog = gson.toJson(ConfigBean.configBean.popupConfigBean).replace(",", ",\n")
// sb.append(popupLog)
// showLogDialog(sb.toString())
// }
startActivity
(
Intent
(
this
,
BatteryInfoActivity
::
class
.
java
))
}
}
override
fun
onResumeOneShoot
()
{
super
.
onResumeOneShoot
()
viewModel
.
startJumpCountdown
()
}
override
fun
onStop
()
{
super
.
onStop
()
viewModel
.
cancelJumpCountDown
()
}
override
fun
useDefaultImmersive
()
{
// enableEdgeToEdge(SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT))
enableEdgeToEdge
(
SystemBarStyle
.
dark
(
Color
.
TRANSPARENT
))
ViewCompat
.
setOnApplyWindowInsetsListener
(
binding
.
root
)
{
v
,
insets
->
val
systemBars
=
insets
.
getInsets
(
WindowInsetsCompat
.
Type
.
systemBars
())
v
.
setPadding
(
systemBars
.
left
,
0
,
systemBars
.
right
,
systemBars
.
bottom
)
insets
}
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/ui/start/StartViewModel.kt
deleted
100644 → 0
View file @
1f4fded5
package
com.base.appzxhy.ui.start
import
android.os.CountDownTimer
import
androidx.lifecycle.ViewModel
import
com.base.appzxhy.bean.config.AdConfigBean
class
StartViewModel
:
ViewModel
()
{
var
jumpNext
:
(()
->
Unit
)?
=
null
var
onTick
:
((
sLong
:
Long
,
total
:
Long
,
percent
:
Int
)
->
Unit
)?
=
null
private
val
openAdLoading
=
AdConfigBean
.
adsConfigBean
.
openAdLoading
*
1000L
private
var
countdownTimer
:
CountDownTimer
?
=
null
fun
startJumpCountdown
()
{
cancelJumpCountDown
()
countdownTimer
=
createNewCountdownTimer
()
countdownTimer
?.
start
()
}
fun
cancelJumpCountDown
()
{
countdownTimer
?.
cancel
()
onTick
?.
invoke
(
0
,
openAdLoading
,
0
)
}
private
fun
createNewCountdownTimer
():
CountDownTimer
{
return
object
:
CountDownTimer
(
openAdLoading
,
1000
)
{
override
fun
onTick
(
millisUntilFinished
:
Long
)
{
val
progress
=
(
openAdLoading
-
millisUntilFinished
)
val
percent
=
(
progress
*
100
/
openAdLoading
).
toInt
()
onTick
?.
invoke
(
progress
,
openAdLoading
,
percent
)
}
override
fun
onFinish
()
{
onTick
?.
invoke
(
openAdLoading
,
openAdLoading
,
100
)
jumpNext
?.
invoke
()
jumpNext
=
null
}
}
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/ui/views/NotificationDialog.kt
deleted
100644 → 0
View file @
1f4fded5
package
com.base.appzxhy.ui.views
import
android.annotation.SuppressLint
import
android.app.AlertDialog
import
android.content.Context
import
android.content.Intent
import
android.os.Build
import
android.provider.Settings
import
android.view.Gravity
import
android.view.LayoutInflater
import
com.base.appzxhy.R
import
com.base.appzxhy.databinding.DialogNotificationTurnOnBinding
import
com.base.appzxhy.utils.ActivityLauncher
object
NotificationDialog
{
@SuppressLint
(
"SetTextI18n"
)
fun
Context
.
showNotificationTurnOn
(
launcher
:
ActivityLauncher
)
{
val
dialog
=
AlertDialog
.
Builder
(
this
).
create
()
val
binding
=
DialogNotificationTurnOnBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
dialog
.
setView
(
binding
.
root
)
dialog
.
setCanceledOnTouchOutside
(
true
)
dialog
.
show
()
val
params
=
dialog
.
window
?.
attributes
// params?.width = resources.getDimensionPixelOffset(R.dimen.dp_320)
// params?.height = LinearLayout.LayoutParams.WRAP_CONTENT
params
?.
gravity
=
Gravity
.
BOTTOM
// params?.y = 50
dialog
.
window
?.
attributes
=
params
dialog
.
window
?.
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
)
val
appName
=
resources
.
getString
(
R
.
string
.
app_name
)
binding
.
tvTip
.
text
=
"Never miss important $appName notification reminders"
binding
.
ivClose
.
setOnClickListener
{
dialog
.
dismiss
()
}
binding
.
tvTurnOn
.
setOnClickListener
{
dialog
.
dismiss
()
val
intent
=
Intent
()
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
intent
.
action
=
Settings
.
ACTION_APP_NOTIFICATION_SETTINGS
intent
.
putExtra
(
Settings
.
EXTRA_APP_PACKAGE
,
this
.
packageName
)
}
else
{
intent
.
action
=
"android.settings.APP_NOTIFICATION_SETTINGS"
intent
.
putExtra
(
"app_package"
,
this
.
packageName
)
}
launcher
.
launch
(
intent
)
}
}
}
\ No newline at end of file
app/src/main/res/layout/activity_start.xml
deleted
100644 → 0
View file @
1f4fded5
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/main"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".ui.start.StartActivity"
>
<TextView
android:id=
"@+id/tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Click"
android:textSize=
"30dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_notification_turn_on.xml
deleted
100644 → 0
View file @
1f4fded5
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"324dp"
android:background=
"@mipmap/img_tongzhi_pop_bj"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<ImageView
android:id=
"@+id/iv_close"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"25dp"
android:src=
"@mipmap/icon_close"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginBottom=
"8dp"
android:text=
"@string/turn_on_notification"
android:textColor=
"#1A1A1A"
android:textSize=
"22sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_tip"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginHorizontal=
"40dp"
android:layout_marginBottom=
"20dp"
android:gravity=
"center"
android:textColor=
"#666666"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_turn_on"
android:layout_width=
"259dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginBottom=
"40dp"
android:background=
"@drawable/bg_03b988_35"
android:gravity=
"center"
android:text=
"@string/turn_on"
android:textColor=
"@color/white"
android:textSize=
"20sp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_home.xml
deleted
100644 → 0
View file @
1f4fded5
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".ui.main.HomeFragment"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:text=
"Home"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/item_home_tab.xml
deleted
100644 → 0
View file @
1f4fded5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
tools:ignore=
"UseCompoundDrawables"
>
<ImageView
android:id=
"@+id/iv_icon"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"12dp"
tools:ignore=
"ContentDescription"
tools:src=
"@mipmap/ic_launcher"
/>
<TextView
android:id=
"@+id/tv_tab"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"5dp"
android:textColor=
"#838383"
android:textSize=
"13sp"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/item_language.xml
deleted
100644 → 0
View file @
1f4fded5
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/fl"
android:layout_width=
"match_parent"
android:layout_height=
"76dp"
android:layout_margin=
"6dp"
>
<TextView
android:id=
"@+id/tv"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:textSize=
"18sp"
android:textStyle=
"bold"
tools:text=
"English"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/stay_notification_big
_location
.xml
→
app/src/main/res/layout/stay_notification_big.xml
View file @
97a304e2
File moved
app/src/main/res/layout/stay_notification_small
_location
.xml
→
app/src/main/res/layout/stay_notification_small.xml
View file @
97a304e2
File moved
app/src/main/res/values/strings.xml
View file @
97a304e2
<resources>
<string
name=
"app_name"
>
LocalWeatherWhit
e
</string>
<string
name=
"app_name"
>
AppNam
e
</string>
<string
name=
"facebook_app_id"
>
4512448902756291
</string>
<string
name=
"home"
>
Home
</string>
<string
name=
"turn_on_notification"
>
Turn on notification
</string>
<string
name=
"turn_on"
>
Turn on
</string>
<string
name=
"preparing_advertisement"
>
Preparing advertisement
</string>
<!-- TODO: Remove or change this placeholder text -->
<string
name=
"hello_blank_fragment"
>
Hello blank fragment
</string>
</resources>
\ No newline at end of file
build.gradle.kts
View file @
97a304e2
...
...
@@ -5,7 +5,7 @@ plugins {
id
(
"com.google.gms.google-services"
)
version
"4.4.1"
apply
false
id
(
"com.google.firebase.crashlytics"
)
version
"3.0.2"
apply
false
alias
(
libs
.
plugins
.
android
.
library
)
apply
false
id
(
"
com.google.devtools.ksp"
)
version
"1.9.24-1.0.20
"
apply
false
//先不用ksp,容易出问题
// id("com.google.devtools.ksp") version "1.9.24-1.0.20" apply false
id
(
"
org.jetbrains.kotlin.kapt"
)
version
"1.9.24
"
apply
false
}
debug-release-key.keystore
0 → 100644
View file @
97a304e2
File added
gradle/libs.versions.toml
View file @
97a304e2
...
...
@@ -9,9 +9,6 @@ appcompat = "1.6.1"
material
=
"1.10.0"
activity
=
"1.8.0"
constraintlayout
=
"2.1.4"
navigationFragmentKtx
=
"2.6.0"
navigationUiKtx
=
"2.6.0"
immersionbar
=
"3.2.2"
playServicesAds
=
"23.5.0.0"
applovin
=
"13.0.1"
...
...
@@ -19,11 +16,8 @@ vungle = "7.4.2.0"
facebook
=
"6.18.0.0"
mintegral
=
"16.8.61.0"
pangle
=
"6.3.0.4.0"
drouterApi
=
"2.4.6"
drouterPlugin
=
"1.4.0"
drouterApiPage
=
"1.0.0"
drouterApiProcess
=
"1.0.0"
navigationFragmentKtx
=
"2.6.0"
navigationUiKtx
=
"2.6.0"
[libraries]
...
...
@@ -35,11 +29,6 @@ androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version
material
=
{
group
=
"com.google.android.material"
,
name
=
"material"
,
version.ref
=
"material"
}
androidx-activity
=
{
group
=
"androidx.activity"
,
name
=
"activity"
,
version.ref
=
"activity"
}
androidx-constraintlayout
=
{
group
=
"androidx.constraintlayout"
,
name
=
"constraintlayout"
,
version.ref
=
"constraintlayout"
}
immersionbar
=
{
module
=
"com.geyifeng.immersionbar:immersionbar"
,
version.ref
=
"immersionbar"
}
immersionbar-ktx
=
{
module
=
"com.geyifeng.immersionbar:immersionbar-ktx"
,
version.ref
=
"immersionbar"
}
androidx-navigation-fragment-ktx
=
{
group
=
"androidx.navigation"
,
name
=
"navigation-fragment-ktx"
,
version.ref
=
"navigationFragmentKtx"
}
androidx-navigation-ui-ktx
=
{
group
=
"androidx.navigation"
,
name
=
"navigation-ui-ktx"
,
version.ref
=
"navigationUiKtx"
}
vungle
=
{
group
=
"com.google.ads.mediation"
,
name
=
"vungle"
,
version.ref
=
"vungle"
}
facebook
=
{
group
=
"com.google.ads.mediation"
,
name
=
"facebook"
,
version.ref
=
"facebook"
}
...
...
@@ -53,10 +42,10 @@ applovin_vungle = { group = "com.applovin.mediation", name = "vungle-adapter", v
applovin_facebook
=
{
group
=
"com.applovin.mediation"
,
name
=
"facebook-adapter"
,
version.ref
=
"facebook"
}
applovin_mintegral
=
{
group
=
"com.applovin.mediation"
,
name
=
"mintegral-adapter"
,
version.ref
=
"mintegral"
}
applovin_pangle
=
{
group
=
"com.applovin.mediation"
,
name
=
"bytedance-adapter"
,
version.ref
=
"pangle"
}
androidx-navigation-fragment-ktx
=
{
group
=
"androidx.navigation"
,
name
=
"navigation-fragment-ktx"
,
version.ref
=
"navigationFragmentKtx"
}
androidx-navigation-ui-ktx
=
{
group
=
"androidx.navigation"
,
name
=
"navigation-ui-ktx"
,
version.ref
=
"navigationUiKtx"
}
[plugins]
android-application
=
{
id
=
"com.android.application"
,
version.ref
=
"agp"
}
kotlin-android
=
{
id
=
"org.jetbrains.kotlin.android"
,
version.ref
=
"kotlin"
}
android-library
=
{
id
=
"com.android.library"
,
version.ref
=
"agp"
}
gradle/wrapper/gradle-wrapper.properties
View file @
97a304e2
#Mon Dec 16 10:01:19 CST 2024
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-8.5-
bin
.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-8.5-
all
.zip
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
settings.gradle.kts
View file @
97a304e2
pluginManagement
{
repositories
{
// 添加国内插件镜像
maven
(
"https://maven.aliyun.com/repository/public"
)
maven
(
"https://maven.aliyun.com/repository/google"
)
maven
(
"https://repo.huaweicloud.com/repository/maven"
)
google
{
content
{
includeGroupByRegex
(
"com\\.android.*"
)
...
...
@@ -14,6 +21,7 @@ pluginManagement {
dependencyResolutionManagement
{
repositoriesMode
.
set
(
RepositoriesMode
.
FAIL_ON_PROJECT_REPOS
)
repositories
{
google
()
mavenCentral
()
maven
(
"https://s01.oss.sonatype.org/content/groups/public"
)
...
...
@@ -23,6 +31,10 @@ dependencyResolutionManagement {
maven
(
"https://artifact.bytedance.com/repository/pangle"
)
maven
(
"https://dl-maven-android.mintegral.com/repository/se_sdk_for_android/"
)
// 添加国内插件镜像
maven
(
"https://maven.aliyun.com/repository/public"
)
maven
(
"https://maven.aliyun.com/repository/google"
)
maven
(
"https://repo.huaweicloud.com/repository/maven"
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment