Exemplo n.º 1
0
        public async void LoadAccount()
        {
            bool internetConnection = await API.checkForInternetConnection();

            if (internetConnection)
            {
                currentAccount = await API.getAccountByEmail(pref.GetString("PrefEmailUser", ""));

                currentLinkAccount = await API.getLinkAccounts(pref.GetString("PrefEmailUser", ""), pref.GetString("PrefPasswordUser", ""));

                FindViewById <EditText>(Resource.Id.ProSetNick).Text       = currentAccount.Login;
                FindViewById <EditText>(Resource.Id.ProSetEmail).Text      = currentAccount.Email;
                FindViewById <EditText>(Resource.Id.ProSetCountry).Text    = currentAccount.Language;
                FindViewById <EditText>(Resource.Id.ProSetPass).Text       = "";
                FindViewById <EditText>(Resource.Id.ProSetDes).Text        = currentAccount.Description;
                FindViewById <Switch>(Resource.Id.ProSetMicSwitch).Checked = currentAccount.Microphone;
                FindViewById <EditText>(Resource.Id.ProOrigin).Text        = currentLinkAccount.ORIGIN_Account;
                FindViewById <EditText>(Resource.Id.ProSteam).Text         = currentLinkAccount.STEAM_Account;
                FindViewById <EditText>(Resource.Id.ProBattle).Text        = currentLinkAccount.BATTLE_Account;
                FindViewById <EditText>(Resource.Id.ProPSN).Text           = currentLinkAccount.PSN_Account;
                FindViewById <EditText>(Resource.Id.ProXBOX).Text          = currentLinkAccount.XBOX_Account;
                FindViewById <EditText>(Resource.Id.ProDiscord).Text       = currentLinkAccount.DISCORD_Account;
                FindViewById <EditText>(Resource.Id.ProUplay).Text         = currentLinkAccount.UPLAY_Account;
                FindViewById <EditText>(Resource.Id.ProSkype).Text         = currentLinkAccount.SKYPE_Account;
                FindViewById <EditText>(Resource.Id.ProLOL).Text           = currentLinkAccount.LOL_Account;
            }
            else
            {
                ShowSnack(GetString(Resource.String.NoInternetConnection));
            }
        }
Exemplo n.º 2
0
        public async void LoadAccount()
        {
            ProgressDialog dialog = new ProgressDialog(this, Resource.Style.AppCompatAlertDialogStyle);

            dialog.SetMessage(GetString(Resource.String.Pro_Loading));
            dialog.Show();
            bool internetConnection = await API.checkForInternetConnection();

            if (internetConnection)
            {
                currentAccount = await API.getAccountByEmail(pref.GetString("PrefEmailUser", ""));

                currentLinkAccount = await API.getLinkAccounts(pref.GetString("PrefEmailUser", ""), pref.GetString("PrefPasswordUser", ""));

                mProfileDescription.Description = currentAccount.Description;
                mProfileAccounts.LinkedAccounts = currentLinkAccount;
                FindViewById <TextView>(Resource.Id.textViewWydarzenia1).Text = currentAccount.Login;
                FindViewById <TextView>(Resource.Id.pro_country).Text         = currentAccount.Language;
                FindViewById <TextView>(Resource.Id.pro_reputation).Text      = currentAccount.RepPoint.ToString();
            }
            else
            {
                ShowSnack(GetString(Resource.String.NoInternetConnection));
            }
            dialog.Dismiss();
        }