CommonActivity

Properties

Link copied to clipboard
var activity: Activity?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val displayMetrics: DisplayMetrics
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var keyEventListener: (Pair<KeyEvent?, Boolean>) -> Boolean?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val TAG: String

Functions

Link copied to clipboard
fun continueGetNextFocus(root: Any?, view: View, direction: FocusDirection, nextId: Int, depth: Int = 0): View?

skips the initial stage of searching for an id using the view, see getNextFocus for specification

Link copied to clipboard
fun dispatchKeyEvent(act: Activity?, event: KeyEvent?): Boolean?

overrides focus and custom key events

Link copied to clipboard
@MainThread
fun Activity?.getCastSession(): CastSession?
Link copied to clipboard
fun getNextFocus(root: Any?, view: View?, direction: FocusDirection, depth: Int = 0): View?

recursively looks for a next focus up to a depth of 10, this is used to override the normal shit focus system because this application has a lot of invisible views that messes with some tv devices

Link copied to clipboard
fun init(act: Activity)
Link copied to clipboard
fun loadThemes(act: Activity?)
Link copied to clipboard
fun onKeyDown(act: Activity?, keyCode: Int, event: KeyEvent?): Boolean?
Link copied to clipboard
fun onUserLeaveHint(act: Activity)
Link copied to clipboard
@MainThread
fun setActivityInstance(newActivity: Activity?)
Link copied to clipboard
fun setLocale(context: Context?, languageTag: String?)

Set locale

Link copied to clipboard
fun showToast(message: UiText?, duration: Int? = null)
fun showToast(@StringRes message: Int, duration: Int? = null)
fun showToast(message: String?, duration: Int? = null)
@MainThread
fun showToast(act: Activity?, text: UiText, duration: Int)

@MainThread
fun showToast(act: Activity?, @StringRes message: Int, duration: Int? = null)
@MainThread
fun showToast(act: Activity?, message: String?, duration: Int? = null)

duration is Toast.LENGTH_SHORT if null

Link copied to clipboard
fun Context.updateLocale()
Link copied to clipboard
fun updateTheme(act: Activity)