Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ui/layout

Index

Interfaces

Variables

Functions

Variables

Const R

R: Resources = ...

Similar to Android's R, used to get resource related ID, such as R.drawable.ic_launcher and R.style.ScriptTheme.

example
"nodejs";

const { R } = require("ui");

const context = $autojs.androidContext;
console.log(context.getDrawable(R.drawable.ic_delete))

see

https://developer.android.com/reference/android/R

Functions

defaultThemeContext

  • defaultThemeContext(): Context
  • Get the default theme context.

    Returns Context

inflateXml

  • inflateXml(ctx: Context, xml: string, parent?: ViewGroup, attachToParent?: boolean): JsView<View>
  • Inflate a new view hierarchy from the specified xml resource. Throws InflateException if there is an error.

    Parameters

    • ctx: Context

      Android Context, if you want to create androidx-related views, you must specify a Material-related theme context

    • xml: string

      xml content

    • Optional parent: ViewGroup

      Optional view to be the parent of the generated hierarchy (if attachToRoot is true), or else simply an object that provides a set of LayoutParams values for root of the returned hierarchy (if attachToRoot is false.)

    • Optional attachToParent: boolean

    Returns JsView<View>

Generated using TypeDoc