/* * setting for looping through words * setting for language of words (later) * setting for difficultly/level of words (by grade maybe?) * setting for length of words */ protected override void OnCreate(Bundle bundle) { // TODO: rotating the screen restarts the app! base.OnCreate(bundle); Window.SetBackgroundDrawable(Resources.GetDrawable(Resource.Color.wordswipe_background)); // Set our view from the "main" layout resource SetContentView(Resource.Layout.ViewManager); // set the splash screen to visible first (default) SetActionBar(FindViewById <Toolbar> (Resource.Id.toolbar)); ActionBar.SetHomeButtonEnabled(true); // get the TextViews from the UI currentWordView = FindViewById <TextView> (Resource.Id.currentWord); currentDefinitionView = FindViewById <TextView> (Resource.Id.definition); swipeYesView = FindViewById <TextView> (Resource.Id.swipeYes); swipeNoView = FindViewById <TextView> (Resource.Id.swipeNo); viewWordsButton = FindViewById <Button> (Resource.Id.viewWordsButton); generator = new WordGenerator(Assets.Open, GetFileStreamPath("dict.txt").AbsolutePath); InitializeWordSet(); //FIXME: need to store this so it doesn't reset each time the user restarts the app List <string> learnedWords = new List <string> (); swipeYesView.Click += delegate { UpdateCurrentWord(); }; swipeNoView.Click += delegate { learnedWords.Add(currentWord); UpdateCurrentWord(); }; viewWordsButton.Click += (sender, e) => { var intent = new Intent(this, typeof(WordsLearnedActivity)); intent.PutStringArrayListExtra("learned_words", learnedWords); StartActivity(intent); }; }
/* * setting for looping through words * setting for language of words (later) * setting for difficultly/level of words (by grade maybe?) * setting for length of words */ protected override void OnCreate (Bundle bundle) { // TODO: rotating the screen restarts the app! base.OnCreate (bundle); Window.SetBackgroundDrawable (Resources.GetDrawable (Resource.Color.wordswipe_background)); // Set our view from the "main" layout resource SetContentView (Resource.Layout.ViewManager); // set the splash screen to visible first (default) SetActionBar (FindViewById<Toolbar> (Resource.Id.toolbar)); ActionBar.SetHomeButtonEnabled (true); // get the TextViews from the UI currentWordView = FindViewById<TextView> (Resource.Id.currentWord); currentDefinitionView = FindViewById<TextView> (Resource.Id.definition); swipeYesView = FindViewById<TextView> (Resource.Id.swipeYes); swipeNoView = FindViewById<TextView> (Resource.Id.swipeNo); viewWordsButton = FindViewById<Button> (Resource.Id.viewWordsButton); generator = new WordGenerator (Assets.Open, GetFileStreamPath ("dict.txt").AbsolutePath); InitializeWordSet (); //FIXME: need to store this so it doesn't reset each time the user restarts the app List<string> learnedWords = new List<string> (); swipeYesView.Click += delegate { UpdateCurrentWord (); }; swipeNoView.Click += delegate { learnedWords.Add (currentWord); UpdateCurrentWord (); }; viewWordsButton.Click += (sender, e) => { var intent = new Intent(this, typeof(WordsLearnedActivity)); intent.PutStringArrayListExtra("learned_words", learnedWords); StartActivity(intent); }; }