/android/export-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/export-contacts

« back to all changes in this revision

Viewing changes to src/am/ed/exportcontacts/FileChooser.java

  • Committer: edam
  • Date: 2012-04-24 11:29:44 UTC
  • Revision ID: tim@ed.am-20120424112944-6fic236bul6r9cqi
changed all the URLs to ed.am, including copyrights, package names and project
site

Show diffs side-by-side

added added

removed removed

4
4
 * Copyright (C) 2010 Tim Marston <tim@ed.am>
5
5
 *
6
6
 * This file is part of the Export Contacts program (hereafter referred
7
 
 * to as "this program").  For more information, see
 
7
 * to as "this program"). For more information, see
8
8
 * http://ed.am/dev/android/export-contacts
9
9
 *
10
10
 * This program is free software: you can redistribute it and/or modify
29
29
import java.util.ArrayList;
30
30
import java.util.Collections;
31
31
import java.util.Comparator;
32
 
import java.util.Locale;
33
32
 
34
33
import android.app.AlertDialog;
35
34
import android.app.Dialog;
196
195
        // set the path prefix
197
196
        public void setPathPrefix( String path_prefix )
198
197
        {
199
 
                // set to cleaned-up path, with trailing '/' removed so that it can be
 
198
                // set to cleaned-up path, with trailaing '/' removed so that it can be
200
199
                // trivially pre-pended to a cleaned-up path
201
200
                _path_prefix = cleanUpPath( path_prefix );
202
201
                _path_prefix = _path_prefix.substring( 0, _path_prefix.length() - 1 );
248
247
                }
249
248
        };
250
249
 
251
 
        private OnItemClickListener _fileChooserItemClickListener =
252
 
                        new OnItemClickListener() {
253
 
                public void onItemClick( AdapterView< ? > adapter_view, View view,
254
 
                        int position, long id )
 
250
        private OnItemClickListener _fileChooserItemClickListener = new OnItemClickListener() {
 
251
                public void onItemClick( AdapterView< ? > adapterView, View view, int position, long id )
255
252
                {
256
253
                        RowItem rowitem = _items.get( position );
257
254
 
371
368
                if( path.startsWith( _path_prefix + "/" ) )
372
369
                        path = path.substring( _path_prefix.length() );
373
370
 
374
 
                // unless path is "/", strip trailing "/"
 
371
                // unless path is "/", strip trailing "/".
375
372
                if( path.length() > 1 && path.endsWith( "/" ) )
376
373
                        path = path.substring( 0, path.length() - 1 );
377
374
 
426
423
                                public boolean accept( File file ) {
427
424
                                        if( file.isDirectory() || file.getName().startsWith( "." ) )
428
425
                                                return false;
429
 
                                        String filename =
430
 
                                                file.getName().toLowerCase( Locale.ENGLISH );
 
426
                                        String filename = file.getName().toLowerCase();
431
427
                                        for( int i = 0; i < _extensions.length; i++ )
432
428
                                                if( filename.endsWith( "." + _extensions[ i ] ) )
433
429
                                                        return true;