public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { _cell = _rootTableView.DequeueReusableCell(DetailedPostTableViewCell.Key, indexPath) as DetailedPostTableViewCell; _detailedPostView = _cell.DetailedPostView; (_cell.DetailedPostView.ViewPostBody as PostBodyView).Width = (int)_rootTableView.Frame.Width; var post = DataService.RepositoryController.RepositoryPost.GetOnePostById(PostId); var market = post.ModelPost.Market; _detailedPostView.SetPostMarket((EMarketTypes)Enum.Parse(typeof(EMarketTypes), market)); _interactor = new InteractorPost(PostId, new OnePostController(DataService.RepositoryController.RepositoryPost), DataService.NotificationCenter, DataService.RepositoryController.RepositoryPost, DataService.RepositoryController.RepoQc); var presenter = new PresenterPost( view: _cell.DetailedPostView, interactor: _interactor, router: new RouterPost(this), otherThemeStrings: ThemeHolder.PostOtherThemeStrings, headerStylesHolder: new PostHeaderStylesHolderIOS <GlobalControlsTheme>(iOS_DAL.ThemeParser), socialStylesHolder: new PostSocialStylesHolderIOS <GlobalControlsTheme>(iOS_DAL.ThemeParser), bodyStylesHolder: new PostBodyStylesHolderIOS <GlobalControlsTheme>(iOS_DAL.ThemeParser), postLocale: DataService.RepositoryController.RepositoryPost.LangPost, isPostDetailed: true ); PostHeightCounted = DetailedPostHeightCounted; (_cell.DetailedPostView.ViewPostBody as PostBodyView)?.SetActionOnCountingHeight(PostHeightCounted, 0); _cell.DetailedPostView.Presenter = presenter; (_interactor as InteractorPost).SendRequestForPosts(); presenter.SetConfigToolbar(); return(_cell); }
public PresenterPost(IViewPost view, IInteractorPost interactor, IRouterPost router, PostOtherThemeStrings otherThemeStrings, IPostHeaderStylesHolder headerStylesHolder, IPostSocialStylesHolder socialStylesHolder, IPostBodyStylesHolder bodyStylesHolder, IPost postLocale, bool isPostDetailed) { _view = view; _router = router; _interactor = interactor; _postLocale = postLocale; _isPostDetailed = isPostDetailed; _otherThemeStrings = otherThemeStrings; IPresenterPostHeader presenterPostHeader = new PresenterPostHeader(view.ViewPostHeader, interactor.InteractorPostHeader, router, DataService.RepositoryController.RepositoryPost.LangPost, headerStylesHolder); IPresenterPostBody presenterPostBody = new PresenterPostBody(view.ViewPostBody, interactor.InteractorPostBody, router, bodyStylesHolder, isPostDetailed); IPresenterPostSocial presenterPostSocial = new PresenterPostSocial(view.ViewPostSocial, interactor.InteractorPostSocial, router, DataService.RepositoryController.RepositoryPost.LangPost, socialStylesHolder); interactor.InteractorPostBody.Presenter = presenterPostBody; interactor.InteractorPostHeader.Presenter = presenterPostHeader; interactor.InteractorPostSocial.Presenter = presenterPostSocial; _view.SetConfig(); presenterPostHeader.SetConfig(); presenterPostSocial.SetConfig(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); RequestWindowFeature(WindowFeatures.NoTitle); SetContentView(Resource.Layout.PostDetailedActivity); var postView = FindViewById <PostDetailedView>(Resource.Id.detailedPost_postView); _postId = Intent.GetStringExtra("id"); var post = DataService.RepositoryController.RepositoryPost.GetOnePostById(_postId); var market = post.ModelPost.Market; postView.SetPostMarket((EMarketTypes)Enum.Parse(typeof(EMarketTypes), market)); _interactor = new InteractorPost(_postId, new OnePostController(DataService.RepositoryController.RepositoryPost), DataService.NotificationCenter, DataService.RepositoryController.RepositoryPost, DataService.RepositoryController.RepoQc); var presenter = new PresenterPost( view: postView, interactor: _interactor, router: new RouterPost(this), otherThemeStrings: ThemeHolder.PostOtherThemeStrings, headerStylesHolder: new PostHeaderStylesHolderDroid <GlobalControlsTheme>(DroidDAL.ThemeParser), socialStylesHolder: new PostSocialStylesHolderDroid <GlobalControlsTheme>(DroidDAL.ThemeParser), bodyStylesHolder: new PostBodyStylesHolderDroid <GlobalControlsTheme>(DroidDAL.ThemeParser), postLocale: DataService.RepositoryController.RepositoryPost.LangPost, isPostDetailed: true ); postView.Presenter = presenter; ((InteractorPost)_interactor).SendRequestForPosts(); presenter.SetConfigToolbar(); _globalTimer = GlobalTimer.GetInstance(); }