2025-10-31 15:18:32 +08:00
|
|
|
|
package com.xscm.modulemain
|
|
|
|
|
|
|
2025-11-04 16:39:10 +08:00
|
|
|
|
import android.content.Context
|
2025-11-03 14:16:27 +08:00
|
|
|
|
import com.blankj.utilcode.util.LogUtils
|
2025-10-31 15:18:32 +08:00
|
|
|
|
import com.opensource.svgaplayer.utils.log.SVGALogger
|
2025-11-04 16:39:10 +08:00
|
|
|
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout
|
|
|
|
|
|
import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator
|
|
|
|
|
|
import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator
|
|
|
|
|
|
import com.scwang.smartrefresh.layout.api.RefreshFooter
|
|
|
|
|
|
import com.scwang.smartrefresh.layout.api.RefreshHeader
|
|
|
|
|
|
import com.scwang.smartrefresh.layout.api.RefreshLayout
|
|
|
|
|
|
import com.scwang.smartrefresh.layout.footer.ClassicsFooter
|
|
|
|
|
|
import com.scwang.smartrefresh.layout.header.ClassicsHeader
|
2025-10-31 15:18:32 +08:00
|
|
|
|
import com.xscm.modulemain.widget.WheatLayoutSingManager
|
|
|
|
|
|
import com.xscm.moduleutil.base.CommonAppContext
|
|
|
|
|
|
|
2025-11-04 16:39:10 +08:00
|
|
|
|
|
2025-10-31 15:18:32 +08:00
|
|
|
|
open class Application : CommonAppContext() {
|
|
|
|
|
|
|
|
|
|
|
|
override fun onCreate() {
|
|
|
|
|
|
super.onCreate()
|
|
|
|
|
|
// 初始化并预绘制视图 二卡八列
|
|
|
|
|
|
WheatLayoutSingManager.init(this)
|
|
|
|
|
|
WheatLayoutSingManager.getInstance().setWheatData( null)
|
|
|
|
|
|
|
|
|
|
|
|
// 默认情况下,SVGA 内部不会输出任何 log,所以需要手动设置为 true
|
2025-11-03 14:16:27 +08:00
|
|
|
|
SVGALogger.setLogEnabled(false)
|
|
|
|
|
|
LogUtils.getConfig().isLogSwitch = true
|
2025-11-04 16:39:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设置全局的Header构建器
|
|
|
|
|
|
SmartRefreshLayout.setDefaultRefreshHeaderCreator { context, _ ->
|
|
|
|
|
|
val header = ClassicsHeader(context)
|
|
|
|
|
|
header.setDrawableSize(20f)
|
|
|
|
|
|
// header.setFinishDuration(0)
|
|
|
|
|
|
header.setTextSizeTitle(12f)
|
|
|
|
|
|
header.setTextSizeTime(10f)
|
|
|
|
|
|
header
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//设置全局的Footer构建器
|
|
|
|
|
|
SmartRefreshLayout.setDefaultRefreshFooterCreator { context, _ ->
|
|
|
|
|
|
val classicsFooter = ClassicsFooter(context)
|
|
|
|
|
|
classicsFooter.setDrawableSize(20f)
|
|
|
|
|
|
// classicsFooter.setFinishDuration(0)
|
|
|
|
|
|
classicsFooter.setTextSizeTitle(12f)
|
|
|
|
|
|
//指定为经典Footer,默认是 BallPulseFooter
|
|
|
|
|
|
classicsFooter
|
|
|
|
|
|
}
|
2025-10-31 15:18:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|