• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.robolectric.annotation;
2 
3 import java.lang.annotation.Documented;
4 import java.lang.annotation.ElementType;
5 import java.lang.annotation.Retention;
6 import java.lang.annotation.RetentionPolicy;
7 import java.lang.annotation.Target;
8 
9 /**
10  * A {@link org.robolectric.pluginapi.config.Configurer} annotation for controlling how Robolectric
11  * performs UI layout.
12  *
13  * <p>PR #4818 changed Robolectric to be more realistic when performing layout on Android views.
14  * This change in behavior could cause tests still using the legacy 'UNPAUSED' looper mode or
15  * relying on views being a specific size to fail.
16  *
17  * <p>This annotation can be applied to tests to have Robolectric perform the legacy, less accurate
18  * mechanism of laying out and measuring Android text views, as a stopgap until the tests can be
19  * properly fixed.
20  *
21  * <p>This annotation will be deleted in a forthcoming Robolectric release.
22  */
23 @Documented
24 @Retention(RetentionPolicy.RUNTIME)
25 @Target({ElementType.PACKAGE, ElementType.TYPE, ElementType.METHOD})
26 public @interface TextLayoutMode {
27 
28   /** Specifies the different supported Text layout modes. */
29   enum Mode {
30     /**
31      * Robolectric's layout mode prior to 4.3.
32      *
33      * @deprecated LEGACY mode is inaccurate, has known bugs and will be removed in a future
34      *     release.
35      */
36     @Deprecated
37     LEGACY,
38     /**
39      * The new, more accurate layout mechanism.
40      *
41      * @deprecated REALTISTIC is the default mode and does not need to be stated explicity.
42      */
43     @Deprecated
44     REALISTIC,
45   }
46 
value()47   Mode value();
48 
49   /**
50    * Optional string for storing the issue / bug id tracking the fixing of the affected tests and
51    * thus removal of this annotation.
52    */
issueId()53   String issueId() default "";
54 }
55