theme / projekt.commons.theme / ThemeApp

ThemeApp

object ThemeApp

Main class of this library.

Types

Name Summary
InitResult sealed class InitResult
This class represents the result of Backend initialization.
OverlayState object OverlayState
Used to represent status of the installed overlay

Properties

Name Summary
isAndromeda val isAndromeda:Boolean
Returns true if the active Backend uses Andromeda Server.
isAndromedaSamsung val isAndromedaSamsung:Boolean
Returns true if the active Backend uses Andromeda Backend and if Build.VERSION.SDK_INT < Build.VERSION_CODES.P
isPieRoot val isPieRoot:Boolean
Returns true if the active Backend uses root and if Build.VERSION.SDK_INT >= Build.VERSION_CODES.P.
isRoot val isRoot:Boolean
Returns true if the active Backend uses root.
isSubstratumOms val isSubstratumOms:Boolean
Returns true if the host OS runs modified version of OMS. Usually custom ROMs.
isSubstratumService val isSubstratumService:Boolean
Returns true if the active Backend uses Substratum Service.
isSupportCustomFonts val isSupportCustomFonts:Boolean
This checks exists because custom fonts support is kind of broken on P+
isSynergy val isSynergy:Boolean
Returns true if the active Backend uses Synergy
magiskInstalledOverlay val magiskInstalledOverlay:List<OverlayPackageInfo>
Returns list of overlays in form of OverlayPackageInfo in the magisk install location.
OVERLAY_PERMISSION val OVERLAY_PERMISSION:String
Any overlays generated by this library will always have this “permission”.
SAMSUNG_OVERLAY_PERMISSION const val SAMSUNG_OVERLAY_PERMISSION:String
Any overlays generated by this library will always have this permission if the host device runs Samsung OS.

Functions

Name Summary
canUseSamsungExposure fun canUseSamsungExposure():Boolean
Checks whether the Samsung theme exposures can be used.
getBackend fun getBackend(options:ThemeAppOptions):Backend?
Get theme application backend with specified options. If the backend is uninitialized, this method will try silently initialize it, assuming all the requirements (permissions etc) for supported backend are fulfilled. If not, then null will be returned.
getInitIntent fun getInitIntent(context:Context, options:ThemeAppOptions):Intent
Returns an activity Intent to initialize the Backend for the theme app.
getOverlayPackageInfo fun getOverlayPackageInfo(overlayPackageName:String):OverlayPackageInfo?
Reads details of an installed overlay.
getResultFromIntent fun getResultFromIntent(intent:Intent):ThemeApp.InitResult
Returns InitResult from init result intent.
isSamsungExposureAvailable fun isSamsungExposureAvailable():Boolean
Checks whether the Samsung theme exposures is available to use.
isSamsungExposureEnabled fun isSamsungExposureEnabled():Boolean
Checks whether the Samsung exposures is enabled.
setSamsungExposureEnabled fun setSamsungExposureEnabled(enabled:Boolean):Unit
Enables or disables the available Samsung exposures. If it can’t be used this method will fail silently.