Files
yusheng-android/MainModule/src/main/java/com/xscm/modulemain/Application.kt
2025-11-07 09:22:39 +08:00

52 lines
1.9 KiB
Kotlin
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.xscm.modulemain
import android.content.Context
import com.blankj.utilcode.util.LogUtils
import com.opensource.svgaplayer.utils.log.SVGALogger
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
import com.xscm.modulemain.widget.WheatLayoutSingManager
import com.xscm.moduleutil.base.CommonAppContext
open class Application : CommonAppContext() {
override fun onCreate() {
super.onCreate()
// 初始化并预绘制视图 二卡八列
WheatLayoutSingManager.init(this)
WheatLayoutSingManager.getInstance().setWheatData( null)
// 默认情况下SVGA 内部不会输出任何 log所以需要手动设置为 true
SVGALogger.setLogEnabled(false)
LogUtils.getConfig().isLogSwitch = true
//设置全局的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
}
}
}