protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.TheBestHeli);
            ////////////////////////МЕНЮ\\\\\\\\\\\\\\\\\\\\\\
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id._app_bar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetTitle(Resource.String.app_name);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;
            var drawerToogle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);

            drawerLayout.AddDrawerListener(drawerToogle);
            drawerToogle.SyncState();
            ////////////////////////МЕНЮ\\\\\\\\\\\\\\\\\\\\\\ 
            Context context = Application.Context;
            var     id      = "ca-app-pub-8211072909515345~1945501010";

            Android.Gms.Ads.MobileAds.Initialize(context, id);
            var adView    = FindViewById <AdView>(Resource.Id.adViewTheBestHeli);
            var adRequest = new AdRequest.Builder().Build();

            adView.LoadAd(adRequest);
            //var requestbuilder = new AdRequest.Builder().AddTestDevice("D0BE22F1A4BE27C7470F95A699568FE2");
            //adView.LoadAd(requestbuilder.Build());


            _TheBestSpinnerNation = FindViewById <Spinner>(Resource.Id.TheBestSpinnerNationH);
            _TheBestSpinnerRank   = FindViewById <Spinner>(Resource.Id.TheBestSpinnerRankH);
            _TheBestSpinnerTask   = FindViewById <Spinner>(Resource.Id.TheBestSpinnerTaskH);
            _TheBestListView      = FindViewById <ListView>(Resource.Id.TheBestlistViewH);
            //Привязка спиннеров к шарп коду
            theBestNations                = NationCollection.GetNation();
            TheBestAdapterNation          = new NationAdapter(this, theBestNations);
            _TheBestSpinnerNation.Adapter = TheBestAdapterNation;
            _TheBestSpinnerNation.SetSelection(0);  //Автовыбор
            selectedNation = 100;

            theBestRanks                = RankCollection.GetRank();
            TheBestAdapterRank          = new RankAdapter(this, theBestRanks);
            _TheBestSpinnerRank.Adapter = TheBestAdapterRank;
            _TheBestSpinnerRank.SetSelection(6); //Автовыбор
            selectedRank = 6;                    //Автовыбор

            theBestTask                 = HeliTaskCollection.GetTask();
            TheBestAdapterTask          = new TaskAdapter(this, theBestTask);
            _TheBestSpinnerTask.Adapter = TheBestAdapterTask;
            _TheBestSpinnerTask.SetSelection(0); //Автовыбор
            SelectedTask = 0;                    //Автовыбор

            _TheBestSpinnerNation.ItemSelected += _TheBestSpinnerNation_ItemSelected;
            _TheBestSpinnerRank.ItemSelected   += _TheBestSpinnerRank_ItemSelected;
            _TheBestSpinnerTask.ItemSelected   += _TheBestSpinnerTask_ItemSelected;
        }
示例#2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.InfoHeli);
            context = Application.Context;
            ////////////////////////МЕНЮ\\\\\\\\\\\\\\\\\\\\\\
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id._app_bar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetTitle(Resource.String.app_name);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;
            var drawerToogle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);

            drawerLayout.AddDrawerListener(drawerToogle);
            drawerToogle.SyncState();
            ////////////////////////МЕНЮ\\\\\\\\\\\\\\\\\\\\\\
            var id = "ca-app-pub-8211072909515345~1945501010";

            Android.Gms.Ads.MobileAds.Initialize(context, id);
            var adView    = FindViewById <AdView>(Resource.Id.adViewInfoHeli);
            var adRequest = new AdRequest.Builder().Build();

            adView.LoadAd(adRequest);
            // var requestbuilder = new AdRequest.Builder().AddTestDevice("D0BE22F1A4BE27C7470F95A699568FE2");
            //adView.LoadAd(requestbuilder.Build());
            //шрифт
            var font = Typeface.CreateFromAsset(Assets, "dinfont.ttf");

            _InfoSpinnerNation             = FindViewById <Spinner>(Resource.Id.InfoSpinnerNationH);
            _InfoSpinnerRank               = FindViewById <Spinner>(Resource.Id.InfoSpinnerRankH);
            _InfoSpinnerHeli               = FindViewById <Spinner>(Resource.Id.InfoSpinnerHeli);
            _InfoListView                  = FindViewById <ListView>(Resource.Id.listViewH);
            _InfoSpinnerPotentialEnemyHeli = FindViewById <Spinner>(Resource.Id.InfoSpinnerPotentialEnemyHeli);
            //Привязка спиннеров к шарп коду

            #region Привязка TextView к коду
            _InfoImage            = FindViewById <ImageView>(Resource.Id.InfoImageH);
            _InfoFlag             = FindViewById <ImageView>(Resource.Id.InfoFlagH);
            _InfoHandlingAGM      = FindViewById <ImageView>(Resource.Id.InfoHeliHandlingAGMRocket);
            _InfoHandlingASM      = FindViewById <ImageView>(Resource.Id.InfoHeliHandlingASMRocket);
            _InfoHandlingCannon   = FindViewById <ImageView>(Resource.Id.InfoHeliHandlingCannon);
            _InfoHandlingBomb     = FindViewById <ImageView>(Resource.Id.InfoHeliHandlingBomb);
            _InfoHandlingAirToAir = FindViewById <ImageView>(Resource.Id.InfoHeliHandlingAirToAir);
            _InfoIRCM             = FindViewById <ImageView>(Resource.Id.InfoHeliIRCM);
            _InfoFlares           = FindViewById <ImageView>(Resource.Id.InfoHeliFlares);
            _InfoHIRSS            = FindViewById <ImageView>(Resource.Id.InfoHeliHIRSS);

            _InfoHeliLabelTextFirstFlyYear        = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextFirstFlyYear);
            _InfoHeliLabelTextPatchAdded          = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextPatchAdded);
            _InfoHeliLabelTextType                = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextType);
            _InfoHeliLabelTextCharacter           = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextCharacter);
            _InfoHeliLabelTextBR                  = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextBR);
            _InfoHeliLabelTextMaxSpeed            = FindViewById <TextView>(Resource.Id.InfoHeliLabelMaxSpeed);
            _InfoHeliLabelTextClimbTo1000         = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextClimbTo1000);
            _InfoHeliLabelTextTurn360             = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextTurn360);
            _InfoHeliLabelTextEnginePower         = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextEnginePower);
            _InfoHeliLabelTextWeight              = FindViewById <TextView>(Resource.Id.InfoHeliLabelWeight);
            _InfoHeliLabelTextThrustToWeightRatio = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextThrustToWeightRatio);
            _InfoHeliLabelTextAGMCount            = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextAGMCount);
            _InfoHeliLabelTextAGMArmorPenetration = FindViewById <TextView>(Resource.Id.InfoHeliLabelAGMArmorPenetration);
            _InfoHeliLabelTextAGMSpeed            = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextAGMSpeed);
            _InfoHeliLabelTextAGMRange            = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextAGMRange);
            _InfoHeliLabelTextASMCount            = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextASMCount);
            _InfoHeliLabelTextASMArmorPenetration = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextASMArmorPenetration);
            _InfoHeliLabelTextASMSpeed            = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextASMSpeed);
            _InfoHeliLabelTextBombLoad            = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextBombLoad);
            _InfoHeliLabelOffensiveWeapon         = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextOffensiveWeapon);
            _InfoHeliLabelSuspensionWeapon        = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextHeliSuspensionWeapon);
            _InfoHeliLabelTextHandingWeapon       = FindViewById <TextView>(Resource.Id.InfoHeliLabelTextHandingWeapon);
            _InfoHeliLabelDefence                 = FindViewById <TextView>(Resource.Id.InfoHeliLabelDefence);

            _InfoHeliTextFirstFlyYear        = FindViewById <TextView>(Resource.Id.InfoHeliFirstFlyYear);
            _InfoHeliTextPatchAdded          = FindViewById <TextView>(Resource.Id.InfoHeliTextPatchAdded);
            _InfoHeliTextType                = FindViewById <TextView>(Resource.Id.InfoHeliTextType);
            _InfoHeliTextCharacter           = FindViewById <TextView>(Resource.Id.InfoHeliTextCharacter);
            _InfoHeliTextBR                  = FindViewById <TextView>(Resource.Id.InfoHeliTextBR);
            _InfoHeliTextMaxSpeed            = FindViewById <TextView>(Resource.Id.InfoHeliTextMaxSpeed);
            _InfoHeliTextClimbTo1000         = FindViewById <TextView>(Resource.Id.InfoHeliTextClimbTo1000);
            _InfoHeliTextTurn360             = FindViewById <TextView>(Resource.Id.InfoHeliTextTurn360);
            _InfoHeliTextEnginePower         = FindViewById <TextView>(Resource.Id.InfoHeliTextEnginePower);
            _InfoHeliTextWeight              = FindViewById <TextView>(Resource.Id.InfoHeliTextWeight);
            _InfoHeliTextThrustToWeightRatio = FindViewById <TextView>(Resource.Id.InfoHeliTextThrustToWeightRatio);
            _InfoHeliTextAGMCount            = FindViewById <TextView>(Resource.Id.InfoHeliTextAGMCount);
            _InfoHeliTextAGMArmorPenetration = FindViewById <TextView>(Resource.Id.InfoHeliTextAGMArmorPenetration);
            _InfoHeliTextAGMSpeed            = FindViewById <TextView>(Resource.Id.InfoHeliTextAGMSpeed);
            _InfoHeliTextAGMRange            = FindViewById <TextView>(Resource.Id.InfoHeliTextAGMRange);
            _InfoHeliTextASMCount            = FindViewById <TextView>(Resource.Id.InfoHeliTextASMCount);
            _InfoHeliTextASMArmorPenetration = FindViewById <TextView>(Resource.Id.InfoHeliTextASMArmorPenetration);
            _InfoHeliTextASMSpeed            = FindViewById <TextView>(Resource.Id.InfoHeliTextASMSpeed);
            _InfoHeliTextBombLoad            = FindViewById <TextView>(Resource.Id.InfoHeliTextBombLoad);
            _InfoHeliOffensiveWeapon         = FindViewById <TextView>(Resource.Id.InfoHeliTextOffensiveWeapon);
            _InfoHeliSuspensionWeapon        = FindViewById <TextView>(Resource.Id.InfoHeliTextHeliSuspensionWeapon);
            #endregion

            #region Изменения шрифта

            _InfoHeliLabelTextFirstFlyYear.Typeface        = font;
            _InfoHeliLabelTextPatchAdded.Typeface          = font;
            _InfoHeliLabelTextType.Typeface                = font;
            _InfoHeliLabelTextCharacter.Typeface           = font;
            _InfoHeliLabelTextBR.Typeface                  = font;
            _InfoHeliLabelTextMaxSpeed.Typeface            = font;
            _InfoHeliLabelTextClimbTo1000.Typeface         = font;
            _InfoHeliLabelTextTurn360.Typeface             = font;
            _InfoHeliLabelTextEnginePower.Typeface         = font;
            _InfoHeliLabelTextWeight.Typeface              = font;
            _InfoHeliLabelTextThrustToWeightRatio.Typeface = font;
            _InfoHeliLabelTextAGMCount.Typeface            = font;
            _InfoHeliLabelTextAGMArmorPenetration.Typeface = font;
            _InfoHeliLabelTextAGMSpeed.Typeface            = font;
            _InfoHeliLabelTextAGMRange.Typeface            = font;
            _InfoHeliLabelTextASMCount.Typeface            = font;
            _InfoHeliLabelTextASMArmorPenetration.Typeface = font;
            _InfoHeliLabelTextASMSpeed.Typeface            = font;
            _InfoHeliLabelTextBombLoad.Typeface            = font;
            _InfoHeliLabelOffensiveWeapon.Typeface         = font;
            _InfoHeliLabelSuspensionWeapon.Typeface        = font;
            _InfoHeliLabelTextHandingWeapon.Typeface       = font;
            _InfoHeliLabelDefence.Typeface                 = font;
            #endregion

            #region Изменения цвета текста всех TextView

            _InfoHeliTextFirstFlyYear.SetTextColor(Color.Black);
            _InfoHeliTextPatchAdded.SetTextColor(Color.Black);
            _InfoHeliTextType.SetTextColor(Color.Black);
            _InfoHeliTextCharacter.SetTextColor(Color.Black);
            _InfoHeliTextBR.SetTextColor(Color.Black);
            _InfoHeliTextMaxSpeed.SetTextColor(Color.Black);
            _InfoHeliTextClimbTo1000.SetTextColor(Color.Black);
            _InfoHeliTextTurn360.SetTextColor(Color.Black);
            _InfoHeliTextEnginePower.SetTextColor(Color.Black);
            _InfoHeliTextWeight.SetTextColor(Color.Black);
            _InfoHeliTextThrustToWeightRatio.SetTextColor(Color.Black);
            _InfoHeliTextAGMCount.SetTextColor(Color.Black);
            _InfoHeliTextAGMArmorPenetration.SetTextColor(Color.Black);
            _InfoHeliTextAGMSpeed.SetTextColor(Color.Black);
            _InfoHeliTextAGMRange.SetTextColor(Color.Black);
            _InfoHeliTextASMCount.SetTextColor(Color.Black);
            _InfoHeliTextASMArmorPenetration.SetTextColor(Color.Black);
            _InfoHeliTextASMSpeed.SetTextColor(Color.Black);
            _InfoHeliTextBombLoad.SetTextColor(Color.Black);
            _InfoHeliOffensiveWeapon.SetTextColor(Color.Black);
            _InfoHeliSuspensionWeapon.SetTextColor(Color.Black);


            _InfoHeliLabelTextFirstFlyYear.SetTextColor(Color.Black);
            _InfoHeliLabelTextPatchAdded.SetTextColor(Color.Black);
            _InfoHeliLabelTextType.SetTextColor(Color.Black);
            _InfoHeliLabelTextCharacter.SetTextColor(Color.Black);
            _InfoHeliLabelTextBR.SetTextColor(Color.Black);
            _InfoHeliLabelTextMaxSpeed.SetTextColor(Color.Black);
            _InfoHeliLabelTextClimbTo1000.SetTextColor(Color.Black);
            _InfoHeliLabelTextTurn360.SetTextColor(Color.Black);
            _InfoHeliLabelTextEnginePower.SetTextColor(Color.Black);
            _InfoHeliLabelTextWeight.SetTextColor(Color.Black);
            _InfoHeliLabelTextThrustToWeightRatio.SetTextColor(Color.Black);
            _InfoHeliLabelTextAGMCount.SetTextColor(Color.Black);
            _InfoHeliLabelTextAGMArmorPenetration.SetTextColor(Color.Black);
            _InfoHeliLabelTextAGMSpeed.SetTextColor(Color.Black);
            _InfoHeliLabelTextAGMRange.SetTextColor(Color.Black);
            _InfoHeliLabelTextASMCount.SetTextColor(Color.Black);
            _InfoHeliLabelTextASMArmorPenetration.SetTextColor(Color.Black);
            _InfoHeliLabelTextASMSpeed.SetTextColor(Color.Black);
            _InfoHeliLabelTextBombLoad.SetTextColor(Color.Black);


            #endregion

            nations       = NationCollection.GetNation();
            AdapterNation = new NationAdapter(this, nations);
            _InfoSpinnerNation.Adapter = AdapterNation;
            _InfoSpinnerNation.SetSelection(7); //Автовыбор
            selectedNation = 7;                 //Автовыбор

            ranks       = RankCollection.GetRank();
            AdapterRank = new RankAdapter(this, ranks);
            _InfoSpinnerRank.Adapter = AdapterRank;
            _InfoSpinnerRank.SetSelection(6); //Автовыбор
            selectedRank = 6;                 //Автовыбор

            potentialTask            = HeliTaskCollection.GetTask();
            PotentialAdapterTaskHeli = new TaskAdapter(this, potentialTask);
            _InfoSpinnerPotentialEnemyHeli.Adapter = PotentialAdapterTaskHeli;
            _InfoSpinnerPotentialEnemyHeli.SetSelection(0); //Автовыбор
            SelectedPotentialTaskHeli = 0;                  //Автовыбор

            _InfoSpinnerHeli.SetSelection(1);
            //Объявление коллекции наций, рангов и адаптеров

            _InfoSpinnerNation.ItemSelected             += _InfoSpinnerNation_ItemSelected;
            _InfoSpinnerRank.ItemSelected               += _InfoSpinnerRank_ItemSelected;
            _InfoSpinnerHeli.ItemSelected               += _InfoSpinnerHeli_ItemSelected;
            _InfoSpinnerPotentialEnemyHeli.ItemSelected += _InfoSpinnerPotentialEnemyHeli_ItemSelected;
        }