private void GetInformation() { buttonInformationAboutGame.Enabled = false; buttonPlayGame.Enabled = false; AlertDialog.Builder alert = new AlertDialog.Builder(Activity); alert.SetTitle("Правила игры"); alert.SetMessage("Из Вашего словаря автоматически каждую игру выбираются 5 случайных английских слов. В них ставятся от 1 до 4 пропусков.\n" + "Ваша задача отгадать пропущенные буквы в словах. За каждую правильно угаданную букву добавляется 3 очка, за неправильную - отнимается 1 очко." + "На каждое слово у Вас есть 5 попыток. Также, если Вы сразу написали слово целиком, то за правильный ответ получите +10 очков, если слово окажется неверным - минус пять очков " + "(попытки сгорают и отображается верное слово)."); alert.SetPositiveButton("Ок", (senderAlert, args) => { buttonInformationAboutGame.Enabled = true; if (WordsLogic.GetInstance().GetEnAllWords().Count != 0) { buttonPlayGame.Enabled = true; } }); Dialog dialogEndTest = alert.Create(); dialogEndTest.Show(); dialogEndTest.SetCanceledOnTouchOutside(false); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); wordsLogic = WordsLogic.GetInstance(); SetContentView(Resource.Layout.solution_test_view); wordsForTest = Intent.GetStringArrayListExtra("WordsForTest").ToList(); countQuestions = wordsForTest.Count; numberOfThisQuestion = 1; index = 0; textViewCountQuestions = FindViewById <TextView>(Resource.Id.tv_count_answers); textViewQuestion = FindViewById <TextView>(Resource.Id.tv_question); editTextAnswers = FindViewById <EditText>(Resource.Id.et_answer); buttonNextQuestion = FindViewById <Button>(Resource.Id.btn_next_question); if (countQuestions == 1) { buttonNextQuestion.Text = "Завершить тест"; } textViewCountQuestions.Text = $"{numberOfThisQuestion}/{countQuestions}"; textViewQuestion.Text = wordsForTest[0]; buttonNextQuestion.Click += (sender, e) => GoToNextQuestion(); }
public override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); wordsLogic = WordsLogic.GetInstance(); dictionaryAdapter = new DictionaryAdapter(wordsLogic, activity); wordsLogic.LoadStatistics(); }
private void Init() { logicer = new WordsLogic(); binder = new BinderWordsPage(logicer); this.BindingContext = binder; fillter = "I am Fillter"; sorter = "I am Sorter"; }
public MyDictionaryViewHolder(View itemView, Context context, MainAppActivity activity) : base(itemView) { textViewRu = itemView.FindViewById <TextView>(Resource.Id.tv_ru); textViewEn = itemView.FindViewById <TextView>(Resource.Id.tv_en); this.context = context; this.activity = activity; wordsLogic = WordsLogic.GetInstance(); textViewRu.Click += ItemRu_Click; textViewEn.Click += ItemEn_Click; }
public BinderWordsPage(WordsLogic logicer) { this.logicer = logicer; Catagory[] tletter = logicer.GetLetterCatagorys(); _wordsgroups = new ObservableCollection <WordsGroupItem>(); for (int i = 0; i < tletter.Length; i++) { _wordsgroups.Add(new WordsGroupItem(tletter[i].GetName(), tletter[i].GetNumber())); } OnPropertyChanged("WordsGroups"); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); counter = 1; WordsLogic.GetInstance(); Task.Run(() => TranslatorApi.ZeroRequest()); SetContentView(Resource.Layout.splash_screen_view); }
//Constructor public BinderWordLearning(WordsLogic logicer) { this.logicer = logicer; _title = logicer.GetPickedName(); //the name of the screen //ipos picked word _pickedWordIndex = 0; PickedWordName = ""; PickedWordIndex = "/"; PickedWordlevel = ""; PickedWordLearned = false; //set the vars IndividualVisibilty = true; SetListView(); SetTimer(); //create the words List _wordslist = new ObservableCollection <BasicWord>(); UpdateListOfWords(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.game_view, container, false); textViewCountGames = view.FindViewById <TextView>(Resource.Id.tv_count_games); textViewNumberOfPoints = view.FindViewById <TextView>(Resource.Id.tv_number_points); buttonInformationAboutGame = view.FindViewById <Button>(Resource.Id.btn_information); buttonPlayGame = view.FindViewById <Button>(Resource.Id.btn_play); buttonInformationAboutGame.Click += (sender, e) => GetInformation(); buttonPlayGame.Click += (sender, e) => PlayAsync(); if (WordsLogic.GetInstance().GetEnAllWords().Count == 0) { buttonPlayGame.Enabled = false; } return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.dictionary_view, container, false); searchView = view.FindViewById <SearchView>(Resource.Id.sv_word_search); recyclerView = view.FindViewById <RecyclerView>(Resource.Id.rv_dictionary_words); LinearLayoutManager layoutManager = new LinearLayoutManager(Application.Context); recyclerView.SetLayoutManager(layoutManager); recyclerView.SetAdapter(dictionaryAdapter); var callback = new DictionaryItemTouchHelper(WordsLogic.GetInstance(), dictionaryAdapter, this); var itemTouchHelper = new ItemTouchHelper(callback); itemTouchHelper.AttachToRecyclerView(recyclerView); searchView.QueryTextChange += TextChange; return(view); }
public DictionaryItemTouchHelper(WordsLogic wordsLogic, DictionaryAdapter adapter, DictionaryActivity activity) { this.wordsLogic = wordsLogic; this.adapter = adapter; this.activity = activity; }
//builder public WordsLearnPage(WordsLogic logicer) { InitializeComponent(); this.logicer = logicer; Init(); }
public CardsAdapter(FragmentManager fm, string language) : base(fm) { this.language = language; wordsLogic = WordsLogic.GetInstance(); Count = wordsLogic.GetCount(); }
public DictionaryAdapter(WordsLogic wordsLogic, MainAppActivity activity) { this.wordsLogic = wordsLogic; this.activity = activity; }
public ProgressPage(WordsLogic logicer) { this.logicer = logicer; this.BindingContext = binder; InitializeComponent(); }