Esempio n. 1
0
        public MainPage()
        {
            NavigationPage.SetHasNavigationBar(this, false);
            NavigationPage.SetHasBackButton(this, false);

            BindingContext = dashboard;

            InitializeComponent();

            MainGrid.RaiseChild(Guilds);
            MainGrid.SizeChanged += SetNavSize;

            Task.Factory.StartNew(dashboard.Get);
        }
Esempio n. 2
0
        private void CloseSearchTapped(object sender, EventArgs e)
        {
            LblSearchIcon.IsVisible = true;
            ImgFindVipTable.TranslateTo(0, 0, AppThemeConstants.AnimationSpeed, Easing.SinInOut);
            SearchBarGrid.TranslateTo(0, 0, AppThemeConstants.AnimationSpeed, Easing.SinInOut);
            Rectangle searchBarGridBounds = SearchBarGrid.Bounds;

            searchBarGridBounds.Height = searchBarGridBounds.Height - ImgFindVipTable.Margin.Top;
            SearchBarGrid.Layout(searchBarGridBounds);
            FilterScroll.TranslateTo(0, AppThemeConstants.ScreenHeight, AppThemeConstants.AnimationSpeed, Easing.SinInOut);
            FilterScroll.FadeTo(0, AppThemeConstants.AnimationSpeed, Easing.SinInOut);
            CIUserIco.FadeTo(1, AppThemeConstants.AnimationSpeed, Easing.SinInOut);
            MainGrid.RaiseChild(FrNearBy);
            MainGrid.RaiseChild(CIUserIco);
            TxtSearch.Text = string.Empty;
            TxtSearch.Unfocus();
        }
Esempio n. 3
0
        private void SearchFocused(object sender, EventArgs e)
        {
            MainGrid.RaiseChild(TopContainerStack);
            MainGrid.RaiseChild(CIUserIco);
            SearchBarGrid.RaiseChild(FrmSearchbar);

            _suggestionContainerRectangle = SuggestionsContainerStack.Bounds.Height > _suggestionContainerRectangle.Height ? SuggestionsContainerStack.Bounds : _suggestionContainerRectangle;

            SuggestionsContainerStack.IsVisible = false;

            ImgFindVipTable.TranslateTo(0, -ImgFindVipTable.Margin.Top, AppThemeConstants.AnimationSpeed, Easing.SinInOut);
            SearchBarGrid.TranslateTo(0, -ImgFindVipTable.Margin.Top, AppThemeConstants.AnimationSpeed, Easing.SinInOut);
            Rectangle searchBarGridBounds = SearchBarGrid.Bounds;

            searchBarGridBounds.Height = searchBarGridBounds.Height + ImgFindVipTable.Margin.Top;
            SearchBarGrid.Layout(searchBarGridBounds);
            FilterScroll.TranslateTo(0, 0, AppThemeConstants.AnimationSpeed, Easing.SinInOut);
            FilterScroll.FadeTo(1, AppThemeConstants.AnimationSpeed, Easing.SinInOut);
            CIUserIco.FadeTo(0, AppThemeConstants.AnimationSpeed, Easing.SinInOut);
            LblSearchIcon.IsVisible = false;
        }
        //This function is basically used to do the animation as we are panning
        void Image_Panning(object sender, MR.Gestures.PanEventArgs e)
        {
            initXCord  = TicTacToeViewModel.initXCord;
            initYCord  = TicTacToeViewModel.inityCord;
            finalXCord = TicTacToeViewModel.finalXCord;
            finalYCord = TicTacToeViewModel.finalYCord;

            if (initXCord == -1 || initYCord == -1)
            {
                return;
            }

            int initialPoint = Int32.Parse(initYCord.ToString() + initXCord.ToString());

            //Here we are initializing the variable s to the image that we are controlling/panning
            var label = e.Sender as MR.Gestures.Label;

            if (label == null)
            {
                return;
            }

            MainGrid.RaiseChild(label);

            //These two lines is what does the animations. TotalDistance is what made the animation smooth. += Is what assigns a handler to an event
            label.TranslationX += e.TotalDistance.X;
            label.TranslationY += e.TotalDistance.Y;

            //This sets up once we try to trade images to bring it back to its original spot, due to it going past the grid length which kept causing bugs.
            if (e.ViewPosition.Y > MainGrid.Height)
            {
                TicTacToeViewModel.finalXCord = TicTacToeViewModel.initXCord;
                TicTacToeViewModel.finalYCord = TicTacToeViewModel.inityCord;
                return;
            }

            if (finalXCord < 0 || finalYCord < 0)
            {
                return;
            }

            int finalPoint = Int32.Parse(finalYCord.ToString() + finalXCord.ToString());

            //We are rotating the rest of the blocks as we are panning a block.
            if (initialPoint > finalPoint && prevFinalPoint != finalPoint)
            {
                shiftRightAnimation(initialPoint, finalPoint, label);
            }
            else if (initialPoint < finalPoint && prevFinalPoint != finalPoint)
            {
                shiftLeftAnimation(initialPoint, finalPoint, label);
            }

            prevFinalPoint = finalPoint;

            //This is used to update the initial point so it stops blocks from shifting that don't need to be shifted, therefore causeing overlap, page 246 of BuJo
            string initialUpdatedStringPoint = prevFinalPoint.ToString();;

            if (initialUpdatedStringPoint.Length == 1)
            {
                initialUpdatedStringPoint = "0" + initialUpdatedStringPoint;
            }

            TicTacToeViewModel.inityCord = Int32.Parse(initialUpdatedStringPoint[0].ToString());
            TicTacToeViewModel.initXCord = Int32.Parse(initialUpdatedStringPoint[1].ToString());
        }
Esempio n. 5
0
 private void OnSideMenuShow(object sender, EventArgs e)
 {
     MainGrid.RaiseChild(SMSideMenu);
     System.Diagnostics.Debug.WriteLine("Side menu showing...");
 }
Esempio n. 6
0
 private void SearchNowTapped(object sender, EventArgs e)
 {
     MainGrid.RaiseChild(TopContainerStack);
     MainGrid.RaiseChild(CIUserIco);
 }