/android/import-contacts

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

« back to all changes in this revision

Viewing changes to src/org/waxworlds/importcontacts/Doit.java

  • Committer: edam
  • Date: 2009-01-28 00:45:02 UTC
  • Revision ID: edam@waxworlds.org-20090128004502-erfklxlwmwhkx4i5
- added scroll view to all layouts
- added intro activity (with disclaimer)
- added action constants so that updates (and changed ids) won't affect saved data
- updated todo

Show diffs side-by-side

added added

removed removed

62
62
        public final static int MESSAGE_CONTACTMERGED = 12;
63
63
        public final static int MESSAGE_CONTACTSKIPPED = 13;
64
64
 
 
65
        public final static int ACTION_PROMPT = 0;
 
66
        public final static int ACTION_KEEP = 1;
 
67
        public final static int ACTION_MERGE_MERGE = 2;
 
68
        public final static int ACTION_OVERWRITE = 3;
 
69
 
65
70
        private boolean _startedProgress;
66
71
        private int _maxProgress;
67
72
        private int _tmpProgress;
284
289
                        int responseExtra = _mergePromptAlwaysSelected?
285
290
                                        Importer.RESPONSEEXTRA_ALWAYS : Importer.RESPONSEEXTRA_NONE;
286
291
                        Doit.this._mergePromptDialog.dismiss();
287
 
                        Doit.this._mergePromptDialog = null;    // dont keep a reference!
288
 
                        Doit.this._importer.wake( view.getId(), responseExtra );
 
292
                        Doit.this._mergePromptDialog = null;    // don't keep a reference!
 
293
                        Doit.this._importer.wake( convertIdToAction( view.getId() ),
 
294
                                        responseExtra );
289
295
                }
290
296
        };
291
297
 
 
298
        public static int convertIdToAction( int id ) {
 
299
                switch( id ) {
 
300
                case R.id.merge_keep:           return ACTION_KEEP;
 
301
                case R.id.merge_merge:          return ACTION_MERGE_MERGE;
 
302
                case R.id.merge_overwrite:      return ACTION_OVERWRITE;
 
303
                default: return ACTION_PROMPT;
 
304
                }
 
305
        }
 
306
 
 
307
        public static int convertActionToId( int action ) {
 
308
                switch( action ) {
 
309
                case ACTION_KEEP:               return R.id.merge_keep;
 
310
                case ACTION_MERGE_MERGE:return R.id.merge_merge;
 
311
                case ACTION_OVERWRITE:  return R.id.merge_overwrite;
 
312
                default: return R.id.merge_prompt;
 
313
                }
 
314
        }
 
315
 
292
316
        private DialogInterface.OnCancelListener _dialogOnCancelListener =
293
317
                        new DialogInterface.OnCancelListener() {
294
318
                public void onCancel( DialogInterface dialog ) {