package com.xtremelabs.droidsugar.view;

import java.io.File;

public class ResourceLoader {
    public final ViewLoader viewLoader;
    public final StringResourceLoader stringResourceLoader;

    public ResourceLoader(Class rClass, File resourceDir) throws Exception {
        ResourceExtractor resourceExtractor = new ResourceExtractor();
        resourceExtractor.addRClass(rClass);

        viewLoader = new ViewLoader(resourceExtractor);
        viewLoader.addResourceXmlDir(new File(resourceDir, "layout"));

        stringResourceLoader = new StringResourceLoader(resourceExtractor);
        stringResourceLoader.addResourceXmlDir(new File(resourceDir, "values"));
    }
}

@@ -32,18 +32,18 @@
 ar.view;
-%0A%0A
+%0D%0D
 import j
@@ -54,18 +54,45 @@
 io.File;
-%0A%0A
+%0Dimport java.io.FileFilter;%0D%0D
 public c
@@ -112,17 +112,17 @@
 Loader %7B
-%0A
+%0D
     publ
@@ -152,17 +152,17 @@
 wLoader;
-%0A
+%0D
     publ
@@ -212,18 +212,18 @@
 eLoader;
-%0A%0A
+%0D%0D
     publ
@@ -290,17 +290,17 @@
 eption %7B
-%0A
+%0D
         
@@ -361,17 +361,17 @@
 actor();
-%0A
+%0D
         
@@ -406,18 +406,18 @@
 rClass);
-%0A%0A
+%0D%0D
         
@@ -463,25 +463,25 @@
 ractor);
-%0A
+%0D
         
 viewLoad
@@ -476,72 +476,339 @@
     
-viewLoader.addResourceXmlDir(new File(resourceDir, %22layout%22));%0A%0A
+File%5B%5D layoutDirs = resourceDir.listFiles(new FileFilter() %7B%0D            @Override%0D            public boolean accept(File pathname) %7B%0D                return pathname.getPath().contains(%22/layout%22);%0D            %7D%0D        %7D);%0D        for (File layoutDir : layoutDirs) %7B%0D            viewLoader.addResourceXmlDir(layoutDir);%0D        %7D%0D%0D
     
@@ -878,17 +878,17 @@
 ractor);
-%0A
+%0D
         
@@ -963,13 +963,13 @@
 %22));
-%0A
+%0D
     %7D
-%0A%7D%0A
+%0D%7D%0D

Load resources from all layout* directories