Package org.robolectric.res.android
Class ResTable_config
java.lang.Object
org.robolectric.res.android.ResTable_config
Describes a particular resource configuration.
Transliterated from: * https://android.googlesource.com/platform/frameworks/base/+/android-9.0.0_r12/libs/androidfw/ResourceTypes.cpp * https://android.googlesource.com/platform/frameworks/base/+/android-9.0.0_r12/libs/androidfw/include/ResourceTypes.h (struct ResTable_config)
Changes from 8.0.0_r4 partially applied.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The different types of configs that can be present in aResTable_config
. -
Field Summary
Modifier and TypeFieldDescriptionbyte
final byte[]
Returns a packed 2-byte country code.int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
int
int
static final int
static final byte
static final byte
static final byte
static final byte
final byte[]
Returns a packed 2-byte language code.static final int
static final int
static final int
final byte[]
The ISO-15924 short name for the script corresponding to this configuration.final byte[]
A single BCP-47 variant subtag.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
int
int
static final int
int
static final byte
static final byte
static final byte
int
static final int
int
static final int
static final int
static final int
static final int
static final int
short
int
static final int
int
int
byte
An extension toscreenLayout
.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
int
static final int
int
int
static final int
static final int
static final int
static final int
static final int
static final int
int
int
static final int
static final int
static final int
static final int
static final int
static final int
int
byte[]
Any remaining bytes in this resource configuration that are unaccounted for.static final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionResTable_config
(int size, int mcc, int mnc, byte[] language, byte[] country, int orientation, int touchscreen, int density, int keyboard, int navigation, int inputFlags, int screenWidth, int screenHeight, int sdkVersion, int minorVersion, int screenLayout, int uiMode, int smallestScreenWidthDp, int screenWidthDp, int screenHeightDp, byte[] localeScript, byte[] localeVariant, byte screenLayout2, byte colorMode, short screenConfigPad2, byte[] unknown) ResTable_config
(ResTable_config other) -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Returns the HDR section ofcolorMode
.final int
Returns the wide color gamut section ofcolorMode
.boolean
isBetterThan
(ResTable_config o, ResTable_config requested) final boolean
Returns true if this is the default "any" configuration.final int
final void
keyboardHidden
(int value) final String
Returnslanguage
as an unpacked string representation.final String
Returns thelocaleScript
as a string.final String
Returns thelocaleVariant
as a string.boolean
match
(ResTable_config settings) final int
final void
navigationHidden
(int value) void
packLanguage
(String language) void
packRegion
(String region) final String
Returnscountry
as an unpacked string representation.final int
final void
screenLayoutDirection
(int value) final int
final void
screenLayoutLong
(int value) final int
final void
screenLayoutRound
(int value) final int
final void
screenLayoutSize
(int value) final String
void
setBcp47Locale
(String in) final String
toString()
final Map<ResTable_config.Type,
String> Returns a map of the configuration parts fortoString()
.final int
final void
uiModeNight
(int value) final int
final void
uiModeType
(int value) final ResTable_config
withSdkVersion
(int sdkVersion) Returns a copy of this resource configuration with a differentsdkVersion
, or this configuration if thesdkVersion
is the same.
-
Field Details
-
RESTABLE_MAX_LOCALE_LEN
public static final int RESTABLE_MAX_LOCALE_LEN- See Also:
-
SIZEOF
public static final int SIZEOF- See Also:
-
SHIFT_LAYOUTDIR
public static final int SHIFT_LAYOUTDIR- See Also:
-
LAYOUTDIR_ANY
public static final int LAYOUTDIR_ANY- See Also:
-
LAYOUTDIR_LTR
public static final int LAYOUTDIR_LTR- See Also:
-
LAYOUTDIR_RTL
public static final int LAYOUTDIR_RTL- See Also:
-
SCREENWIDTH_ANY
public static final int SCREENWIDTH_ANY- See Also:
-
SCREENSIZE_ANY
public static final int SCREENSIZE_ANY- See Also:
-
SCREENSIZE_SMALL
public static final int SCREENSIZE_SMALL- See Also:
-
SCREENSIZE_NORMAL
public static final int SCREENSIZE_NORMAL- See Also:
-
SCREENSIZE_LARGE
public static final int SCREENSIZE_LARGE- See Also:
-
SCREENSIZE_XLARGE
public static final int SCREENSIZE_XLARGE- See Also:
-
MASK_UI_MODE_TYPE
public static final int MASK_UI_MODE_TYPE- See Also:
-
UI_MODE_TYPE_ANY
public static final int UI_MODE_TYPE_ANY- See Also:
-
UI_MODE_TYPE_NORMAL
public static final int UI_MODE_TYPE_NORMAL- See Also:
-
MASK_UI_MODE_NIGHT
public static final int MASK_UI_MODE_NIGHT- See Also:
-
SHIFT_UI_MODE_NIGHT
public static final int SHIFT_UI_MODE_NIGHT- See Also:
-
UI_MODE_NIGHT_ANY
public static final int UI_MODE_NIGHT_ANY- See Also:
-
DENSITY_DEFAULT
public static final int DENSITY_DEFAULT- See Also:
-
DENSITY_LOW
public static final int DENSITY_LOW- See Also:
-
DENSITY_MEDIUM
public static final int DENSITY_MEDIUM- See Also:
-
DENSITY_TV
public static final int DENSITY_TV- See Also:
-
DENSITY_HIGH
public static final int DENSITY_HIGH- See Also:
-
DENSITY_XHIGH
public static final int DENSITY_XHIGH- See Also:
-
DENSITY_XXHIGH
public static final int DENSITY_XXHIGH- See Also:
-
DENSITY_XXXHIGH
public static final int DENSITY_XXXHIGH- See Also:
-
DENSITY_ANY
public static final int DENSITY_ANY- See Also:
-
DENSITY_NONE
public static final int DENSITY_NONE- See Also:
-
TOUCHSCREEN_ANY
public static final int TOUCHSCREEN_ANY- See Also:
-
MASK_KEYSHIDDEN
public static final int MASK_KEYSHIDDEN- See Also:
-
KEYSHIDDEN_ANY
public static final byte KEYSHIDDEN_ANY- See Also:
-
KEYSHIDDEN_NO
public static final byte KEYSHIDDEN_NO- See Also:
-
KEYSHIDDEN_YES
public static final byte KEYSHIDDEN_YES- See Also:
-
KEYSHIDDEN_SOFT
public static final byte KEYSHIDDEN_SOFT- See Also:
-
KEYBOARD_ANY
public static final int KEYBOARD_ANY- See Also:
-
MASK_NAVHIDDEN
public static final int MASK_NAVHIDDEN- See Also:
-
SHIFT_NAVHIDDEN
public static final int SHIFT_NAVHIDDEN- See Also:
-
NAVHIDDEN_ANY
public static final byte NAVHIDDEN_ANY- See Also:
-
NAVHIDDEN_NO
public static final byte NAVHIDDEN_NO- See Also:
-
NAVHIDDEN_YES
public static final byte NAVHIDDEN_YES- See Also:
-
NAVIGATION_ANY
public static final int NAVIGATION_ANY- See Also:
-
SCREENHEIGHT_ANY
public static final int SCREENHEIGHT_ANY- See Also:
-
SDKVERSION_ANY
public static final int SDKVERSION_ANY- See Also:
-
MINORVERSION_ANY
public static final int MINORVERSION_ANY- See Also:
-
WIDE_COLOR_GAMUT_ANY
public static final int WIDE_COLOR_GAMUT_ANY- See Also:
-
WIDE_COLOR_GAMUT_NO
public static final int WIDE_COLOR_GAMUT_NO- See Also:
-
WIDE_COLOR_GAMUT_YES
public static final int WIDE_COLOR_GAMUT_YES- See Also:
-
MASK_WIDE_COLOR_GAMUT
public static final int MASK_WIDE_COLOR_GAMUT- See Also:
-
HDR_ANY
public static final int HDR_ANY- See Also:
-
HDR_NO
public static final int HDR_NO- See Also:
-
HDR_YES
public static final int HDR_YES- See Also:
-
MASK_HDR
public static final int MASK_HDR- See Also:
-
DENSITY_DPI_UNDEFINED
public static final int DENSITY_DPI_UNDEFINED- See Also:
-
DENSITY_DPI_MDPI
public static final int DENSITY_DPI_MDPI- See Also:
-
DENSITY_DPI_ANY
public static final int DENSITY_DPI_ANY- See Also:
-
DENSITY_DPI_NONE
public static final int DENSITY_DPI_NONE- See Also:
-
ORIENTATION_ANY
public static final int ORIENTATION_ANY- See Also:
-
ORIENTATION_PORT
public static final int ORIENTATION_PORT- See Also:
-
ORIENTATION_LAND
public static final int ORIENTATION_LAND- See Also:
-
ORIENTATION_SQUARE
public static final int ORIENTATION_SQUARE- See Also:
-
MASK_SCREENLONG
public static final int MASK_SCREENLONG- See Also:
-
SHIFT_SCREENLONG
public static final int SHIFT_SCREENLONG- See Also:
-
SCREENLONG_ANY
public static final int SCREENLONG_ANY- See Also:
-
SCREENLONG_NO
public static final int SCREENLONG_NO- See Also:
-
SCREENLONG_YES
public static final int SCREENLONG_YES- See Also:
-
SCREENROUND_ANY
public static final int SCREENROUND_ANY- See Also:
-
SCREENROUND_NO
public static final int SCREENROUND_NO- See Also:
-
SCREENROUND_YES
public static final int SCREENROUND_YES- See Also:
-
TOUCHSCREEN_FINGER
public static final int TOUCHSCREEN_FINGER- See Also:
-
UI_MODE_NIGHT_NO
public static final int UI_MODE_NIGHT_NO- See Also:
-
mcc
public int mcc -
mnc
public int mnc -
language
public final byte[] languageReturns a packed 2-byte language code. -
country
public final byte[] countryReturns a packed 2-byte country code. -
orientation
public int orientation -
touchscreen
public int touchscreen -
density
public int density -
keyboard
public int keyboard -
inputFlags
public int inputFlags -
screenWidth
public int screenWidth -
screenHeight
public int screenHeight -
sdkVersion
public int sdkVersion -
minorVersion
public int minorVersion -
screenLayout
public int screenLayout -
uiMode
public int uiMode -
smallestScreenWidthDp
public int smallestScreenWidthDp -
screenWidthDp
public int screenWidthDp -
screenHeightDp
public int screenHeightDp -
localeScript
public final byte[] localeScriptThe ISO-15924 short name for the script corresponding to this configuration. -
localeVariant
public final byte[] localeVariantA single BCP-47 variant subtag. -
screenLayout2
public byte screenLayout2An extension toscreenLayout
. Contains round/notround qualifier. -
colorMode
public byte colorMode -
screenConfigPad2
public short screenConfigPad2 -
unknown
public byte[] unknownAny remaining bytes in this resource configuration that are unaccounted for. -
MASK_LAYOUTDIR
public static final int MASK_LAYOUTDIR- See Also:
-
-
Constructor Details
-
ResTable_config
-
ResTable_config
public ResTable_config(int size, int mcc, int mnc, byte[] language, byte[] country, int orientation, int touchscreen, int density, int keyboard, int navigation, int inputFlags, int screenWidth, int screenHeight, int sdkVersion, int minorVersion, int screenLayout, int uiMode, int smallestScreenWidthDp, int screenWidthDp, int screenHeightDp, byte[] localeScript, byte[] localeVariant, byte screenLayout2, byte colorMode, short screenConfigPad2, byte[] unknown) -
ResTable_config
public ResTable_config()
-
-
Method Details
-
languageString
Returnslanguage
as an unpacked string representation. -
localeScriptString
Returns thelocaleScript
as a string. -
localeVariantString
Returns thelocaleVariant
as a string. -
colorModeWideColorGamut
public final int colorModeWideColorGamut()Returns the wide color gamut section ofcolorMode
. -
colorModeHdr
public final int colorModeHdr()Returns the HDR section ofcolorMode
. -
regionString
Returnscountry
as an unpacked string representation. -
scriptString
-
keyboardHidden
public final int keyboardHidden() -
keyboardHidden
public final void keyboardHidden(int value) -
withSdkVersion
Returns a copy of this resource configuration with a differentsdkVersion
, or this configuration if thesdkVersion
is the same.- Parameters:
sdkVersion
- The SDK version of the returned configuration.- Returns:
- A copy of this configuration with the only difference being #sdkVersion.
-
screenLayoutDirection
public final int screenLayoutDirection() -
screenLayoutDirection
public final void screenLayoutDirection(int value) -
screenLayoutSize
public final int screenLayoutSize() -
screenLayoutSize
public final void screenLayoutSize(int value) -
screenLayoutLong
public final int screenLayoutLong() -
screenLayoutLong
public final void screenLayoutLong(int value) -
screenLayoutRound
public final int screenLayoutRound() -
screenLayoutRound
public final void screenLayoutRound(int value) -
uiModeType
public final int uiModeType() -
uiModeType
public final void uiModeType(int value) -
uiModeNight
public final int uiModeNight() -
uiModeNight
public final void uiModeNight(int value) -
packLanguage
-
packRegion
-
isDefault
public final boolean isDefault()Returns true if this is the default "any" configuration. -
toString
-
toStringParts
Returns a map of the configuration parts fortoString()
.If a configuration part is not defined for this
ResTable_config
, its value will be the empty string. -
isBetterThan
-
match
-
setBcp47Locale
-