Skip to content

Commit

Permalink
#1899 (dashboard)
Browse files Browse the repository at this point in the history
- Renamed the old DashboardViewController as ActivitiesViewController, and cleaned up obsolete references to dashboard, to avoid confusion.
  • Loading branch information
Dejal committed Oct 30, 2024
1 parent f29b3f6 commit 99145a2
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 132 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// NBDashboardNavigationBar.h
// ActivitiesNavigationBar.h
// NewsBlur
//
// Created by Samuel Clay on 10/3/17.
Expand All @@ -8,6 +8,6 @@

#import <UIKit/UIKit.h>

@interface NBDashboardNavigationBar : UINavigationBar
@interface ActivitiesNavigationBar : UINavigationBar

@end
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// NBDashboardNavigationBar.m
// ActivitiesNavigationBar.m
// NewsBlur
//
// Created by Samuel Clay on 10/3/17.
// Copyright © 2017 NewsBlur. All rights reserved.
//

#import "NBDashboardNavigationBar.h"
#import "ActivitiesNavigationBar.h"

@implementation NBDashboardNavigationBar
@implementation ActivitiesNavigationBar

- (void)layoutSubviews
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
//
// DashboardViewController.h
// ActivitiesViewController.h
// NewsBlur
//
// Created by Roy Yang on 7/10/12.
// Copyright (c) 2012 NewsBlur. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "NBDashboardNavigationBar.h"
#import "ActivitiesNavigationBar.h"

@class NewsBlurAppDelegate;
@class InteractionsModule;
@class ActivityModule;
@class FeedbackModule;
@class FeedDetailViewController;

@interface DashboardViewController : UIViewController <UIPopoverControllerDelegate> {
@interface ActivitiesViewController : UIViewController <UIPopoverControllerDelegate> {
NewsBlurAppDelegate *appDelegate;
InteractionsModule *interactionsModule;
ActivityModule *activitiesModule;
UIToolbar *toolbar;
NBDashboardNavigationBar *topToolbar;
ActivitiesNavigationBar *topToolbar;
UISegmentedControl *segmentedButton;
}

@property (nonatomic) IBOutlet NewsBlurAppDelegate *appDelegate;
@property (nonatomic) IBOutlet InteractionsModule *interactionsModule;
@property (nonatomic) IBOutlet ActivityModule *activitiesModule;

@property (nonatomic) IBOutlet NBDashboardNavigationBar *topToolbar;
@property (nonatomic) IBOutlet ActivitiesNavigationBar *topToolbar;
@property (nonatomic) IBOutlet UIToolbar *toolbar;
@property (nonatomic) IBOutlet UISegmentedControl *segmentedButton;
@property (nonatomic) IBOutlet UIImageView *logoImageView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//
// DashboardViewController.m
// ActivitiesViewController.m
// NewsBlur
//
// Created by Roy Yang on 7/10/12.
// Copyright (c) 2012 NewsBlur. All rights reserved.
//

#import "DashboardViewController.h"
#import "ActivitiesViewController.h"
#import "NewsBlurAppDelegate.h"
#import "ActivityModule.h"
#import "InteractionsModule.h"
Expand All @@ -16,7 +16,7 @@
#import "UISearchBar+Field.h"
#import "NewsBlur-Swift.h"

@implementation DashboardViewController
@implementation ActivitiesViewController

@synthesize appDelegate;
@synthesize interactionsModule;
Expand Down
2 changes: 1 addition & 1 deletion clients/ios/Classes/FeedDetailTableCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "NewsBlurAppDelegate.h"
#import "FeedDetailTableCell.h"
#import "DashboardViewController.h"
#import "ActivitiesViewController.h"
#import "ABTableViewCell.h"
#import "UIView+TKCategory.h"
#import "UIImageView+AFNetworking.h"
Expand Down
45 changes: 8 additions & 37 deletions clients/ios/Classes/FeedsObjCViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

#import "FeedsObjCViewController.h"
#import "NewsBlurAppDelegate.h"
#import "DashboardViewController.h"
#import "ActivitiesViewController.h"
#import "InteractionsModule.h"
#import "ActivityModule.h"
#import "FeedTableCell.h"
#import "DashboardViewController.h"
#import "ActivitiesViewController.h"
#import "UserProfileViewController.h"
#import "MBProgressHUD.h"
#import "SBJson4.h"
Expand Down Expand Up @@ -344,37 +344,6 @@ - (void)viewDidAppear:(BOOL)animated {
[self becomeFirstResponder];
}

//- (void)handleGesture:(UIScreenEdgePanGestureRecognizer *)gesture {
// if ([[UIDevice currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPad) return;
//
// self.interactiveFeedDetailTransition = YES;
//
// CGPoint point = [gesture locationInView:self.view];
// CGFloat viewWidth = CGRectGetWidth(self.view.frame);
// CGFloat percentage = MIN(point.x, viewWidth) / viewWidth;
//// NSLog(@"back gesture: %d, %f - %f/%f", (int)gesture.state, percentage, point.x, viewWidth);
//
// if (gesture.state == UIGestureRecognizerStateBegan) {
//// if (appDelegate.storiesCollection.transferredFromDashboard) {
//// [appDelegate.dashboardViewController.storiesModule.storiesCollection
//// transferStoriesFromCollection:appDelegate.storiesCollection];
//// [appDelegate.dashboardViewController.storiesModule fadeSelectedCell:NO];
//// }
// } else if (gesture.state == UIGestureRecognizerStateChanged) {
// [appDelegate.masterContainerViewController interactiveTransitionFromFeedDetail:percentage];
// } else if (gesture.state == UIGestureRecognizerStateEnded) {
// CGPoint velocity = [gesture velocityInView:self.view];
// if (velocity.x > 0) {
// [appDelegate.masterContainerViewController transitionFromFeedDetail];
// } else {
//// // Returning back to view, cancelling pop animation.
//// [appDelegate.masterContainerViewController transitionToFeedDetail:NO];
// }
//
// self.interactiveFeedDetailTransition = NO;
// }
//}

- (void)fadeSelectedCell {
[self fadeCellWithIndexPath:[self.feedTitlesTable indexPathForSelectedRow]];
}
Expand Down Expand Up @@ -751,6 +720,8 @@ - (void)finishLoadingFeedListWithDict:(NSDictionary *)results finished:(BOOL)fin
appDelegate.dictSocialServices = [results objectForKey:@"social_services"];
appDelegate.userActivitiesArray = [results objectForKey:@"activities"];

appDelegate.dashboardArray = [results objectForKey:@"dashboard_rivers"];

appDelegate.isPremium = [[appDelegate.dictUserProfile objectForKey:@"is_premium"] integerValue] == 1;
appDelegate.isPremiumArchive = [[appDelegate.dictUserProfile objectForKey:@"is_archive"] integerValue] == 1;
id premiumExpire = [appDelegate.dictUserProfile objectForKey:@"premium_expire"];
Expand Down Expand Up @@ -1221,10 +1192,10 @@ - (IBAction)showInteractionsPopover:(id)sender {
CGSize size = CGSizeMake(self.view.frame.size.width - 36,
self.view.frame.size.height - 60);

[self.appDelegate showPopoverWithViewController:self.appDelegate.dashboardViewController contentSize:size barButtonItem:self.activitiesButton];
[self.appDelegate showPopoverWithViewController:self.appDelegate.activitiesViewController contentSize:size barButtonItem:self.activitiesButton];

[appDelegate.dashboardViewController refreshInteractions];
[appDelegate.dashboardViewController refreshActivity];
[appDelegate.activitiesViewController refreshInteractions];
[appDelegate.activitiesViewController refreshActivity];
}

- (void)handleLongPress:(UILongPressGestureRecognizer *)gestureRecognizer {
Expand Down Expand Up @@ -2532,7 +2503,7 @@ - (IBAction)selectIntelligence {
[self showExplainerOnEmptyFeedlist];

// if (!self.isPhone) {
// FeedDetailViewController *storiesModule = self.appDelegate.dashboardViewController.storiesModule;
// FeedDetailViewController *storiesModule = self.appDelegate.activitiesViewController.storiesModule;
//
// storiesModule.storiesCollection.feedPage = 0;
// storiesModule.storiesCollection.storyCount = 0;
Expand Down
2 changes: 1 addition & 1 deletion clients/ios/Classes/InteractionsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "SmallInteractionCell.h"
#import <QuartzCore/QuartzCore.h>
#import "UserProfileViewController.h"
#import "DashboardViewController.h"
#import "ActivitiesViewController.h"

#define MINIMUM_INTERACTION_HEIGHT_IPAD 78
#define MINIMUM_INTERACTION_HEIGHT_IPHONE 54
Expand Down
12 changes: 4 additions & 8 deletions clients/ios/Classes/NewsBlurAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
#define FEED_DETAIL_VIEW_TAG 1000001
#define STORY_DETAIL_VIEW_TAG 1000002
#define FEED_TITLE_GRADIENT_TAG 100003
#define FEED_DASHBOARD_VIEW_TAG 100004
#define SHARE_MODAL_HEIGHT 120
#define STORY_TITLES_HEIGHT 240
#define DASHBOARD_TITLE @"NewsBlur"

@class AppDelegateHelper;
@class SplitViewController;
@class FeedsViewController;
@class DashboardViewController;
@class ActivitiesViewController;
@class FeedDetailViewController;
@class MarkReadMenuViewController;
@class FirstTimeUserViewController;
Expand Down Expand Up @@ -73,7 +71,7 @@ SFSafariViewControllerDelegate> {
FirstTimeUserAddFriendsViewController *firstTimeUserAddFriendsViewController;
FirstTimeUserAddNewsBlurViewController *firstTimeUserAddNewsBlurViewController;

DashboardViewController *dashboardViewController;
ActivitiesViewController *activitiesViewController;
FeedsViewController *feedsViewController;
FeedDetailViewController *feedDetailViewController;
FriendsListViewController *friendsListViewController;
Expand Down Expand Up @@ -175,7 +173,7 @@ SFSafariViewControllerDelegate> {
@property (nonatomic) UINavigationController *userProfileNavigationController;
@property (nonatomic) UINavigationController *originalStoryViewNavController;
@property (nonatomic) IBOutlet DetailViewController *detailViewController;
@property (nonatomic) IBOutlet DashboardViewController *dashboardViewController;
@property (nonatomic) IBOutlet ActivitiesViewController *activitiesViewController;
@property (nonatomic) IBOutlet FeedsViewController *feedsViewController;
@property (nonatomic) IBOutlet FeedDetailViewController *feedDetailViewController;
@property (nonatomic, strong) UINavigationController *feedDetailMenuNavigationController;
Expand Down Expand Up @@ -255,7 +253,6 @@ SFSafariViewControllerDelegate> {
@property (nonatomic) NSMutableDictionary *collapsedFolders;
@property (nonatomic) UIFontDescriptor *fontDescriptorTitleSize;


@property (nonatomic) NSDictionary *dictFolders;
@property (nonatomic, strong) NSMutableDictionary *dictFeeds;
@property (nonatomic, strong) NSMutableDictionary *dictInactiveFeeds;
Expand All @@ -276,6 +273,7 @@ SFSafariViewControllerDelegate> {
@property (nonatomic) NSArray *userActivitiesArray;
@property (nonatomic) NSMutableArray *dictFoldersArray;
@property (nonatomic) NSArray *notificationFeedIds;
@property (nonatomic) NSArray *dashboardArray;

@property (nonatomic, readonly) NSString *widgetFolder;
@property (nonatomic, strong) NSString *pendingFolder;
Expand Down Expand Up @@ -352,8 +350,6 @@ SFSafariViewControllerDelegate> {
- (void)backgroundLoadNotificationStory;
- (void)loadStarredDetailViewWithStory:(NSString *)contentId showFindingStory:(BOOL)showHUD;
- (void)loadRiverFeedDetailView:(FeedDetailViewController *)feedDetailView withFolder:(NSString *)folder;
- (void)openDashboardRiverForStory:(NSString *)contentId
showFindingStory:(BOOL)showHUD;

- (void)loadStoryDetailView;
- (void)adjustStoryDetailWebView;
Expand Down
39 changes: 5 additions & 34 deletions clients/ios/Classes/NewsBlurAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

#import "NewsBlurAppDelegate.h"
#import "DashboardViewController.h"
#import "ActivitiesViewController.h"
#import "MarkReadMenuViewController.h"
#import "FirstTimeUserViewController.h"
#import "FriendsListViewController.h"
Expand Down Expand Up @@ -93,7 +93,7 @@ @implementation NewsBlurAppDelegate
@synthesize userProfileNavigationController;
//@synthesize masterContainerViewController;
@synthesize detailViewController;
@synthesize dashboardViewController;
@synthesize activitiesViewController;
@synthesize feedsViewController;
@synthesize feedDetailViewController;
@synthesize friendsListViewController;
Expand Down Expand Up @@ -1226,7 +1226,7 @@ - (void)prepareViewControllers {
self.detailNavigationController = (UINavigationController *)splitChildren[2];
self.detailViewController = self.detailNavigationController.viewControllers.firstObject;

self.dashboardViewController = [DashboardViewController new];
self.activitiesViewController = [ActivitiesViewController new];
self.friendsListViewController = [FriendsListViewController new];
self.storyDetailViewController = [StoryDetailViewController new];
self.loginViewController = [LoginViewController new];
Expand Down Expand Up @@ -1279,8 +1279,8 @@ - (void)showLogin {
[self.feedsViewController.feedTitlesTable reloadData];
[self.feedsViewController resetToolbar];

[self.dashboardViewController.interactionsModule.interactionsTable reloadData];
[self.dashboardViewController.activitiesModule.activitiesTable reloadData];
[self.activitiesViewController.interactionsModule.interactionsTable reloadData];
[self.activitiesViewController.activitiesModule.activitiesTable reloadData];

NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults];
[userPreferences setInteger:-1 forKey:@"selectedIntelligence"];
Expand Down Expand Up @@ -2147,35 +2147,6 @@ - (void)loadRiverFeedDetailView:(FeedDetailViewController *)feedDetailView withF
}];
}

- (void)openDashboardRiverForStory:(NSString *)contentId
showFindingStory:(BOOL)showHUD {
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
// [self.feedsNavigationController popToRootViewControllerAnimated:NO];
// [self.splitViewController showColumn:UISplitViewControllerColumnPrimary];
[self showFeedsListAnimated:NO];
[self.feedsNavigationController dismissViewControllerAnimated:YES completion:nil];
[self hidePopoverAnimated:NO];
}

self.inFindingStoryMode = YES;
[storiesCollection reset];
storiesCollection.isRiverView = YES;

self.tryFeedStoryId = contentId;
storiesCollection.activeFolder = @"everything";

[self loadRiverFeedDetailView:feedDetailViewController withFolder:@"river_dashboard"];

if (showHUD) {
if (!self.isPhone) {
[self.storyPagesViewController showShareHUD:@"Finding story..."];
} else {
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.feedDetailViewController.view animated:YES];
HUD.labelText = @"Finding story...";
}
}
}

- (void)adjustStoryDetailWebView {
// change the web view
[self.storyPagesViewController.currentPage changeWebViewWidth];
Expand Down
3 changes: 0 additions & 3 deletions clients/ios/Classes/StoriesCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
BOOL isRiverView;
BOOL isSocialView;
BOOL isSocialRiverView;
BOOL transferredFromDashboard;
BOOL inSearch;
NSString *searchQuery;
}
Expand Down Expand Up @@ -56,7 +55,6 @@
@property (nonatomic, readwrite) BOOL isSavedView;
@property (nonatomic, readwrite) BOOL isReadView;
@property (nonatomic, readwrite) BOOL isWidgetView;
@property (nonatomic, readwrite) BOOL transferredFromDashboard;
@property (nonatomic, readwrite) BOOL showHiddenStories;
@property (nonatomic, readwrite) BOOL inSearch;
@property (nonatomic, readonly) BOOL isEverything;
Expand All @@ -78,7 +76,6 @@
@property (nonatomic, readonly) NSString *storyTitlesPositionKey;
@property (nonatomic, readonly) NSString *storyViewKey;

- (id)initForDashboard;
- (void)reset;
- (void)transferStoriesFromCollection:(StoriesCollection *)fromCollection;

Expand Down
10 changes: 0 additions & 10 deletions clients/ios/Classes/StoriesCollection.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ @implementation StoriesCollection
@synthesize isSocialRiverView;
@synthesize isSavedView;
@synthesize isReadView;
@synthesize transferredFromDashboard;
@synthesize inSearch;
@synthesize searchQuery;

Expand All @@ -58,14 +57,6 @@ - (id)init {
return self;
}

- (id)initForDashboard {
if (self = [self init]) {

}

return self;
}

- (void)reset {
[self setStories:nil];
[self setFeedUserProfiles:nil];
Expand All @@ -77,7 +68,6 @@ - (void)reset {
self.activeFolderFeeds = nil;
self.activeClassifiers = [NSMutableDictionary dictionary];

self.transferredFromDashboard = NO;
self.isRiverView = NO;
self.isSocialView = NO;
self.isSocialRiverView = NO;
Expand Down
Loading

0 comments on commit 99145a2

Please sign in to comment.