protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.ChooseLanguage); templish = Intent.GetStringArrayListExtra("settings"); var lang = templish[0]; helperlanguage = new App8.Helperlanguage(lang, this); checkbutton = FindViewById <Button>(Resource.Id.buttonChaked); radioButton1 = FindViewById <RadioButton>(Resource.Id.radioButton1); radioButton2 = FindViewById <RadioButton>(Resource.Id.radioButton2); radioButton3 = FindViewById <RadioButton>(Resource.Id.radioButton3); radioGroup = FindViewById <RadioGroup>(Resource.Id.radioGroup1); textViewLang = FindViewById <TextView>(Resource.Id.textViewLang); textViewLang.Text = helperlanguage.TextViewLang; checkbutton.Click += Checkbutton_Click; if (lang == "English") { radioGroup.Check(radioButton1.Id); } else if (lang == "Russian") { radioGroup.Check(radioButton2.Id); } else { radioGroup.Check(radioButton3.Id); } // Create your application here }
protected override void OnCreate(Bundle bundle) { if (bundle == null) { bundle = new Bundle(); } base.OnCreate(bundle); OnSaveInstanceState(bundle); var lang = Intent.GetStringArrayListExtra("settings"); if (lang != null) { // Intent.PutStringArrayListExtra("settings", temp1); list = lang; } helperlanguage = new Helperlanguage(list[0], this); // Set our view from the "main" layout resource // SetContentView (Resource.Layout.Main); SetContentView(Resource.Layout.Main); button1 = FindViewById <Button>(Resource.Id.button1); ButtonLang = FindViewById <Button>(Resource.Id.buttonLang); button1.Text = helperlanguage.StartGame; ButtonLang.Text = helperlanguage.ChooseLanguage; // button1.Background = new ColorStateList() Helperlanguage g = new Helperlanguage("English", this); button1.Click += delegate(object sender, EventArgs e) { var itent = new Android.Content.Intent((this), typeof(StartGame)); var temp = Intent.GetStringArrayListExtra("settings"); if (temp != null) { itent.PutStringArrayListExtra("settings", temp); list = temp; } else { itent.PutStringArrayListExtra("settings", list); } StartActivity(itent); }; ButtonLang.Click += delegate(object sender, EventArgs e) { Intent itent = new Android.Content.Intent((this), typeof(ChooseLanguage)); itent.PutStringArrayListExtra("settings", list); StartActivity(itent); }; }
protected override void OnCreate(Bundle savedInstanceState) { if (savedInstanceState == null) { savedInstanceState = new Bundle(); } base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.StartGame); var language = Intent.GetStringArrayListExtra("settings"); helperlanguage = new Helperlanguage(language[0], this); this.RequestedOrientation = ScreenOrientation.Portrait; _gameManager = new GameManager(); _buttonSetBet = FindViewById <Button>(Resource.Id.buttonSetBet); _buttonShowCard = FindViewById <Button>(Resource.Id.buttonShowCard); _buttonGetCard = FindViewById <Button>(Resource.Id.buttonGetCard); _buttonDoubleBet = FindViewById <Button>(Resource.Id.buttonDoubleBet); _buttonContinue = FindViewById <Button>(Resource.Id.buttonContinue); _buttonSetBet.Text = helperlanguage.SetBet; _buttonShowCard.Text = helperlanguage.Stand; _buttonGetCard.Text = helperlanguage.GetCard; _buttonDoubleBet.Text = helperlanguage.DoubleBet; _buttonContinue.Text = helperlanguage.Continue; editBet = FindViewById <EditText>(Resource.Id.editText1); _playerCard1 = FindViewById <TextView>(Resource.Id.cardplayer1); _playerCard2 = FindViewById <TextView>(Resource.Id.cardplayer2); _playerCard3 = FindViewById <TextView>(Resource.Id.cardplayer3); _playerCard4 = FindViewById <TextView>(Resource.Id.cardplayer4); _playerCard5 = FindViewById <TextView>(Resource.Id.cardplayer5); _playerCard6 = FindViewById <TextView>(Resource.Id.cardplayer6); _dillerCard1 = FindViewById <TextView>(Resource.Id.carddiller1); _dillerCard2 = FindViewById <TextView>(Resource.Id.carddiller2); _dillerCard3 = FindViewById <TextView>(Resource.Id.carddiller3); _dillerCard4 = FindViewById <TextView>(Resource.Id.carddiller4); _dillerCard5 = FindViewById <TextView>(Resource.Id.carddiller5); _dillerCard6 = FindViewById <TextView>(Resource.Id.carddiller6); _listCardsPlayer.Add(_playerCard1); _listCardsPlayer.Add(_playerCard2); _listCardsPlayer.Add(_playerCard3); _listCardsPlayer.Add(_playerCard4); _listCardsPlayer.Add(_playerCard5); _listCardsPlayer.Add(_playerCard6); _listCardsDiller.Add(_dillerCard1); _listCardsDiller.Add(_dillerCard2); _listCardsDiller.Add(_dillerCard3); _listCardsDiller.Add(_dillerCard4); _listCardsDiller.Add(_dillerCard5); _listCardsDiller.Add(_dillerCard6); _dillerCoins = FindViewById <TextView>(Resource.Id.dillerCoins); _textBet = FindViewById <TextView>(Resource.Id.bet); _textBalance = FindViewById <TextView>(Resource.Id.balance); _playerCoins = FindViewById <TextView>(Resource.Id.playerCoins); _info = FindViewById <TextView>(Resource.Id.info); _clubs = FindViewById <View>(Resource.Drawable.clubs); _diamonds = FindViewById <View>(Resource.Drawable.diamonds); _hearts = FindViewById <View>(Resource.Drawable.hearts); _spades = FindViewById <View>(Resource.Drawable.spades); _dictionarySuit = new Dictionary <Suit, int> { { Suit.Club, Resource.Drawable.clubs }, { Suit.Diamond, Resource.Drawable.diamonds }, { Suit.Heart, Resource.Drawable.hearts }, { Suit.Spade, Resource.Drawable.spades } }; start(); _buttonGetCard.Click += GetCard; _buttonContinue.Click += ContinueGame; _buttonShowCard.Click += ShowCsrd; _buttonDoubleBet.Click += DoubleDown; _buttonSetBet.Click += SetBet; }