예제 #1
0
 protected override void OnResume()
 {
     if (savedStateIsPlaying) {
         quizFragment = (QuizFragment)FragmentManager.FindFragmentByTag(FragmentTag);
         FindViewById(Resource.Id.quiz_fragment_container).Visibility = ViewStates.Visible;
     }
     base.OnResume();
 }
예제 #2
0
		public static QuizFragment Create (string categoryId)
		{
			if (string.IsNullOrEmpty (categoryId)) {
				throw new InvalidOperationException ("The category can not be null");
			}
			var args = new Bundle ();
			args.PutString (Category.TAG, categoryId);
			var fragment = new QuizFragment ();
			fragment.Arguments = args;
			return fragment;
		}
예제 #3
0
 void InitQuizFragment() {
     quizFragment = QuizFragment.Create(categoryId);
     quizFragment.CategorySolved += (outerSender, outerArgs) =>
     {
         ElevateToolbar();
         if (circularReveal != null && circularReveal.IsRunning)
         {
             EventHandler handler = null;
             handler = (innerSender, innerArgs) =>
             {
                 quizFab.SetImageResource(Resource.Drawable.ic_tick);
                 quizFab.Id = Resource.Id.quiz_done;
                 quizFab.Visibility = ViewStates.Visible;
                 quizFab.ScaleX = 0f;
                 quizFab.ScaleY = 0f;
                 quizFab.Animate()
                         .ScaleX(1)
                         .ScaleY(1)
                         .SetInterpolator(interpolator)
                         .SetListener(null)
                         .Start();
                 circularReveal.AnimationEnd -= handler;
             };
             circularReveal.AnimationEnd += handler;
         } else {
             quizFab.SetImageResource(Resource.Drawable.ic_tick);
             quizFab.Id = Resource.Id.quiz_done;
             quizFab.Visibility = ViewStates.Visible;
             quizFab.ScaleX = 0f;
             quizFab.ScaleY = 0f;
             quizFab.Animate()
                     .ScaleX(1)
                     .ScaleY(1)
                     .SetInterpolator(interpolator)
                     .SetListener(null)
                     .Start();
         }
     };
     toolbar.Elevation = 0;
 }