Пример #1
0
 public void initializeSlidingPanelDelegates(SlidingUpPanelLayout view, NavigationLayoutManager manager)
 {
     //Binds a delegate that enables recyclerView scrolling iff the panel has been expanded, otherwise it disables it; it runs every time the panel state changes.
     //Also enables map scrolling iff the panel has been collapsed, otherwise disables it.
     view.PanelStateChanged += delegate
     {
         manager.scrollable = (view.GetPanelState() == SlidingUpPanelLayout.PanelState.Expanded);
         map.UiSettings.ScrollGesturesEnabled = (view.GetPanelState() == SlidingUpPanelLayout.PanelState.Collapsed);
     };
 }
 private void RightButtonClick(object sender, EventArgs e)
 {
     isRightLanguageButton = true;
     isLeftLanguageButton  = false;
     if (sliding_layout.GetPanelState() == SlidingUpPanelLayout.PanelState.Collapsed)
     {
         KeyValuePair <string, string> selectedLanguage =
             new KeyValuePair <string, string>(rightSelectedLanguage, rightSelectedLanguageCode);
         spinner.SetSelection(languagesList.IndexOf(selectedLanguage));
         sliding_layout.SetPanelState(SlidingUpPanelLayout.PanelState.Expanded);
     }
     else if (sliding_layout.GetPanelState() == SlidingUpPanelLayout.PanelState.Expanded)
     {
         sliding_layout.SetPanelState(SlidingUpPanelLayout.PanelState.Collapsed);
     }
 }
 private void RightButtonClick(object sender, EventArgs e)
 {
     if (sliding_layout.GetPanelState() == SlidingUpPanelLayout.PanelState.Hidden)
     {
         KeyValuePair <string, string> selectedLanguage =
             new KeyValuePair <string, string>(rightSelectedLanguage, rightSelectedLanguageCode);
         spinner.SetSelection(languagesList.IndexOf(selectedLanguage));
         sliding_layout.SetPanelState(SlidingUpPanelLayout.PanelState.Expanded);
     }
 }
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            return(base.OnCreateOptionsMenu(menu));

            // Inflate the menu; this adds items to the action bar if it is present.
            MenuInflater.Inflate(Resource.Menu.demo, menu);

            var item = menu.FindItem(Resource.Id.action_toggle);

            if (mLayout != null)
            {
                if (mLayout.GetPanelState() == PanelState.Hidden)
                {
                    item.SetTitle(Resource.String.action_show);
                }
                else
                {
                    item.SetTitle(Resource.String.action_hide);
                }
            }
            return(true);
        }
Пример #5
0
        private void configureStationImage()
        {
            //Binds variable for the layers and the images in each layer
            LinearLayout thumbLayer = FindViewById <LinearLayout>(Resource.Id.subwayThumbLayer);
            ImageView    thumbImage = FindViewById <ImageView>(Resource.Id.subwayThumbImage);
            FrameLayout  fullLayer  = FindViewById <FrameLayout>(Resource.Id.subwayFullLayer);
            ImageView    fullImage  = FindViewById <ImageView>(Resource.Id.subwayFullImage);

            //Binds variable for sliding panel
            SlidingUpPanelLayout slider = FindViewById <SlidingUpPanelLayout>(Resource.Id.sliding_layout);

            //Sets the image resources of each imageView, they're invisible so they don't show up yet
            thumbImage.SetImageResource(Resource.Drawable.entrance_example);
            fullImage.SetImageResource(Resource.Drawable.entrance_example);

            //Sets the thumbnail layer to be visible and take click events
            thumbLayer.Visibility = ViewStates.Visible;
            thumbImage.Clickable  = true;

            //Hides the thumbnail layer when the sliding panel is extended
            slider.PanelStateChanged += delegate
            {
                if (slider.GetPanelState() == SlidingUpPanelLayout.PanelState.Expanded || slider.GetPanelState() == SlidingUpPanelLayout.PanelState.Dragging)
                {
                    Tools.toggleVisibility(thumbLayer);
                }
                else
                {
                    Tools.toggleVisibility(thumbLayer);
                }
            };

            //Switches view from the thumbnail view with map to a fullscreen image
            thumbImage.Click += delegate
            {
                Tools.toggleVisibility(thumbLayer);
                Tools.toggleVisibility(fullLayer);
            };

            //Switches view from the full layer to the thumbnail view
            fullLayer.Click += delegate
            {
                Tools.toggleVisibility(thumbLayer);
                Tools.toggleVisibility(fullLayer);
            };
        }