public async void GetDataChannelApi() { try { if (ListUtils.MyChannelList.Count == 0) { await ApiRequest.GetChannelData(Activity, UserDetails.UserId); } var dataChannel = ListUtils.MyChannelList.FirstOrDefault(); if (dataChannel != null) { var name = AppTools.GetNameFinal(dataChannel); CollapsingToolbar.Title = name; ChannelNameText.Text = name; GlideImageLoader.LoadImage(Activity, dataChannel.Avatar, ImageChannel, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); Glide.With(this).Load(dataChannel.Cover).Apply(new RequestOptions().FitCenter()).Into(ImageCoverChannel); if (dataChannel.Verified == "1") { ChannelVerifiedText.Visibility = ViewStates.Visible; } } } catch (Exception exception) { Console.WriteLine(exception); } }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { if (viewHolder is NotificationAdapterViewHolder holder) { var item = NotificationList[position]; if (item != null) { GlideImageLoader.LoadImage(ActivityContext, item.Userdata.Avatar, holder.NotificationImage, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); if (item.Title.Contains("added")) { FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.NotificationIcon, IonIconsFonts.Videocamera); holder.NotifcationEvent.Text = item.Title == "added a new video" ? ActivityContext.GetText(Resource.String.Lbl_Notif_Added) : item.Title; } else if (item.Title.Contains("unsubscribed")) { FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.NotificationIcon, IonIconsFonts.PersonAdd); holder.NotifcationEvent.Text = item.Title == "unsubscribed from your channel" ? ActivityContext.GetText(Resource.String.Lbl_Notif_Unsubscribed) : item.Title; } else if (item.Title.Contains("subscribed")) { FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.NotificationIcon, IonIconsFonts.PersonAdd); holder.NotifcationEvent.Text = item.Title == "subscribed to your channel" ? ActivityContext.GetText(Resource.String.Lbl_Notif_Subscribed) : item.Title; } else if (item.Title.Contains("disliked")) { FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.NotificationIcon, IonIconsFonts.Thumbsdown); holder.NotifcationEvent.Text = item.Title == "disliked your video" ? ActivityContext.GetText(Resource.String.Lbl_Notif_Disliked) : item.Title; } else if (item.Title.Contains("liked")) { FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.NotificationIcon, IonIconsFonts.Thumbsup); holder.NotifcationEvent.Text = item.Title == "liked your video" ? ActivityContext.GetText(Resource.String.Lbl_Notif_Liked) : item.Title; } else if (item.Title.Contains("commented")) { FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.NotificationIcon, IonIconsFonts.Chatboxes); holder.NotifcationEvent.Text = item.Title == "commented on your video" ? ActivityContext.GetText(Resource.String.Lbl_Notif_Commented) : item.Title; } else { FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.NotificationIcon, IonIconsFonts.AndroidNotifications); holder.NotifcationEvent.Text = item.Title; } holder.Username.Text = AppTools.GetNameFinal(item.Userdata); holder.NotificationTime.Text = item.Time; } } } catch (Exception exception) { Console.WriteLine(exception); } }
private void LoadReplies() { try { if (Comment == null) { return; } GlideImageLoader.LoadImage(ActivityContext, Comment.CommentUserData.Avatar, Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); TextSanitizer chnager = new TextSanitizer(CommentText, ActivityContext); chnager.Load(Methods.FunString.DecodeString(Comment.Text)); TimeTextView.Text = Comment.TextTime; UsernameTextView.Text = AppTools.GetNameFinal(Comment.CommentUserData); LikeNumber.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(Comment.Likes)); UnLikeNumber.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(Comment.DisLikes)); RepliesCount.Text = Comment.RepliesCount.ToString(); if (Comment.IsLikedComment == 1) { LikeiconView.SetColorFilter(Color.ParseColor(AppSettings.MainColor)); LikeButton.Tag = "1"; } else { LikeButton.Tag = "0"; } if (Comment.IsDislikedComment == 1) { UnLikeiconView.SetColorFilter(Color.ParseColor(AppSettings.MainColor)); UnLikeButton.Tag = "1"; } else { UnLikeButton.Tag = "0"; } if (Comment.CommentReplies?.Count > 0) { ReplyAdapter.ReplyList = new ObservableCollection <ReplyObject>(Comment.CommentReplies); ReplyAdapter.NotifyDataSetChanged(); EmptyStateLayout.Visibility = ViewStates.Gone; } string offset = ReplyAdapter.ReplyList.LastOrDefault()?.Id.ToString() ?? "0"; StartApiService(offset); } catch (Exception e) { Console.WriteLine(e); } }
public static async Task <UserDataObject> GetChannelData(Activity activity, string userId) { if (!Methods.CheckConnectivity()) { return(null); } var(apiStatus, respond) = await RequestsAsync.Global.Get_Channel_Info_HttP(userId); if (apiStatus == 200) { if (respond is GetChannelInfoObject result) { if (userId == UserDetails.UserId) { UserDetails.Avatar = result.DataResult.Avatar; UserDetails.Cover = result.DataResult.Cover; UserDetails.Username = result.DataResult.Username; UserDetails.FullName = AppTools.GetNameFinal(result.DataResult); ListUtils.MyChannelList.Clear(); ListUtils.MyChannelList.Add(result.DataResult); try { var profileImage = TabbedMainActivity.GetInstance()?.FragmentBottomNavigator?.ProfileImage; if (profileImage != null) { GlideImageLoader.LoadImage(activity, UserDetails.Avatar, profileImage, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); } } catch (Exception e) { Console.WriteLine(e); } var sqlEntity = new SqLiteDatabase(); sqlEntity.InsertOrUpdate_DataMyChannel(result.DataResult); sqlEntity.Dispose(); return(result.DataResult); } else { return(result.DataResult); } } } else { Methods.DisplayReportResult(activity, respond); } return(null); }
private void Initialize(ContactsAdapterViewHolder holder, UserDataObject users) { try { GlideImageLoader.LoadImage(ActivityContext, users.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); holder.Name.Text = Methods.FunString.SubStringCutOf(AppTools.GetNameFinal(users), 25); if (Type == TypeTextSecondary.None) { holder.About.Visibility = ViewStates.Gone; } else { holder.About.Text = Type == TypeTextSecondary.About ? Methods.FunString.SubStringCutOf(AppTools.GetAboutFinal(users), 25) : ActivityContext.GetString(Resource.String.Lbl_Last_seen) + " " + Methods.Time.TimeAgo(int.Parse(users.LastSeen)); } if (ShowButton) { switch (users.IsFollowing) { // My Friend case true: { holder.Button.SetBackgroundResource(Resource.Xml.background_signup2); holder.Button.SetTextColor(Color.ParseColor("#ffffff")); holder.Button.Text = ActivityContext.GetText(Resource.String.Lbl_Following); holder.Button.Tag = "true"; break; } case false: { holder.Button.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); holder.Button.SetTextColor(Color.ParseColor(AppSettings.MainColor)); holder.Button.Text = ActivityContext.GetText(Resource.String.Lbl_Follow); holder.Button.Tag = "false"; break; } } if (users.UserId.ToString() == UserDetails.UserId) { holder.Button.Visibility = ViewStates.Gone; } } } catch (Exception e) { Console.WriteLine(e); } }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { if (viewHolder is AllChannelSubscribedAdapterViewHolder holder) { if (AppSettings.FlowDirectionRightToLeft) { holder.RelativeLayoutMain.LayoutDirection = LayoutDirection.Rtl; holder.TxtNamechannal.TextDirection = TextDirection.Rtl; } var item = ChannelList[position]; if (item != null) { GlideImageLoader.LoadImage(ActivityContext, item.Avatar, holder.ImgChannel, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); holder.TxtNamechannal.Text = AppTools.GetNameFinal(item); //Verified if (item.Verified == "1") { holder.IconVerified.Visibility = ViewStates.Visible; FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.IconVerified, IonIconsFonts.CheckmarkCircled); } else { holder.IconVerified.Visibility = ViewStates.Gone; } holder.BtnSubcribeChannel.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends_pressed); holder.BtnSubcribeChannel.SetTextColor(Color.ParseColor("#ffffff")); holder.BtnSubcribeChannel.Text = ActivityContext.GetText(Resource.String.Btn_Subscribed); holder.BtnSubcribeChannel.Tag = "Subscribed"; if (!holder.BtnSubcribeChannel.HasOnClickListeners) { holder.BtnSubcribeChannel.Click += (sender, e) => OnSubscribeButtOnClick(new AllChannelSubscribedClickEventArgs { View = holder.ItemView, UserClass = item, Position = position, ButtonSubscribed = holder.BtnSubcribeChannel }); } } } } catch (Exception exception) { Console.WriteLine(exception); } }
public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { if (viewHolder is MentionAdapterViewHolder holder) { var item = MentionList[position]; if (item != null) { holder.CheckBox.Checked = item.Selected; holder.CheckBox.SetOnCheckedChangeListener(null); if (!holder.MainView.HasOnClickListeners) { holder.MainView.Click += (sender, args) => { if (holder.CheckBox.Checked) { holder.CheckBox.Checked = false; item.Selected = false; NotifyItemChanged(position); } else { holder.CheckBox.Checked = true; item.Selected = true; NotifyItemChanged(position); } } } ; GlideImageLoader.LoadImage(ActivityContext, item.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); holder.Name.Text = AppTools.GetNameFinal(item); holder.About.Text = Methods.FunString.SubStringCutOf(AppTools.GetAboutFinal(item), 25); } } } catch (Exception exception) { Console.WriteLine(exception); } }
private async void LoadProfile() { try { //var dataUser = new SqLiteDatabase().GetMyProfile(); if (ListUtils.MyProfileList.Count == 0) { await ApiRequest.GetProfile_Api(Activity); } var data = ListUtils.MyProfileList.FirstOrDefault(); if (data != null) { GlideImageLoader.LoadImage(Activity, data.Avatar, UserProfileImage, ImageStyle.RoundedCrop, ImagePlaceholders.Color); TxtName.Text = AppTools.GetNameFinal(data); TxtUsername.Text = data.Username; TextSanitizerAutoLink.Load(AppTools.GetAboutFinal(data)); TxtCountFav.Text = Methods.FunString.FormatPriceValue(Int32.Parse(data.Favourites)); IconVerified.Visibility = data.Verified == "1" ? ViewStates.Visible : ViewStates.Gone; IconBusiness.Visibility = data.BusinessAccount == "1" ? ViewStates.Visible : ViewStates.Gone; if (data.Followers != null && int.TryParse(data.Followers, out var numberFollowers)) { TxtCountFollowers.Text = Methods.FunString.FormatPriceValue(numberFollowers); } if (data.Following != null && int.TryParse(data.Following, out var numberFollowing)) { TxtCountFollowing.Text = Methods.FunString.FormatPriceValue(numberFollowing); } } } catch (Exception e) { Console.WriteLine(e); } }
public override Object InstantiateItem(ViewGroup view, int position) { try { View layout = Inflater.Inflate(Resource.Layout.ImageCoursalLayout, view, false); var mainFeaturedVideo = layout.FindViewById <ImageView>(Resource.Id.Imagevideo); var channelImage = layout.FindViewById <ImageView>(Resource.Id.Image_Channel); var channelName = layout.FindViewById <TextView>(Resource.Id.Channel_Name); FeaturedVideoTitle = layout.FindViewById <TextView>(Resource.Id.TitleFeaturedVideo); channelName.Text = AppTools.GetNameFinal(VideoList[position].Owner); FeaturedVideoTitle.Text = Methods.FunString.DecodeString(VideoList[position].Title); GlideImageLoader.LoadImage(Context, VideoList[position].Thumbnail, mainFeaturedVideo, ImageStyle.CenterCrop, ImagePlaceholders.Drawable); GlideImageLoader.LoadImage(Context, VideoList[position].Owner.Avatar, channelImage, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); mainFeaturedVideo.Click += (sender, args) => { TabbedMainActivity.GetInstance()?.StartPlayVideo(VideoList[position]); }; channelImage.Click += (sender, args) => { TabbedMainActivity.GetInstance()?.ShowUserChannelFragment(VideoList[position].Owner, VideoList[position].Owner.Id); }; FeaturedVideoTitle.Click += (sender, args) => { TabbedMainActivity.GetInstance()?.StartPlayVideo(VideoList[position]); }; view.AddView(layout); return(layout); } catch (Exception e) { Console.WriteLine(e); return(null); } }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { if (viewHolder is VideoHorizontalAdapterViewHolder holder) { var item = VideoList[position]; if (item != null) { GlideImageLoader.LoadImage(ActivityContext, item.Thumbnail, holder.VideoImage, ImageStyle.CenterCrop, ImagePlaceholders.Drawable); holder.TxtDuration.Text = Methods.FunString.SplitStringDuration(item.Duration); holder.TxtTitle.Text = Methods.FunString.DecodeString(item.Title); holder.TxtChannelName.Text = AppTools.GetNameFinal(item.Owner); holder.TxtViewsCount.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(item.Views)) + " " + ActivityContext.GetText(Resource.String.Lbl_Views); //Verified if (item.Owner.Verified == "1") { holder.IconVerified.Visibility = ViewStates.Visible; FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.IconVerified, IonIconsFonts.CheckmarkCircled); } else { holder.IconVerified.Visibility = ViewStates.Gone; } //Set Badge on videos AppTools.ShowGlobalBadgeSystem(holder.VideoType, item); } } } catch (Exception exception) { Console.WriteLine(exception); } }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { Position = position; var item = SubscriptionsList[Position]; if (item != null) { if (item.Type == ItemType.Channel) { if (viewHolder is SubscriptionsAdapterViewHolder holder) { if (ChannelAdapter == null) { ChannelAdapter = new ChannelAdapter(ActivityContext) { ChannelList = new ObservableCollection <UserDataObject>() }; LinearLayoutManager layoutManager = new LinearLayoutManager(ActivityContext, LinearLayoutManager.Horizontal, false); holder.MRecycler.SetLayoutManager(layoutManager); holder.MRecycler.GetLayoutManager().ItemPrefetchEnabled = true; var sizeProvider = new FixedPreloadSizeProvider(10, 10); var preLoader = new RecyclerViewPreloader <UserDataObject>(ActivityContext, ChannelAdapter, sizeProvider, 10); holder.MRecycler.AddOnScrollListener(preLoader); holder.MRecycler.SetAdapter(ChannelAdapter); ChannelAdapter.ItemClick += ChannelAdapterOnOnItemClick; } if (item.ChannelList.Count > 0) { if (ChannelAdapter.ChannelList.Count == 0) { ChannelAdapter.ChannelList = new ObservableCollection <UserDataObject>(item.ChannelList); ChannelAdapter.NotifyDataSetChanged(); } else if (ChannelAdapter.ChannelList != null && ChannelAdapter.ChannelList.Count != item.ChannelList.Count) { ChannelAdapter.ChannelList = new ObservableCollection <UserDataObject>(item.ChannelList); ChannelAdapter.NotifyDataSetChanged(); } } holder.MainLinear.Visibility = ViewStates.Visible; holder.MoreText.Visibility = ChannelAdapter.ChannelList?.Count >= 5 ? ViewStates.Visible : ViewStates.Invisible; holder.TitleText.Text = ActivityContext.GetString(Resource.String.Lbl_All_Channal); } } else if (item.Type == ItemType.Video) { if (viewHolder is VideoRowAdapterViewHolder videoRow) { GlideImageLoader.LoadImage(ActivityContext, item.VideoData.Thumbnail, videoRow.VideoImage, ImageStyle.CenterCrop, ImagePlaceholders.Drawable); videoRow.TxtDuration.Text = Methods.FunString.SplitStringDuration(item.VideoData.Duration); videoRow.TxtTitle.Text = Methods.FunString.DecodeString(item.VideoData.Title); videoRow.TxtChannelName.Text = AppTools.GetNameFinal(item.VideoData.Owner); videoRow.TxtViewsCount.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(item.VideoData.Views)) + " " + ActivityContext.GetText(Resource.String.Lbl_Views); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, videoRow.MenueView, IonIconsFonts.AndroidMoreVertical); //Verified if (item.VideoData.Owner.Verified == "1") { videoRow.IconVerified.Visibility = ViewStates.Visible; FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, videoRow.IconVerified, IonIconsFonts.CheckmarkCircled); } else { videoRow.IconVerified.Visibility = ViewStates.Gone; } if (!videoRow.MenueView.HasOnClickListeners) { videoRow.MenueView.Click += (sender, args) => { ContextThemeWrapper ctw = new ContextThemeWrapper(ActivityContext, Resource.Style.PopupMenuStyle); PopupMenu popup = new PopupMenu(ctw, videoRow.MenueView); popup.MenuInflater.Inflate(Resource.Menu.Video_More_Menue, popup.Menu); popup.Show(); popup.MenuItemClick += (o, eventArgs) => { try { var id = eventArgs.Item.ItemId; switch (id) { case Resource.Id.menu_AddWatchLater: LibrarySynchronizer.AddToWatchLater(item.VideoData); break; case Resource.Id.menu_AddPlaylist: LibrarySynchronizer.AddToPlaylist(item.VideoData); break; case Resource.Id.menu_Remove: OnMenuRemove_Click(item.VideoData); break; case Resource.Id.menu_Share: LibrarySynchronizer.ShareVideo(item.VideoData); break; case Resource.Id.menu_Report: LibrarySynchronizer.AddReportVideo(item.VideoData); break; } } catch (Exception exception) { Console.WriteLine(exception); } }; } } ; //Set Badge on videos AppTools.ShowGlobalBadgeSystem(videoRow.VideoType, item.VideoData); } } } } catch (Exception exception) { Console.WriteLine(exception); } }
private async void AddStoryButtonOnClick(object sender, EventArgs e) { try { if (Methods.CheckConnectivity()) { //Show a progress AndHUD.Shared.Show(this, GetText(Resource.String.Lbl_Loading)); string time = Methods.Time.TimeAgo(DateTime.Now); int unixTimestamp = (int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds; string time2 = unixTimestamp.ToString(); var attach = new Attachments { Id = 0, TypeAttachment = "file", FileSimple = PathStory, FileUrl = PathStory, }; (int respondCode, var respondString) = await RequestsAsync.Story.CreateStory(attach); if (respondCode == 200) { if (respondString is CreateStoryObject storyObject) { AndHUD.Shared.ShowSuccess(this, GetText(Resource.String.Lbl_Done), MaskType.Clear, TimeSpan.FromSeconds(3)); var check = GlobalContext?.NewsFeedFragment?.StoryAdapter?.StoryList?.FirstOrDefault(a => a.UserId == Convert.ToInt32(UserDetails.UserId)); if (check != null) { check.Stories.Add(new FetchStoriesObject.Story() { UserId = Convert.ToInt32(UserDetails.UserId), Id = storyObject.Id, Caption = EmojisIconEditText.Text, Owner = true, TimeText = time, Time = time2, Type = Type, MediaFile = PathStory }); } else { var userData = ListUtils.MyProfileList.FirstOrDefault(); List <FetchStoriesObject.Story> storiesList = new List <FetchStoriesObject.Story> { new FetchStoriesObject.Story() { UserId = Convert.ToInt32(UserDetails.UserId), Id = storyObject.Id, Caption = EmojisIconEditText.Text, Owner = true, TimeText = time, Time = time2, Type = Type, MediaFile = PathStory, Duration = Duration.ToString(), } }; GlobalContext?.NewsFeedFragment?.StoryAdapter?.StoryList?.Add(new FetchStoriesObject.Data() { Id = storyObject.Id, Avatar = userData?.Avatar ?? UserDetails.Avatar, Type = "", Username = UserDetails.FullName, Owner = true, UserId = Convert.ToInt32(UserDetails.UserId), Stories = new List <FetchStoriesObject.Story>(storiesList), Name = AppTools.GetNameFinal(userData) ?? UserDetails.Username, Time = time2, Caption = EmojisIconEditText.Text, MediaFile = PathStory, Duration = Duration.ToString(), }); } GlobalContext?.NewsFeedFragment?.StoryAdapter?.NotifyDataSetChanged(); Finish(); } } else { Methods.DisplayReportResult(this, respondString); } AndHUD.Shared.Dismiss(this); } else { Toast.MakeText(this, GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show(); } } catch (Exception exception) { Console.WriteLine(exception); AndHUD.Shared.Dismiss(this); } }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { if (viewHolder is ActivitiesAdapterViewHolder holder) { var item = ActivitiesList[position]; if (item != null) { GlideImageLoader.LoadImage(ActivityContext, item.Image, holder.ImageAct, ImageStyle.CenterCrop, ImagePlaceholders.Drawable); if (TabbedMainActivity.GetInstance()?.UserChannelFragment == null) { var dataChannel = ListUtils.MyChannelList.FirstOrDefault(); if (dataChannel != null) { item.UserData = dataChannel; GlideImageLoader.LoadImage(ActivityContext, dataChannel.Avatar, holder.ImageUser, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); holder.NameUser.Text = AppTools.GetNameFinal(dataChannel); } } else { var dataChannel = TabbedMainActivity.GetInstance()?.UserChannelFragment?.UserData; if (dataChannel != null) { item.UserData = dataChannel; GlideImageLoader.LoadImage(ActivityContext, dataChannel.Avatar, holder.ImageUser, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); holder.NameUser.Text = AppTools.GetNameFinal(dataChannel); } } holder.TimeUser.Text = Methods.Time.TimeAgo(Convert.ToInt32(item.Time), false); holder.ContentAct.Text = Methods.FunString.DecodeString(item.Text); switch (item.IsLiked) { case "0": FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeRegular, holder.IconLikeAct, FontAwesomeIcon.ThumbsUp); holder.IconLikeAct.SetTextColor(Color.ParseColor("#444444")); holder.LikeActLayout.Tag = "Like"; break; case "1": FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeSolid, holder.IconLikeAct, FontAwesomeIcon.ThumbsUp); holder.IconLikeAct.SetTextColor(Color.ParseColor("#4caf50")); holder.LikeActLayout.Tag = "Liked"; break; default: FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeRegular, holder.IconLikeAct, FontAwesomeIcon.ThumbsUp); holder.IconLikeAct.SetTextColor(Color.ParseColor("#444444")); holder.LikeActLayout.Tag = "Like"; break; } holder.CountLikeAct.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(item.Likes)); switch (item.IsDisliked) { case "0": FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeRegular, holder.IconDislikeAct, FontAwesomeIcon.ThumbsDown); holder.IconDislikeAct.SetTextColor(Color.ParseColor("#444444")); holder.DislikeActLayout.Tag = "Dislike"; break; case "1": FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeSolid, holder.IconDislikeAct, FontAwesomeIcon.ThumbsDown); holder.IconDislikeAct.SetTextColor(Color.ParseColor("#4caf50")); holder.DislikeActLayout.Tag = "Disliked"; break; default: FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeRegular, holder.IconDislikeAct, FontAwesomeIcon.ThumbsDown); holder.IconDislikeAct.SetTextColor(Color.ParseColor("#444444")); holder.DislikeActLayout.Tag = "Dislike"; break; } holder.CountDislikeAct.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(item.Dislikes)); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeRegular, holder.IconCommentAct, FontAwesomeIcon.CommentDots); holder.CountCommentAct.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(item.CommentsCount)); } } } catch (Exception exception) { Console.WriteLine(exception); } }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { if (viewHolder is ChannelAdapterViewHolder holder) { var item = ChannelList[position]; if (item != null) { if (AppSettings.FlowDirectionRightToLeft) { holder.RelativeLayoutMain.LayoutDirection = LayoutDirection.Rtl; holder.TxtNamechannal.TextDirection = TextDirection.Rtl; } GlideImageLoader.LoadImage(ActivityContext, item.Avatar, holder.ImgChannel, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); holder.TxtNamechannal.Text = Methods.FunString.SubStringCutOf(AppTools.GetNameFinal(item), 16); //Verified if (item.Verified == "1") { holder.IconVerified.Visibility = ViewStates.Visible; FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.IconVerified, IonIconsFonts.CheckmarkCircled); } else { holder.IconVerified.Visibility = ViewStates.Gone; } } } } catch (Exception exception) { Console.WriteLine(exception); } }
private async void LoadProfile() { try { if (ListUtils.MyProfileList.Count == 0) { await ApiRequest.GetProfile_Api(Activity); } var data = ListUtils.MyProfileList.FirstOrDefault(); if (data != null) { GlideImageLoader.LoadImage(Activity, data.Avatar, ImageUser, ImageStyle.CircleCrop, ImagePlaceholders.Color); //TxtFullName.Text = AppTools.GetNameFinal(data); CollapsingToolbar.Title = AppTools.GetNameFinal(data); TxtUserName.Text = "@" + data.Username; TxtPostCount.Text = Methods.FunString.FormatPriceValue(Int32.Parse(data.Favourites)); if (data.Followers != null && int.TryParse(data.Followers, out var numberFollowers)) { TxtFollowersCount.Text = Methods.FunString.FormatPriceValue(numberFollowers); } if (data.Following != null && int.TryParse(data.Following, out var numberFollowing)) { TxtFollowingCount.Text = Methods.FunString.FormatPriceValue(numberFollowing); } var font = Typeface.CreateFromAsset(Application.Context.Resources.Assets, "ionicons.ttf"); TxtFullName.SetTypeface(font, TypefaceStyle.Normal); var textHighLighter = AppTools.GetNameFinal(data); var textIsPro = string.Empty; if (data.Verified == "1") { textHighLighter += " " + IonIconsFonts.CheckmarkCircled; } if (data.BusinessAccount == "1") { textIsPro = " " + IonIconsFonts.SocialUsd; textHighLighter += textIsPro; } var decorator = TextDecorator.Decorate(TxtFullName, textHighLighter); if (data.Verified == "1") { decorator.SetTextColor(Resource.Color.Post_IsVerified, IonIconsFonts.CheckmarkCircled); } if (data.BusinessAccount == "1") { decorator.SetTextColor(Resource.Color.Post_IsBusiness, IonIconsFonts.SocialUsd); } decorator.Build(); } } catch (Exception e) { Console.WriteLine(e); } }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { if (viewHolder is PopChannelRowAdapterViewHolder holder) { var item = ChannelList[position]; if (item != null) { GlideImageLoader.LoadImage(ActivityContext, item.UserData.Avatar, holder.ImgChannel, ImageStyle.CenterCrop, ImagePlaceholders.Drawable); holder.TxtNamechannal.Text = Methods.FunString.SubStringCutOf(AppTools.GetNameFinal(item.UserData), 16); holder.TxtViews.Text = item.Views + " " + ActivityContext.GetText(Resource.String.Lbl_Views); holder.TxtSubscribers.Text = item.SubscribersCount + " " + ActivityContext.GetText(Resource.String.Lbl_Subscribers); } } } catch (Exception exception) { Console.WriteLine(exception); } }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { if (viewHolder is ReplyAdapterViewHolder holder) { var item = ReplyList[position]; if (item != null) { holder.UnLikeButton.Visibility = ViewStates.Gone; GlideImageLoader.LoadImage(ActivityContext, item.ReplyUserData.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); TextSanitizer chnager = new TextSanitizer(holder.CommentText, ActivityContext); chnager.Load(Methods.FunString.DecodeString(item.Text)); holder.TimeTextView.Text = item.TextTime; holder.UsernameTextView.Text = AppTools.GetNameFinal(item.ReplyUserData); holder.LikeNumber.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(item.ReplyLikes)); holder.UnLikeNumber.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(item.ReplyDislikes)); holder.RepliesCount.Visibility = ViewStates.Invisible; if (item.IsLikedReply == 1) { holder.LikeiconView.SetColorFilter(Color.ParseColor(AppSettings.MainColor)); holder.LikeButton.Tag = "1"; } else { holder.LikeButton.Tag = "0"; } if (item.IsDislikedReply == 1) { holder.UnLikeiconView.SetColorFilter(Color.ParseColor(AppSettings.MainColor)); holder.UnLikeButton.Tag = "1"; } else { holder.UnLikeButton.Tag = "0"; } if (!holder.Image.HasOnClickListeners) { holder.Image.Click += (sender, e) => OnAvatarClick(new AvatarReplyAdapterClickEventArgs { Class = item, Position = position, View = holder.MainView }); } if (!holder.LikeButton.HasOnClickListeners) { holder.LikeButton.Click += (sender, e) => OnLikeButtonClick(holder, new ReplyAdapterClickEventArgs { Class = item, Position = position, View = holder.MainView }); } if (!holder.UnLikeButton.HasOnClickListeners) { holder.UnLikeButton.Click += (sender, e) => OnUnLikeButtonClick(holder, new ReplyAdapterClickEventArgs { Class = item, Position = position, View = holder.MainView }); } if (!holder.ReplyButton.HasOnClickListeners) { holder.ReplyButton.Click += (sender, e) => OnReplyClick(new ReplyAdapterClickEventArgs { Class = item, Position = position, View = holder.MainView }); } } } } catch (Exception exception) { Console.WriteLine(exception); } }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { if (viewHolder is WatchLaterVideoRowAdapterViewHolder holder) { var item = VideoList[position]; if (item != null) { if (item.Videos != null) { GlideImageLoader.LoadImage(ActivityContext, item.Videos?.VideoAdClass.Thumbnail, holder.VideoImage, ImageStyle.CenterCrop, ImagePlaceholders.Drawable); holder.TxtDuration.Text = Methods.FunString.SplitStringDuration(item.Videos?.VideoAdClass.Duration); holder.TxtTitle.Text = Methods.FunString.DecodeString(item.Videos?.VideoAdClass.Title); holder.TxtChannelName.Text = AppTools.GetNameFinal(item.Videos?.VideoAdClass.Owner); holder.TxtViewsCount.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(item.Videos?.VideoAdClass.Views)) + " " + ActivityContext.GetText(Resource.String.Lbl_Views); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.MenueView, IonIconsFonts.AndroidMoreVertical); //Verified if (item.Videos?.VideoAdClass.Owner.Verified == "1") { holder.IconVerified.Visibility = ViewStates.Visible; FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.IconVerified, IonIconsFonts.CheckmarkCircled); } else { holder.IconVerified.Visibility = ViewStates.Gone; } if (!holder.MenueView.HasOnClickListeners) { holder.MenueView.Click += (sender, args) => { ContextThemeWrapper ctw = new ContextThemeWrapper(ActivityContext, Resource.Style.PopupMenuStyle); PopupMenu popup = new PopupMenu(ctw, holder.MenueView); if (Type == "MyChannel") { popup.MenuInflater.Inflate(Resource.Menu.MyVideoMore_Menu, popup.Menu); } else { popup.MenuInflater.Inflate(Resource.Menu.Video_More_Menue, popup.Menu); } popup.Show(); popup.MenuItemClick += (o, eventArgs) => { try { var id = eventArgs.Item.ItemId; switch (id) { case Resource.Id.menu_AddWatchLater: LibrarySynchronizer.AddToWatchLater(item.Videos?.VideoAdClass); break; case Resource.Id.menu_AddPlaylist: LibrarySynchronizer.AddToPlaylist(item.Videos?.VideoAdClass); break; case Resource.Id.menu_Remove: OnMenuRemove_Click(item); break; case Resource.Id.menu_Share: LibrarySynchronizer.ShareVideo(item.Videos?.VideoAdClass); break; case Resource.Id.menu_Report: LibrarySynchronizer.AddReportVideo(item.Videos?.VideoAdClass); break; } } catch (Exception exception) { Console.WriteLine(exception); } }; } } ; //Set Badge on videos AppTools.ShowGlobalBadgeSystem(holder.VideoType, item.Videos?.VideoAdClass); } } } } catch (Exception exception) { Console.WriteLine(exception); } }
private void LoadData() { try { if (!string.IsNullOrEmpty(Arguments.GetString("DataItemActivity"))) { ItemActivity = JsonConvert.DeserializeObject <ActivitiesObject>(Arguments.GetString("DataItemActivity")); if (ItemActivity != null) { GlideImageLoader.LoadImage(Activity, ItemActivity.Image, ImageAct, ImageStyle.CenterCrop, ImagePlaceholders.Drawable); var dataChannel = ItemActivity.UserData; if (dataChannel != null) { ItemActivity.UserData = dataChannel; GlideImageLoader.LoadImage(Activity, dataChannel.Avatar, ImageUser, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); NameUser.Text = AppTools.GetNameFinal(dataChannel); } TimeUser.Text = Methods.Time.TimeAgo(Convert.ToInt32(ItemActivity.Time), false); ContentAct.Text = Methods.FunString.DecodeString(ItemActivity.Text); switch (ItemActivity.IsLiked) { case "0": FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeRegular, IconLikeAct, FontAwesomeIcon.ThumbsUp); IconLikeAct.SetTextColor(Color.ParseColor("#444444")); LikeActLayout.Tag = "Like"; break; case "1": FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeSolid, IconLikeAct, FontAwesomeIcon.ThumbsUp); IconLikeAct.SetTextColor(Color.ParseColor("#4caf50")); LikeActLayout.Tag = "Liked"; break; default: FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeRegular, IconLikeAct, FontAwesomeIcon.ThumbsUp); IconLikeAct.SetTextColor(Color.ParseColor("#444444")); LikeActLayout.Tag = "Like"; break; } CountLikeAct.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(ItemActivity.Likes)); switch (ItemActivity.IsDisliked) { case "0": FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeRegular, IconDislikeAct, FontAwesomeIcon.ThumbsDown); IconDislikeAct.SetTextColor(Color.ParseColor("#444444")); DislikeActLayout.Tag = "Dislike"; break; case "1": FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeSolid, IconDislikeAct, FontAwesomeIcon.ThumbsDown); IconDislikeAct.SetTextColor(Color.ParseColor("#4caf50")); DislikeActLayout.Tag = "Disliked"; break; default: FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeRegular, IconDislikeAct, FontAwesomeIcon.ThumbsDown); IconDislikeAct.SetTextColor(Color.ParseColor("#444444")); DislikeActLayout.Tag = "Dislike"; break; } CountDislikeAct.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(ItemActivity.Dislikes)); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeRegular, IconCommentAct, FontAwesomeIcon.CommentDots); CountCommentAct.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(ItemActivity.CommentsCount)); StartApiService(); } } } catch (Exception e) { Console.WriteLine(e); } }
private void SetDataUser() { try { if (UserData != null) { var name = AppTools.GetNameFinal(UserData); CollapsingToolbar.Title = name; ChannelNameText.Text = name; if (string.IsNullOrEmpty(UserData.SubCount)) { UserData.SubCount = "0"; } TxtSubscribeCount.Text = UserData.SubCount; GlideImageLoader.LoadImage(Activity, UserData.Avatar, ImageChannel, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); Glide.With(Activity).Load(UserData.Cover).Apply(new RequestOptions().FitCenter()).Into(ImageCoverChannel); //Verified ChannelVerifiedText.Visibility = UserData.Verified == "1" ? ViewStates.Visible : ViewStates.Gone; if (!string.IsNullOrEmpty(UserData.SubscriberPrice) && UserData.SubscriberPrice != "0") { if (UserData.IsSubscribedToChannel == "0") { //This channel is paid, You must pay to subscribe SubscribeChannelButton.Tag = "PaidSubscribe"; //Color SubscribeChannelButton.SetTextColor(Color.ParseColor("#efefef")); //icon Drawable icon = Activity.GetDrawable(Resource.Drawable.SubcribeButton); icon.Bounds = new Rect(10, 10, 10, 7); SubscribeChannelButton.SetCompoundDrawablesWithIntrinsicBounds(icon, null, null, null); var idCurrency = ListUtils.MySettingsList?.PaymentCurrency; var(currency, currencyIcon) = AppTools.GetCurrency(idCurrency); Console.WriteLine(currency); SubscribeChannelButton.Text = Activity.GetText(Resource.String.Btn_Subscribe) + " " + currencyIcon + UserData.SubscriberPrice; PlayListFragment.MRecycler.Visibility = ViewStates.Gone; SetEmptyPageSubscribeChannelWithPaid(PlayListFragment.EmptyStateLayout, PlayListFragment.Inflated); VideosFragment.MRecycler.Visibility = ViewStates.Gone; SetEmptyPageSubscribeChannelWithPaid(VideosFragment.EmptyStateLayout, VideosFragment.Inflated); } else { SubscribeChannelButton.Tag = "Subscribed"; SubscribeChannelButton.Text = Activity.GetText(Resource.String.Btn_Subscribed); //Color SubscribeChannelButton.SetTextColor(Color.ParseColor("#efefef")); //icon Drawable icon = Activity.GetDrawable(Resource.Drawable.SubcribedButton); icon.Bounds = new Rect(10, 10, 10, 7); SubscribeChannelButton.SetCompoundDrawablesWithIntrinsicBounds(icon, null, null, null); } } else { SubscribeChannelButton.Tag = UserData.IsSubscribedToChannel == "0" ? "Subscribe" : "Subscribed"; if (SubscribeChannelButton.Tag.ToString() == "Subscribed") { SubscribeChannelButton.Text = Activity.GetText(Resource.String.Btn_Subscribed); //Color SubscribeChannelButton.SetTextColor(Color.ParseColor("#efefef")); //icon Drawable icon = Activity.GetDrawable(Resource.Drawable.SubcribedButton); icon.Bounds = new Rect(10, 10, 10, 7); SubscribeChannelButton.SetCompoundDrawablesWithIntrinsicBounds(icon, null, null, null); } else if (SubscribeChannelButton.Tag.ToString() == "Subscribe") { SubscribeChannelButton.Text = Activity.GetText(Resource.String.Btn_Subscribe); //Color SubscribeChannelButton.SetTextColor(Color.ParseColor("#efefef")); //icon Drawable icon = Activity.GetDrawable(Resource.Drawable.SubcribeButton); icon.Bounds = new Rect(10, 10, 10, 7); SubscribeChannelButton.SetCompoundDrawablesWithIntrinsicBounds(icon, null, null, null); } } } } catch (Exception e) { Console.WriteLine(e); } }
public void LoadUserData(UserDataObject cl, bool friends = true) { try { PPrivacy = cl.PPrivacy; GlideImageLoader.LoadImage(Activity, cl.Avatar, ImageUser, ImageStyle.CircleCrop, ImagePlaceholders.Color); AboutTab.TextSanitizerAutoLink.Load(AppTools.GetAboutFinal(cl)); AboutTab.TxtGender.Text = cl.Gender; AboutTab.TxtEmail.Text = cl.Email; if (string.IsNullOrEmpty(cl.Website)) { AboutTab.WebsiteLinearLayout.Visibility = ViewStates.Gone; } else { AboutTab.TxtWebsite.Text = cl.Website; AboutTab.WebsiteLinearLayout.Visibility = ViewStates.Visible; } TxtUserName.Text = "@" + cl.Username; var font = Typeface.CreateFromAsset(Application.Context.Resources.Assets, "ionicons.ttf"); TxtFullName.SetTypeface(font, TypefaceStyle.Normal); var textHighLighter = AppTools.GetNameFinal(cl); if (cl.Verified == "1") { textHighLighter += " " + IonIconsFonts.CheckmarkCircled; } if (cl.BusinessAccount == "1") { textHighLighter += " " + IonIconsFonts.SocialUsd; } var decorator = TextDecorator.Decorate(TxtFullName, textHighLighter); if (cl.Verified == "1") { decorator.SetTextColor(Resource.Color.Post_IsVerified, IonIconsFonts.CheckmarkCircled); } if (cl.BusinessAccount == "1") { decorator.SetTextColor(Resource.Color.Post_IsBusiness, IonIconsFonts.SocialUsd); } decorator.Build(); TxtPostCount.Text = Methods.FunString.FormatPriceValue(Int32.Parse(cl.PostsCount)); if (cl.Followers != null && int.TryParse(cl.Followers, out var numberFollowers)) { TxtFollowersCount.Text = Methods.FunString.FormatPriceValue(numberFollowers); } if (cl.Following != null && int.TryParse(cl.Following, out var numberFollowing)) { TxtFollowingCount.Text = Methods.FunString.FormatPriceValue(numberFollowing); } if (!string.IsNullOrEmpty(cl.Google)) { AboutTab.Google = cl.Google; AboutTab.SocialGoogle.SetTypeface(font, TypefaceStyle.Normal); AboutTab.SocialGoogle.Text = IonIconsFonts.SocialGoogle; AboutTab.SocialGoogle.Visibility = ViewStates.Visible; AboutTab.SocialLinksLinear.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.Facebook)) { AboutTab.Facebook = cl.Facebook; AboutTab.SocialFacebook.SetTypeface(font, TypefaceStyle.Normal); AboutTab.SocialFacebook.Text = IonIconsFonts.SocialFacebook; AboutTab.SocialFacebook.Visibility = ViewStates.Visible; AboutTab.SocialLinksLinear.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.Website)) { AboutTab.Website = cl.Website; AboutTab.WebsiteButton.SetTypeface(font, TypefaceStyle.Normal); AboutTab.WebsiteButton.Text = IonIconsFonts.AndroidGlobe; AboutTab.WebsiteButton.Visibility = ViewStates.Visible; AboutTab.SocialLinksLinear.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.Twitter)) { AboutTab.Twitter = cl.Twitter; AboutTab.SocialTwitter.SetTypeface(font, TypefaceStyle.Normal); AboutTab.SocialTwitter.Text = IonIconsFonts.SocialTwitter; AboutTab.SocialTwitter.Visibility = ViewStates.Visible; AboutTab.SocialLinksLinear.Visibility = ViewStates.Visible; } BtnMessage.Visibility = cl.IsFollowing != null && (cl.CPrivacy == "1" || cl.CPrivacy == "2" && cl.IsFollowing.Value) ? ViewStates.Visible : ViewStates.Invisible; if (cl.IsFollowing != null) { SIsFollowing = cl.IsFollowing.Value; } if (!friends) { return; } if (cl.IsFollowing != null && cl.IsFollowing.Value) // My Friend { FollowButton.SetBackgroundColor(Color.ParseColor("#efefef")); FollowButton.SetTextColor(Color.ParseColor("#444444")); FollowButton.Text = Context.GetText(Resource.String.Lbl_Following); FollowButton.Tag = "true"; } else { //Not Friend FollowButton.SetBackgroundResource(Resource.Drawable.buttonFlatNormal); FollowButton.SetTextColor(Color.ParseColor("#ffffff")); FollowButton.Text = Context.GetText(Resource.String.Lbl_Follow); FollowButton.Tag = "false"; } } catch (Exception e) { Console.WriteLine(e); } }
private void LoadUserData(UserDataObject cl, bool friends = true) { try { PPrivacy = cl.PPrivacy; GlideImageLoader.LoadImage(Activity, cl.Avatar, UserProfileImage, ImageStyle.RoundedCrop, ImagePlaceholders.Color); UserProfileImage.SetScaleType(ImageView.ScaleType.CenterCrop); TextSanitizerAutoLink.Load(AppTools.GetAboutFinal(cl)); AboutLiner.Visibility = ViewStates.Visible; Username.Text = "@" + cl.Username; Fullname.Text = AppTools.GetNameFinal(cl); IconVerified.Visibility = cl.Verified == "1" ? ViewStates.Visible : ViewStates.Gone; IconBusiness.Visibility = cl.BusinessAccount == "1" ? ViewStates.Visible : ViewStates.Gone; Typeface font = Typeface.CreateFromAsset(Application.Context.Resources.Assets, "ionicons.ttf"); TxtCountFav.Text = Methods.FunString.FormatPriceValue(Int32.Parse(cl.PostsCount)); TxtCountFollowers.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(cl.Followers)); TxtCountFollowing.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(cl.Following)); if (!string.IsNullOrEmpty(cl.Google)) { Google = cl.Google; SocialGoogle.SetTypeface(font, TypefaceStyle.Normal); SocialGoogle.Text = IonIconsFonts.SocialGoogle; SocialGoogle.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.Facebook)) { Facebook = cl.Facebook; SocialFacebook.SetTypeface(font, TypefaceStyle.Normal); SocialFacebook.Text = IonIconsFonts.SocialFacebook; SocialFacebook.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.Website)) { Website = cl.Website; WebsiteButton.SetTypeface(font, TypefaceStyle.Normal); WebsiteButton.Text = IonIconsFonts.AndroidGlobe; WebsiteButton.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.Twitter)) { Twitter = cl.Twitter; SocialTwitter.SetTypeface(font, TypefaceStyle.Normal); SocialTwitter.Text = IonIconsFonts.SocialTwitter; SocialTwitter.Visibility = ViewStates.Visible; } if (cl.IsFollowing != null) { SIsFollowing = cl.IsFollowing.Value; if (!friends) { return; } if (cl.IsFollowing.Value) // My Friend { FollowButton.SetBackgroundResource(Resource.Drawable.Shape_Radius_Grey_Btn); FollowButton.SetTextColor(Color.ParseColor("#000000")); FollowButton.Text = Context.GetText(Resource.String.Lbl_Following); FollowButton.Tag = "true"; } else { //Not Friend FollowButton.SetBackgroundResource(Resource.Drawable.Shape_Radius_Gradient_Btn); FollowButton.SetTextColor(Color.ParseColor("#ffffff")); FollowButton.Text = Context.GetText(Resource.String.Lbl_Follow); FollowButton.Tag = "false"; } MessageButton.Visibility = cl.CPrivacy == "1" || cl.CPrivacy == "2" && cl.IsFollowing.Value ? ViewStates.Visible : ViewStates.Invisible; } } catch (Exception e) { Console.WriteLine(e); } }