Class BinaryResourceConfiguration
- java.lang.Object
-
- com.google.devrel.gmscore.tools.apk.arsc.BinaryResourceConfiguration
-
- All Implemented Interfaces:
SerializableResource
public class BinaryResourceConfiguration extends java.lang.Object implements SerializableResource
Describes a particular resource configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBinaryResourceConfiguration.TypeThe different types of configs that can be present in aBinaryResourceConfiguration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdensity()booleanequals(java.lang.Object o)inthashCode()intinputFlags()booleanisDefault()Returns true if this is the default "any" configuration.intkeyboard()intkeyboardHidden()byte[]language()Returns a packed 2-byte language code.java.lang.StringlanguageString()Returnslanguageas an unpacked string representation.byte[]localeScript()The ISO-15924 short name for the script corresponding to this configuration.byte[]localeVariant()A single BCP-47 variant subtag.intmcc()intminorVersion()intmnc()intnavigation()intnavigationHidden()intorientation()byte[]region()Returns a packed 2-byte region code.java.lang.StringregionString()Returnsregionas an unpacked string representation.intscreenHeight()intscreenHeightDp()intscreenLayout()intscreenLayout2()An extension toscreenLayout.intscreenLayoutDirection()intscreenLayoutLong()intscreenLayoutRound()intscreenLayoutSize()intscreenWidth()intscreenWidthDp()intsdkVersion()intsize()The number of bytes that this resource configuration takes up.intsmallestScreenWidthDp()byte[]toByteArray()Converts this resource into an array of bytes representation.byte[]toByteArray(boolean shrink)Converts this resource into an array of bytes representation.java.lang.StringtoString()java.util.Map<BinaryResourceConfiguration.Type,java.lang.String>toStringParts()Returns a map of the configuration parts fortoString().inttouchscreen()intuiMode()intuiModeNight()intuiModeType()byte[]unknown()Any remaining bytes in this resource configuration that are unaccounted for.BinaryResourceConfigurationwithSdkVersion(int sdkVersion)Returns a copy of this resource configuration with a differentsdkVersion, or this configuration if thesdkVersionis the same.
-
-
-
Method Detail
-
size
public int size()
The number of bytes that this resource configuration takes up.
-
mcc
public int mcc()
-
mnc
public int mnc()
-
language
public byte[] language()
Returns a packed 2-byte language code.
-
languageString
public final java.lang.String languageString()
Returnslanguageas an unpacked string representation.
-
region
public byte[] region()
Returns a packed 2-byte region code.
-
regionString
public final java.lang.String regionString()
Returnsregionas an unpacked string representation.
-
orientation
public int orientation()
-
touchscreen
public int touchscreen()
-
density
public int density()
-
keyboard
public int keyboard()
-
navigation
public int navigation()
-
inputFlags
public int inputFlags()
-
keyboardHidden
public final int keyboardHidden()
-
navigationHidden
public final int navigationHidden()
-
screenWidth
public int screenWidth()
-
screenHeight
public int screenHeight()
-
sdkVersion
public int sdkVersion()
-
withSdkVersion
public final BinaryResourceConfiguration withSdkVersion(int sdkVersion)
Returns a copy of this resource configuration with a differentsdkVersion, or this configuration if thesdkVersionis the same.- Parameters:
sdkVersion- The SDK version of the returned configuration.- Returns:
- A copy of this configuration with the only difference being #sdkVersion.
-
minorVersion
public int minorVersion()
-
screenLayout
public int screenLayout()
-
screenLayoutDirection
public final int screenLayoutDirection()
-
screenLayoutSize
public final int screenLayoutSize()
-
screenLayoutLong
public final int screenLayoutLong()
-
screenLayoutRound
public final int screenLayoutRound()
-
uiMode
public int uiMode()
-
uiModeType
public final int uiModeType()
-
uiModeNight
public final int uiModeNight()
-
smallestScreenWidthDp
public int smallestScreenWidthDp()
-
screenWidthDp
public int screenWidthDp()
-
screenHeightDp
public int screenHeightDp()
-
localeScript
public byte[] localeScript()
The ISO-15924 short name for the script corresponding to this configuration.
-
localeVariant
public byte[] localeVariant()
A single BCP-47 variant subtag.
-
screenLayout2
public int screenLayout2()
An extension toscreenLayout. Contains round/notround qualifier.
-
unknown
public byte[] unknown()
Any remaining bytes in this resource configuration that are unaccounted for.
-
isDefault
public final boolean isDefault()
Returns true if this is the default "any" configuration.
-
toByteArray
public final byte[] toByteArray()
Description copied from interface:SerializableResourceConverts this resource into an array of bytes representation.- Specified by:
toByteArrayin interfaceSerializableResource- Returns:
- An array of bytes representing this resource.
-
toByteArray
public final byte[] toByteArray(boolean shrink)
Description copied from interface:SerializableResourceConverts this resource into an array of bytes representation.- Specified by:
toByteArrayin interfaceSerializableResource- Parameters:
shrink- True if, when converting to a byte array, this resource can modify the returned bytes in an effort to reduce the size.- Returns:
- An array of bytes representing this resource.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStringParts
public final java.util.Map<BinaryResourceConfiguration.Type,java.lang.String> toStringParts()
Returns a map of the configuration parts fortoString().If a configuration part is not defined for this
BinaryResourceConfiguration, its value will be the empty string.
-
-