コード例 #1
0
        void HandleCurveSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            if (currentExperiment == null)
            {
                return;
            }

            ITimeCurve curve = null;

            if (e.Position == 0)
            {
                curve = currentExperiment.CreatePreferredTimeCurve();
            }
            else
            {
                curve = availableCurves [e.Position - 1];
            }
            currentExperiment.SetTimeCurve(curve);
            graph.SetAnimationCompletion(0);
            graph.SetInterpolatorCurve(curve);
        }
コード例 #2
0
        void SwitchToExperiment <TFragment> () where TFragment : Fragment, IExperiment, new()
        {
            if (currentExperiment is TFragment)
            {
                return;
            }

            var frag = new TFragment();

            FragmentManager.BeginTransaction()
            .SetCustomAnimations(Resource.Animator.fragment_enter, Resource.Animator.fragment_exit)
            .Replace(Resource.Id.contentContainer, frag)
            .Commit();
            FragmentManager.ExecutePendingTransactions();

            currentExperiment = frag;
            var curve = currentExperiment.CreatePreferredTimeCurve();

            currentExperiment.SetTimeCurve(curve);
            graph.SetAnimationCompletion(0);
            graph.SetInterpolatorCurve(curve);
        }