Exemple #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            mScrollView = FindViewById <SlidingTabScrollView>(Resource.Id.sliding_tabs);
            mViewPager  = FindViewById <ViewPager>(Resource.Id.viewPager);

            mViewPager.Adapter     = new SamplePagerAdapter(SupportFragmentManager, this);
            mScrollView.ViewPager  = mViewPager;
            mPagerAdapter          = (SamplePagerAdapter)mViewPager.Adapter;
            mSettingsFragment      = (SettingsFragment)mPagerAdapter.GetItem(0);
            mInverseFragment       = (InverseFragment)mPagerAdapter.GetItem(1);
            mAccelerometerFragment = (AccelerometerFragment)mPagerAdapter.GetItem(2);
            mTargetFragment        = (TargetFragment)mPagerAdapter.GetItem(3);

            //Set Up Default Inverse Params (geometrical)
            SetDefaultInverseParams();

            //Set update event, when tab change
            mScrollView.NewPageSelected += OnPageChanged;

            //Set up accelerometer readings
            sensorManager         = (SensorManager)GetSystemService(Context.SensorService);
            NewAccelerometerData += mAccelerometerFragment.OnAccelerometerData;
            aPageChanged         += mAccelerometerFragment.OnPageChanged;
        }
 public SettingsFragment(SamplePagerAdapter par)
 {
     parent = par;
 }
Exemple #3
0
 public InverseFragment(SamplePagerAdapter par)
 {
     parent = par;
 }
 public TargetFragment(SamplePagerAdapter par)
 {
     parent = par;
 }
Exemple #5
0
 public AccelerometerFragment(SamplePagerAdapter par)
 {
     parent = par;
 }