/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/WizardActivity.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

32
32
 
33
33
public class WizardActivity extends Activity
34
34
{
35
 
        private int _nextState;
36
 
        private boolean _backEnabled;
 
35
        private int _nextState = 0;
37
36
 
38
37
        @Override
39
38
        protected void onCreate(Bundle savedInstanceState)
40
39
        {
41
40
                super.onCreate(savedInstanceState);
42
41
 
43
 
                _nextState = 0;
44
 
 
45
 
                // deal with saved state vs. defaults
46
 
                if( savedInstanceState == null)
47
 
                {
48
 
                        _backEnabled = false;
49
 
 
50
 
                        Bundle extras = getIntent().getExtras();
51
 
                        if( extras != null )
52
 
                                _backEnabled = extras.getBoolean( "backstate" );
53
 
                }
54
 
                else
55
 
                {
56
 
                        _backEnabled = savedInstanceState.getBoolean( "_backEnabled" );
57
 
                }
58
 
 
59
 
                // enable/disable back button
60
 
                ( (Button)findViewById( R.id.back ) ).setEnabled( _backEnabled );
61
 
 
62
42
                // set up next button
63
43
                Button next = (Button)findViewById( R.id.next );
64
44
                next.setOnClickListener( new View.OnClickListener() {
65
45
                        public void onClick( View view ) {
66
 
                                onNext();
 
46
                                switchToState( _nextState );
67
47
                        }
68
48
                } );
69
49
 
75
55
                                finish();
76
56
                        }
77
57
                } );
78
 
        }
79
 
 
80
 
        @Override
81
 
        protected void onSaveInstanceState( Bundle outState ) {
82
 
                super.onSaveInstanceState(outState);
83
 
                outState.putBoolean( "_backEnabled", _backEnabled );
84
 
        }
85
 
/*
86
 
        @Override
87
 
        protected void onPause()
88
 
        {
89
 
                super.onPause();
90
 
        }
91
 
 
92
 
        @Override
93
 
        protected void onResume()
94
 
        {
95
 
                super.onResume();
96
 
        }
97
 
*/
98
 
        protected void onNext()
99
 
        {
100
 
                switchToState( _nextState );
 
58
 
 
59
                // enable back button?
 
60
                Bundle extras = getIntent().getExtras();
 
61
                if( extras != null ) {
 
62
                        Boolean backstate = extras.getBoolean( "backstate" );
 
63
                        if( backstate != null )
 
64
                                ( (Button)findViewById( R.id.back ) ).setEnabled( true );
 
65
                }
101
66
        }
102
67
 
103
68
        protected void setNextState( int nextState )