Example #1
0
File: Link.cs Project: picibird/hbs
        private void OnClick()
        {
            Intent openUrlIntent = new Intent(Intent.ACTION_OPEN, Uri);

            openUrlIntent.AddExtra("title", Title);
            openUrlIntent.AddExtra("subtitle", Subtitle);
            Pici.Intent.Send(openUrlIntent);
        }
Example #2
0
        private void OnBookTap(object sender, EventArgs e)
        {
            var book3d = sender as Book3DViewModel;
            var intent = new Intent(HbsIntents.ACTION_OPEN_BOOK);

            intent.AddExtra("book3D", book3d);
            Pici.Intent.Send(intent);
        }
Example #3
0
        private void OnTap(object sender, System.EventArgs e)
        {
            var av = Model as AvailabilityInfo;

            if (av != null)
            {
                Uri uri = null;
                if (Uri.TryCreate(av.Href, UriKind.Absolute, out uri))
                {
                    Intent openUrlIntent = new Intent(Intent.ACTION_OPEN, uri);
                    openUrlIntent.AddExtra("title", av.Signature);
                    openUrlIntent.AddExtra("subtitle", av.Href);
                    Pici.Intent.Send(openUrlIntent);
                }
                else
                {
                    Pici.Log.warn(typeof(AvailabilityInfo), "cannot parse availability href to uri: {0}", av.Href);
                }
            }
        }
Example #4
0
        public override void OnTranistionCompleted()
        {
            HBS.ViewModel.Opened.BookVM.IsBitmapCacheEnabled = false;
            HBS.ViewModel.Opened.BookVM.TransformMatrix      = MxM.Identity;
            activeTransition.OnTranistionCompleted();

            if (SwipeMode == SwipeMode.Book)
            {
                if (Direction == Direction.Center)
                {
                    if (LastNextBook3D != null)
                    {
                        LastNextBook3D.Visibility = true;
                        LastNextBook3D.AnimateOpacity(0, 1);
                    }
                }
                else
                {
                    Book3D.Visibility = true;
                    Book3D.AnimateOpacity(0, 1);
                }
            }
            if (SwipeMode == SwipeMode.Shelf)
            {
                Events.OnIdleOnce(() =>
                {
                    HBS.ViewModel.Opened.BookVM.Book = null;
                    HBS.IsAnimating   = false;
                    Book3D.Visibility = true;

                    var intent = new Intent(HbsIntents.ACTION_OPEN_BOOK);

                    var selectedShelf = HBS.ViewModel.ShelfViewModel.GetSelectedBookshelf();
                    var index         = Bookshelf.RotatedIndex < selectedShelf.RotatedIndex
                        ? 1
                        : selectedShelf.Books3D.Items.Count - 1;
                    var book3D = (Book3DViewModel)selectedShelf.Books3D.Items[index];

                    intent.AddExtra("book3D", book3D);
                    Pici.Intent.Send(intent);
                });
            }
        }