-
- All Implemented Interfaces:
-
com.liecoder.framework.service.IAppStatusService
public class AppHelper implements IAppStatusService
应用程序助手对象,提供应用程序级别的辅助功能。 实现了 IAppStatusService 接口,用以管理应用程序的状态。
-
-
Field Summary
Fields Modifier and Type Field Description private final Applicationapplicationprivate final BuildTypeenvModeprivate final BooleanisDevelopmentprivate final BooleanisTestingprivate final BooleanisProductionprivate final BooleanisAppForegroundprivate final BooleanisAppBackgroundpublic final static AppHelperINSTANCE
-
Method Summary
Modifier and Type Method Description final Unitinit(Application application, BuildType buildType)初始化应用程序助手。 UnitonAppStatusChanged(AppStatus appStatus, Activity activity)IAppStatusService 接口实现,用于处理应用程序状态变化。 final SharedPreferencescreateSharedPreferences()创建并返回应用程序的 SharedPreferences 对象。 final ApplicationgetApplication()final BuildTypegetEnvMode()final BooleangetIsDevelopment()final BooleangetIsTesting()final BooleangetIsProduction()final BooleangetIsAppForeground()final BooleangetIsAppBackground()-
-
Method Detail
-
init
final Unit init(Application application, BuildType buildType)
初始化应用程序助手。
- Parameters:
application- 应用程序实例。buildType- 应用程序的构建类型。
-
onAppStatusChanged
Unit onAppStatusChanged(AppStatus appStatus, Activity activity)
IAppStatusService 接口实现,用于处理应用程序状态变化。
- Parameters:
appStatus- 应用程序的新状态。activity- 触发状态变化的活动。
-
createSharedPreferences
final SharedPreferences createSharedPreferences()
创建并返回应用程序的 SharedPreferences 对象。
-
getApplication
final Application getApplication()
-
getEnvMode
final BuildType getEnvMode()
-
getIsDevelopment
final Boolean getIsDevelopment()
-
getIsTesting
final Boolean getIsTesting()
-
getIsProduction
final Boolean getIsProduction()
-
getIsAppForeground
final Boolean getIsAppForeground()
-
getIsAppBackground
final Boolean getIsAppBackground()
-
-
-
-