public void DataFectched(ContentSourceProfile profile)
        {
            if (!string.IsNullOrEmpty(profile.PrimaryColor))
            {
                try
                {
                    (btnBack.Parent as ViewGroup).SetBackgroundColor(Color.ParseColor(profile.PrimaryColor));
                    (btnProfile.Parent as ViewGroup).SetBackgroundColor(Color.ParseColor(profile.PrimaryColor));
                }
                catch
                {
                }
            }

            lblTitle.Text = profile.Name;
            (fragments[1] as ContentSourceAboutFragment).SetData(profile);
        }
Exemplo n.º 2
0
        public void SetData(ContentSourceProfile profile)
        {
            this.profile = profile;

            if (!string.IsNullOrEmpty(profile.FacebookLink))
            {
                (btnFacebook.Parent.Parent as ViewGroup).Visibility = ViewStates.Visible;
            }
            if (!string.IsNullOrEmpty(profile.TwitterLink))
            {
                (btnTwitter.Parent.Parent as ViewGroup).Visibility = ViewStates.Visible;
            }
            if (!string.IsNullOrEmpty(profile.InstagramLink))
            {
                (btnInstagram.Parent.Parent as ViewGroup).Visibility = ViewStates.Visible;
            }
        }
        public void SetView(ContentSourceProfile profile)
        {
            this.profile = profile;

            if (!string.IsNullOrEmpty(profile.TwitterLink))
            {
                btnTwitter.Superview.Hidden = false;
            }
            if (!string.IsNullOrEmpty(profile.FacebookLink))
            {
                btnFacebook.Superview.Hidden = false;
            }
            if (!string.IsNullOrEmpty(profile.InstagramLink))
            {
                btnInstagram.Superview.Hidden = false;
            }
        }
Exemplo n.º 4
0
        void GetData()
        {
            var apiTask = new ServiceApi().GetContentSourceProfile(ContentSourceId);

            apiTask.HandleError(ActivityProgresDialog);
            apiTask.OnSucess(ActivityProgresDialog, response =>
            {
                profile = response.Result;
                btnActionButton.Text = profile.ActionButtonText;
                if (!string.IsNullOrEmpty(response.Result.PrimaryColor))
                {
                    try
                    {
                        btnActionButton.SetTextColor(Color.ParseColor(response.Result.PrimaryColor));
                    }
                    catch
                    {
                    }
                }

                (Activity as ContentSourceActivity)?.DataFectched(response.Result);
                lblName.Text      = response.Result.Name;
                lblPosts.Text     = LargeValueHelper.GetString(response.Result.Posts);
                lblFollowers.Text = LargeValueHelper.GetString(response.Result.Followers);
                try
                {
                    if (!response.Result.WebsiteLink.StartsWith("http://") && !response.Result.WebsiteLink.StartsWith("https://"))
                    {
                        response.Result.WebsiteLink = "http://" + response.Result.WebsiteLink;
                    }
                    lblUrl.Text = new Uri(response.Result.WebsiteLink).Host;
                }
                catch (Exception e)
                {
                }
                lblDescription.Text = response.Result.Description;
                isFollowing         = response.Result.IsFollowing;
                Views.SetFollowed(btnFollow, isFollowing);

                if (!string.IsNullOrEmpty(response.Result.ProfileUrl))
                {
                    ImageService.Instance.LoadUrl(response.Result.ProfileUrl).Transform(new CircleTransformation()).Retry(3, 300).Into(imgProfile);
                }
            });
        }
Exemplo n.º 5
0
        void GetData()
        {
            var apiTask = new ServiceApi().GetContentSourceProfile(ContentSourceId);

            apiTask.HandleError();
            apiTask.OnSucess(response =>
            {
                profile = response.Result;
                btnSignUp.SetTitle(profile.ActionButtonText, UIControlState.Normal);

                var color = ColorHelper.GetColor(profile.PrimaryColor, btnBack.Superview.BackgroundColor);
                btnSignUp.SetTitleColor(color, UIControlState.Normal);
                btnBack.Superview.BackgroundColor = color;
                btnProfile.Superview.Superview.BackgroundColor = color;

                aboutController.SetView(profile);
                lblName.Text      = response.Result.Name;
                lblTitle.Text     = response.Result.Name;
                lblPosts.Text     = LargeValueHelper.GetString(response.Result.Posts);
                lblFollowers.Text = LargeValueHelper.GetString(response.Result.Followers);
                try
                {
                    if (!response.Result.WebsiteLink.StartsWith("http://") && !response.Result.WebsiteLink.StartsWith("https://"))
                    {
                        response.Result.WebsiteLink = "http://" + response.Result.WebsiteLink;
                    }
                    lblUrl.Text = new Uri(response.Result.WebsiteLink).Host;
                }
                catch (Exception e)
                {
                }
                lblDescription.Text = response.Result.Description;
                Views.SetFollowed(btnFollow, response.Result.IsFollowing);

                if (!string.IsNullOrEmpty(response.Result.ProfileUrl))
                {
                    ImageService.Instance.LoadUrl(response.Result.ProfileUrl).Transform(new CircleTransformation()).Retry(3, 300).Into(imgProfile);
                }
            });
        }