private void RenderHeader(IGalleryItem item)
        {
            Title.Text = item.Title;
            string color = Utils.GetAccentColorHex(Activity);

            SubTitle.SetText(Utils.FromHtml($"by <b><font color='{color}'>{item.UploaderName}</font></b> • {item.Ups} points"), TextView.BufferType.Spannable);
        }
 private void RenderAlbum(IGalleryItem item)
 {
     Item = item;
     Title.Text = item.Title;
     AlbumRecyclerView.SetLayoutManager(new LinearLayoutManager(Context));
     bindings.Add(this.SetBinding(() => Item.AlbumImages).WhenSourceChanges(UpdateAlbumAdapter));
 }
Exemplo n.º 3
0
 public override void Initialize(IComponent component)
 {
     base.Initialize(component);
     //
     this.m_pCollectionItem = base.Component as ICollectionItem;
     this.m_pRibbonApplicationObjectDesignHelper = base.Component as IRibbonApplicationObjectDesignHelper;
     this.m_pObjectDesignHelper           = base.Component as IObjectDesignHelper;
     this.m_pCollectionObjectDesignHelper = base.Component as ICollectionObjectDesignHelper;
     this.m_pPopupObjectDesignHelper      = base.Component as IPopupObjectDesignHelper;
     //
     this.m_pRibbonControl       = base.Component as IRibbonControl;
     this.m_pRibbonPageItem      = base.Component as IRibbonPageItem;
     this.m_pButtonGroupItem     = base.Component as IButtonGroupItem;
     this.m_pGalleryItem         = base.Component as IGalleryItem;
     this.m_RibbonGalleryRowItem = base.Component as RibbonGalleryRowItem;
     //
     if (this.m_pRibbonControl != null)
     {
         IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost;
         if (host != null)
         {
             if (host.RootComponent is System.Windows.Forms.Form)
             {
                 System.Windows.Forms.Form form = (System.Windows.Forms.Form)host.RootComponent;
                 form.MainMenuStrip = this.m_pRibbonControl.MenuStrip;
                 this.m_pRibbonControl.ParentForm = form;
                 if (form is WFNew.RibbonForm)
                 {
                     ((WFNew.RibbonForm)form).RibbonControl = this.m_pRibbonControl;
                 }
             }
         }
     }
 }
        private void UpdateItem(int index)
        {
            ListViewItem lvi  = _listView.Items[index];
            IGalleryItem item = (IGalleryItem)_gallery[index];

            lvi.SubItems.Clear();
            AddSubItems(lvi, item);

            lvi.Text = item.Name;

            int keyIndex = _listView.LargeImageList.Images.IndexOfKey(lvi.ImageKey);
            var existing = _listView.LargeImageList.Images[keyIndex];
            var @new     = (Image)item.Image;

            if (existing != @new)
            {
                if (@new != null)
                {
                    _listView.LargeImageList.Images[keyIndex] = @new;
                }
                else
                {
                    _listView.LargeImageList.Images.RemoveAt(keyIndex);
                }

                _listView.RedrawItems(index, index, true);
            }
        }
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     var position = Arguments.GetInt(POSITION_ARG);
     item = (Activity as BrowserActivity)?.Vm.Images.ElementAt(position);
     isAlbum = item.ItemType == GalleryItemType.Album;
 }
 private void OnItemActivate(object sender, EventArgs e)
 {
     if (_listView.FocusedItem != null)
     {
         IGalleryItem item = _listView.FocusedItem.Tag as IGalleryItem;
         _component.Activate(item);
     }
 }
Exemplo n.º 7
0
 public ScrollDropDownButtonItem(IGalleryItem pGalleryItem)
     : base(GalleryScrollButtonStyle.eScrollDropDownButton)
 {
     base.Name = "GISShare.Controls.WinForm.WFNew.ScrollDropDownButtonItem";
     base.Text = "画廊列表按钮";
     //
     this.owner = pGalleryItem;
     ((ISetOwnerHelper)this).SetOwner(owner as IOwner);
 }
 public MainPage()
 {
     this.InitializeComponent();
     _imagelist    = new ObservableCollection <ClientImage>();
     _imageGallery = new List <IGalleryItem>();
     DataContext   = this;
     saveSlot      = null;
     Loaded       += MainPage_Loaded;
 }
 private void RenderImage(IGalleryItem item)
 {           
     MainImage.RenderContent(item);
     var hasDescription = !string.IsNullOrEmpty(item.Description);
     var descView = Description;
     if (hasDescription)
         descView.Text = item.Description;
     else
         descView.Visibility = ViewStates.Gone;
 }
Exemplo n.º 10
0
        private void SetDimensions(View view, IGalleryItem itemToRender)
        {
            var layParams = view.LayoutParameters;
            var width     = DpToPx(Math.Min(PxToDp(LayoutRoot.Width, Resources), itemToRender.Width), Resources);
            var height    = (int)Math.Ceiling((itemToRender.Height / (double)itemToRender.Width) * width);

            layParams.Width       = width;
            layParams.Height      = height;
            view.LayoutParameters = layParams;
        }
Exemplo n.º 11
0
        public void ShareItem(IGalleryItem item)
        {
            Intent sendIntent = new Intent();

            sendIntent.SetAction(Intent.ActionSend);
            sendIntent.PutExtra(Intent.ExtraTitle, item.Title ?? "Sharing from Monocle Giraffe");
            sendIntent.PutExtra(Intent.ExtraText, item.Link);
            sendIntent.SetType("text/plain");
            context.StartActivity(sendIntent);
        }
Exemplo n.º 12
0
        private static IGalleryItem CastToGalleryItem(object item)
        {
            IGalleryItem galleryItem = item as IGalleryItem;

            if (galleryItem == null)
            {
                throw new InvalidCastException("DataSource must be an IBindingList of IGalleryItem objects.");
            }

            return(galleryItem);
        }
Exemplo n.º 13
0
 public static IItem ToItem(this IGalleryItem galleryItem)
 {
     if (galleryItem.IsAlbum && galleryItem is GalleryAlbum album)
     {
         return(album.ToAlbum());
     }
     else if (!galleryItem.IsAlbum && galleryItem is GalleryImage image)
     {
         return(image.ToImage());
     }
     return(null);
 }
Exemplo n.º 14
0
        private void RenderImage(IGalleryItem item)
        {
            MainImageView.SetImageResource(global::Android.Resource.Color.Transparent);
            LayoutRoot.Post(() => SetDimensions(MainImageView, item));
            MainImageView.Visibility = ViewStates.Visible;
            VideoWrapper.Visibility  = ViewStates.Gone;
            MainVideoView.Visibility = ViewStates.Gone;
            var width = DpToPx(Math.Min(PxToDp(LayoutRoot.Width, Resources), item.Width), Resources);

            ImageService.Instance
            .LoadUrl(item.Link)
            .DownSample(width)
            .Into(MainImageView);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Activates the specified <see cref="IGalleryItem"/>.
        /// </summary>
        /// <param name="item">The item to activate.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="item"/> is null.</exception>
        /// <exception cref="ArgumentException">Thrown if <paramref name="item"/> is not in the <see cref="DataSource"/>.</exception>
        /// <exception cref="InvalidOperationException">Thrown if <see cref="DataSource"/> is null.</exception>
        public void Activate(IGalleryItem item)
        {
            Platform.CheckForNullReference(item, "item");
            if (_dataSource == null)
            {
                throw new InvalidOperationException(_msgNullDataSource);
            }
            if (!_dataSource.Contains(item))
            {
                throw new ArgumentException(_msgItemNotInDataSource, "item");
            }

            NotifyItemActivated(item);
        }
Exemplo n.º 16
0
 public void RenderContent(IGalleryItem item)
 {
     switch (item.ItemType)
     {
         case GalleryItemType.Animation:
             RenderVideo(item);
             break;
         case GalleryItemType.Image:
             RenderImage(item);
             break;
         default:
             throw new NotSupportedException($"Itemtype {item.ItemType.ToString()} is not supported.");
     }
 }        
Exemplo n.º 17
0
 protected void ImageTapped(IGalleryItem clickedItem, object collection)
 {
     if (collection == Albums)
     {
         GoToBrowser((IEnumerable <IGalleryItem>)Albums, Albums.IndexOf((AlbumItem)clickedItem), PageKeyHolder.SelfBrowserPageKey);
     }
     else if (collection == Images)
     {
         GoToBrowser(Images, Images.IndexOf((GalleryItem)clickedItem), PageKeyHolder.SelfBrowserPageKey);
     }
     else if (collection == Favourites)
     {
         GoToBrowser(Favourites, Favourites.IndexOf((GalleryItem)clickedItem), PageKeyHolder.SubredditBrowserPageKey);
     }
 }
Exemplo n.º 18
0
        private void AddItem(object item)
        {
            IGalleryItem galleryItem = CastToGalleryItem(item);

            string imageKey = Guid.NewGuid().ToString();

            _listView.LargeImageList.Images.Add(imageKey, (Image)galleryItem.Image);
            ListViewItem lvi = new ListViewItem(galleryItem.Name, imageKey);

            AddSubItems(lvi, galleryItem);

            lvi.ToolTipText = galleryItem.Description;
            lvi.Tag         = galleryItem;
            _listView.Items.Add(lvi);
        }
Exemplo n.º 19
0
 private void RenderVideo(IGalleryItem item)
 {
     //detector = new GestureDetector(new GestureListener(MainVideoView));
     LayoutRoot.Post(() => SetDimensions(MainVideoView, item));
     MainVideoView.Visibility = ViewStates.Visible;
     MainVideoView.SetVideoURI(global::Android.Net.Uri.Parse(item.Mp4));
     MediaController controller = new MediaController(Context);
     controller.SetAnchorView(MainVideoView);
     controller.SetMediaPlayer(MainVideoView);
     MainVideoView.SetMediaController(controller);
     //MainVideoView.Start();
     //MainVideoView.SeekTo(100);
    // MainVideoView.Touch += MainVideoView_Touch;
     MainVideoView.Prepared += MainVideoView_Prepared;
 }
Exemplo n.º 20
0
 /// <summary>
 /// Selects the specified <see cref="IGalleryItem"/>.
 /// </summary>
 /// <remarks>
 /// Unselection of all items can be accomplished by passing an empty enumeration to <see cref="Select(IEnumerable{IGalleryItem})"/>.
 /// </remarks>
 /// <param name="item">The item to select.</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="item"/> is null.</exception>
 /// <exception cref="ArgumentException">Thrown if <paramref name="item"/> is not in the <see cref="DataSource"/>.</exception>
 /// <exception cref="InvalidOperationException">Thrown if <see cref="DataSource"/> is null.</exception>
 public void Select(IGalleryItem item)
 {
     Platform.CheckForNullReference(item, "item");
     if (_dataSource == null)
     {
         throw new InvalidOperationException(_msgNullDataSource);
     }
     if (!_dataSource.Contains(item))
     {
         return;                 // throw new ArgumentException(_msgItemNotInDataSource, "item");
     }
     _selection     = new Selection(item);
     _dataSelection = new Selection(item.Item);
     NotifySelectionChanged();
 }
        private void RenderImage(IGalleryItem item)
        {
            var hasDescription = !string.IsNullOrEmpty(item.Description);

            //var descView = Description;
            if (hasDescription)
            {
                Description.Text = item.Description;
            }
            else
            {
                Description.Visibility = ViewStates.Gone;
            }
            MainImage.RenderContent(item, InFragmentManager);
        }
 public ScrollUpButtonItem(IGalleryItem pGalleryItem)
     : base(GalleryScrollButtonStyle.eScrollUpButton)
 {
     READONLY_TimerInterval = (int)(1.5 * System.Windows.Forms.SystemInformation.DoubleClickTime);
     //
     base.Name = "GISShare.Controls.WinForm.WFNew.ScrollUpButtonItem";
     base.Text = "向上翻动";
     //
     this.owner = pGalleryItem;
     ((ISetOwnerHelper)this).SetOwner(owner as IOwner);
     //
     this.m_Timer          = new System.Windows.Forms.Timer();
     this.m_Timer.Interval = READONLY_TimerInterval;
     this.m_Timer.Tick    += new EventHandler(Timer_Tick);
 }
Exemplo n.º 23
0
        private void RenderVideo(IGalleryItem itemToRender)
        {
            MainImageView.Visibility = ViewStates.Gone;
            LayoutRoot.Post(() => { SetDimensions(MainVideoView, itemToRender); });
            VideoWrapper.Alpha      = 0;
            VideoWrapper.Visibility = ViewStates.Visible;

            MainVideoView.SetVideoURI(global::Android.Net.Uri.Parse(itemToRender.Mp4));
            MainVideoView.Prepared += (sender, e) =>
            {
                var mp = sender as MediaPlayer;
                (sender as MediaPlayer).Looping = true;
                VideoWrapper.Alpha = 1;
                MainVideoView.Start();
            };
        }
Exemplo n.º 24
0
        private void UpdateItem(int index)
        {
            ListViewItem lvi      = _listView.Items[index];
            IGalleryItem item     = (IGalleryItem)_gallery[index];
            int          keyIndex = _listView.LargeImageList.Images.IndexOfKey(lvi.ImageKey);

            var existing = _listView.LargeImageList.Images[keyIndex];
            var @new     = (Image)item.Image;

            if (existing != @new)
            {
                _listView.LargeImageList.Images[keyIndex] = @new;
                // update name, description
                _listView.RedrawItems(index, index, true);
            }
        }
Exemplo n.º 25
0
 private void AddSubItems(ListViewItem lvi, IGalleryItem galleryItem)
 {
     string[] galleryDescriptionLines = galleryItem.Description.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
     for (var i = 0; i < galleryDescriptionLines.Length; i++)
     {
         if (galleryDescriptionLines.Length > this.MaxDescriptionLines &&
             i == this.MaxDescriptionLines - 1)
         {
             // There are more descriptions then number of lines allowed
             // and this is pass the last line, add ellipsis instead
             lvi.SubItems.Add("...", Color.Gray, Color.Transparent, _listView.Font);
         }
         else
         {
             // Add regular description line
             lvi.SubItems.Add(galleryDescriptionLines[i], Color.Gray, Color.Transparent, _listView.Font);
         }
     }
 }
Exemplo n.º 26
0
        private void UpdateItem(int index)
        {
            ListViewItem lvi      = _listView.Items[index];
            IGalleryItem item     = (IGalleryItem)_gallery[index];
            int          keyIndex = _listView.LargeImageList.Images.IndexOfKey(lvi.ImageKey);

            // ensure tag is the correct item (may change if item at index was set via indexer)
            lvi.Tag = item;

            var existing = _listView.LargeImageList.Images[keyIndex];
            var @new     = (Image)item.Image;

            if (existing != @new)
            {
                _listView.LargeImageList.Images[keyIndex] = @new;
                // update name, description
                _listView.RedrawItems(index, index, true);
            }
        }
Exemplo n.º 27
0
        public void RenderContent(IGalleryItem itemToRender, FragmentManager fragmentManager)
        {
            this.fragmentManager = fragmentManager;
            item = itemToRender;
            if (item.Id == BrowserItemFragment.DUMMY)
            {
                RenderDummy();
                return;
            }
            switch (itemToRender.ItemType)
            {
            case GalleryItemType.Animation:
                RenderVideo(itemToRender);
                break;

            case GalleryItemType.Image:
                RenderImage(itemToRender);
                break;

            default:
                throw new NotSupportedException($"Itemtype {itemToRender.ItemType.ToString()} is not supported.");
            }
        }
 public RibbonGalleryPopup(IGalleryItem ribbonGalleryItem)
 {
     this.m_RibbonGalleryMirrorPopupPanel = new RibbonGalleryMirrorPopupPanelItem(ribbonGalleryItem);
     this.m_RibbonGalleryMirrorPopupPanel.LeftTopRadius     = 5;
     this.m_RibbonGalleryMirrorPopupPanel.LeftBottomRadius  = 6;
     this.m_RibbonGalleryMirrorPopupPanel.RightTopRadius    = 6;
     this.m_RibbonGalleryMirrorPopupPanel.RightBottomRadius = 7;
     //
     this.m_ToolStripControlHost = new ToolStripControlHost(new BaseItemHost(this.m_RibbonGalleryMirrorPopupPanel));
     this.m_RibbonGalleryMirrorPopupPanel.Entity = this.m_ToolStripControlHost.Control;
     this.m_ToolStripControlHost.Dock            = DockStyle.Fill;
     //this.m_ToolStripControlHost.BackColor = base.BackColor;
     this.m_ToolStripControlHost.Margin  = new Padding(0);
     this.m_ToolStripControlHost.Padding = new Padding(0);
     base.Items.Add(this.m_ToolStripControlHost);
     //
     this.Margin            = new Padding(0);
     this.Padding           = new Padding(0);
     this.DropShadowEnabled = false;
     this.ShowItemToolTips  = false;
     //
     ((ISetOwnerHelper)(this.m_ToolStripControlHost.Control)).SetOwner(this);
 }
Exemplo n.º 29
0
        public async Task FetchSubredditImage(EduardoContext context, string subredditName)
        {
            IGalleryItem img = await ImgurHelper.SearchImgurSubreddit(_credentials.ImgurClientId, _credentials.ImgurClientSecret, subredditName);

            if (img != null)
            {
                switch (img)
                {
                case GalleryAlbum album:
                    await context.Channel.SendMessageAsync(album.Link);

                    break;

                case GalleryImage image:
                    await context.Channel.SendMessageAsync(image.Link);

                    break;
                }
            }
            else
            {
                await context.Channel.SendMessageAsync($"**Could not find subreddit with name {subredditName}.**");
            }
        }
Exemplo n.º 30
0
        public async Task SearchImgur(EduardoContext context, string searchQuery = null)
        {
            IGalleryItem img = await ImgurHelper.SearchImgur(_credentials.ImgurClientId, _credentials.ImgurClientSecret, searchQuery);

            if (img != null)
            {
                switch (img)
                {
                case GalleryAlbum album:
                    await context.Channel.SendMessageAsync(album.Link);

                    break;

                case GalleryImage image:
                    await context.Channel.SendMessageAsync(image.Link);

                    break;
                }
            }
            else
            {
                await context.Channel.SendMessageAsync($"**Could not find any images that match {searchQuery}**");
            }
        }
Exemplo n.º 31
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="droppedData"></param>
		/// <param name="targetItem"></param>
		/// <param name="action"></param>
		/// <param name="modifiers"></param>
		/// <returns></returns>
		public override sealed DragDropOption PerformDrop(IDragDropObject droppedData, IGalleryItem targetItem, DragDropOption action, ModifierFlags modifiers)
		{
			DragDropOption performedAction;
			IList<IGalleryItem> droppedItems = ExtractGalleryItemList(droppedData);
			if (droppedItems != null)
			{
				if (_draggedItems == droppedItems)
				{
					performedAction = PerformDropLocalItems(droppedItems, targetItem, action, modifiers);
				}
				else
				{
					performedAction = PerformDropForeignItems(droppedItems, targetItem, action, modifiers);
				}
			}
			else
			{
				performedAction = PerformDropForeignObject(droppedData, targetItem, action, modifiers);
			}
			return performedAction;
		}
Exemplo n.º 32
0
 public void AddGalleryItem(IGalleryItem i_GalleryItem, GalleryElementAdder i_ElementAdder)
 {
     i_ElementAdder.AddElement(this, i_GalleryItem);
 }
Exemplo n.º 33
0
		private void AddSubItems(ListViewItem lvi, IGalleryItem galleryItem)
		{
			string[] galleryDescriptionLines = galleryItem.Description.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
			for (var i = 0; i < galleryDescriptionLines.Length; i++)
			{
				if (galleryDescriptionLines.Length > _component.MaxDescriptionLines &&
					i == _component.MaxDescriptionLines - 1)
				{
					// There are more descriptions then number of lines allowed
					// and this is pass the last line, add ellipsis instead
					lvi.SubItems.Add("...", Color.Gray, Color.Transparent, _listView.Font);
				}
				else
				{
					// Add regular description line
					lvi.SubItems.Add(galleryDescriptionLines[i], Color.Gray, Color.Transparent, _listView.Font);
				}
			}	
		}
Exemplo n.º 34
0
 public void ShareItem(IGalleryItem item)
 {
     itemToShare = item;
     shareType   = IMAGE;
     DataTransferManager.ShowShareUI();
 }
Exemplo n.º 35
0
		/// <summary>
		/// Constructs a new <see cref="GalleryItemDragEventArgs"/>.
		/// </summary>
		/// <param name="item">The <see cref="IGalleryItem"/>.</param>
		public GalleryItemDragEventArgs(IGalleryItem item)
			: base(item)
		{
			_additionalDataFormats = new List<object>();
		}
Exemplo n.º 36
0
		/// <summary>
		/// Checks for allowed drag &amp; drop actions involving the specified foreign data and the given target on this component.
		/// </summary>
		/// <param name="droppingData">The <see cref="IDragDropObject"/> object that encapsulates all forms of the foreign data.</param>
		/// <param name="targetItem">The target item that the user is trying to drop on to.</param>
		/// <param name="actions"></param>
		/// <param name="modifiers">The modifier keys that are being held by the user.</param>
		/// <returns>The allowed <see cref="DragDropKind"/> action for this attempted drag &amp; drop operation.</returns>
		public override sealed DragDropOption CheckDrop(IDragDropObject droppingData, IGalleryItem targetItem, DragDropOption actions, ModifierFlags modifiers)
		{
			DragDropOption allowedActions;
			IList<IGalleryItem> droppingItems = ExtractGalleryItemList(droppingData);
			if (droppingItems != null)
			{
				if (_draggedItems == droppingItems)
				{
					allowedActions = CheckDropLocalItems(droppingItems, targetItem, actions, modifiers);
				}
				else
				{
					allowedActions = CheckDropForeignItems(droppingItems, targetItem, actions, modifiers);
				}
			}
			else
			{
				allowedActions = CheckDropForeignObject(droppingData, targetItem, actions, modifiers);
			}
			return actions & allowedActions;
		}
Exemplo n.º 37
0
 private void RenderImage(IGalleryItem item)
 {
     var imageService = ImageService.Instance;
     imageService.LoadFileFromApplicationBundle("DummyImage.png").Into(MainImageView);
     LayoutRoot.Post(() => SetDimensions(MainImageView, item));
     MainImageView.Visibility = ViewStates.Visible;
     var width = DpToPx(Math.Min(PxToDp(LayoutRoot.Width), item.Width));
     imageService.LoadUrl(item.Link).DownSample(width).Into(MainImageView);
 }
Exemplo n.º 38
0
		/// <summary>
		/// Checks if drag-dropping <see cref="IGalleryItem"/>s from within this gallery on top of the specified item is allowed.
		/// </summary>
		/// <param name="droppingItems">The list of <see cref="IGalleryItem"/>s to drop.</param>
		/// <param name="targetItem">The target <see cref="IGalleryItem"/> at which the <paramref name="droppingItems"/> are being dropped.</param>
		/// <param name="actions">The interactions that are being allowed by the data source.</param>
		/// <param name="modifiers">The modifier keys that currently being pressed.</param>
		/// <returns>The allowed interactions for dropping the <paramref name="droppingItems"/> here.</returns>
		protected virtual DragDropOption CheckDropLocalItems(IList<IGalleryItem> droppingItems, IGalleryItem targetItem, DragDropOption actions, ModifierFlags modifiers)
		{
			return DragDropOption.None;
		}
Exemplo n.º 39
0
		/// <summary>
		/// Performs a drag-drop of <see cref="IGalleryItem"/>s from outside this gallery on top of the specified item.
		/// </summary>
		/// <param name="droppedItems">The list of <see cref="IGalleryItem"/>s to drop.</param>
		/// <param name="targetItem">The target <see cref="IGalleryItem"/> at which the <paramref name="droppedItems"/> are being dropped.</param>
		/// <param name="actions">The interaction to take.</param>
		/// <param name="modifiers">The modifier keys that were pressed at the time of the drop.</param>
		/// <returns>The actual interaction on the <paramref name="droppedItems"/> that was taken.</returns>
		protected virtual DragDropOption PerformDropForeignItems(IList<IGalleryItem> droppedItems, IGalleryItem targetItem, DragDropOption actions, ModifierFlags modifiers)
		{
			return DragDropOption.None;
		}
Exemplo n.º 40
0
 public void ShareItem(IGalleryItem item)
 {
     itemToShare = item;
     shareType = IMAGE;
     DataTransferManager.ShowShareUI();
 }
Exemplo n.º 41
0
 private void SetDimensions(View view, IGalleryItem item)
 {
     var layParams = view.LayoutParameters;
     var width = DpToPx(Math.Min(PxToDp(LayoutRoot.Width), item.Width));
     var height = (int)Math.Ceiling((item.Height / (double)item.Width) * width);
     layParams.Width = width;
     layParams.Height = height;
     view.LayoutParameters = layParams;
 }
Exemplo n.º 42
0
 public void ShareItem(IGalleryItem item)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 43
0
 /// <summary>
 /// Checks for allowed drag &amp; drop actions involving the specified foreign data and the given target on this component.
 /// </summary>
 /// <param name="droppingData">The <see cref="IDragDropObject"/> object that encapsulates all forms of the foreign data.</param>
 /// <param name="targetItem">The target item that the user is trying to drop on to.</param>
 /// <param name="actions"></param>
 /// <param name="modifiers">The modifier keys that are being held by the user.</param>
 /// <returns>The allowed <see cref="DragDropKind"/> action for this attempted drag &amp; drop operation.</returns>
 public virtual DragDropOption CheckDrop(IDragDropObject droppingData, IGalleryItem targetItem, DragDropOption actions, ModifierFlags modifiers)
 {
     return(DragDropOption.None);
 }
Exemplo n.º 44
0
        public void AddElement(IGallery i_Gallery, IGalleryItem i_Item)
        {
            List <IGalleryItem> galleryItems = i_Gallery.GalleryItems;

            galleryItems.Add(i_Item);
        }
Exemplo n.º 45
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="droppedData"></param>
 /// <param name="targetItem"></param>
 /// <param name="action"></param>
 /// <param name="modifiers"></param>
 /// <returns></returns>
 public virtual DragDropOption PerformDrop(IDragDropObject droppedData, IGalleryItem targetItem, DragDropOption action, ModifierFlags modifiers)
 {
     return(DragDropOption.None);
 }
Exemplo n.º 46
0
 protected void ImageTapped(IGalleryItem clickedItem, object collection)
 {
     if (collection == Albums)
         GoToBrowser((IEnumerable<IGalleryItem>)Albums, Albums.IndexOf((AlbumItem)clickedItem), PageKeyHolder.SelfBrowserPageKey);
     else if (collection == Images)
         GoToBrowser(Images, Images.IndexOf((GalleryItem)clickedItem), PageKeyHolder.SelfBrowserPageKey);
     else if (collection == Favourites)
         GoToBrowser(Favourites, Favourites.IndexOf((GalleryItem)clickedItem), PageKeyHolder.SubredditBrowserPageKey);
 }
 private void RenderHeader(IGalleryItem item)
 {
     Title.Text = item.Title;
     SubTitle.SetText(Html.FromHtml($"by <font color='#528ACA'>{item.UploaderName}</font> • {item.Ups} points"), TextView.BufferType.Spannable);
 }
Exemplo n.º 48
0
		/// <summary>
		/// Performs a drag-drop of a non-<see cref="IGalleryItem"/> object from outside this gallery on top of the specified item.
		/// </summary>
		/// <param name="droppedData">The data object to drop.</param>
		/// <param name="targetItem">The target <see cref="IGalleryItem"/> at which the <paramref name="droppedData"/> is being dropped.</param>
		/// <param name="actions">The interaction to take.</param>
		/// <param name="modifiers">The modifier keys that were pressed at the time of the drop.</param>
		/// <returns>The actual interaction on the <paramref name="droppedData"/> that was taken.</returns>
		protected virtual DragDropOption PerformDropForeignObject(IDragDropObject droppedData, IGalleryItem targetItem, DragDropOption actions, ModifierFlags modifiers)
		{
			return DragDropOption.None;
		}
Exemplo n.º 49
0
		/// <summary>
		/// Constructs a new <see cref="GalleryItemEventArgs"/>.
		/// </summary>
		/// <param name="item">The <see cref="IGalleryItem"/>.</param>
		public GalleryItemEventArgs(IGalleryItem item)
		{
			_item = item;
		}