/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: Tim Marston
  • Date: 2014-03-02 11:04:33 UTC
  • Revision ID: tim@ed.am-20140302110433-9crgerrfbh30bs39
bump version to 1.0.3

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;
32
33
 
33
34
import android.app.AlertDialog;
34
35
import android.app.Dialog;
195
196
        // set the path prefix
196
197
        public void setPathPrefix( String path_prefix )
197
198
        {
198
 
                // set to cleaned-up path, with trailaing '/' removed so that it can be
 
199
                // set to cleaned-up path, with trailing '/' removed so that it can be
199
200
                // trivially pre-pended to a cleaned-up path
200
201
                _path_prefix = cleanUpPath( path_prefix );
201
202
                _path_prefix = _path_prefix.substring( 0, _path_prefix.length() - 1 );
247
248
                }
248
249
        };
249
250
 
250
 
        private OnItemClickListener _fileChooserItemClickListener = new OnItemClickListener() {
251
 
                public void onItemClick( AdapterView< ? > adapterView, View view, int position, long id )
 
251
        private OnItemClickListener _fileChooserItemClickListener =
 
252
                        new OnItemClickListener() {
 
253
                public void onItemClick( AdapterView< ? > adapter_view, View view,
 
254
                        int position, long id )
252
255
                {
253
256
                        RowItem rowitem = _items.get( position );
254
257
 
368
371
                if( path.startsWith( _path_prefix + "/" ) )
369
372
                        path = path.substring( _path_prefix.length() );
370
373
 
371
 
                // unless path is "/", strip trailing "/".
 
374
                // unless path is "/", strip trailing "/"
372
375
                if( path.length() > 1 && path.endsWith( "/" ) )
373
376
                        path = path.substring( 0, path.length() - 1 );
374
377
 
423
426
                                public boolean accept( File file ) {
424
427
                                        if( file.isDirectory() || file.getName().startsWith( "." ) )
425
428
                                                return false;
426
 
                                        String filename = file.getName().toLowerCase();
 
429
                                        String filename =
 
430
                                                file.getName().toLowerCase( Locale.ENGLISH );
427
431
                                        for( int i = 0; i < _extensions.length; i++ )
428
432
                                                if( filename.endsWith( "." + _extensions[ i ] ) )
429
433
                                                        return true;