Ejemplo n.º 1
0
        public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
        {
            var asset = (PHAsset)FetchResult [indexPath.Item];

            // Dequeue an GridViewCell.
            var cell = (GridViewCell)collectionView.DequeueReusableCell(cellReuseIdentifier, indexPath);

#if __IOS__ && !__TVOS__
            // Add a badge to the cell if the PHAsset represents a Live Photo.
            // Add Badge Image to the cell to denote that the asset is a Live Photo.
            if (asset.MediaSubtypes.HasFlag(PHAssetMediaSubtype.PhotoLive))
            {
                cell.LivePhotoBadgeImage = PHLivePhotoView.GetLivePhotoBadgeImage(PHLivePhotoBadgeOptions.OverContent);
            }
#endif

            // Request an image for the asset from the PHCachingImageManager.
            cell.RepresentedAssetIdentifier = asset.LocalIdentifier;
            imageManager.RequestImageForAsset(asset, thumbnailSize, PHImageContentMode.AspectFill, null, (image, info) => {
                // Set the cell's thumbnail image if it's still showing the same asset.
                if (cell.RepresentedAssetIdentifier == asset.LocalIdentifier)
                {
                    cell.ThumbnailImage = image;
                }
            });

            return(cell);
        }
Ejemplo n.º 2
0
 public virtual void WillBeginPlayback(PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle)
 {
     playingHint = (playbackStyle == PHLivePhotoViewPlaybackStyle.Hint);
 }
Ejemplo n.º 3
0
 public virtual void DidEndPlayback(PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle)
 {
     isPlayingHint = (playbackStyle == PHLivePhotoViewPlaybackStyle.Hint);
 }
		public virtual void WillBeginPlayback (PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle)
		{
			Console.WriteLine ("Will Beginning Playback of Live Photo...");
		}
		public virtual void DidEndPlayback (PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle)
		{
			Console.WriteLine ("Did End Playback of Live Photo...");
			playingHint = false;
		}
		public virtual void WillBeginPlayback (PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle)
		{
			playingHint = (playbackStyle == PHLivePhotoViewPlaybackStyle.Hint);
		}
 public virtual void WillBeginPlayback(PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle)
 {
     Console.WriteLine("Will Beginning Playback of Live Photo...");
 }
 public virtual void DidEndPlayback(PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle)
 {
     Console.WriteLine("Did End Playback of Live Photo...");
     playingHint = false;
 }