Example #1
0
        public static ObservableSearchDelegate AddSearchBar(this BaseTableViewController @this, out UISearchBar searchBar)
        {
            searchBar = new UISearchBar(new CGRect(0f, 0f, 320f, 44f));
            searchBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;

            var searchDelegate = new ObservableSearchDelegate();

            searchBar.Delegate = searchDelegate;

            @this.TableView.TableHeaderView = searchBar;

            return(searchDelegate);
        }
Example #2
0
        public static void TrackScreen(this BaseTableViewController viewController)
        {
            var analytics = viewController.GetAnalytics();

            if (analytics == null)
            {
                return;
            }

            var screenName = viewController.GetType().Name;

            analytics.Screen(screenName);
        }
Example #3
0
        public static ObservableSearchDelegate AddSearchBar(this BaseTableViewController @this, Action <string> searchAction)
        {
            var searchDelegate = AddSearchBar(@this);

            var supportsActivation = @this as IActivatable;

            if (supportsActivation != null)
            {
                supportsActivation.WhenActivated(d =>
                {
                    d(searchDelegate.SearchTextChanging.Subscribe(searchAction));
                });
            }
            else
            {
                searchDelegate.SearchTextChanging.Subscribe(searchAction);
            }

            return(searchDelegate);
        }
Example #4
0
        public static ObservableSearchDelegate AddSearchBar(this BaseTableViewController @this)
        {
            UISearchBar searchBar;

            return(AddSearchBar(@this, out searchBar));
        }
Example #5
0
 public static IAnalyticsService GetAnalytics(this BaseTableViewController viewController)
 {
     return(Locator.Current.GetService <IAnalyticsService>());
 }