Ejemplo n.º 1
0
        private void InitComponent()
        {
            try
            {
                RootView = FindViewById <RelativeLayout>(Resource.Id.rootChatWindowView);

                ChatEmojiImage       = FindViewById <AppCompatImageView>(Resource.Id.emojiicon);
                EmojiconEditTextView = FindViewById <EmojiconEditText>(Resource.Id.EmojiconEditText5);
                ChatSendButton       = FindViewById <CircleButton>(Resource.Id.sendButton);
                ChatBoxRecylerView   = FindViewById <RecyclerView>(Resource.Id.recyler);
                SwipeRefreshLayout   = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);

                ChatSendButton.Tag = "Text";
                ChatSendButton.SetImageResource(Resource.Drawable.SendLetter);

                ModeCallback = new ActionModeCallback(this);

                var emojisIcon = new EmojIconActions(this, RootView, EmojiconEditTextView, ChatEmojiImage);
                emojisIcon.ShowEmojIcon();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 2
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MAdapter      = new LastChatAdapter(this);
                LayoutManager = new LinearLayoutManager(this);
                MRecycler.SetLayoutManager(LayoutManager);
                MRecycler.HasFixedSize = true;
                MRecycler.SetItemViewCacheSize(10);
                MRecycler.GetLayoutManager().ItemPrefetchEnabled = true;
                var sizeProvider = new FixedPreloadSizeProvider(10, 10);
                var preLoader    = new RecyclerViewPreloader <UserDataObject>(this, MAdapter, sizeProvider, 10);
                MRecycler.AddOnScrollListener(preLoader);
                MRecycler.SetAdapter(MAdapter);
                MAdapter.SetOnClickListener(this);

                ModeCallback = new ActionModeCallback(this);

                RecyclerViewOnScrollListener xamarinRecyclerViewOnScrollListener = new RecyclerViewOnScrollListener(LayoutManager);
                MainScrollEvent = xamarinRecyclerViewOnScrollListener;
                MainScrollEvent.LoadMoreEvent += MainScrollEventOnLoadMoreEvent;
                MRecycler.AddOnScrollListener(xamarinRecyclerViewOnScrollListener);
                MainScrollEvent.IsLoading = false;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 3
0
        private void SetUpActionMode()
        {
            actionModeCallback = new ActionModeCallback(
                onActionItemClicked: (mode, item) =>
            {
                switch (item.ItemId)
                {
                case Resource.Id.action_help:
                    mode.Finish();
                    break;

                default:
                    break;
                }
            }, onCreateActionMode: (mode, menu) =>
            {
                MenuInflater inflater = mode.MenuInflater;
                inflater.Inflate(Resource.Menu.help_menu, menu);
            }, onDestroyActionMode: (mode) =>
            {
                mode = null;
            });
        }