Exemplo n.º 1
0
        public BaseTimelineViewController(bool pushing) : base(null, pushing)
        {
            Autorotate        = true;
            EnableSearch      = true;
            AutoHideSearch    = true;
            RefreshRequested += delegate {
                ReloadTimeline();
            };
            Style = UITableViewStyle.Plain;
            NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Compose, delegate {
                if (kind == TweetKind.Direct)
                {
                    var sheet = Util.GetSheet("");
                    sheet.AddButton(Locale.GetText("New Tweet"));
                    sheet.AddButton(Locale.GetText("Direct Message"));
                    sheet.AddButton(Locale.GetText("Cancel"));

                    sheet.CancelButtonIndex = 2;
                    sheet.Clicked          += delegate(object sender, UIButtonEventArgs e) {
                        if (e.ButtonIndex == 2)
                        {
                            return;
                        }

                        if (e.ButtonIndex == 0)
                        {
                            Composer.Main.NewTweet(this);
                        }
                        else
                        {
                            selector = new UserSelector(name => {
                                Composer.Main.Direct(this, name);
                                selector = null;
                            });
                            PresentModalViewController(selector, true);
                        }
                    };
                    sheet.ShowInView(AppDelegate.MainAppDelegate.MainView);
                }
                else
                {
                    Composer.Main.NewTweet(this);
                }
            });
        }
Exemplo n.º 2
0
        public BaseTimelineViewController(bool pushing)
            : base(null, pushing)
        {
            Autorotate = true;
            EnableSearch = true;
            AutoHideSearch = true;
            RefreshRequested += delegate {
                ReloadTimeline ();
            };
            Style = UITableViewStyle.Plain;
            NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Compose, delegate {
                if (kind == TweetKind.Direct){
                    var sheet = Util.GetSheet ("");
                    sheet.AddButton (Locale.GetText ("New Tweet"));
                    sheet.AddButton (Locale.GetText ("Direct Message"));
                    sheet.AddButton (Locale.GetText ("Cancel"));

                    sheet.CancelButtonIndex = 2;
                    sheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
                        if (e.ButtonIndex == 2)
                            return;

                        if (e.ButtonIndex == 0)
                            Composer.Main.NewTweet (this);
                        else {
                            selector = new UserSelector (name => {
                                Composer.Main.Direct (this, name);
                                selector = null;
                            });
                            PresentModalViewController (selector, true);
                        }
                    };
                    sheet.ShowInView (AppDelegate.MainAppDelegate.MainView);
                } else {
                    Composer.Main.NewTweet (this);
                }
            });
        }