config

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config provides Go bindings for Android AConfiguration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CONFIGURATION

type CONFIGURATION int32
const (
	ACONFIGURATION_ORIENTATION_ANY              CONFIGURATION = 0
	ACONFIGURATION_ORIENTATION_PORT             CONFIGURATION = 1
	ACONFIGURATION_ORIENTATION_LAND             CONFIGURATION = 2
	ACONFIGURATION_ORIENTATION_SQUARE           CONFIGURATION = 3
	ACONFIGURATION_TOUCHSCREEN_ANY              CONFIGURATION = 0
	ACONFIGURATION_TOUCHSCREEN_NOTOUCH          CONFIGURATION = 1
	ACONFIGURATION_TOUCHSCREEN_STYLUS           CONFIGURATION = 2
	ACONFIGURATION_TOUCHSCREEN_FINGER           CONFIGURATION = 3
	ACONFIGURATION_DENSITY_DEFAULT              CONFIGURATION = 0
	ACONFIGURATION_DENSITY_LOW                  CONFIGURATION = 120
	ACONFIGURATION_DENSITY_MEDIUM               CONFIGURATION = 160
	ACONFIGURATION_DENSITY_TV                   CONFIGURATION = 213
	ACONFIGURATION_DENSITY_HIGH                 CONFIGURATION = 240
	ACONFIGURATION_DENSITY_XHIGH                CONFIGURATION = 320
	ACONFIGURATION_DENSITY_XXHIGH               CONFIGURATION = 480
	ACONFIGURATION_DENSITY_XXXHIGH              CONFIGURATION = 640
	ACONFIGURATION_DENSITY_ANY                  CONFIGURATION = 65534
	ACONFIGURATION_DENSITY_NONE                 CONFIGURATION = 65535
	ACONFIGURATION_KEYBOARD_ANY                 CONFIGURATION = 0
	ACONFIGURATION_KEYBOARD_NOKEYS              CONFIGURATION = 1
	ACONFIGURATION_KEYBOARD_QWERTY              CONFIGURATION = 2
	ACONFIGURATION_KEYBOARD_12KEY               CONFIGURATION = 3
	ACONFIGURATION_NAVIGATION_ANY               CONFIGURATION = 0
	ACONFIGURATION_NAVIGATION_NONAV             CONFIGURATION = 1
	ACONFIGURATION_NAVIGATION_DPAD              CONFIGURATION = 2
	ACONFIGURATION_NAVIGATION_TRACKBALL         CONFIGURATION = 3
	ACONFIGURATION_NAVIGATION_WHEEL             CONFIGURATION = 4
	ACONFIGURATION_KEYSHIDDEN_ANY               CONFIGURATION = 0
	ACONFIGURATION_KEYSHIDDEN_NO                CONFIGURATION = 1
	ACONFIGURATION_KEYSHIDDEN_YES               CONFIGURATION = 2
	ACONFIGURATION_KEYSHIDDEN_SOFT              CONFIGURATION = 3
	ACONFIGURATION_NAVHIDDEN_ANY                CONFIGURATION = 0
	ACONFIGURATION_NAVHIDDEN_NO                 CONFIGURATION = 1
	ACONFIGURATION_NAVHIDDEN_YES                CONFIGURATION = 2
	ACONFIGURATION_SCREENSIZE_ANY               CONFIGURATION = 0
	ACONFIGURATION_SCREENSIZE_SMALL             CONFIGURATION = 1
	ACONFIGURATION_SCREENSIZE_NORMAL            CONFIGURATION = 2
	ACONFIGURATION_SCREENSIZE_LARGE             CONFIGURATION = 3
	ACONFIGURATION_SCREENSIZE_XLARGE            CONFIGURATION = 4
	ACONFIGURATION_SCREENLONG_ANY               CONFIGURATION = 0
	ACONFIGURATION_SCREENLONG_NO                CONFIGURATION = 1
	ACONFIGURATION_SCREENLONG_YES               CONFIGURATION = 2
	ACONFIGURATION_SCREENROUND_ANY              CONFIGURATION = 0
	ACONFIGURATION_SCREENROUND_NO               CONFIGURATION = 1
	ACONFIGURATION_SCREENROUND_YES              CONFIGURATION = 2
	ACONFIGURATION_WIDE_COLOR_GAMUT_ANY         CONFIGURATION = 0
	ACONFIGURATION_WIDE_COLOR_GAMUT_NO          CONFIGURATION = 1
	ACONFIGURATION_WIDE_COLOR_GAMUT_YES         CONFIGURATION = 2
	ACONFIGURATION_HDR_ANY                      CONFIGURATION = 0
	ACONFIGURATION_HDR_NO                       CONFIGURATION = 1
	ACONFIGURATION_HDR_YES                      CONFIGURATION = 2
	ACONFIGURATION_UI_MODE_TYPE_ANY             CONFIGURATION = 0
	ACONFIGURATION_UI_MODE_TYPE_NORMAL          CONFIGURATION = 1
	ACONFIGURATION_UI_MODE_TYPE_DESK            CONFIGURATION = 2
	ACONFIGURATION_UI_MODE_TYPE_CAR             CONFIGURATION = 3
	ACONFIGURATION_UI_MODE_TYPE_TELEVISION      CONFIGURATION = 4
	ACONFIGURATION_UI_MODE_TYPE_APPLIANCE       CONFIGURATION = 5
	ACONFIGURATION_UI_MODE_TYPE_WATCH           CONFIGURATION = 6
	ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET      CONFIGURATION = 7
	ACONFIGURATION_UI_MODE_NIGHT_ANY            CONFIGURATION = 0
	ACONFIGURATION_UI_MODE_NIGHT_NO             CONFIGURATION = 1
	ACONFIGURATION_UI_MODE_NIGHT_YES            CONFIGURATION = 2
	ACONFIGURATION_SCREEN_WIDTH_DP_ANY          CONFIGURATION = 0
	ACONFIGURATION_SCREEN_HEIGHT_DP_ANY         CONFIGURATION = 0
	ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY CONFIGURATION = 0
	ACONFIGURATION_LAYOUTDIR_ANY                CONFIGURATION = 0
	ACONFIGURATION_LAYOUTDIR_LTR                CONFIGURATION = 1
	ACONFIGURATION_LAYOUTDIR_RTL                CONFIGURATION = 2
	ACONFIGURATION_MCC                          CONFIGURATION = 1
	ACONFIGURATION_MNC                          CONFIGURATION = 2
	ACONFIGURATION_LOCALE                       CONFIGURATION = 4
	ACONFIGURATION_TOUCHSCREEN                  CONFIGURATION = 8
	ACONFIGURATION_KEYBOARD                     CONFIGURATION = 16
	ACONFIGURATION_KEYBOARD_HIDDEN              CONFIGURATION = 32
	ACONFIGURATION_NAVIGATION                   CONFIGURATION = 64
	ACONFIGURATION_ORIENTATION                  CONFIGURATION = 128
	ACONFIGURATION_DENSITY                      CONFIGURATION = 256
	ACONFIGURATION_SCREEN_SIZE                  CONFIGURATION = 512
	ACONFIGURATION_VERSION                      CONFIGURATION = 1024
	ACONFIGURATION_SCREEN_LAYOUT                CONFIGURATION = 2048
	ACONFIGURATION_UI_MODE                      CONFIGURATION = 4096
	ACONFIGURATION_SMALLEST_SCREEN_SIZE         CONFIGURATION = 8192
	ACONFIGURATION_LAYOUTDIR                    CONFIGURATION = 16384
	ACONFIGURATION_SCREEN_ROUND                 CONFIGURATION = 32768
	ACONFIGURATION_COLOR_MODE                   CONFIGURATION = 65536
	ACONFIGURATION_GRAMMATICAL_GENDER           CONFIGURATION = 131072
	ACONFIGURATION_MNC_ZERO                     CONFIGURATION = 65535
	ACONFIGURATION_GRAMMATICAL_GENDER_ANY       CONFIGURATION = 0
	ACONFIGURATION_GRAMMATICAL_GENDER_NEUTER    CONFIGURATION = 1
	ACONFIGURATION_GRAMMATICAL_GENDER_FEMININE  CONFIGURATION = 2
	ACONFIGURATION_GRAMMATICAL_GENDER_MASCULINE CONFIGURATION = 3
)

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config wraps the NDK AConfiguration handle.

func NewConfig

func NewConfig() *Config

NewConfig creates a new Config.

func NewConfigFromPointer

func NewConfigFromPointer(ptr unsafe.Pointer) *Config

NewConfigFromPointer wraps a raw AConfiguration pointer.

func (*Config) Close

func (h *Config) Close() error

Close releases the underlying NDK handle.

func (*Config) Copy

func (h *Config) Copy(src *Config)

Copy calls the underlying NDK function.

func (*Config) Country

func (h *Config) Country(outCountry string)

Country calls the underlying NDK function.

func (*Config) Density

func (h *Config) Density() int32

Density returns the value directly.

func (*Config) Diff

func (h *Config) Diff(config2 *Config) error

Diff calls the underlying NDK function.

func (*Config) GetGrammaticalGender

func (h *Config) GetGrammaticalGender() error

GetGrammaticalGender calls the underlying NDK function.

func (*Config) GetKeyboard

func (h *Config) GetKeyboard() error

GetKeyboard calls the underlying NDK function.

func (*Config) GetKeysHidden

func (h *Config) GetKeysHidden() error

GetKeysHidden calls the underlying NDK function.

func (*Config) GetLayoutDirection

func (h *Config) GetLayoutDirection() error

GetLayoutDirection calls the underlying NDK function.

func (*Config) GetMcc

func (h *Config) GetMcc() error

GetMcc calls the underlying NDK function.

func (*Config) GetMnc

func (h *Config) GetMnc() error

GetMnc calls the underlying NDK function.

func (*Config) GetNavHidden

func (h *Config) GetNavHidden() error

GetNavHidden calls the underlying NDK function.

func (*Config) GetNavigation

func (h *Config) GetNavigation() error

GetNavigation calls the underlying NDK function.

func (*Config) GetScreenLong

func (h *Config) GetScreenLong() error

GetScreenLong calls the underlying NDK function.

func (*Config) GetScreenRound

func (h *Config) GetScreenRound() error

GetScreenRound calls the underlying NDK function.

func (*Config) GetSmallestScreenWidthDp

func (h *Config) GetSmallestScreenWidthDp() error

GetSmallestScreenWidthDp calls the underlying NDK function.

func (*Config) GetTouchscreen

func (h *Config) GetTouchscreen() error

GetTouchscreen calls the underlying NDK function.

func (*Config) GetUiModeNight

func (h *Config) GetUiModeNight() error

GetUiModeNight calls the underlying NDK function.

func (*Config) GetUiModeType

func (h *Config) GetUiModeType() error

GetUiModeType calls the underlying NDK function.

func (*Config) IsBetterThan

func (h *Config) IsBetterThan(test *Config, requested *Config) error

IsBetterThan calls the underlying NDK function.

func (*Config) Language

func (h *Config) Language(outLanguage string)

Language calls the underlying NDK function.

func (*Config) Match

func (h *Config) Match(requested *Config) error

Match calls the underlying NDK function.

func (*Config) Orientation

func (h *Config) Orientation() int32

Orientation returns the value directly.

func (*Config) Pointer

func (h *Config) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Config) ScreenHeightDp

func (h *Config) ScreenHeightDp() int32

ScreenHeightDp returns the value directly.

func (*Config) ScreenSize

func (h *Config) ScreenSize() int32

ScreenSize returns the value directly.

func (*Config) ScreenWidthDp

func (h *Config) ScreenWidthDp() int32

ScreenWidthDp returns the value directly.

func (*Config) SdkVersion

func (h *Config) SdkVersion() int32

SdkVersion returns the value directly.

func (*Config) SetCountry

func (h *Config) SetCountry(country string)

SetCountry calls the underlying NDK function.

func (*Config) SetDensity

func (h *Config) SetDensity(density int32)

SetDensity calls the underlying NDK function.

func (*Config) SetGrammaticalGender

func (h *Config) SetGrammaticalGender(value int32)

SetGrammaticalGender calls the underlying NDK function.

func (*Config) SetKeyboard

func (h *Config) SetKeyboard(keyboard int32)

SetKeyboard calls the underlying NDK function.

func (*Config) SetKeysHidden

func (h *Config) SetKeysHidden(keysHidden int32)

SetKeysHidden calls the underlying NDK function.

func (*Config) SetLanguage

func (h *Config) SetLanguage(language string)

SetLanguage calls the underlying NDK function.

func (*Config) SetLayoutDirection

func (h *Config) SetLayoutDirection(value int32)

SetLayoutDirection calls the underlying NDK function.

func (*Config) SetMcc

func (h *Config) SetMcc(mcc int32)

SetMcc calls the underlying NDK function.

func (*Config) SetMnc

func (h *Config) SetMnc(mnc int32)

SetMnc calls the underlying NDK function.

func (*Config) SetNavHidden

func (h *Config) SetNavHidden(navHidden int32)

SetNavHidden calls the underlying NDK function.

func (*Config) SetNavigation

func (h *Config) SetNavigation(navigation int32)

SetNavigation calls the underlying NDK function.

func (*Config) SetOrientation

func (h *Config) SetOrientation(orientation Orientation)

SetOrientation calls the underlying NDK function.

func (*Config) SetScreenHeightDp

func (h *Config) SetScreenHeightDp(value int32)

SetScreenHeightDp calls the underlying NDK function.

func (*Config) SetScreenLong

func (h *Config) SetScreenLong(screenLong int32)

SetScreenLong calls the underlying NDK function.

func (*Config) SetScreenSize

func (h *Config) SetScreenSize(screenSize ScreenSize)

SetScreenSize calls the underlying NDK function.

func (*Config) SetScreenWidthDp

func (h *Config) SetScreenWidthDp(value int32)

SetScreenWidthDp calls the underlying NDK function.

func (*Config) SetSdkVersion

func (h *Config) SetSdkVersion(sdkVersion int32)

SetSdkVersion calls the underlying NDK function.

func (*Config) SetSmallestScreenWidthDp

func (h *Config) SetSmallestScreenWidthDp(value int32)

SetSmallestScreenWidthDp calls the underlying NDK function.

func (*Config) SetTouchscreen

func (h *Config) SetTouchscreen(touchscreen int32)

SetTouchscreen calls the underlying NDK function.

func (*Config) SetUiModeNight

func (h *Config) SetUiModeNight(uiModeNight int32)

SetUiModeNight calls the underlying NDK function.

func (*Config) SetUiModeType

func (h *Config) SetUiModeType(uiModeType int32)

SetUiModeType calls the underlying NDK function.

type Error

type Error int32

Error represents an NDK error code.

func (Error) Error

func (e Error) Error() string

type Orientation

type Orientation int32
const (
	OrientationAny    Orientation = 0
	OrientationPort   Orientation = 1
	OrientationLand   Orientation = 2
	OrientationSquare Orientation = 3
)

type ScreenSize

type ScreenSize int32
const (
	ScreensizeAny    ScreenSize = 0
	ScreensizeSmall  ScreenSize = 1
	ScreensizeNormal ScreenSize = 2
	ScreensizeLarge  ScreenSize = 3
	ScreensizeXlarge ScreenSize = 4
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL