Example #1
0
 private void InitNavigationBar()
 {
     _navigationBarView = FindViewById <NavigationBarView>(Resource.Id.activity_chat_new_nav_bar);
     _navigationBarView.SetLeftButton(StyleHelper.Style.NavigationBarBackButtonIcon, ViewModel.CancelCommand);
     _navigationBarView.SetTitle(ViewModel.LocalizedStrings.NewChat);
     _navigationBarView.SetBackground(Resource.Color.chat_content_color);
 }
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            _navigationBarView = view.FindViewById <NavigationBarView>(Resource.Id.fragment_chats_navigation_bar);

            if (StyleHelper.Style.UseLogoInsteadOfConnectionStatus)
            {
                _navigationBarView.SetCenterImage(StyleHelper.Style.LogoIcon, null);
            }

            _createChatFloatButton = view.FindViewById <FloatingActionButton>(Resource.Id.fab_create_chat);
            _chatsRecyclerView     = view.FindViewById <RecyclerView>(Resource.Id.rv_chats_list);

            InitializeRecyclerView();

            _createChatFloatButton.SetCommand(nameof(_createChatFloatButton.Click), ViewModel.CreateChatCommand);

            _swipeLeaveActionViewOptions = new SimpleSwipeActionView.Options
            {
                Width           = Activity.ToPixels(80),
                TextSize        = Activity.ToPixels(14),
                BackgroundColor = Color.Red
            };
            _swipeCloseActionViewOptions = new SimpleSwipeActionView.Options
            {
                Width           = Activity.ToPixels(80),
                TextSize        = Activity.ToPixels(14),
                BackgroundColor = Color.Orange
            };
        }
 private void InitNavigationBarView(View view)
 {
     _navigationBarView = view.FindViewById <NavigationBarView>(Resource.Id.dialog_select_members_nav_bar);
     _navigationBarView.SetLeftButton(StyleHelper.Style.NavigationBarBackButtonIcon, new RelayCommand(Close));
     _navigationBarView.SetRightButton(ViewModel.Resources.Done, ViewModel.DoneCommand);
     _navigationBarView.SetTitle(ViewModel.Title);
     _navigationBarView.SetBackground(StyleHelper.Style.ContentColor);
 }
Example #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            OverridePendingTransition(0, 0);

            SetTheme(StyleHelper.Style.CommonActivityStyle);

            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_chat_details);

            _navigationBarView = FindViewById <NavigationBarView>(Resource.Id.activity_chat_details_navigation_bar);
            _navigationBarView.SetLeftButton(StyleHelper.Style.NavigationBarBackButtonIcon, ViewModel.BackCommand);
            _navigationBarView.SetTitle(ViewModel.LocalizedStrings.DetailsTitle);
            _navigationBarView.SetRightButton(ViewModel.LocalizedStrings.Save, new RelayCommand(OnSaveClick));
            _navigationBarView.RightTextButton.Visibility = ViewStates.Gone;

            _chatPhotoImageView = FindViewById <MvxCachedImageView>(Resource.Id.iv_chat_photo);

            _chatEditedPhotoImageView = FindViewById <MvxCachedImageView>(Resource.Id.iv_chat_photo_edited);

            _chatNameText     = FindViewById <TextView>(Resource.Id.activity_chat_details_chat_name);
            _chatNameEditText = FindViewById <EditText>(Resource.Id.activity_chat_details_chat_name_edit);

            _chatMembersCountTextView = FindViewById <TextView>(Resource.Id.tv_members_count);

            _addMemberContainer = FindViewById <LinearLayout>(Resource.Id.activity_chat_details_add_member_container);
            _addmemberImageView = FindViewById <ImageView>(Resource.Id.activity_chat_details_add_member_image);
            _addmemberImageView.SetImageResource(StyleHelper.Style.AddMemberIcon);
            _addMemberTextView      = FindViewById <TextView>(Resource.Id.activity_chat_details_add_member_text);
            _addMemberTextView.Text = ViewModel.LocalizedStrings.AddMembers;

            _membersRecyclerView = FindViewById <RecyclerView>(Resource.Id.rv_contacts_list);

            _changeChatPhotoButton = FindViewById <Button>(Resource.Id.b_chat_change_photo);
            _changeChatPhotoButton.SetCommand(new RelayCommand(OpenImagePicker));
            _changeChatPhotoButton.Text = ViewModel.LocalizedStrings.ChangePhoto;

            _muteNotificationsLabel      = FindViewById <TextView>(Resource.Id.activity_chat_details_mute_label);
            _muteNotificationsLabel.Text = ViewModel.LocalizedStrings.Notifications;
            _muteNotificationsSwitch     = FindViewById <SwitchCompat>(Resource.Id.activity_chat_details_mute_switch);
            _muteNotificationsSwitch.SetCommand(ViewModel.HeaderViewModel.ChangeMuteNotificationsCommand);

            InitializeMembersRecyclerView();

            // TODO YP: remove ServiceLocator
            _imagePicker = new ImagePicker(
                Dependencies.Container.Resolve <IPermissionsManager>(),
                Dependencies.Container.Resolve <IImagePickerService>())
            {
                MaxImageWidth = 300
            };

            _busyOverlayView = FindViewById <BusyOverlayView>(Resource.Id.activity_chat_details_busy_view);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            OverridePendingTransition(0, 0);

            SetTheme(StyleHelper.Style.CommonActivityStyle);

            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_chat_create);

            _navigationBarView = FindViewById <NavigationBarView>(Resource.Id.activity_chat_create_navigation_bar);
            _navigationBarView.SetLeftButton(StyleHelper.Style.NavigationBarBackButtonIcon, ViewModel.BackCommand);
            _navigationBarView.SetTitle(ViewModel.LocalizedStrings.CreateGroup);
            _navigationBarView.SetRightButton(ViewModel.LocalizedStrings.Create, new RelayCommand(() =>
            {
                KeyboardService.HideSoftKeyboard(_chatNameEditTextView);

                ViewModel.SaveCommand.Execute(_imagePicker.GetStreamFunc());
            }));
            _navigationBarView.RightTextButton.SetBackgroundColor(Color.Transparent);

            _chatPhotoImageView       = FindViewById <MvxCachedImageView>(Resource.Id.iv_chat_photo);
            _chatEditedPhotoImageView = FindViewById <MvxCachedImageView>(Resource.Id.iv_chat_photo_edited);
            _chatNameEditTextView     = FindViewById <EditText>(Resource.Id.et_chat_name);
            _contactsRecyclerView     = FindViewById <RecyclerView>(Resource.Id.rv_contacts_list);
            _membersCountTextView     = FindViewById <TextView>(Resource.Id.tv_members_count);
            _changeChatPhotoButton    = FindViewById <Button>(Resource.Id.b_chat_change_photo);
            _changeChatPhotoButton.SetCommand(new RelayCommand(ChangePhoto));
            _changeChatPhotoButton.Text = ViewModel.LocalizedStrings.ChangePhoto;

            InitializeContactsRecyclerView();

            _imagePicker = new ImagePicker(Dependencies.PermissionsManager, Dependencies.Container.Resolve <IImagePickerService>())
            {
                MaxImageWidth = 300
            };

            _chatPhotoImageView.SetImageResource(StyleHelper.Style.ChatGroupNoAvatarIcon);
            _chatEditedPhotoImageView.Visibility = ViewStates.Gone;

            _addMembers      = FindViewById <Button>(Resource.Id.activity_chat_create_add_member);
            _addMembers.Text = ViewModel.LocalizedStrings.AddMembers;
            _addMembers.SetCommand(ViewModel.AddMembersCommand);

            _chatNameEditTextView.Hint = ViewModel.LocalizedStrings.ChatName;

            _busyOverlayView = FindViewById <BusyOverlayView>(Resource.Id.activity_chat_create_busy_view);
        }
Example #6
0
        public void SetNavigationBarView(NavigationBarView view)
        {
            ExceptionUtility.Try(() =>
            {
                this.ClearNavigationBarView();

                if (this.NavigationController != null)
                {
                    if (this.NavigationController.NavigationBar != null)
                    {
                        if (view != null)
                        {
                            this.NavigationController.NavigationBar.AddSubview(view);
                        }
                    }
                }
            });
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            OverridePendingTransition(0, 0);

            SetTheme(StyleHelper.Style.CommonActivityStyle);

            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_chat_conversations);

            _navigationBarView = FindViewById <NavigationBarView>(Resource.Id.activity_chat_conversations_navigation_bar);
            _navigationBarView.SetLeftButton(StyleHelper.Style.NavigationBarBackButtonIcon, ViewModel.BackCommand);
            if (ViewModel.HasInfo)
            {
                _navigationBarView.SetRightButton(StyleHelper.Style.NavigationBarDetailsButtonIcon, ViewModel.ShowInfoCommand);
            }

            _conversationsRecyclerView = FindViewById <RecyclerView>(Resource.Id.rv_conversations_list);

            _scrollDownImageButton = FindViewById <ImageButton>(Resource.Id.ib_conversations_scroll_down);
            _scrollDownImageButton.SetImageResource(StyleHelper.Style.ScrollDownButtonIcon);

            _chatInputView = FindViewById <ChatInputView>(Resource.Id.ll_chat_input_view);

            InitializeConversationsRecyclerView();

            _contextMenuHandler = new ContextMenuHandler <ChatMessageViewModel>(itemViewModel =>
            {
                var commandActions = ViewModel.GetCommandActionsForMessage(itemViewModel);
                return(new ContextMenuComponent(commandActions));
            });

            _scrollDownImageButton.SetCommand(nameof(_scrollDownImageButton.Click), new RelayCommand(ScrollToBottom));

            ViewModel.MessageAddedCommand = new RelayCommand(ScrollToBottomIfNeeded);
        }
Example #8
0
 public NavigationBarViewMediator(NavigationBarView _view) : base(NAME, _view)
 {
     m_bindSuccessView.BackButtonClicked += Back;
     m_bindSuccessView.HomeButtonClicked += Home;
 }