예제 #1
0
        public void SetPostMarket(EMarketTypes type)
        {
            var headerContainer = FindViewById(Resource.Id.post_postHeader_container) as ViewGroup;

            switch (type)
            {
            case EMarketTypes.Simple:
                if (headerContainer?.ChildCount == 0)
                {
                    _inflater.Inflate(Resource.Layout.PostSimpleHeaderView, headerContainer);
                    ViewPostHeader = FindViewById <PostSimpleHeaderView>(Resource.Id.post_postHeader_simplelayout);
                }
                break;

            case EMarketTypes.Currency:
            case EMarketTypes.Stock:
            case EMarketTypes.Crypto:
            case EMarketTypes.Commodity:
            case EMarketTypes.Index:
            default:

                if (headerContainer?.ChildCount == 0)
                {
                    _inflater.Inflate(Resource.Layout.PostHeaderView, headerContainer);
                    ViewPostHeader = FindViewById <PostHeaderView>(Resource.Id.post_postHeader_layout);
                }

                break;
            }
            FindViews();
        }
예제 #2
0
        public void SetConfig(IRepositoryPost repository, IRepositoryQc repositoryQc, INotificationCenter notification, PostOtherThemeStrings otherThemeStrings,
                              PostsViewController viewController, string id, int bodyWidth, int row, Action <int, nfloat> postHeightCounted, nfloat height)
        {
            var post = DataService.RepositoryController.RepositoryPost.GetOnePostById(id);

            _market = (EMarketTypes)Enum.Parse(typeof(EMarketTypes), post.ModelPost.Market);
            PostView.SetPostMarket(_market);

            Console.WriteLine(_market + "   " + post.ModelPost.Content);

            PostInteractor = new InteractorPost(id, new OnePostController(DataService.RepositoryController.RepositoryPost), notification, repository, repositoryQc);
            var presenter = new PresenterPost(
                view:               PostView,
                interactor:         PostInteractor,
                router:             new RouterPost(viewController),
                otherThemeStrings:  otherThemeStrings,
                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:     false
                );

            SetCellWidth(bodyWidth);
            TransfareActionToView(postHeightCounted, row);

            PostInteractor.SendRequestForPosts();

            var fr = PostView.Frame;

            fr.Height      = height;
            PostView.Frame = fr;
        }
예제 #3
0
        public void SetPostMarket(EMarketTypes type)
        {
            InvokeOnMainThread(() =>
            {
                foreach (var item in _postHeaderContainer.Subviews)
                {
                    item.RemoveFromSuperview();
                }
                var constr = _postHeaderContainer.Constraints;
                _postHeaderContainer.RemoveConstraints(constr);
            });

            if (type == EMarketTypes.Simple)
            {
                CreateHeader(new PostSimpleHeaderView(), 80);                   // header height 80
            }
            else
            {
                CreateHeader(new PostHeaderView(), 160);                        // header height 160
            }
        }