Prepare UX Rework:

- Define the 4 tabs: Home, Fav, People and Rooms
This commit is contained in:
Giom Foret
2017-04-06 14:27:45 +02:00
parent 52021bd252
commit 4eb90fbb2e
23 changed files with 1958 additions and 575 deletions
+63 -32
View File
@@ -1,5 +1,6 @@
/*
Copyright 2015 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -16,12 +17,72 @@
#import <MatrixKit/MatrixKit.h>
@class PublicRoomsDirectoryDataSource;
#import "PublicRoomsDirectoryDataSource.h"
/**
'RecentsDataSource' class inherits from 'MXKInterleavedRecentsDataSource' to define Vector recents source.
List the different modes used to prepare the recents data source.
Each mode corresponds to an application tab: Home, Favourites, People and Rooms.
*/
typedef enum : NSUInteger
{
RecentsDataSourceModeHome,
RecentsDataSourceModeFavourites,
RecentsDataSourceModePeople,
RecentsDataSourceModeRooms
} RecentsDataSourceMode;
/**
'RecentsDataSource' class inherits from 'MXKInterleavedRecentsDataSource' to define the Riot recents source
shared between all the applications tabs.
*/
@interface RecentsDataSource : MXKInterleavedRecentsDataSource
{
@protected
NSInteger directorySection;
NSInteger invitesSection;
NSInteger favoritesSection;
NSInteger conversationSection;
NSInteger lowPrioritySection;
NSInteger sectionsCount;
}
/**
Set the delegate by specifying the selected display mode.
*/
- (void)setDelegate:(id<MXKDataSourceDelegate>)delegate andRecentsDataSourceMode:(RecentsDataSourceMode)recentsDataSourceMode;
/**
The current mode (RecentsDataSourceModeHome by default).
*/
@property (nonatomic, readonly) RecentsDataSourceMode recentsDataSourceMode;
/**
The data source used to manage the rooms from directory.
*/
@property (nonatomic) PublicRoomsDirectoryDataSource *publicRoomsDirectoryDataSource;
/**
Refresh the recents data source and notify its delegate.
*/
- (void)forceRefresh;
/**
Tell whether the sections are shrinkable. NO by default.
*/
@property (nonatomic) BOOL areSectionsShrinkable;
#pragma mark - Drag & Drop handling
/**
Return true of the cell can be moved from a section to another one.
*/
- (BOOL)isDraggableCellAt:(NSIndexPath*)path;
/**
Return true of the cell can be moved from a section to another one.
*/
- (BOOL)canCellMoveFrom:(NSIndexPath*)oldPath to:(NSIndexPath*)newPath;
/**
There is a pending drag and drop cell.
@@ -40,36 +101,6 @@
*/
@property (nonatomic) UIImageView* droppingCellBackGroundView;
/**
The data source used to manage search in public rooms.
*/
@property (nonatomic, readonly) PublicRoomsDirectoryDataSource *publicRoomsDirectoryDataSource;
/**
Hide the public rooms directory cell. YES by default.
*/
@property (nonatomic) BOOL hidePublicRoomsDirectory;
/**
Hide recents. NO by default.
*/
@property (nonatomic) BOOL hideRecents;
/**
Return the header height from the section.
*/
- (CGFloat)heightForHeaderInSection:(NSInteger)section;
/**
Return true of the cell can be moved from a section to another one.
*/
- (BOOL)isDraggableCellAt:(NSIndexPath*)path;
/**
Return true of the cell can be moved from a section to another one.
*/
- (BOOL)canCellMoveFrom:(NSIndexPath*)oldPath to:(NSIndexPath*)newPath;
/**
Move a cell from a path to another one.
It is based on room Tag.