private void LoadDataUser(UserDataObject dataUser) { try { if (dataUser != null) { CollapsingToolbar.Title = DeepSoundTools.GetNameFinal(dataUser); FullGlideRequestBuilder.Load(dataUser.Cover).Into(ImageCover); FullGlideRequestBuilder.Load(dataUser.Avatar).Into(ImageAvatar); TxtFullName.Text = DeepSoundTools.GetNameFinal(dataUser); IconPro.Visibility = dataUser.IsPro == 1 ? ViewStates.Visible : ViewStates.Gone; if (dataUser.Verified == 1) { TxtFullName.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0); } if (ActivitiesFragment?.IsCreated == true) { ActivitiesFragment.PopulateData(dataUser.Activities); } if (AlbumsFragment?.IsCreated == true) { AlbumsFragment.PopulateData(dataUser.Albums); } if (LikedFragment?.IsCreated == true) { LikedFragment.PopulateData(dataUser.Liked); } if (PlaylistFragment?.IsCreated == true) { PlaylistFragment.PopulateData(dataUser.Playlists); } if (SongsFragment?.IsCreated == true) { SongsFragment.PopulateData(dataUser.TopSongs); } if (StationsFragment?.IsCreated == true) { StationsFragment.PopulateData(dataUser.Stations); } if (StoreFragment?.IsCreated == true) { StoreFragment.PopulateData(dataUser.Store); } } } catch (Exception e) { Console.WriteLine(e); } }
private void LoadDataUser(UserDataObject dataUser) { try { if (dataUser != null) { CollapsingToolbar.Title = DeepSoundTools.GetNameFinal(dataUser); FullGlideRequestBuilder.Load(dataUser.Cover).Into(ImageCover); FullGlideRequestBuilder.Load(dataUser.Avatar).Into(ImageAvatar); TxtFullName.Text = DeepSoundTools.GetNameFinal(dataUser); IconPro.Visibility = dataUser.IsPro == 1 ? ViewStates.Visible : ViewStates.Gone; if (dataUser.Verified == 1) { TxtFullName.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0); } if (DataUser.IsFollowing != null && DataUser.IsFollowing.Value) // My Friend { //BtnFollow.SetBackgroundResource(Resource.Drawable.SubcribeButton); //BtnFollow.BackgroundTintList = ColorStateList.ValueOf(Color.ParseColor(AppSettings.MainColor)); //icon var iconTick = Activity.GetDrawable(Resource.Drawable.ic_tick); iconTick.Bounds = new Rect(10, 10, 10, 7); BtnFollow.SetCompoundDrawablesWithIntrinsicBounds(iconTick, null, null, null); BtnFollow.Tag = "friends"; } else //Not Friend { //BtnFollow.SetBackgroundResource(Resource.Drawable.SubcribeButton); //BtnFollow.BackgroundTintList = ColorStateList.ValueOf(Color.ParseColor("#444444")); //icon var iconAdd = Activity.GetDrawable(Resource.Drawable.ic_add); iconAdd.Bounds = new Rect(10, 10, 10, 7); BtnFollow.SetCompoundDrawablesWithIntrinsicBounds(iconAdd, null, null, null); BtnFollow.Tag = "Add"; } if (ActivitiesFragment?.IsCreated == true) { ActivitiesFragment.PopulateData(dataUser.Activities); } if (AlbumsFragment?.IsCreated == true) { AlbumsFragment.PopulateData(dataUser.Albums); } if (LikedFragment?.IsCreated == true) { LikedFragment.PopulateData(dataUser.Liked); } if (PlaylistFragment?.IsCreated == true) { PlaylistFragment.PopulateData(dataUser.Playlists); } if (SongsFragment?.IsCreated == true) { SongsFragment.PopulateData(dataUser.TopSongs); } if (StationsFragment?.IsCreated == true) { StationsFragment.PopulateData(dataUser.Stations); } if (StoreFragment?.IsCreated == true) { StoreFragment.PopulateData(dataUser.Store); } } } catch (Exception e) { Console.WriteLine(e); } }