Ejemplo n.º 1
0
        public AccountViewHolder(View item, IAccountItemClickListener listener) : base(item)
        {
            _tvFullName    = item.FindViewById <MaterialTextView>(Resource.Id.item_account_fullname);
            _tvUserName    = item.FindViewById <MaterialTextView>(Resource.Id.item_account_username);
            _tvFollowings  = item.FindViewById <MaterialTextView>(Resource.Id.item_account_followings);
            _tvFollowers   = item.FindViewById <MaterialTextView>(Resource.Id.item_account_followers);
            _tvUnfollowers = item.FindViewById <MaterialTextView>(Resource.Id.item_account_unfollowers);

            var menu = new MenuBuilder(ItemView.Context);

            menu.SetCallback(this);

            var inflater = new SupportMenuInflater(ItemView.Context);

            inflater.Inflate(Resource.Menu.popup_account, menu);

            _popup = new MenuPopupHelper(ItemView.Context, menu);
            _popup.SetAnchorView(ItemView);
            _popup.SetForceShowIcon(true);

            _listener = listener;

            var card = item.FindViewById <MaterialCardView>(Resource.Id.item_account_card);

            if (card == null)
            {
                return;
            }
            card.Click     += Item_Click;
            card.LongClick += Item_LongClick;
        }
Ejemplo n.º 2
0
        private void ConnectViews(View view)
        {
            toolbar_friend = view.FindViewById <MaterialToolbar>(Resource.Id.toolbar_friend);
            toolbar_friend.SetNavigationIcon(Resource.Mipmap.ic_arrow_back_white_18dp);
            toolbar_friend.NavigationClick += Toolbar_friend_NavigationClick;

            Names      = view.FindViewById <MaterialTextView>(Resource.Id.txt_profile_name);
            Surname    = view.FindViewById <MaterialTextView>(Resource.Id.txt_profile_surname);
            Phone      = view.FindViewById <MaterialTextView>(Resource.Id.txt_profile_phone_number);
            ImgCover   = view.FindViewById <AppCompatImageView>(Resource.Id.F_ProfileImgCover);
            ImgProfile = view.FindViewById <AppCompatImageView>(Resource.Id.F_ProfileImage);

            FabCallFriend        = view.FindViewById <FloatingActionButton>(Resource.Id.FabCallFriend);
            FabCallFriend.Click += FabCallFriend_Click;
            CrossCloudFirestore
            .Current
            .Instance
            .Collection("PEOPLE")
            .Document(id)
            .AddSnapshotListener((value, error) =>
            {
                if (value.Exists)
                {
                    var users    = value.ToObject <AppUsers>();
                    Names.Text   = users.Name;
                    Surname.Text = users.Surname;
                    ///InputUsername.Text = users.Username;
                    Phone.Text = users.PhoneNumber;
                    // InputEmail.Text = users.Email;
                }
            });
        }
Ejemplo n.º 3
0
        public override async void OnViewCreated(View view, Bundle savedInstanceState)
        {
            ((IFragmentContainer)Activity).ShowLoadingView();
            ((IActionBarContainer)Activity).SetTitle(Resource.String.title_challenge);
            ((IActionBarContainer)Activity).Hide();

            _phoneTextView       = view.FindViewById <MaterialTextView>(Resource.Id.fragment_login_challenge_phone);
            _methodPhoneTextView = view.FindViewById <MaterialTextView>(Resource.Id.fragment_login_challenge_methods_phone);
            _methodEmailTextView = view.FindViewById <MaterialTextView>(Resource.Id.fragment_login_challenge_methods_email);

            _phoneInputLayout = view.FindViewById <TextInputLayout>(Resource.Id.fragment_login_challenge_phone_input_layout);
            _phoneEditText    = view.FindViewById <TextInputEditText>(Resource.Id.fragment_login_challenge_phone_input);

            _otpInputLayout = view.FindViewById <TextInputLayout>(Resource.Id.fragment_login_challenge_code_input_layout);
            _otpEditText    = view.FindViewById <TextInputEditText>(Resource.Id.fragment_login_challenge_code_input);

            _submitButton      = view.FindViewById <MaterialButton>(Resource.Id.fragment_login_challenge_submit);
            _resendButton      = view.FindViewById <MaterialButton>(Resource.Id.fragment_login_challenge_button_resend);
            _methodPhoneButton = view.FindViewById <MaterialButton>(Resource.Id.fragment_login_challenge_button_phone);
            _methodEmailButton = view.FindViewById <MaterialButton>(Resource.Id.fragment_login_challenge_button_email);

            _submitButton.Click      += SubmitButton_Click;
            _resendButton.Click      += ResendButton_Click;
            _methodPhoneButton.Click += PhoneButton_Click;
            _methodEmailButton.Click += EmailButton_Click;

            try
            {
                _challenge = await _account.StartChallengeAsync();

                if (_challenge.SubmitPhoneRequired)
                {
                    _submitButton.Visibility  = ViewStates.Visible;
                    _phoneTextView.Visibility = ViewStates.Visible;
                    return;
                }

                if (!string.IsNullOrEmpty(_challenge.StepData.PhoneNumber))
                {
                    _methodPhoneTextView.Text = GetString(Resource.String.msg_challenge_methods_phone,
                                                          _challenge.StepData.PhoneNumber);
                    _methodPhoneTextView.Visibility = ViewStates.Visible;
                    _methodPhoneButton.Visibility   = ViewStates.Visible;
                }

                if (!string.IsNullOrEmpty(_challenge.StepData.Email))
                {
                    _methodEmailTextView.Text = GetString(Resource.String.msg_challenge_methods_email,
                                                          _challenge.StepData.Email);
                    _methodEmailTextView.Visibility = ViewStates.Visible;
                    _methodEmailButton.Visibility   = ViewStates.Visible;
                }
            }
            catch (Exception ex)
            {
                ((IErrorHandler)Activity).ShowError(ex);
            }

            ((IFragmentContainer)Activity).ShowContentView();
        }
Ejemplo n.º 4
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            if (_didTwoFactorAuthentication)
            {
                ((IFragmentContainer)Activity).PopFragment();
            }

            ((IActionBarContainer)Activity).SetTitle(Resource.String.title_addaccount);
            ((IActionBarContainer)Activity).Hide();

            _userNameEditText      = view.FindViewById <TextInputEditText>(Resource.Id.fragment_login_username_input);
            _passwordEditText      = view.FindViewById <TextInputEditText>(Resource.Id.fragment_login_password_input);
            _userNameInputLayout   = view.FindViewById <TextInputLayout>(Resource.Id.fragment_login_username_layout);
            _passwordInputLayout   = view.FindViewById <TextInputLayout>(Resource.Id.fragment_login_password_layout);
            _loginButton           = view.FindViewById <MaterialButton>(Resource.Id.fragment_login_login);
            _privacyPolicyTextView = view.FindViewById <MaterialTextView>(Resource.Id.fragment_login_terms);

            _loginButton.Click += LoginButton_Click;

            // Show a "Privacy Policy" link
            // create spanned string
            var termsText = new SpannableStringBuilder();

            // append text before link
            termsText.Append(GetString(Resource.String.msg_terms0));
            // append link
            var spanStart = termsText.Length();

            termsText.Append(GetString(Resource.String.msg_terms1));
            var spanEnd = termsText.Length();

            // append text after link
            termsText.Append(GetString(Resource.String.msg_terms2));
            // add link span
            termsText.SetSpan(
                new TermsSpan(Context),
                spanStart,
                spanEnd,
                SpanTypes.InclusiveExclusive);

            _privacyPolicyTextView.SetText(termsText, TextView.BufferType.Spannable);
            _privacyPolicyTextView.MovementMethod = LinkMovementMethod.Instance;
        }