public ScreenSwitcherFrame(Context context, AttributeSet attrs) {
   super(
       context,
       attrs,
       new SimplePathContainer(
           R.id.screen_switcher_tag, Path.contextFactory(new MortarContextFactory())));
 }
示例#2
0
 public static int getLayout(@NonNull Path path) {
   Class pathType = path.getClass();
   Integer layoutResId = PATH_LAYOUT_CACHE.get(pathType);
   if (layoutResId == null) {
     Layout layout = (Layout) pathType.getAnnotation(Layout.class);
     if (layout == null) {
       throw new IllegalArgumentException(
           String.format(
               "@%s annotation not found on class %s",
               Layout.class.getSimpleName(), pathType.getName()));
     }
     layoutResId = layout.value();
     PATH_LAYOUT_CACHE.put(pathType, layoutResId);
   }
   return layoutResId;
 }