Exemple #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            ListAdapter = SteamAdapters.GetFriendsAdapter();
            ListView.SetBackgroundColor(Resources.GetColor(Resource.Color.ListBackground));
        }
Exemple #2
0
        public override void OnStart(Intent intent, int startId)
        {
            base.OnStart(intent, startId);

            SteamService.GetClient().AddHandler(this);

            SteamAdapters.GetFriendsAdapter();
        }
Exemple #3
0
        /// <summary>
        /// Returns the friend with the specified steam id
        /// </summary>
        /// <param name="steamId"></param>
        /// <returns></returns>
        public static Friend GetFriendBySteamId(String steamId)
        {
            FriendsAdapter adapter = SteamAdapters.GetFriendsAdapter();

            for (int i = 0; i < adapter.Count; i++)
            {
                if (adapter.GetFriendAt(i).SteamId.ToString() == steamId)
                {
                    return(adapter.GetFriendAt(i));
                }
            }

            throw new Exception("Error retrieving friend by Steam ID: " + steamId);
        }
Exemple #4
0
        protected override void OnListItemClick(ListView l, View v, int position, long id)
        {
            base.OnListItemClick(l, v, position, id);

            FriendsAdapter adapter = SteamAdapters.GetFriendsAdapter();
            Friend         friend  = adapter.GetFriendAt(position);

            if (SteamService.GetClient().Friends.GetPersonaState() == SteamKit2.EPersonaState.Offline)
            {
                SteamAlerts.ShowToast("Your state is set to offline");
            }
            else if (friend.State == SteamKit2.EPersonaState.Offline)
            {
                SteamAlerts.ShowToast(friend.Name + " is offline");
            }
            else
            {
                Intent chatIntent = new Intent(this, typeof(Chat));
                chatIntent.PutExtra("steam_id", friend.SteamId.ToString());
                StartActivity(chatIntent);
            }
        }