();
40 | }
41 |
42 | ///
43 | /// This method will tell us if the given FileSystemInfo instance is a directory.
44 | ///
45 | /// The FileSystemInfo
46 | ///
47 | public static bool IsDirectory(this FileSystemInfo fileSystemInfo)
48 | {
49 | if (fileSystemInfo == null)
50 | {
51 | return false;
52 | }
53 |
54 | return (fileSystemInfo.Attributes & FileAttributes.Directory) == FileAttributes.Directory;
55 | }
56 |
57 | ///
58 | /// This method will tell us if the given FileSystemInfo instance is a file.
59 | ///
60 | /// The FileSystemInfo
61 | ///
62 | public static bool IsFile(this FileSystemInfo fileSystemInfo)
63 | {
64 | if (fileSystemInfo == null)
65 | {
66 | return false;
67 | }
68 | return !IsDirectory(fileSystemInfo);
69 | }
70 |
71 | ///
72 | /// This method will tell us if the given FileSystemInfo instance is visible.
73 | ///
74 | /// The FileSystemInfo
75 | ///
76 | public static bool IsVisible(this FileSystemInfo fileSystemInfo)
77 | {
78 | if (fileSystemInfo == null)
79 | {
80 | return false;
81 | }
82 | var isHidden = (fileSystemInfo.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden;
83 | return !isHidden;
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/Compass.FilePicker/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("Compass.FilePicker")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("Compass.FilePicker")]
14 | [assembly: AssemblyCopyright("Copyright © 2014")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
32 | // Add some common permissions, these can be removed if not needed
33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)]
34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
35 |
--------------------------------------------------------------------------------
/Compass.FilePicker/README.html:
--------------------------------------------------------------------------------
1 | 
2 |
3 | Compass FilePicker
4 |
5 | Download the sample application from the Play Store.
6 |
7 | Compass FilePicker is a simple shapefile tile engine written in C#.
8 | The purpose of the library is to provide an easy way to render a shapefile into tiles that can be used as an overlay on Google Maps or similar services.
9 | It's currently being used by 30 Local Authorities in Ireland as part of the PMS project to display the official road network on an Android application operating offline.
10 |
11 | Usage example
12 |
13 |
14 | var intent = new Intent(this, typeof(FilePickerActivity));
15 | intent.PutExtra(FilePickerActivity.ExtraNewDirName, "NewFolder");
16 | intent.PutExtra(FilePickerActivity.ExtraInitialDirectory, SelectedDirectory);
17 | intent.PutExtra(FilePickerActivity.ExtraMode, (int)FilePickerMode.Directory);
18 | StartActivityForResult(intent, FilePickerActivity.ResultCodeDirSelected);
19 |
20 | and then
21 |
22 | Supported Platforms
23 |
24 |
25 | - Xamarin.Android
26 |
27 |
28 | Build
29 |
30 | Compass Tessera is built using
31 |
32 |
33 | - Visual Studio 2013 or Xamarin Studio
34 | - The Xamarin framework
35 |
36 |
37 | Sample Applications
38 |
39 | This project contains one sample Xamarin.Android application.
40 |
41 | Xamarin.Android App
42 |
43 | The app displays a full screen Google Maps map (Google Maps Api V2) and it's set up to generate the tiles on the device.
44 | The big advantage is that the background mapping is not necessary to display the tiles, making the tile generation fully working offline.
45 | After deploying the app to the device, copy the the roads.* files in the Maps folder of the web application into the root folder of the device.
46 |
47 | Known bugs and limitations
48 |
49 |
50 | - The library currently supports only WGS84 -EPSG:4326 as input shapefiles.
51 | - The style of the lines is hardcoded
52 | - There is a small gap between tiles
53 |
54 |
55 | TODO
56 |
57 |
58 | - Suite of unit tests
59 | - Support of different projections in the input file
60 | - Code cleanup
61 |
62 |
63 | Credits
64 |
65 |
69 |
70 | Libraries
71 |
72 |
73 | - The application is using the portable version of the NetTopologySuite library and its dependencies. For convenience the compiled assemblies are available in this repository.
74 | - Proj.Net
75 | - GeoAPI.NET
76 | - TinyIoC
77 |
78 |
79 | Feedback
80 |
81 | All bugs, feature requests, pull requests, feedback, etc., are welcome. Create an issue.
82 | Or ask a question on StackOverflow
83 |
84 | License
85 |
86 | Copyright 2014, Compass Informatics Ltd.
87 |
88 | Licensed under the MIT License or see the LICENSE
file.
89 |
90 | Author
91 |
92 |
97 |
98 | Logo
99 |
100 | Copyright 2014, Compass Informatics Ltd.
101 |
--------------------------------------------------------------------------------
/Compass.FilePicker/README.min.html:
--------------------------------------------------------------------------------
1 | 
Compass FilePicker
Download the sample application from the Play Store.
Compass FilePicker is a simple shapefile tile engine written in C#.
The purpose of the library is to provide an easy way to render a shapefile into tiles that can be used as an overlay on Google Maps or similar services.
It's currently being used by 30 Local Authorities in Ireland as part of the PMS project to display the official road network on an Android application operating offline.
Usage example
var intent = new Intent(this, typeof(FilePickerActivity));
intent.PutExtra(FilePickerActivity.ExtraNewDirName, "NewFolder");
intent.PutExtra(FilePickerActivity.ExtraInitialDirectory, SelectedDirectory);
intent.PutExtra(FilePickerActivity.ExtraMode, (int)FilePickerMode.Directory);
StartActivityForResult(intent, FilePickerActivity.ResultCodeDirSelected);
and then
Supported Platforms
Build
Compass Tessera is built using
- Visual Studio 2013 or Xamarin Studio
- The Xamarin framework
Sample Applications
This project contains one sample Xamarin.Android application.
Xamarin.Android App
The app displays a full screen Google Maps map (Google Maps Api V2) and it's set up to generate the tiles on the device.
The big advantage is that the background mapping is not necessary to display the tiles, making the tile generation fully working offline.
After deploying the app to the device, copy the the roads.* files in the Maps folder of the web application into the root folder of the device.
Known bugs and limitations
- The library currently supports only WGS84 -EPSG:4326 as input shapefiles.
- The style of the lines is hardcoded
- There is a small gap between tiles
TODO
- Suite of unit tests
- Support of different projections in the input file
- Code cleanup
Credits
Libraries
Feedback
All bugs, feature requests, pull requests, feedback, etc., are welcome. Create an issue.
Or ask a question on StackOverflow
License
Copyright 2014, Compass Informatics Ltd.
Licensed under the MIT License or see the LICENSE
file.
Author
Logo
Copyright 2014, Compass Informatics Ltd.
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-hdpi/filepicker_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-hdpi/filepicker_file.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-hdpi/filepicker_folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-hdpi/filepicker_folder.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-hdpi/filepicker_new_folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-hdpi/filepicker_new_folder.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-hdpi/filepicker_previous.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-hdpi/filepicker_previous.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-ldpi/filepicker_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-ldpi/filepicker_file.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-ldpi/filepicker_folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-ldpi/filepicker_folder.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-ldpi/filepicker_new_folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-ldpi/filepicker_new_folder.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-ldpi/filepicker_previous.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-ldpi/filepicker_previous.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-xhdpi/filepicker_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-xhdpi/filepicker_file.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-xhdpi/filepicker_folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-xhdpi/filepicker_folder.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-xhdpi/filepicker_new_folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-xhdpi/filepicker_new_folder.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable-xhdpi/filepicker_previous.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable-xhdpi/filepicker_previous.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable/borderless_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 | -
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable/filepicker_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable/filepicker_file.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable/filepicker_folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable/filepicker_folder.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable/filepicker_new_folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable/filepicker_new_folder.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Drawable/filepicker_previous.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikescandy/FilePicker/782219f2aa853d1ad049d16179e9ec9822e27270/Compass.FilePicker/Resources/Drawable/filepicker_previous.png
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Layout/filepicker_createfolder.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
15 |
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Layout/filepicker_fragment.axml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
15 |
24 |
34 |
44 |
45 |
50 |
59 |
70 |
83 |
92 |
98 |
99 |
105 |
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Layout/filepicker_listitem.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
15 |
25 |
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Layout/filepicker_mainactivity.axml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Menu/filepicker_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Resource.Designer.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable 1591
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Runtime Version:4.0.30319.34014
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | [assembly: global::Android.Runtime.ResourceDesignerAttribute("Compass.FilePicker.Resource", IsApplication=false)]
13 |
14 | namespace Compass.FilePicker
15 | {
16 |
17 |
18 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
19 | public partial class Resource
20 | {
21 |
22 | static Resource()
23 | {
24 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
25 | }
26 |
27 | public partial class Attribute
28 | {
29 |
30 | static Attribute()
31 | {
32 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
33 | }
34 |
35 | private Attribute()
36 | {
37 | }
38 | }
39 |
40 | public partial class Color
41 | {
42 |
43 | // aapt resource value: 0x7f040009
44 | public static int bright_blue = 2130968585;
45 |
46 | // aapt resource value: 0x7f040005
47 | public static int custom_black = 2130968581;
48 |
49 | // aapt resource value: 0x7f040006
50 | public static int dark_red = 2130968582;
51 |
52 | // aapt resource value: 0x7f040007
53 | public static int dark_red_pressed = 2130968583;
54 |
55 | // aapt resource value: 0x7f040004
56 | public static int lightgraybackground = 2130968580;
57 |
58 | // aapt resource value: 0x7f04000a
59 | public static int selection_background_color = 2130968586;
60 |
61 | // aapt resource value: 0x7f040001
62 | public static int solid_blue = 2130968577;
63 |
64 | // aapt resource value: 0x7f040002
65 | public static int solid_green = 2130968578;
66 |
67 | // aapt resource value: 0x7f040000
68 | public static int solid_red = 2130968576;
69 |
70 | // aapt resource value: 0x7f040003
71 | public static int solid_yellow = 2130968579;
72 |
73 | // aapt resource value: 0x7f040008
74 | public static int whitesmoke = 2130968584;
75 |
76 | static Color()
77 | {
78 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
79 | }
80 |
81 | private Color()
82 | {
83 | }
84 | }
85 |
86 | public partial class Drawable
87 | {
88 |
89 | // aapt resource value: 0x7f020006
90 | public static int blue = 2130837510;
91 |
92 | // aapt resource value: 0x7f020000
93 | public static int borderless_button = 2130837504;
94 |
95 | // aapt resource value: 0x7f020001
96 | public static int filepicker_file = 2130837505;
97 |
98 | // aapt resource value: 0x7f020002
99 | public static int filepicker_folder = 2130837506;
100 |
101 | // aapt resource value: 0x7f020003
102 | public static int filepicker_new_folder = 2130837507;
103 |
104 | // aapt resource value: 0x7f020004
105 | public static int filepicker_previous = 2130837508;
106 |
107 | // aapt resource value: 0x7f020007
108 | public static int green = 2130837511;
109 |
110 | // aapt resource value: 0x7f020005
111 | public static int red = 2130837509;
112 |
113 | // aapt resource value: 0x7f02000a
114 | public static int screen_background_black = 2130837514;
115 |
116 | // aapt resource value: 0x7f02000b
117 | public static int translucent_background = 2130837515;
118 |
119 | // aapt resource value: 0x7f02000c
120 | public static int transparent_background = 2130837516;
121 |
122 | // aapt resource value: 0x7f020009
123 | public static int white = 2130837513;
124 |
125 | // aapt resource value: 0x7f020008
126 | public static int yellow = 2130837512;
127 |
128 | static Drawable()
129 | {
130 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
131 | }
132 |
133 | private Drawable()
134 | {
135 | }
136 | }
137 |
138 | public partial class Id
139 | {
140 |
141 | // aapt resource value: 0x7f070003
142 | public static int btnCancel = 2131165187;
143 |
144 | // aapt resource value: 0x7f070004
145 | public static int btnConfirm = 2131165188;
146 |
147 | // aapt resource value: 0x7f070009
148 | public static int btnCreateFolder2 = 2131165193;
149 |
150 | // aapt resource value: 0x7f070006
151 | public static int btnNavUp = 2131165190;
152 |
153 | // aapt resource value: 0x7f070005
154 | public static int directoryInfo = 2131165189;
155 |
156 | // aapt resource value: 0x7f07000b
157 | public static int directoryList = 2131165195;
158 |
159 | // aapt resource value: 0x7f07000a
160 | public static int divider = 2131165194;
161 |
162 | // aapt resource value: 0x7f07000c
163 | public static int file_picker_image = 2131165196;
164 |
165 | // aapt resource value: 0x7f07000d
166 | public static int file_picker_text = 2131165197;
167 |
168 | // aapt resource value: 0x7f07000e
169 | public static int filepicker_main = 2131165198;
170 |
171 | // aapt resource value: 0x7f07000f
172 | public static int filepicker_new_folder_item = 2131165199;
173 |
174 | // aapt resource value: 0x7f070000
175 | public static int folderName = 2131165184;
176 |
177 | // aapt resource value: 0x7f070001
178 | public static int footer = 2131165185;
179 |
180 | // aapt resource value: 0x7f070002
181 | public static int horizontalDivider = 2131165186;
182 |
183 | // aapt resource value: 0x7f070008
184 | public static int txtvSelectedFolder = 2131165192;
185 |
186 | // aapt resource value: 0x7f070007
187 | public static int txtvSelectedFolderLabel = 2131165191;
188 |
189 | static Id()
190 | {
191 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
192 | }
193 |
194 | private Id()
195 | {
196 | }
197 | }
198 |
199 | public partial class Layout
200 | {
201 |
202 | // aapt resource value: 0x7f030000
203 | public static int filepicker_createfolder = 2130903040;
204 |
205 | // aapt resource value: 0x7f030001
206 | public static int filepicker_fragment = 2130903041;
207 |
208 | // aapt resource value: 0x7f030002
209 | public static int filepicker_listitem = 2130903042;
210 |
211 | // aapt resource value: 0x7f030003
212 | public static int filepicker_mainactivity = 2130903043;
213 |
214 | static Layout()
215 | {
216 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
217 | }
218 |
219 | private Layout()
220 | {
221 | }
222 | }
223 |
224 | public partial class Menu
225 | {
226 |
227 | // aapt resource value: 0x7f060000
228 | public static int filepicker_menu = 2131099648;
229 |
230 | static Menu()
231 | {
232 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
233 | }
234 |
235 | private Menu()
236 | {
237 | }
238 | }
239 |
240 | public partial class String
241 | {
242 |
243 | // aapt resource value: 0x7f050000
244 | public static int filepicker_ApplicationName = 2131034112;
245 |
246 | // aapt resource value: 0x7f050002
247 | public static int filepicker_cancel_label = 2131034114;
248 |
249 | // aapt resource value: 0x7f050003
250 | public static int filepicker_confirm_label = 2131034115;
251 |
252 | // aapt resource value: 0x7f05000c
253 | public static int filepicker_create_folder_error = 2131034124;
254 |
255 | // aapt resource value: 0x7f05000b
256 | public static int filepicker_create_folder_error_already_exists = 2131034123;
257 |
258 | // aapt resource value: 0x7f05000a
259 | public static int filepicker_create_folder_error_no_write_access = 2131034122;
260 |
261 | // aapt resource value: 0x7f050006
262 | public static int filepicker_create_folder_label = 2131034118;
263 |
264 | // aapt resource value: 0x7f050008
265 | public static int filepicker_create_folder_msg = 2131034120;
266 |
267 | // aapt resource value: 0x7f050009
268 | public static int filepicker_create_folder_success = 2131034121;
269 |
270 | // aapt resource value: 0x7f050007
271 | public static int filepicker_enter_folder_msg = 2131034119;
272 |
273 | // aapt resource value: 0x7f050001
274 | public static int filepicker_ok = 2131034113;
275 |
276 | // aapt resource value: 0x7f050005
277 | public static int filepicker_selected_file_label = 2131034117;
278 |
279 | // aapt resource value: 0x7f050004
280 | public static int filepicker_selected_folder_label = 2131034116;
281 |
282 | // aapt resource value: 0x7f05000d
283 | public static int filepicker_up_label = 2131034125;
284 |
285 | static String()
286 | {
287 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
288 | }
289 |
290 | private String()
291 | {
292 | }
293 | }
294 | }
295 | }
296 | #pragma warning restore 1591
297 |
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Values/Colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #7f00
4 | #770000ff
5 | #7700ff00
6 | #77ffff00
7 | #ffffff
8 |
9 | #ff000000
10 | #e0000000
11 | #00000000
12 |
13 |
14 |
15 |
16 | #f00
17 | #0000ff
18 | #f0f0
19 | #ffffff00
20 | #f2f2f2
21 | #000000
22 | #8b0000
23 | #894747
24 | #F5F5F5
25 |
26 | #33B5E5
27 |
28 |
29 | #FEBB20
30 |
31 |
--------------------------------------------------------------------------------
/Compass.FilePicker/Resources/Values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | $projectname$
4 | OK
5 | Cancel
6 | Confirm
7 | Selected folder:
8 | Selected file:
9 | Create folder
10 | Enter Folder Name
11 | Create new folder with name "%1$s"?
12 | Created new folder
13 | Cannot write to this folder
14 | The selected folder already exists
15 | Could not create folder
16 | Up
17 |
--------------------------------------------------------------------------------
/Compass.FilePicker/Settings.StyleCop:
--------------------------------------------------------------------------------
1 |
2 |
3 | en-GB
4 |
5 | Sql
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | False
14 |
15 |
16 |
17 |
18 | False
19 |
20 |
21 |
22 |
23 | False
24 |
25 |
26 |
27 |
28 | False
29 |
30 |
31 |
32 |
33 | False
34 |
35 |
36 |
37 |
38 | False
39 |
40 |
41 |
42 |
43 | False
44 |
45 |
46 |
47 |
48 | False
49 |
50 |
51 |
52 |
53 | False
54 |
55 |
56 |
57 |
58 | False
59 |
60 |
61 |
62 |
63 | False
64 |
65 |
66 |
67 |
68 | Compass Informatics
69 | (c) Compass Informatics
70 | True
71 |
72 |
73 |
74 |
75 |
76 |
77 | False
78 |
79 |
80 |
81 |
82 | False
83 |
84 |
85 |
86 |
87 | False
88 |
89 |
90 |
91 |
92 | False
93 |
94 |
95 |
96 |
97 | False
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 | False
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 | False
118 |
119 |
120 |
121 |
122 | False
123 |
124 |
125 |
126 |
127 | False
128 |
129 |
130 |
131 |
132 | False
133 |
134 |
135 |
136 |
137 | False
138 |
139 |
140 |
141 |
142 | False
143 |
144 |
145 |
146 |
147 | False
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 | False
158 |
159 |
160 |
161 |
162 | False
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 | False
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 | db
182 |
183 |
184 |
185 |
186 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 mikescandy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [![] (http://www.compass.ie/wordpress/wp-content/uploads/Compass-logo-Final-300x104.png)](http://www.compass.ie)
2 |
3 | # Compass FilePicker
4 |
5 |
6 | Compass FilePicker is a simple file picker component for Xamarin Android.
7 | It can be used as a full screen activity or as a fragment in a dialog.
8 |
9 | 
10 |
11 | 
12 |
13 | ## Usage example
14 |
15 | ```
16 | var intent = new Intent(this, typeof(FilePickerActivity));
17 | intent.PutExtra(FilePickerActivity.ExtraNewDirName, "NewFolder");
18 | intent.PutExtra(FilePickerActivity.ExtraInitialDirectory, SelectedDirectory);
19 | intent.PutExtra(FilePickerActivity.ExtraMode, (int)FilePickerMode.Directory);
20 | StartActivityForResult(intent, FilePickerActivity.ResultCodeDirSelected);
21 | ```
22 |
23 | and then in the OnActivityResult method
24 |
25 | ```
26 | data.GetStringExtra(FilePickerActivity.ResultSelectedDir)
27 | ```
28 |
29 | ## Supported Platforms
30 |
31 | * Xamarin.Android
32 |
33 | ## Build
34 |
35 | Compass FilePicker is built using
36 |
37 | * Visual Studio 2013 or Xamarin Studio
38 | * The Xamarin framework
39 |
40 | ## Sample Applications
41 | This project contains one sample Xamarin.Android application.
42 |
43 | ## TODO
44 | - Suite of unit tests
45 |
46 | ## Credits
47 | * [Androd-DirectoryChooser](passy/Android-DirectoryChooser) for the inspiration
48 |
49 | ## Feedback
50 | All bugs, feature requests, pull requests, feedback, etc., are welcome. [Create an issue](https://github.com/mikescandy/FilePicker/issues).
51 |
52 | ## License
53 | Copyright 2014, [Compass Informatics Ltd](http://www.compass.ie/).
54 |
55 | Licensed under the [MIT License](http://opensource.org/licenses/MIT) or see the [`LICENSE`](https://github.com/mikescandy/FilePicker/blob/master/LICENSE) file.
56 |
57 | ## Author
58 | - Michele Scandura -
59 | [gitHub](https://github.com/mikescandy) or [Twitter](https://twitter.com/mikescandy)
60 | - Compass Informatics - [gitHub](https://github.com/compassinformatics), [Twitter](https://twitter.com/CompassInfo) or [web](https://www.compass.ie)
61 |
62 | ## Copyright
63 | Copyright 2014, [Compass Informatics Ltd](http://www.compass.ie/).
64 |
--------------------------------------------------------------------------------
/SampleApplication/MainActivity.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Compass Informatics 2014, All Right Reserved, http://compass.ie/
3 | //
4 | // This source is subject to the MIT License.
5 | // Please see the License file for more information.
6 | // All other rights reserved.
7 | //
8 | // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
9 | // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
10 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
11 | // PARTICULAR PURPOSE.
12 | //
13 | //
14 | // Michele Scandura
15 | // mscandura@compass.ie
16 | // 30-04-2014
17 | // Contains a simple Point with floating coordinates.
18 |
19 | using System;
20 |
21 | using Android.App;
22 | using Android.Content;
23 | using Android.Widget;
24 | using Android.OS;
25 | using Compass.FilePicker;
26 |
27 | namespace SampleApplication
28 | {
29 | [Activity(Label = "SampleApplication", MainLauncher = true, Icon = "@drawable/icon")]
30 | public class MainActivity : Activity
31 | {
32 | private const string SelectedDirectory = "/";
33 |
34 | private FilePickerFragment filePickerFragment;
35 | protected override void OnCreate(Bundle bundle)
36 | {
37 | base.OnCreate(bundle);
38 |
39 | // Set our view from the "main" layout resource
40 | SetContentView(Resource.Layout.Main);
41 |
42 | // Get our button from the layout resource,
43 | // and attach an event to it
44 | var buttonDirectoryActivity = FindViewById