private void EnsureAdapter ()
 {
     if (recyclerView.GetAdapter() == null) {
         var isGrouped = ServiceContainer.Resolve<SettingsStore> ().GroupedTimeEntries;
         collectionView = isGrouped ? (TimeEntriesCollectionView)new GroupedTimeEntriesView () : new LogTimeEntriesView ();
         logAdapter = new LogTimeEntriesAdapter (recyclerView, collectionView);
         recyclerView.SetAdapter (logAdapter);
         SetupRecyclerView ();
     }
 }
示例#2
0
 private void EnsureAdapter()
 {
     if (recyclerView.GetAdapter() == null)
     {
         var isGrouped = ServiceContainer.Resolve <SettingsStore> ().GroupedTimeEntries;
         collectionView = isGrouped ? (TimeEntriesCollectionView) new GroupedTimeEntriesView() : new LogTimeEntriesView();
         logAdapter     = new LogTimeEntriesAdapter(recyclerView, collectionView);
         recyclerView.SetAdapter(logAdapter);
         SetupRecyclerView();
     }
 }
示例#3
0
        private async Task SyncCollectionView()
        {
            IsGroupedMode = ServiceContainer.Resolve <ISettingsStore> ().GroupedTimeEntries;

            if (collectionView != null)
            {
                collectionView.Dispose();
                collectionView.CollectionChanged -= OnCollectionChanged;
            }

            // In a near future, CollectionView will be only
            // one object and not divided in two separated classes
            // like that: LogTimeEntriesView and GroupedTimeEntriesView

            collectionView = IsGroupedMode ? (TimeEntriesCollectionView) new GroupedTimeEntriesView() : new LogTimeEntriesView();
            collectionView.CollectionChanged += OnCollectionChanged;
            await collectionView.ReloadAsync();

            CollectionView = collectionView;
        }
示例#4
0
 public LogTimeEntriesAdapter(RecyclerView owner, TimeEntriesCollectionView modelView) : base(owner, modelView)
 {
     this.modelView             = modelView;
     lastTimeEntryContinuedTime = Time.UtcNow;
 }