public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootView = (FrameLayout)inflater.Inflate(Resource.Layout.math_fragment, container, false);
            TransitionManager.BeginDelayedTransition((ViewGroup)rootView,
                                                     new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn));

            igrajPonovo = rootView.FindViewById <FButton>(Resource.Id.igrajPonovo);

            izlaz       = rootView.FindViewById <FButton>(Resource.Id.izlaz);
            number1Btn  = rootView.FindViewById <FButton>(Resource.Id.number1);
            number2Btn  = rootView.FindViewById <FButton>(Resource.Id.number2);
            number3Btn  = rootView.FindViewById <FButton>(Resource.Id.number3);
            number4Btn  = rootView.FindViewById <FButton>(Resource.Id.number4);
            number5Btn  = rootView.FindViewById <FButton>(Resource.Id.number5);
            number6Btn  = rootView.FindViewById <FButton>(Resource.Id.number6);
            number7Btn  = rootView.FindViewById <FButton>(Resource.Id.number7);
            number8Btn  = rootView.FindViewById <FButton>(Resource.Id.number8);
            number9Btn  = rootView.FindViewById <FButton>(Resource.Id.number9);
            number0Btn  = rootView.FindViewById <FButton>(Resource.Id.number0);
            delete      = rootView.FindViewById <FButton>(Resource.Id.delete);
            start       = rootView.FindViewById <FButton>(Resource.Id.start);
            startLayout = rootView.FindViewById <LinearLayout>(Resource.Id.startLayout);

            number1TW         = rootView.FindViewById <TextView>(Resource.Id.number1TW);
            number2TW         = rootView.FindViewById <TextView>(Resource.Id.number2TW);
            solutionTW        = rootView.FindViewById <TextView>(Resource.Id.solutionTW);
            vreme             = rootView.FindViewById <TextView>(Resource.Id.vreme);
            redniBrojZadatka  = rootView.FindViewById <TextView>(Resource.Id.redniBrojZadatka);
            operacijaTW       = rootView.FindViewById <TextView>(Resource.Id.operacija);
            tacnihOdgovoraTW  = rootView.FindViewById <TextView>(Resource.Id.tacnihOdgovora);
            brojTacnihNaKraju = rootView.FindViewById <TextView>(Resource.Id.brojTacnihNaKraju);
            vremeNaKraju      = rootView.FindViewById <TextView>(Resource.Id.vremeNaKraju);
            igrajPonovoLayout = rootView.FindViewById <LinearLayout>(Resource.Id.igrajPonovoLayout);
            questionLayout    = rootView.FindViewById <LinearLayout>(Resource.Id.questionLayout);

            Init();

            start.Click += delegate
            {
                Start();
            };

            izlaz.Click += delegate
            {
                //Activity.FragmentManager.PopBackStack();
                PlayFragment pf = new PlayFragment();
                Activity.FragmentManager.BeginTransaction().Replace(App.fragmentContainer.Id, pf, "play").Commit();
                App.CurrentFragment = pf;
            };

            igrajPonovo.Click += delegate
            {
                Start();
            };

            return(rootView);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootView    = (FrameLayout)inflater.Inflate(Resource.Layout.math_with_answers_fragment, container, false);
            answer1     = rootView.FindViewById <FButton>(Resource.Id.answer1);
            answer2     = rootView.FindViewById <FButton>(Resource.Id.answer2);
            answer3     = rootView.FindViewById <FButton>(Resource.Id.answer3);
            answer4     = rootView.FindViewById <FButton>(Resource.Id.answer4);
            igrajPonovo = rootView.FindViewById <FButton>(Resource.Id.igrajPonovo);
            izlaz       = rootView.FindViewById <FButton>(Resource.Id.izlaz);

            start       = rootView.FindViewById <FButton>(Resource.Id.start);
            startLayout = rootView.FindViewById <LinearLayout>(Resource.Id.startLayout);

            number1TW         = rootView.FindViewById <TextView>(Resource.Id.number1);
            number2TW         = rootView.FindViewById <TextView>(Resource.Id.number2);
            vreme             = rootView.FindViewById <TextView>(Resource.Id.vreme);
            redniBrojZadatka  = rootView.FindViewById <TextView>(Resource.Id.redniBrojZadatka);
            operacijaTW       = rootView.FindViewById <TextView>(Resource.Id.operacija);
            tacnihOdgovoraTW  = rootView.FindViewById <TextView>(Resource.Id.tacnihOdgovora);
            brojTacnihNaKraju = rootView.FindViewById <TextView>(Resource.Id.brojTacnihNaKraju);
            vremeNaKraju      = rootView.FindViewById <TextView>(Resource.Id.vremeNaKraju);
            igrajPonovoLayout = rootView.FindViewById <LinearLayout>(Resource.Id.igrajPonovoLayout);
            questionLayout    = rootView.FindViewById <LinearLayout>(Resource.Id.questionLayout);

            Init();

            start.Click += delegate
            {
                Start();
            };

            izlaz.Click += delegate
            {
                //Activity.FragmentManager.PopBackStack();
                PlayFragment pf = new PlayFragment();
                Activity.FragmentManager.BeginTransaction().Replace(App.fragmentContainer.Id, pf, "play").Commit();
                App.CurrentFragment = pf;
            };

            igrajPonovo.Click += delegate
            {
                Start();
            };

            return(rootView);
        }
Exemple #3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            FButton fb = new FButton(Activity);

            rootView = inflater.Inflate(Resource.Layout.main_fragment, container, false);

            play     = rootView.FindViewById <FButton>(Resource.Id.play);
            latinica = rootView.FindViewById <FButton>(Resource.Id.latinica);
            cirilica = rootView.FindViewById <FButton>(Resource.Id.cirilica);
            settings = rootView.FindViewById <FButton>(Resource.Id.settings);
            records  = rootView.FindViewById <FButton>(Resource.Id.records);
            quit     = rootView.FindViewById <FButton>(Resource.Id.quit);

            //Typeface typeface = Activity.Resources.GetFont(Resource.Font.alegreya_font_family);
            //settings.Typeface = typeface;
            //records.Typeface = typeface;

            cirilica.Click += delegate
            {
                App.preferences.language = LangEnum.Cirilica;
                App.Current.WriteSharedPreferences();

                Java.Util.Locale.Default       = new Locale("sr", "RS");
                Resources.Configuration.Locale = Java.Util.Locale.Default;
                Resources.UpdateConfiguration(Resources.Configuration, Resources.DisplayMetrics);

                ChangeLanguage();
                play.Text           = GetString(Resource.String.igraj);
                this.Activity.Title = GetString(Resource.String.app_name);
            };

            latinica.Click += delegate
            {
                App.preferences.language = LangEnum.Latinica;
                App.Current.WriteSharedPreferences();
                Java.Util.Locale.Default       = App.default_locale;
                Resources.Configuration.Locale = Java.Util.Locale.Default;
                Resources.UpdateConfiguration(Resources.Configuration, Resources.DisplayMetrics);

                ChangeLanguage();
                play.Text           = GetString(Resource.String.igraj);
                this.Activity.Title = GetString(Resource.String.app_name);
            };

            play.Click += delegate
            {
                PlayFragment pf = new PlayFragment();
                Activity.FragmentManager.BeginTransaction().Replace(App.fragmentContainer.Id, pf, "play_fragment").AddToBackStack(null).Commit();
                App.CurrentFragment = pf;
            };

            settings.Click += delegate
            {
                Intent intent = new Intent(Activity, typeof(SettingsActivity));
                StartActivity(intent);
            };

            records.Click += delegate
            {
                RecordFragment rf = new RecordFragment();
                Activity.FragmentManager.BeginTransaction().Replace(App.fragmentContainer.Id, rf, "record_fragment").AddToBackStack(null).Commit();
                App.CurrentFragment = rf;

                //var rec = App.db.GetAllRecords().Where(t => t.GameId == "m1").ToList();
                //Toast.MakeText(Activity, rec.ToString(), ToastLength.Long).Show();
            };


            quit.Click += delegate
            {
                Activity.FinishAffinity();
            };

            return(rootView);
        }