protected override void OnUserInformationLoaded(UserInfoLoaded e) { base.OnUserInformationLoaded(e); m_username.text = e.Info.Username; m_displayName.text = e.Info.Name; m_country.text = e.Info.Country; m_birthday.text = e.Info.Birthdate.ToString("dd/MM/yyyy"); m_userId.text = e.Info.Id; m_followersCount.text = e.Info.Followers.ToString(); m_isPremium.text = e.Info.IsPremium.ToString(); if (!string.IsNullOrEmpty(e.Info.ProfilePictureURL)) { IEnumerator routine = Spotify4Unity.Helpers.Utility.LoadImageFromUrl(e.Info.ProfilePictureURL, m_albumArtResolution, sprite => OnUserProfilePictureLoaded(sprite)); if (this.isActiveAndEnabled) { StartCoroutine(routine); } else { Utility.RunCoroutineEmptyObject(routine); } } }
protected virtual void OnUserInformationLoaded(UserInfoLoaded e) { if (!string.IsNullOrEmpty(e.Info.ProfilePictureURL)) { StartCoroutine(LoadImageFromUrl(e.Info.ProfilePictureURL, sprite => OnUserProfilePictureLoaded(sprite))); } }
protected override void OnUserInformationLoaded(UserInfoLoaded e) { base.OnUserInformationLoaded(e); m_username.text = e.Info.Username; m_displayName.text = e.Info.DisplayName; m_country.text = e.Info.Country; m_birthday.text = e.Info.Birthdate.ToString("dd/MM/yyyy"); m_userId.text = e.Info.UserID; m_followersCount.text = e.Info.Followers.ToString(); m_isPremium.text = e.Info.IsPremium.ToString(); }
protected override void OnUserInformationLoaded(UserInfoLoaded e) { base.OnUserInformationLoaded(e); // If the user is't Premium, show red error when trying to set playback // (Spotify doesn't allow Free users to control their playback through the WebAPI) if (!e.Info.IsPremium) { SetBtnPressedTint(ref m_playBtn); SetBtnPressedTint(ref m_pauseBtn); SetBtnPressedTint(ref m_previousBtn); SetBtnPressedTint(ref m_nextBtn); SetBtnPressedTint(ref m_shuffleBtn); SetBtnPressedTint(ref m_repeatBtn); SetBtnPressedTint(ref m_muteBtn); SetBtnPressedTint(ref m_unmuteBtn); } }
/// <summary> /// Callback for when the current authorized user's information has been loaded /// </summary> /// <param name="e"></param> protected virtual void OnUserInformationLoaded(UserInfoLoaded e) { }