public async void TransitionTo(double startY, double scrollAmount)
        {
            CreateCard();

            AbsLayout.LowerChild(imageInFrame);

            scrollY = scrollAmount;
            //double scrollX = PartyScrollView.ScrollX;
            startY = startY - scrollY;
            prevY  = startY;
            //imageInFrame..Source = PartyDetailsItem.pictureImageSource;
            imageInFrame.TranslationY = startY + _partyImageHeight / 2 - App.ScreenHeight;
            //AnimateableImage.
            DetailsScrollView.FadeTo(1, animationSpeed * 2, Easing.CubicInOut);
            HeaderLayout.FadeTo(1, animationSpeed * 2, Easing.CubicInOut);
            //AnimateableImage.ScaleTo(2, 250, Easing.Linear);
            //imageInFrame.HeightRequest = PartyImageHeight;
            imageInFrame.FadeTo(1, animationSpeed, Easing.CubicInOut);
            await imageInFrame.TranslateTo(imageInFrame.X, -App.ScreenHeight, animationSpeed, Easing.CubicInOut);

            PartyDetailsImage = PartyDetailsItem.pictureImageSource;
            //await imageInFrame.FadeTo(0, animationSpeed, Easing.CubicInOut);

            InputTransparent = false;
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            string           userName   = "******";
            string           password   = "******";
            string           siteUrl    = "https://tenant.sharepoint.com/sites/yoursite";
            HeaderLayout     layout     = HeaderLayout.Standard;
            HeaderBackground background = HeaderBackground.Darker;
            MenuStyle        menuStyle  = MenuStyle.Cascading;

            try
            {
                ChangeTheLookOptionsHelper.ChangeHeaderLayout(siteUrl, layout, userName, password);
                Console.WriteLine($"Header Layout changed to {layout.ToString()} for {siteUrl}.");

                ChangeTheLookOptionsHelper.ChangeHeaderBackground(siteUrl, background, userName, password);
                Console.WriteLine($"Header Background changed to {background.ToString()} for {siteUrl}.");

                ChangeTheLookOptionsHelper.ChangeMenuStyle(siteUrl, menuStyle, userName, password);
                Console.WriteLine($"Menu Style changed to {menuStyle.ToString()} for {siteUrl}.");
            }
            catch (Exception ex)
            {
                Console.WriteLine("There was an error " + ex.Message);
            }
            Console.WriteLine("Press any key to exit.");
            Console.ReadLine();
        }
 internal static void ChangeHeaderLayout(string siteUrl, HeaderLayout layout, string userName, string password)
 {
     using (var client = new SPHttpClient(new Uri(siteUrl), userName, password))
     {
         var itemPayload = new { __metadata = new { type = "SP.Web" }, HeaderLayout = layout };
         var endpointUrl = string.Format("{0}/_api/web", siteUrl);
         var data        = client.ExecuteJson(endpointUrl, HttpMethod.Post, itemPayload);
     }
 }
        public void then_first_header_in_bindable_horizontal_list_has_add_commands()
        {
            SectionViewModel     unitySectionVM       = configurationSourceModel.Sections.Single(x => x.SectionName == UnityConfigurationSection.SectionName);
            HorizontalListLayout unitySectionBindable = (HorizontalListLayout)unitySectionVM.Bindable;

            HeaderLayout firstHeaderViewModel = unitySectionBindable.Current as HeaderLayout;

            Assert.IsNotNull(firstHeaderViewModel);
            Assert.IsNotNull(firstHeaderViewModel.Commands);
            Assert.IsTrue(firstHeaderViewModel.Commands.Any());
        }
Beispiel #5
0
        public override Layout?ReadJson(
            JsonReader reader,
            Type objectType,
            Layout?existingValue,
            bool hasExistingValue,
            JsonSerializer serializer)
        {
            var jo = JObject.ReadFrom(reader);

            var type = jo[nameof(Layout.type)]?.Value <string>();

            switch (type)
            {
            case "header":
                existingValue = new HeaderLayout();
                break;

            case "context":
                existingValue = new ContextLayout();
                break;

            case "image":
                existingValue = new ImageLayout();
                break;

            case "divider":
                existingValue = new DividerLayout();
                break;

            case "section":
                existingValue = new SectionLayout();
                break;

            case "input":
                existingValue = new InputLayout();
                break;

            case "action":
                existingValue = new ActionsLayout();
                break;

            default:
                return(default);
            }

            serializer.Populate(jo.CreateReader(), existingValue);
            return(existingValue);
        }
        public async void TransitionFrom()
        {
            DetailsScrollView.FadeTo(0, animationSpeed, Easing.CubicInOut);
            HeaderLayout.FadeTo(0, animationSpeed, Easing.CubicInOut);
            //AbsLayout.Children.Remove(imageInFrame);
            //AbsLayout.Children.Insert(0, imageInFrame);
            if (imageInFrame != null)
            {
                //await imageInFrame.FadeTo(1, animationSpeed, Easing.CubicInOut);
                PartyDetailsImage = null;
                await imageInFrame.TranslateTo(imageInFrame.X, -App.ScreenHeight + prevY + _partyImageHeight / 2 + DetailsScrollView.ScrollY, animationSpeed, Easing.CubicInOut);

                await imageInFrame.FadeTo(0, animationSpeed, Easing.CubicInOut);
            }
            InputTransparent = true;
        }
Beispiel #7
0
        private void AddHeaderViews()
        {
            mainLayout = new LinearLayout(Context);
            int mainLayoutWidth = 0;

            if (density.Density > 2)
            {
                mainLayoutWidth = (int)(density.WidthPixels / 1.3);
            }
            else
            {
                mainLayoutWidth = (int)(density.WidthPixels / 1.4);
            }

            mainLayout.LayoutParameters = new ViewGroup.LayoutParams(new LinearLayout.LayoutParams(mainLayoutWidth, density.HeightPixels / 14));
            mainLayout.Orientation      = Android.Widget.Orientation.Horizontal;

            leftmainLayout = new LinearLayout(Context);
            leftmainLayout.SetGravity(GravityFlags.Right);
            leftmainLayout.Orientation = Android.Widget.Orientation.Horizontal;

            mainheaderLayout             = new LinearLayout(Context);
            mainheaderLayout.Orientation = Android.Widget.Orientation.Horizontal;

            optionLinearlayout = new LinearLayout(Context);
            optionLinearlayout.LayoutParameters = new ViewGroup.LayoutParams(new LinearLayout.LayoutParams(100, density.HeightPixels / 14));
            ScheduleOption = new ImageView(Context);
            ScheduleOption.SetBackgroundResource(Resource.Drawable.scheduleOption);
            optionLinearlayout.AddView(ScheduleOption);
            mainLayout.AddView(optionLinearlayout);

            monthTextlayout = new LinearLayout(Context);
            monthTextlayout.LayoutParameters = new ViewGroup.LayoutParams(new LinearLayout.LayoutParams(density.WidthPixels / 2, density.HeightPixels / 14));
            MonthText = new TextView(Context);
            MonthText.SetTextColor(Color.Black);

            if (IsTabletDevice(Context))
            {
                monthTextlayout.LayoutParameters = new ViewGroup.LayoutParams(new LinearLayout.LayoutParams(density.WidthPixels / 2, density.HeightPixels / 14));
                monthTextlayout.SetGravity(GravityFlags.Center);
                MonthText.SetPadding(10, 20, 0, 0);
            }

            if (density.Density > 2)
            {
                MonthText.SetPadding(10, 20, 0, 0);
            }

            MonthText.Gravity = GravityFlags.Fill;
            MonthText.SetMinimumHeight(80);
            MonthText.SetTypeface(Typeface.DefaultBold, TypefaceStyle.Bold);
            MonthText.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            MonthText.TextSize         = 20;
            MonthText.Text             = "August 2016";
            monthTextlayout.AddView(MonthText);
            mainLayout.AddView(monthTextlayout);

            plusLinearlayout = new LinearLayout(Context);
            if (density.Density > 2)
            {
                plusLinearlayout.LayoutParameters = new ViewGroup.LayoutParams(new LinearLayout.LayoutParams(120, density.HeightPixels / 13));
            }
            else if (density.Density < 2 && density.WidthPixels < 600)
            {
                plusLinearlayout.LayoutParameters = new ViewGroup.LayoutParams(new LinearLayout.LayoutParams(70, density.HeightPixels / 13));
            }
            else
            {
                plusLinearlayout.LayoutParameters = new ViewGroup.LayoutParams(new LinearLayout.LayoutParams(90, density.HeightPixels / 13));
            }

            SchedulePlus = new ImageView(Context);
            SchedulePlus.SetBackgroundResource(Resource.Drawable.schedulePlus);
            plusLinearlayout.AddView(SchedulePlus);
            leftmainLayout.AddView(plusLinearlayout);

            calendarLinearlayout = new LinearLayout(Context);
            if (density.Density > 2)
            {
                calendarLinearlayout.LayoutParameters = new ViewGroup.LayoutParams(new LinearLayout.LayoutParams(120, density.HeightPixels / 13));
            }
            else if (density.Density < 2 && density.WidthPixels < 600)
            {
                calendarLinearlayout.LayoutParameters = new ViewGroup.LayoutParams(new LinearLayout.LayoutParams(70, density.HeightPixels / 13));
            }
            else
            {
                calendarLinearlayout.LayoutParameters = new ViewGroup.LayoutParams(new LinearLayout.LayoutParams(90, density.HeightPixels / 13));
            }

            ScheduleCalendar = new ImageView(Context);
            ScheduleCalendar.SetBackgroundResource(Resource.Drawable.scheduleCalendar);
            calendarLinearlayout.AddView(ScheduleCalendar);
            leftmainLayout.AddView(calendarLinearlayout);

            leftmainLayout.SetGravity(GravityFlags.Left);

            mainheaderLayout.AddView(mainLayout);
            mainheaderLayout.AddView(leftmainLayout);
            HeaderLayout.AddView(mainheaderLayout);
        }
        public NathanPicker()
        {
            BindingContext = new PickerItem();

            IsVisible = false;

            PickerViewModel = new PickerViewModel();

            _headerLayout = new HeaderLayout();

            _headerLayout.TapGestureRecognizerSearchImage.Tapped += (s, e) =>
            {
                _myCollectionView.ScrollTo(0);

                _headerLayout.TitleImage.IsVisible  = false;
                _headerLayout.TitleLabel.IsVisible  = false;
                _headerLayout.SearchImage.IsVisible = false;

                _headerLayout.PickerSearchBar.IsVisible = true;
                _headerLayout.BackImage.IsVisible       = true;

                new Animation(d => _headerLayout.PickerSearchBar.Opacity = d, 0.5, 1).Commit(_headerLayout.PickerSearchBar,
                                                                                             "SearchBar Animation", 60, 300,
                                                                                             Easing.CubicOut);
            };

            _headerLayout.TapGestureRecognizerBackImage.Tapped += (s, e) =>
            {
                _myCollectionView.ScrollTo(0);

                _headerLayout.SearchImage.IsVisible = true;
                _headerLayout.PickerSearchBar.Text  = "";

                _headerLayout.TitleImage.IsVisible = true;
                _headerLayout.TitleLabel.IsVisible = true;

                _headerLayout.PickerSearchBar.IsVisible = false;
                _headerLayout.BackImage.IsVisible       = false;
            };

            _headerLayout.PickerSearchBar.TextChanged += OnPickerSearchBarTextChanged;


            var emptyViewLabel = new Label
            {
                HorizontalOptions       = LayoutOptions.Fill,
                HorizontalTextAlignment = TextAlignment.Center,
                FontSize = DFDesignMainPage.PickerTitleFontSize.Value
            };

            emptyViewLabel.SetBinding(Label.TextProperty, "CurrentSearch");

            _myCollectionView = new CollectionView
            {
                ItemsSource       = PickerViewModel.PickerItems,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                SelectionMode     = SelectionMode.Single,

                ItemTemplate = new DataTemplate(() => new CollectionCellLayout()),

                EmptyView = new StackLayout
                {
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                    Padding         = new Thickness(DFDesignMainPage.emptyViewSidePadding.Value, 0,
                                                    DFDesignMainPage.emptyViewSidePadding.Value, 0),
                    Children =
                    {
                        emptyViewLabel
                    }
                }
            };
            _myCollectionView.SelectionChanged += OnCollectionsViewItemSelected;


            BottomPanContainer.FrameContentStackLayout.Children.Add(_headerLayout);
            BottomPanContainer.FrameContentStackLayout.Children.Add(_myCollectionView);

            Init();


            var backgroundGesture = new TapGestureRecognizer();

            backgroundGesture.Tapped += (s, e) =>
            {
                if (IsVisible)
                {
                    InVisiblePicker();
                }
            };
        }