Пример #1
0
        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);
        }
Пример #2
0
        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();
        }
Пример #3
0
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     wordsLogic        = WordsLogic.GetInstance();
     dictionaryAdapter = new DictionaryAdapter(wordsLogic, activity);
     wordsLogic.LoadStatistics();
 }
Пример #4
0
 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;
 }
Пример #6
0
 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);
        }
Пример #8
0
 //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();
 }
Пример #9
0
        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);
        }
Пример #10
0
        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);
        }
Пример #11
0
 public DictionaryItemTouchHelper(WordsLogic wordsLogic, DictionaryAdapter adapter, DictionaryActivity activity)
 {
     this.wordsLogic = wordsLogic;
     this.adapter    = adapter;
     this.activity   = activity;
 }
Пример #12
0
 //builder
 public WordsLearnPage(WordsLogic logicer)
 {
     InitializeComponent();
     this.logicer = logicer;
     Init();
 }
Пример #13
0
 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;
 }
Пример #15
0
 public ProgressPage(WordsLogic logicer)
 {
     this.logicer        = logicer;
     this.BindingContext = binder;
     InitializeComponent();
 }