Beispiel #1
0
        async void AnimateContent(StackLayout toShow)
        {
            if (toShow.IsVisible)
            {
                return;
            }

            var toHide = GetVisible();

            Parallel.Invoke(
                async() => await toHide.ScaleTo(0, 100),
                async() => await toHide.FadeTo(0, 100),
                async() => await toShow.ScaleTo(0, 100),
                async() => await toShow.FadeTo(0, 100)
                );

            await Task.Delay(100); //Wait until animation ends

            toHide.IsVisible = false;
            toShow.IsVisible = true;

            Parallel.Invoke(
                async() => await toShow.ScaleTo(1, 200),
                async() => await toShow.FadeTo(1, 200)
                );
        }
        private async void Location_Tapped(object sender, EventArgs e)
        {
            StackLayout obj = sender as StackLayout;

            Device.BeginInvokeOnMainThread(() =>
            {
                try
                {
                    obj.ScaleTo(1.3, 75).ContinueWith((t) =>
                    {
                        try
                        {
                            obj.ScaleTo(1.0, 75);
                        }
                        catch
                        {
                        }
                    },
                                                      scheduler: TaskScheduler.FromCurrentSynchronizationContext());
                }
                catch
                {
                }
            });

            await App.AppCurrent.NavigationService.NavigateModalAsync(new CompanyProductList(obj.StyleId, _company), null, true);
        }
Beispiel #3
0
        private async Task <bool> AnimateStackLayout(StackLayout sl)
        {
            await sl.ScaleTo(0.9, 75, Easing.CubicOut);

            await sl.ScaleTo(1, 75, Easing.CubicIn);

            return(true);
        }
        async void TapGestureRecognizer_Tapped_1(object sender, EventArgs e)
        {
            StackLayout UnitStack = sender as StackLayout;

            UnitStack.BackgroundColor = Color.FromHex("#f65275");
            await UnitStack.ScaleTo(0.99, 150);

            await UnitStack.ScaleTo(1, 150);

            UnitStack.BackgroundColor = Color.White;
        }
Beispiel #5
0
        private async void Query_OnCellTaped(object sender, EventArgs e)
        {
            StackLayout viewcell = (StackLayout)sender;
            ResultItem  item     = (ResultItem)viewcell.BindingContext;

            await viewcell.ScaleTo(1.2, 50, Easing.Linear);

            await viewcell.ScaleTo(1, 50, Easing.Linear);

            Services.XDatabase            db     = Services.XServices.Instance.GetService <Services.XDatabase>();
            ComosWebSDK.UI.UICachedScreen screen = db.GetCachedScreen(IncidentCDevUID);
            await this.Navigation.PushAsync(new PageNewDevice(screen, item.UID, "", item.Name));
        }
Beispiel #6
0
        private void ShowEntry(StackLayout stackLayout)
        {
            if (IsAnimationEnabled)
            {
                stackLayout.Opacity   = 0;
                stackLayout.Scale     = 0.8;
                stackLayout.IsVisible = true;
                stackLayout.FadeTo(1, 500, Easing.SinIn);
                stackLayout.ScaleTo(1, 250);
            }
            else
            {
                stackLayout.IsVisible = true;
            }

            if (stackLayout == PurchaseBULEntryViews)
            {
                var visible = SendBULEntryViews.IsVisible;
                if (visible)
                {
                    HideEntry(SendBULEntryViews);
                }
            }
            else if (stackLayout == SendBULEntryViews)
            {
                var visible = PurchaseBULEntryViews.IsVisible;
                if (visible)
                {
                    HideEntry(PurchaseBULEntryViews);
                }
            }
        }
Beispiel #7
0
        private static IGestureRecognizer GetTappedAnimation(StackLayout tile)
        {
            var tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.Tapped += async(s, e) =>
            {
                if (!_tapped)
                {
                    _tapped = true;
                    await tile.ScaleTo(0.95, 70, Easing.Linear);

                    await tile.ScaleTo(1, 70, Easing.Linear);

                    _tapped = false;
                }
            };
            return(tapGestureRecognizer);
        }
Beispiel #8
0
        public void DisplayView()
        {
            Device.BeginInvokeOnMainThread(async() =>
            {
                var animationList = new List <Task>
                {
                    _backgroundOverlayBoxView.FadeTo(1, AnimationConstants.WelcomeViewAnimationTime),
                    _textAndButtonStack.ScaleTo(AnimationConstants.WelcomeViewMaxSize, AnimationConstants.WelcomeViewAnimationTime),
                    _overlayFrame.ScaleTo(AnimationConstants.WelcomeViewMaxSize, AnimationConstants.WelcomeViewAnimationTime)
                };
                await Task.WhenAll(animationList);

                animationList = new List <Task>
                {
                    _textAndButtonStack.ScaleTo(AnimationConstants.WelcomeViewNormalSize, AnimationConstants.WelcomeViewAnimationTime),
                    _overlayFrame.ScaleTo(AnimationConstants.WelcomeViewNormalSize, AnimationConstants.WelcomeViewAnimationTime)
                };
                await Task.WhenAll(animationList);
            });
        }
Beispiel #9
0
        private async void m_List_ItemTapped(object sender, EventArgs e)
        {
            StackLayout viewcell = (StackLayout)sender;
            ResultItem  item     = (ResultItem)viewcell.BindingContext;

            await viewcell.ScaleTo(1.2, 50, Easing.Linear);

            await viewcell.ScaleTo(1, 50, Easing.Linear);


            if ((bool)docconverter.Convert(item.UID, null, null, null))
            {
                if (plataform.IsOnline)
                {
                    plataform.ShowProgressMessage(Services.TranslateExtension.TranslateText("downloading_documents"), true);
                    CheckAndDownloadAditionalContent downloader = new CheckAndDownloadAditionalContent();
                    CDocument filename_andtype = await downloader.DownloadDocument(item.UID, true);

                    if (filename_andtype != null && filename_andtype.FileName != "")
                    {
                        cachedb.CacheDocumentFilePath(filename_andtype.FileName, filename_andtype.MimeType, item.UID, m_ProjectData.SelectedProject.UID, m_ProjectData.SelectedLayer.UID, filename_andtype.Name, filename_andtype.Description, filename_andtype.Picture);
                    }
                    if (filename_andtype == null)
                    {
                        plataform.ShowToast(Services.TranslateExtension.TranslateText("document_not_found"));
                    }

                    plataform.HideProgressMessage();
                }
            }
            else if ((bool)devconverter.Convert(item.UID, null, null, null))
            {
                CSystemObject sysobj;
                try
                {
                    sysobj = await m_ComosWeb.GetObject(m_ProjectData.SelectedLayer, item.UID, m_ProjectData.SelectedLanguage.LCID);
                }
                catch (Exception ex)
                {
                    await App.Current.MainPage.DisplayAlert("Error", "Error al buscar: " + ex.Message, Services.TranslateExtension.TranslateText("OK"));

                    return;
                }

                if (sysobj == null)
                {
                    return;
                }

                CObject o = new CObject()
                {
                    ClassType       = sysobj.SystemType,
                    Description     = sysobj.Description,
                    IsClientPicture = sysobj.IsClientPicture,
                    Name            = sysobj.Name,
                    UID             = sysobj.UID,
                    OverlayUID      = m_ProjectData.SelectedLayer.UID,
                    Picture         = sysobj.Picture,
                    ProjectUID      = m_ProjectData.SelectedProject.ProjectUID,
                    SystemFullName  = sysobj.Name,
                };
                PageSpecifications page = new PageSpecifications(m_ProjectData.SelectedDB.Key, o, m_ProjectData.SelectedLanguage.LCID);
                await this.Navigation.PushAsync(page);
            }
        }
Beispiel #10
0
        private async Task AnimateLateralMenu(StackLayout sl)
        {
            await sl.ScaleTo(1.1, 20, Easing.Linear);

            await sl.ScaleTo(1, 10, Easing.Linear);
        }
Beispiel #11
0
        public View CreateButton(ICommand command, double width, double height, string text, string image = null, double?fontSize = null, Color?backColorOverride = null)
        {
            backColorOverride = backColorOverride.HasValue ? backColorOverride : _backColor;

            StackLayout layout = new StackLayout()
            {
                Margin          = new Thickness(5, 5, 5, 5),
                Padding         = new Thickness(8, 8, 8, 8),
                BackgroundColor = backColorOverride.Value,
                WidthRequest    = width,
                HeightRequest   = height,
                Orientation     = StackOrientation.Horizontal
            };

            if (string.IsNullOrEmpty(text))
            {
                //No text, just an image, center in on the 'button'
                layout.VerticalOptions   = LayoutOptions.CenterAndExpand;
                layout.HorizontalOptions = LayoutOptions.CenterAndExpand;
                layout.Padding           = new Thickness(2, 2, 2, 2);
            }

            if (!string.IsNullOrEmpty(image))
            {
                Image img = new Image()
                {
                    Source          = image,
                    WidthRequest    = string.IsNullOrEmpty(text) ? width : width / 5,
                    HeightRequest   = string.IsNullOrEmpty(text) ? height: height / 1.8,
                    BackgroundColor = Color.Transparent
                };

                layout.Children.Add(img);
            }

            if (!string.IsNullOrEmpty(text))
            {
                Label lbl = new Label()
                {
                    TextColor             = _textColor,
                    Text                  = $" {text.ToUpper()}",
                    FontSize              = fontSize ?? height / 2.2,
                    BackgroundColor       = backColorOverride.Value,
                    HeightRequest         = height - 10,
                    VerticalTextAlignment = TextAlignment.Center
                };

                layout.Children.Add(lbl);
            }

            TapGestureRecognizer tap = new TapGestureRecognizer()
            {
                Command = new Command(async() =>
                {
                    await layout.ScaleTo(.95, 200, Easing.BounceIn);
                    layout.ScaleTo(1, 200);
                    command.Execute(text);
                })
            };

            layout.GestureRecognizers.Add(tap);

            return(layout);
        }