コード例 #1
0
 void SignOut()
 {
     PreferencesHelper.SignOut(this);
     TopekaDatabaseHelper.Reset(this);
     SignInActivity.Start(this, false, null);
     FinishAfterTransition();
 }
コード例 #2
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            var categoryId = Arguments.GetString(Category.TAG);

            category = TopekaDatabaseHelper.GetCategoryWith(Activity, categoryId);
            base.OnCreate(savedInstanceState);
        }
コード例 #3
0
        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);
        }
コード例 #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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 void UpdateCategories(Activity activity)
 {
     categories = TopekaDatabaseHelper.GetCategories(activity, true);
 }
コード例 #7
0
 void MarkCategorySolved()
 {
     category.Solved = true;
     TopekaDatabaseHelper.UpdateCategory(Activity, category);
 }