コード例 #1
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;
                }
            });
        }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            MobileBarcodeScanner.Initialize(Application);

            Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure);
            SetContentView(Resource.Layout.activityMain);

            if (savedInstanceState != null)
            {
                _isAuthenticated = savedInstanceState.GetBoolean("isAuthenticated");
                _pauseTime       = new DateTime(savedInstanceState.GetLong("pauseTime"));
            }
            else
            {
                _isAuthenticated = false;
                _pauseTime       = DateTime.MinValue;
            }

            _toolbar = FindViewById <MaterialToolbar>(Resource.Id.toolbar);
            SetSupportActionBar(_toolbar);
            SupportActionBar.SetTitle(Resource.String.categoryAll);

            var appBarLayout = FindViewById <AppBarLayout>(Resource.Id.appBarLayout);

            _bottomAppBar = FindViewById <BottomAppBar>(Resource.Id.bottomAppBar);
            _bottomAppBar.NavigationClick += OnBottomAppBarNavigationClick;
            _bottomAppBar.MenuItemClick   += delegate
            {
                _toolbar.Menu.FindItem(Resource.Id.actionSearch).ExpandActionView();
                appBarLayout.SetExpanded(true);
                _authList.SmoothScrollToPosition(0);
            };

            _coordinatorLayout = FindViewById <CoordinatorLayout>(Resource.Id.coordinatorLayout);
            _progressBar       = FindViewById <ProgressBar>(Resource.Id.appBarProgressBar);

            _addButton        = FindViewById <FloatingActionButton>(Resource.Id.buttonAdd);
            _addButton.Click += OnAddButtonClick;

            _authList               = FindViewById <RecyclerView>(Resource.Id.list);
            _emptyStateLayout       = FindViewById <LinearLayout>(Resource.Id.layoutEmptyState);
            _emptyMessageText       = FindViewById <TextView>(Resource.Id.textEmptyMessage);
            _viewGuideButton        = FindViewById <MaterialButton>(Resource.Id.buttonViewGuide);
            _viewGuideButton.Click += delegate { StartActivity(typeof(GuideActivity)); };

            _refreshOnActivityResume = false;

            DetectGoogleAPIsAvailability();

            var prefs       = PreferenceManager.GetDefaultSharedPreferences(this);
            var firstLaunch = prefs.GetBoolean("firstLaunch", true);

            if (firstLaunch)
            {
                StartActivity(typeof(IntroActivity));
            }
        }
コード例 #3
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
            _materialToolbar = view.FindViewById <MaterialToolbar>(Resource.Id.fragment_create_event_topAppBar);
            _materialToolbar.NavigationClick += MaterialToolbarOnNavigationClick;

            _dateEditText =
                view.FindViewById <TextInputEditText>(Resource.Id.fragment_create_event_date_edit_text);
            _dateEditText.FocusChange += DateEditTextOnFocusChange;

            _tagsEditText =
                view.FindViewById <TextInputEditText>(Resource.Id.fragment_create_event_tags_edit_text);
            _tagsEditText.AfterTextChanged += TagsEditTextOnAfterTextChanged;

            _typeTextView =
                view.FindViewById <AutoCompleteTextView>(Resource.Id.fragment_create_type_text_view_dropdown);
            _typeTextView.Adapter = new ArrayAdapter <string>(
                Context,
                Resource.Layout.dropdown_menu_popup_item,
                new[] { "Job", "Home" });
        }