|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.ide.common.rendering.HardwareConfigHelper
public class HardwareConfigHelper
Helper method to create a HardwareConfig object.
The base data comes from a Device object, with additional data provided on the helper
object.
Since HardwareConfig is immutable, this allows creating one in several (optional)
steps more easily.
| Field Summary | |
|---|---|
static java.lang.String |
MANUFACTURER_GENERIC
Manufacturer used by the generic devices in the device list |
| Constructor Summary | |
|---|---|
HardwareConfigHelper(com.android.sdklib.devices.Device device)
Creates a new helper for a given device. |
|
| Method Summary | |
|---|---|
com.android.ide.common.rendering.api.HardwareConfig |
getConfig()
Creates and returns the HardwareConfig object. |
static java.lang.String |
getGenericLabel(com.android.sdklib.devices.Device device)
Returns a user-displayable description of the given generic device |
static java.lang.String |
getNexusLabel(com.android.sdklib.devices.Device device)
Returns a user-displayable description of the given Nexus device |
static java.lang.String |
getResolutionString(com.android.sdklib.devices.Device device)
Returns a user displayable screen resolution string for the given device |
static boolean |
isGeneric(com.android.sdklib.devices.Device device)
Returns true if the given device is a generic device |
static boolean |
isNexus(com.android.sdklib.devices.Device device)
Returns true if the given device is a Nexus device |
static boolean |
isRound(com.android.sdklib.devices.Device device)
Whether the given device has a round screen |
static boolean |
isTv(com.android.sdklib.devices.Device device)
Whether the given device is a TV device |
static boolean |
isWear(com.android.sdklib.devices.Device device)
Whether the given device is a wear device |
static int |
nexusRank(com.android.sdklib.devices.Device device)
Returns the rank of the given nexus device. |
HardwareConfigHelper |
setMaxRenderSize(int maxRenderWidth,
int maxRenderHeight)
Sets the max width and height to be used during rendering. |
HardwareConfigHelper |
setOrientation(com.android.resources.ScreenOrientation screenOrientation)
Sets the orientation of the config. |
HardwareConfigHelper |
setOverrideRenderSize(int overrideRenderWidth,
int overrideRenderHeight)
Overrides the width and height to be used during rendering. |
static void |
sortNexusList(java.util.List<com.android.sdklib.devices.Device> list)
Sorts the given list of Nexus devices according to rank |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String MANUFACTURER_GENERIC
| Constructor Detail |
|---|
public HardwareConfigHelper(@NonNull
com.android.sdklib.devices.Device device)
device - the device to provide the base data.| Method Detail |
|---|
@NonNull
public HardwareConfigHelper setOrientation(@NonNull
com.android.resources.ScreenOrientation screenOrientation)
screenOrientation - the orientation.
@NonNull
public HardwareConfigHelper setOverrideRenderSize(int overrideRenderWidth,
int overrideRenderHeight)
Device object.
overrideRenderWidth - the width in pixels of the layout to be renderedoverrideRenderHeight - the height in pixels of the layout to be rendered
@NonNull
public HardwareConfigHelper setMaxRenderSize(int maxRenderWidth,
int maxRenderHeight)
Device object.
maxRenderWidth - the max width in pixels of the layout to be renderedmaxRenderHeight - the max height in pixels of the layout to be rendered
@NonNull public com.android.ide.common.rendering.api.HardwareConfig getConfig()
@NonNull
public static java.lang.String getNexusLabel(@NonNull
com.android.sdklib.devices.Device device)
device - the device to check
isNexus(com.android.sdklib.devices.Device)
@NonNull
public static java.lang.String getGenericLabel(@NonNull
com.android.sdklib.devices.Device device)
device - the device to check
isGeneric(com.android.sdklib.devices.Device)
@NonNull
public static java.lang.String getResolutionString(@NonNull
com.android.sdklib.devices.Device device)
device - the device to look up the string for
public static boolean isGeneric(@NonNull
com.android.sdklib.devices.Device device)
device - the device to check
public static boolean isNexus(@NonNull
com.android.sdklib.devices.Device device)
device - the device to check
public static boolean isWear(@Nullable
com.android.sdklib.devices.Device device)
public static boolean isRound(@Nullable
com.android.sdklib.devices.Device device)
public static boolean isTv(@Nullable
com.android.sdklib.devices.Device device)
public static int nexusRank(com.android.sdklib.devices.Device device)
device - the device to look up the rank for
public static void sortNexusList(@NonNull
java.util.List<com.android.sdklib.devices.Device> list)
list - the list to sort
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||