예제 #1
0
        void delCards(ImageButtonEx tmp1, ImageButtonEx tmp2)
        {
            tmp1.Visibility = ViewStates.Gone;
            tmp2.Visibility = ViewStates.Gone;

            allCards.Remove(tmp1);
            allCards.Remove(tmp2);
            saveRecords();
        }
예제 #2
0
        void GenerateCard()
        {
            var card = new ImageButtonEx(this);

            //allCards = new List<ImageButtonEx>();
            card.SetBackgroundColor(Color.ParseColor("#81C784"));
            card.SetImageResource(Resource.Drawable.animal_card8);
            //  card.SetBackgroundResource(Resource.Drawable.quest);

            //card.SetPadding(d, d, d, d);
            // card.SetBackgroundColor(Color.Black);
            card.Click += card_Click;
            _cardsField.AddView(card);
            card.Tag = GetResourceId4Card();
            var param       = (ViewGroup.MarginLayoutParams)card.LayoutParameters;
            var dimenMedium = (int)Resources.GetDimension(Resource.Dimension.small);

            param.SetMargins(dimenMedium, dimenMedium, dimenMedium, dimenMedium);

            card.LayoutParameters.Width  = 70.ToDp();
            card.LayoutParameters.Height = 100.ToDp();
            allCards.Add(card);
        }
예제 #3
0
        void card_Click(object sender, EventArgs e)
        {
            if (cardstimer.Enabled)
            {
                return;
            }

            if (_firstCard == null)
            {
                _firstCard = (ImageButtonEx)sender;
                timeTimer.Start();
            }
            else if (_secondCard == null && sender != _firstCard)
            {
                _secondCard = (ImageButtonEx)sender;
            }

            else
            {
                return;
            }

            StartMoveCards();
        }
예제 #4
0
 private void ResetCards()
 {
     _secondCard = null;
     _firstCard  = null;
 }