diff options
author | Christian Williams <christianw@google.com> | 2017-11-08 17:10:38 -0800 |
---|---|---|
committer | Christian Williams <christianw@google.com> | 2017-11-08 17:10:38 -0800 |
commit | 70813a3ee209ad0043a461a64c8ac495c372b83b (patch) | |
tree | 9329aa48fd8f63df15ee20f9cd1f454e59a39f17 /resources | |
parent | 4a11caf182f86aa6f6363715e4f6071b5c352369 (diff) | |
download | robolectric-shadows-70813a3ee209ad0043a461a64c8ac495c372b83b.tar.gz |
Provide defaults for more device configuration.
Size normal, notlong, notround, port, notnight, finge.
Diffstat (limited to 'resources')
-rw-r--r-- | resources/src/main/java/org/robolectric/res/android/ResTable_config.java | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/resources/src/main/java/org/robolectric/res/android/ResTable_config.java b/resources/src/main/java/org/robolectric/res/android/ResTable_config.java index f0915ff5e..f5cbbe9ce 100644 --- a/resources/src/main/java/org/robolectric/res/android/ResTable_config.java +++ b/resources/src/main/java/org/robolectric/res/android/ResTable_config.java @@ -218,7 +218,7 @@ public class ResTable_config { // public static final int MASK_SCREENSIZE = 0x0f; public static final int SCREENSIZE_ANY = ACONFIGURATION_SCREENSIZE_ANY; public static final int SCREENSIZE_SMALL = ACONFIGURATION_SCREENSIZE_SMALL; -// public static final int SCREENSIZE_NORMAL = ACONFIGURATION_SCREENSIZE_NORMAL; + public static final int SCREENSIZE_NORMAL = ACONFIGURATION_SCREENSIZE_NORMAL; public static final int SCREENSIZE_LARGE = ACONFIGURATION_SCREENSIZE_LARGE; public static final int SCREENSIZE_XLARGE = ACONFIGURATION_SCREENSIZE_XLARGE; @@ -517,16 +517,32 @@ public class ResTable_config { return screenLayout & SCREENLAYOUT_LAYOUTDIR_MASK; } + public final void screenLayoutDirection(int value) { + screenLayout = (byte) ((screenLayout & ~SCREENLAYOUT_LAYOUTDIR_MASK) | value); + } + public final int screenLayoutSize() { return screenLayout & SCREENLAYOUT_SIZE_MASK; } + public final void screenLayoutSize(int value) { + screenLayout = (byte) ((screenLayout & ~SCREENLAYOUT_SIZE_MASK) | value); + } + public final int screenLayoutLong() { return screenLayout & SCREENLAYOUT_LONG_MASK; } + public final void screenLayoutLong(int value) { + screenLayout = (byte) ((screenLayout & ~SCREENLAYOUT_LONG_MASK) | value); + } + public final int screenLayoutRound() { - return screenLayout & SCREENLAYOUT_ROUND_MASK; + return screenLayout2 & MASK_SCREENROUND; + } + + public final void screenLayoutRound(int value) { + screenLayout2 = (byte) ((screenLayout2 & ~MASK_SCREENROUND) | value); } public int colorMode; @@ -537,10 +553,18 @@ public class ResTable_config { return uiMode & UI_MODE_TYPE_MASK; } + public final void uiModeType(int value) { + uiMode = (uiMode & ~UI_MODE_TYPE_MASK) | value; + } + public final int uiModeNight() { return uiMode & UI_MODE_NIGHT_MASK; } + public final void uiModeNight(int value) { + uiMode = (uiMode & ~UI_MODE_NIGHT_MASK) | value; + } + public int smallestScreenWidthDp; public int screenWidthDp; public int screenHeightDp; @@ -865,7 +889,6 @@ public class ResTable_config { // constants for isBetterThan... public static final int MASK_LAYOUTDIR = SCREENLAYOUT_LAYOUTDIR_MASK; static final int MASK_SCREENSIZE = SCREENLAYOUT_SIZE_MASK; - static final int SCREENSIZE_NORMAL = ACONFIGURATION_SCREENSIZE_NORMAL; |