Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.contact_list);
            someList = JsonConvert.DeserializeObject <List <ContactItem> >(Intent.GetStringExtra("array"));


            contactList = new ContactList
            {
                listOContacts = someList
            };

            contactListAdapter = new ContactListAdapter(contactList);

            recyclerView        = FindViewById <RecyclerView>(Resource.Id.contactsListView);
            linearLayoutManager = new LinearLayoutManager(this);
            recyclerView.SetLayoutManager(linearLayoutManager);

            recyclerView.SetAdapter(contactListAdapter);
            this.logoutButton        = FindViewById <Button>(Resource.Id.logout_button);
            this.logoutButton.Click += LogOutButton_Click;
            this.restRequester       = new RestRequester();
            authToken = Intent.Extras.GetString("authToken");
        }
Пример #2
0
        private static void OnSucessActiveListRequest(List <GetActiveListRequestResponse> getActiveListRequestResponse)
        {
            int id = getActiveListRequestResponse[0].id;

            RestRequester restRequester = new RestRequester();
            Action <GetContactListResponse> successContactListCallback = (getContactListResponse) => OnSucessGetContactListResponse(getContactListResponse);

            restRequester.SendGetContactsRequest(id.ToString(), authToken, successContactListCallback);
        }
Пример #3
0
        private static void OnSucessAuthentication(AuthenticationResponse authenticationResponse)
        {
            User user = authenticationResponse.user;

            authToken = authenticationResponse.token.AuthToken.ToString();


            RestRequester restRequester = new RestRequester();
            Action <List <GetActiveListRequestResponse> > successActiveListCallback = (getActiveListRequestResponse) => OnSucessActiveListRequest(getActiveListRequestResponse);

            restRequester.GetActiveListRequest(authToken, successActiveListCallback);
        }
Пример #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.login_activity);


            TextInputLayout loginInput    = FindViewById <TextInputLayout>(Resource.Id.input_login);
            TextInputLayout passwordInput = FindViewById <TextInputLayout>(Resource.Id.input_password);
            EditText        loginText     = FindViewById <EditText>(Resource.Id.edit_login);
            EditText        passwordText  = FindViewById <EditText>(Resource.Id.edit_pass);

            this.loginButton         = FindViewById <Button>(Resource.Id.login_button);
            this.loginButton.Enabled = false;
            this.login         = loginText.Text;
            this.password      = passwordText.Text;
            loginButton.Click += loginButton_Click;

            loginText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
            {
                this.login = loginText.Text;
                if (loginText.Text != string.Empty && passwordText.Text != string.Empty)
                {
                    this.loginButton.Enabled = true;
                }
            };
            passwordText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
            {
                this.password = passwordText.Text;
                if (loginText.Text != string.Empty && passwordText.Text != string.Empty)
                {
                    this.loginButton.Enabled = true;
                }
            };
            this.restRequester = new RestRequester();
            AppContexWrapper.SetAContext(this);
            mContext = this;
        }