void SignOut()
 {
     PreferencesHelper.SignOut(this);
     TopekaDatabaseHelper.Reset(this);
     SignInActivity.Start(this, false, null);
     FinishAfterTransition();
 }
        public override void OnCreate(Bundle savedInstanceState)
        {
            var categoryId = Arguments.GetString(Category.TAG);

            category = TopekaDatabaseHelper.GetCategoryWith(Activity, categoryId);
            base.OnCreate(savedInstanceState);
        }
        protected override void OnResume()
        {
            base.OnResume();
            var scoreView = FindViewById <TextView> (Resource.Id.score);
            var score     = TopekaDatabaseHelper.GetScore(this);

            scoreView.Text = string.Format(GetString(Resource.String.x_points), score);
        }
Exemple #4
0
        void Populate(string categoryId)
        {
            if (string.IsNullOrEmpty(categoryId))
            {
                Log.Warn(Tag, "Didn't find a category. Finishing");
                Finish();
            }
            var category = TopekaDatabaseHelper.GetCategoryWith(this, categoryId);

            SetTheme(category.Theme.StyleId);
            InitLayout(category.Id);
            InitToolbar(category);
        }
        public bool ShowNextPage()
        {
            if (quizView == null)
            {
                return(false);
            }

            var nextItem = quizView.DisplayedChild + 1;

            SetProgress(nextItem);
            var count = quizView.Adapter.Count;

            if (nextItem < count)
            {
                quizView.ShowNext();
                TopekaDatabaseHelper.UpdateCategory(Activity, category);
                return(true);
            }
            MarkCategorySolved();
            return(false);
        }
Exemple #6
0
 void UpdateCategories(Activity activity)
 {
     categories = TopekaDatabaseHelper.GetCategories(activity, true);
 }
 void MarkCategorySolved()
 {
     category.Solved = true;
     TopekaDatabaseHelper.UpdateCategory(Activity, category);
 }