Skip to content

hikage-widget-foundation ​

Maven CentralMaven metadata URL

This is a Hikage declaration dependency for Android foundation View components.

hikage-core already includes this dependency by default, but you can also manually include it if needed.

Configure Dependency ​

You can add this module to your project using the following method.

We recommend that you first refer to hikage-bom to use BOM for unified version management.

Add dependency in your project's gradle/libs.versions.toml.

toml
[versions]
hikage-widget-foundation = "<version>"

[libraries]
hikage-widget-foundation = { module = "com.highcapable.hikage:hikage-widget-foundation", version.ref = "hikage-widget-foundation" }

Configure dependency in your project's build.gradle.kts.

kotlin
implementation(libs.hikage.widget.foundation)

Please change <version> to the version displayed at the top of this document.

Traditional Method ​

Configure dependency in your project's build.gradle.kts.

kotlin
implementation("com.highcapable.hikage:hikage-widget-foundation:<version>")

Please change <version> to the version displayed at the top of this document.

Function Introduction ​

This dependency declares the available components from Android foundation View that you can directly reference and use in Hikage.

Tips

This dependency needs to be used in conjunction with hikage-gradle-plugin, the plugin will automatically read the view declaration files in the dependency and generate corresponding Hikage layout component functions (Hikage Performer) in the current module through hikage-compiler.

The following example

kotlin
LinearLayout(
    lparams = LayoutParams(matchParent = true) {
        topMargin = 16.dp
    },
    init = {
        orientation = LinearLayout.VERTICAL
        gravity = Gravity.CENTER
    }
) {
    TextView {
        text = "Hello, World!"
        textSize = 16f
        gravity = Gravity.CENTER
    }
}

Released under the Apache-2.0 License