예제 #1
0
        private void FlipView(bool trash = false)
        {
            var index       = flipper.DisplayedChild;
            var InAnimation = (index > 0)
                ? Resource.Animation.slide_in_from_left
                : Resource.Animation.appear_from_top_right;
            var OutAnimation = (index > 0)
                ? Resource.Animation.dissapear_to_top_right
                : Resource.Animation.slide_out_to_left;

            if (trash)
            {
                OutAnimation = Resource.Animation.dissapear_to_bottom_right;
            }

            flipper.SetInAnimation(this, InAnimation);
            flipper.SetOutAnimation(this, OutAnimation);
            if (index > 0)
            {
                flipper.ShowPrevious();
            }
            else
            {
                flipper.ShowNext();
            }
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            _flipper = FindViewById <ViewFlipper>(Resource.Id.viewFlipper);

            btnNext = FindViewById <Button>(Resource.Id.btnNext);
            btnPrev = FindViewById <Button>(Resource.Id.btnPrev);

            // Use button clicks to cycle through views
            btnNext.Click += (sender, e) => {
                // Use custom animations
                _flipper.SetOutAnimation(this, Resource.Animation.slideout_left);
                _flipper.SetInAnimation(this, Resource.Animation.slidein_right);
                // Use Android built-in animations
                //_flipper.SetInAnimation(this, Android.Resource.Animation.SlideInLeft);
                //_flipper.SetOutAnimation(this, Android.Resource.Animation.SlideOutRight);
                _flipper.ShowNext();
            };
            btnPrev.Click += (sender, e) => {
                // Use custom animations
                _flipper.SetOutAnimation(this, Resource.Animation.slideout_right);
                _flipper.SetInAnimation(this, Resource.Animation.slidein_left);
                // Use Android built-in animations
                //_flipper.SetInAnimation(this, Android.Resource.Animation.SlideInLeft);
                //_flipper.SetOutAnimation(this, Android.Resource.Animation.SlideOutRight);
                _flipper.ShowPrevious();
            };
        }
예제 #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            InitComponents();

            var extras = Intent.Extras;

            if (extras != null)
            {
                var skip = extras.GetBoolean("Skip");
                if (skip)
                {
                    viewFlipper.ShowNext();
                    ActionBar.SetDisplayHomeAsUpEnabled(true);
                    ActionBar.SetDisplayShowHomeEnabled(true);
                }
            }
        }
예제 #4
0
        public bool FlipView()
        {
            int index        = viewFlipper.DisplayedChild;
            int InAnimation  = (index > 0) ? Resource.Animation.slide_in_from_left : Resource.Animation.slide_in_from_right;
            int OutAnimation = (index > 0) ? Resource.Animation.slide_out_to_right : Resource.Animation.slide_out_to_left;

            viewFlipper.SetInAnimation(this, InAnimation);
            viewFlipper.SetOutAnimation(this, OutAnimation);
            if (index > 0)
            {
                viewFlipper.ShowPrevious();
            }
            else
            {
                ViewHelper.ToggleMenu(menu, true);
                viewFlipper.ShowNext();
            }
            return(true);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            /************************************************|
            * 				DECLARING VARIABLES				 |
            * 					for global class use		 |
            * 												 |
            *************************************************/

            Log.Info (Tag, "Choosing Phase began");
            SetContentView(Resource.Layout.NewJourneySpecificPreferences);
            //--------Layout Variables---------//
            // Images - Interests - New Journey
            firstImage = (ImageView)FindViewById (Resource.Id.imageView1);
            secondImage = (ImageView)FindViewById (Resource.Id.imageView2);
            thirdImage = (ImageView)FindViewById (Resource.Id.imageView3);
            fourthImage = (ImageView)FindViewById (Resource.Id.imageView4);

            // Buttons - Moodboard
            takeItFirst = (Button)FindViewById (Resource.Id.takeItFirst);
            takeItSecond = (Button) FindViewById (Resource.Id.takeItSecond);
            takeItThird = (Button)FindViewById (Resource.Id.takeItThird);
            takeItFourth = (Button)FindViewById (Resource.Id.takeItFourth);

            // Buttons - Transitions
            nextButton = (Button) FindViewById (Resource.Id.nextButton);
            backButton = (Button)FindViewById (Resource.Id.backButton);
            nextButtonExplanation = (Button)FindViewById (Resource.Id.nextButtonChoosing);
            backButtonExplanation = (Button)FindViewById (Resource.Id.backButtonChoosing);

            // Layout - Special Preference - New Journey
            layoutFirstImage = (LinearLayout)FindViewById (Resource.Id.layoutFirstImage);
            layoutSecondImage = (LinearLayout)FindViewById (Resource.Id.layoutSecondImage);
            layoutThirdImage = (LinearLayout)FindViewById (Resource.Id.layoutThirdImage);
            layoutFourthImage = (LinearLayout)FindViewById (Resource.Id.layoutFourthImage);
            fullScreen = (LinearLayout)FindViewById (Resource.Id.fullScreenLayout);

            // Flipper - Specific Preferences - New Journey
            flipper = (ViewFlipper) FindViewById (Resource.Id.viewFlipper1);

            //-----------Method Variables---------//
            // bools
            isImageFitToScreen = true;
            isSelected = true;
            canBeSelected = false;

            // ints
            imagesSelected = 0;

            // Remove Like Buttons from View (o t in Fullscreen View)
            fullScreen.RemoveView (takeItFirst);
            fullScreen.RemoveView (takeItSecond);
            fullScreen.RemoveView (takeItThird);
            fullScreen.RemoveView (takeItFourth);

            nextButtonExplanation.Click += delegate {
                flipper.ShowNext();
            };
            backButton.Click += delegate {
                flipper.ShowPrevious();
            };

            /************************************************|
            * 				INVOKING METHODS				 |
             	* 												 |
            * 												 |
            *************************************************/

            // Zoom Methods - Interests
            ImageZoom (firstImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
            ImageZoom (secondImage, Tag, fullScreen, layoutSecondImage, takeItSecond);
            ImageZoom (thirdImage, Tag, fullScreen, layoutThirdImage, takeItThird);
            ImageZoom (fourthImage, Tag, fullScreen, layoutFourthImage, takeItFourth);

            // Like Methods - Interests
            clickingImage (firstImage, takeItFirst, fullScreen, layoutFirstImage);
            clickingImage (secondImage, takeItSecond, fullScreen, layoutSecondImage);
            clickingImage (thirdImage, takeItThird, fullScreen, layoutThirdImage);
            clickingImage (fourthImage, takeItFourth, fullScreen, layoutFourthImage);

            // Transition Methods
            Transition (nextButton);
            Transition (backButtonExplanation);
        }
예제 #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            Log.Warn (Tag, "OnCreate");

            /************************************************|
            * 				DECLARING VARIABLES				 |
            * 					for global class use		 |
            * 												 |
            *************************************************/

            Log.Info (Tag, "Choosing Phase began");
            SetContentView(Resource.Layout.MainPreferencesPhaseOne);

            //--------Layout Variables---------//
            // Images - Interests - Main Preferences
            firstImage = (ImageView)FindViewById (Resource.Id.imageView1);
            secondImage = (ImageView)FindViewById (Resource.Id.imageView2);
            thirdImage = (ImageView)FindViewById (Resource.Id.imageView3);
            fourthImage = (ImageView)FindViewById (Resource.Id.imageView4);
            //imageArray = {firstImage, secondImage, thirdImage, fourthImage}

            // Layout - MainPreferences - Main Preferences
            layoutFirstImage = (LinearLayout)FindViewById (Resource.Id.layoutFirstImage);
            layoutSecondImage = (LinearLayout)FindViewById (Resource.Id.layoutSecondImage);
            layoutThirdImage = (LinearLayout)FindViewById (Resource.Id.layoutThirdImage);
            layoutFourthImage = (LinearLayout)FindViewById (Resource.Id.layoutFourthImage);
            fullScreen = (LinearLayout)FindViewById (Resource.Id.fullScreenLayout);
            mainPreferences = (LinearLayout)FindViewById (Resource.Id.MainPreferences);
            imageChoosingExplanation = (LinearLayout)FindViewById (Resource.Id.ImageChoosingExplanation);

            // Buttons - Main Preferences
            takeIt = (Button)FindViewById (Resource.Id.takeItFirst);
            backButton = (Button)FindViewById (Resource.Id.backButton);
            nextButton = (Button) FindViewById (Resource.Id.nextButton);
            nextButtonChoosing = (Button)FindViewById (Resource.Id.nextButtonChoosing);
            fullScreen.RemoveView (takeIt);

            // Flipper - Main Preferences Main
            flipper = (ViewFlipper) FindViewById (Resource.Id.viewFlipper1);
            flipper.ShowNext ();

            //-----------Method Variables---------//
            // bools
            isImageFitToScreen = true;
            isSelected = true;
            hasStarted = true;

            /************************************************|
            * 				INVOKING METHODS				 |
             	* 												 |
            * 												 |
            *************************************************/

            // Creating the Databse
            createDatabase(dbPath);

            nextButtonChoosing.Click += delegate {
                flipper.ShowPrevious();
            };

            // Phase Handler
            next(Tag);

            // Zoom Methods - Interests
            ImageZoom (firstImage, Tag, fullScreen, layoutFirstImage);
            ImageZoom (secondImage, Tag, fullScreen, layoutSecondImage);
            ImageZoom (thirdImage, Tag, fullScreen, layoutThirdImage);
            ImageZoom (fourthImage, Tag, fullScreen, layoutFourthImage);
        }
예제 #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            Log.Warn (Tag, "OnCreate");

            /************************************************|
            * 				DECLARING VARIABLES				 |
            * 					for global class use		 |
            * 												 |
            *************************************************/

            Log.Info (Tag, "Choosing Phase began");
            SetContentView(Resource.Layout.NewJourney);

            //--------Layout Variables---------//
            // Images - Interests - New Journey
            firstImage = (ImageView)FindViewById (Resource.Id.imageView1);
            secondImage = (ImageView)FindViewById (Resource.Id.imageView2);
            thirdImage = (ImageView)FindViewById (Resource.Id.imageView3);
            fourthImage = (ImageView)FindViewById (Resource.Id.imageView4);
            // Images - Person Count Symbols
            firstPersonImage = (ImageView) FindViewById (Resource.Id.imageView5);
            secondPersonImage = (ImageView)FindViewById (Resource.Id.imageView6);
            thirdPersonImage = (ImageView)FindViewById (Resource.Id.imageView7);
            fourthPersonImage = (ImageView)FindViewById (Resource.Id.imageView8);

            // Layout - Special Preference - New Journey
            layoutFirstImage = (LinearLayout)FindViewById (Resource.Id.layoutFirstImage);
            layoutSecondImage = (LinearLayout)FindViewById (Resource.Id.layoutSecondImage);
            layoutThirdImage = (LinearLayout)FindViewById (Resource.Id.layoutThirdImage);
            layoutFourthImage = (LinearLayout)FindViewById (Resource.Id.layoutFourthImage);
            fullScreen = (LinearLayout)FindViewById (Resource.Id.fullScreenLayout);
            mainPreferences = (LinearLayout)FindViewById (Resource.Id.MainPreferences);
            imageChoosingExplanation = (LinearLayout)FindViewById (Resource.Id.ImageChoosingExplanation);

            // Buttons - Moodboard
            takeItFirst = (Button)FindViewById (Resource.Id.takeItFirst);
            takeItSecond = (Button) FindViewById (Resource.Id.takeItSecond);
            takeItThird = (Button)FindViewById (Resource.Id.takeItThird);
            takeItFourth = (Button)FindViewById (Resource.Id.takeItFourth);
            // Buttons - Back Buttons
            backButtonMoodboard = (Button)FindViewById (Resource.Id.backButton);
            backButtonExplanation = (Button)FindViewById (Resource.Id.backButtonChoosing);
            backButtonDateStart = (Button)FindViewById (Resource.Id.backButtonDateStart);
            backButtonDateEnd = (Button)FindViewById (Resource.Id.backButtonDateEnd);
            backButtonPersonCount = (Button)FindViewById (Resource.Id.backButtonPersonCount);

            // Buttons - Next Buttons
            nextButtonMoodboard = (Button) FindViewById (Resource.Id.nextButton);
            nextButtonChoosing = (Button)FindViewById (Resource.Id.nextButtonChoosing);
            nextButtonDateStart = (Button)FindViewById (Resource.Id.nextButtonDateStart);
            nextButtonDateEnd = (Button)FindViewById (Resource.Id.nextButtonDateEnd);
            nextButtonPersonCount = (Button)FindViewById (Resource.Id.nextButtonPersonCount);

            // Remove Like Buttons from View (o t in Fullscreen View)
            fullScreen.RemoveView (takeItFirst);
            fullScreen.RemoveView (takeItSecond);
            fullScreen.RemoveView (takeItThird);
            fullScreen.RemoveView (takeItFourth);

            // Flipper - Main Preferences Main
            flipper = (ViewFlipper) FindViewById (Resource.Id.viewFlipper1);

            // Date Picker
            dateStart = (DatePicker)FindViewById (Resource.Id.DatePickerStart);
            dateEnd = (DatePicker)FindViewById (Resource.Id.DatePickerEnd);

            //-----------Method Variables---------//
            // bools
            isImageFitToScreen = true;
            isImageChoosen = true;
            isSelected = true;

            // ints
            imagesSelected = 0;
            phase = 1;

            /************************************************|
            * 				INVOKING METHODS				 |
             	* 												 |
            * 												 |
            *************************************************/

            nextButtonChoosing.Click += delegate {
                flipper.ShowNext();
            };
            // Only for testing
            // ONLY FOR TESTING - DELETED WHEN RELEASED
            //-----------Database is created---------//
            createDatabase(dbPath);

            // Phase Handler
            next (Tag, nextButtonMoodboard);
            next (Tag, nextButtonPersonCount);
            next (Tag, nextButtonDateStart);
            next (Tag, nextButtonDateEnd);
            back (backButtonMoodboard);
            back (backButtonExplanation);
            back (backButtonDateStart);
            back (backButtonDateEnd);

            // Zoom Methods - Interests
            ImageZoom (firstImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
            ImageZoom (secondImage, Tag, fullScreen, layoutSecondImage, takeItSecond);
            ImageZoom (thirdImage, Tag, fullScreen, layoutThirdImage, takeItThird);
            ImageZoom (fourthImage, Tag, fullScreen, layoutFourthImage, takeItFourth);
            ImageZoom (firstPersonImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
            ImageZoom (secondPersonImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
            ImageZoom (thirdPersonImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
            ImageZoom (fourthPersonImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
        }
예제 #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.FourthPage);

            // Prefix
            var resourcePrefix = "Math_App.Droid.";

            // Create stream with path
            var assembly = typeof(MainActivity).GetTypeInfo().Assembly;
            Stream stream = assembly.GetManifestResourceStream(resourcePrefix + "Strategies.xml");

            // get title from bundle
            Intent intent = this.Intent;
            string title = intent.GetStringExtra("title");

            // Read Xml file & create strategy object
            StrategyXmlObject strat = new StrategyXmlObject();
            strat = ReaderXml.ReadFile(stream, title);
            Console.WriteLine(title);

            // create flipper
            _flipper = FindViewById<ViewFlipper>(Resource.Id.viewFlipper);

            // create buttons
            btnNext = FindViewById<Button>(Resource.Id.btnNext);
            btnPrev = FindViewById<Button>(Resource.Id.btnPrev);

            // different views flipper
            titel = FindViewById<TextView>(Resource.Id.nameAndLevel);
            titel.Text = strat.Level1.title;
            info = FindViewById<TextView>(Resource.Id.explanation);
            info.Text = strat.Level1.text;

            //image = FindViewById<ImageView>(Resource.Id.img);
            //int id = Resources.GetIdentifier(strat.Level2.image, "drawable", "Math_App.Droid");
            //image.SetImageResource(id);

            titel2 = FindViewById<TextView>(Resource.Id.nameAndLevel2);
            titel2.Text = strat.Level2.title;
            info2 = FindViewById<TextView>(Resource.Id.explanation2);
            info2.Text = strat.Level2.text;

            //image2 = FindViewById<ImageView>(Resource.Id.img2);
            //int id2 = Resources.GetIdentifier(strat.Level2.image, "drawable", "Math_App.Droid");
            //image2.SetImageResource(id2);

            titel3 = FindViewById<TextView>(Resource.Id.nameAndLevel3);
            titel3.Text = strat.Level3.title;
            info3 = FindViewById<TextView>(Resource.Id.explanation3);
            info3.Text = strat.Level3.text;

            //image3 = FindViewById<ImageView>(Resource.Id.img3);
            //int id3 = Resources.GetIdentifier(strat.Level3.image, "drawable", "Math_App.Droid");
            //image3.SetImageResource(id3);

            titel4 = FindViewById<TextView>(Resource.Id.nameAndLevel4);
            titel4.Text = strat.Level4.title;
            info4 = FindViewById<TextView>(Resource.Id.explanation4);
            info4.Text = strat.Level4.text;

            //image4 = FindViewById<ImageView>(Resource.Id.img4);
            //int id4 = Resources.GetIdentifier(strat.Level4.image, "drawable", "Math_App.Droid");
            //image4.SetImageResource(id4);


            // Use button clicks to cycle through views
            btnNext.Click += (sender, e) => {
                // Use custom animations
                _flipper.SetOutAnimation(this, Resource.Layout.Slideout_top);
                _flipper.SetInAnimation(this, Resource.Layout.Slidein_bot);
                // Use Android built-in animations
                //_flipper.SetInAnimation(this, Android.Resource.Animation.SlideInLeft);      
                //_flipper.SetOutAnimation(this, Android.Resource.Animation.SlideOutRight);
                _flipper.ShowNext();
            };
            btnPrev.Click += (sender, e) => {
                // Use custom animations
                _flipper.SetOutAnimation(this, Resource.Layout.Slideout_bot);
                _flipper.SetInAnimation(this, Resource.Layout.Slidein_top);
                // Use Android built-in animations
                //_flipper.SetInAnimation(this, Android.Resource.Animation.SlideInLeft);
                //_flipper.SetOutAnimation(this, Android.Resource.Animation.SlideOutRight);
                _flipper.ShowPrevious();
            };

        }