public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            collectionView.RegisterNibForCell(ActivityCollectionCell.Nib, ActivityCollectionCell.Key);
            collectionView.RegisterNibForSupplementaryView(FeedSectionHeader.Nib, UICollectionElementKindSectionKey.Header, FeedSectionHeader.Key);

            locationManager = new CLLocationManager();
            locationManager.DesiredAccuracy   = CLLocation.AccuracyHundredMeters;
            locationManager.LocationsUpdated += LocationUpdated;

            source = new ActivityViewSource();

            refreshControl               = new UIRefreshControl();
            refreshControl.TintColor     = AppUtils.AppMainColour;
            refreshControl.ValueChanged += (sender, e) =>
            {
                RefreshFeed();
            };

            collectionView.ShowsHorizontalScrollIndicator = false;
            collectionView.RefreshControl  = refreshControl;
            collectionView.Source          = source;
            collectionView.AllowsSelection = true;
            collectionView.Delegate        = new SectionedClickableDelegate((section, index) => {
                var suppressAsync = AppUtils.OpenActivity(source.Rows[section]?.Activities[index], Storyboard, NavigationController);
            });
        }
 public NewConvertController(ILogger <NewConvertController> logger, UserViewSource userSource, BanViewSource banSource,
                             ModuleViewSource moduleViewSource, FileViewSource fileViewSource, ContentViewSource contentViewSource,
                             CategoryViewSource categoryViewSource, VoteViewSource voteViewSource, WatchViewSource watchViewSource,
                             CommentViewSource commentViewSource, ActivityViewSource activityViewSource,
                             ContentApiDbConnection cdbconnection, IEntityProvider entityProvider,
                             ModuleMessageViewSource moduleMessageViewSource,
                             ModuleRoomMessageViewSource moduleRoomMessageViewSource,
                             NewConvertControllerConfig config,
                             IHistoryService historyService,
                             IHistoryConverter historyConverter,
                             /*ContentApiDbContext ctapiContext,*/ IMapper mapper)
 {
     this.logger         = logger;
     this.userSource     = userSource;
     this.banSource      = banSource;
     this.moduleSource   = moduleViewSource;
     this.fileSource     = fileViewSource;
     this.contentSource  = contentViewSource;
     this.categorySource = categoryViewSource;
     this.voteSource     = voteViewSource;
     this.watchSource    = watchViewSource;
     this.commentSource  = commentViewSource;
     this.activitySource = activityViewSource;
     //this.ctapiContext = ctapiContext;
     this.mapper               = mapper;
     this.newdb                = cdbconnection.Connection;
     this.entityProvider       = entityProvider;
     this.moduleMessageSource  = moduleMessageViewSource;
     this.moduleRMessageSource = moduleRoomMessageViewSource;
     this.config               = config;
     this.historyService       = historyService;
     this.historyConverter     = historyConverter;
 }
示例#3
0
 public ReadTestBase()
 {
     contentService = CreateService <ContentViewService>();
     userService    = CreateService <UserViewService>();
     activitySource = CreateService <ActivityViewSource>();
     commentService = CreateService <CommentViewService>();
     watchService   = CreateService <WatchViewService>();
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            screenBounds = UIScreen.MainScreen.Bounds;

            collectionView.RegisterNibForCell(ActivityCollectionCell.Nib, ActivityCollectionCell.Key);
            collectionView.RegisterNibForSupplementaryView(FeedSectionHeader.Nib, UICollectionElementKindSectionKey.Header, FeedSectionHeader.Key);

            source = new ActivityViewSource();

            refreshControl               = new UIRefreshControl();
            refreshControl.TintColor     = AppUtils.AppMainColour;
            refreshControl.ValueChanged += (sender, e) =>
            {
                RefreshFeed();
            };

            collectionView.ShowsHorizontalScrollIndicator = false;
            collectionView.RefreshControl  = refreshControl;
            collectionView.Source          = source;
            collectionView.AllowsSelection = true;
            collectionView.Delegate        = new SectionedClickableDelegate((section, index) =>
            {
                LearningActivity thisActivity = source.Rows[section]?.Activities[index];

                if (thisActivity == null)
                {
                    return;
                }

                if (unsubmittedActivities != null && unsubmittedActivities.Exists((LearningActivity obj) => { return(obj.Id == thisActivity.Id); }))
                {
                    LocalActivityTapped(thisActivity);
                }
                else
                {
                    RemoteActivityTapped(thisActivity);
                }
            });
        }
示例#5
0
 public ActivityViewSourceTests()
 {
     service  = CreateService <ActivityViewSource>();
     provider = CreateService <IEntityProvider>();
     unit     = CreateUnitAsync().Result;
 }