Ejemplo n.º 1
0
 public void OnPageChanged(AXEmojiPager emojiPager, AXEmojiBase @base, int position)
 {
     try
     {
         Drawable drawable;
         if (AXEmojiManager.IsAXEmojiView(@base))
         {
             drawable = AppCompatResources.GetDrawable(Context, Resource.Drawable.emoji_backspace);
             Utils.EnableBackspaceTouch(Footer, emojiPager.EditText);
             Footer.SetOnClickListener(null);
         }
         else
         {
             drawable = AppCompatResources.GetDrawable(Context, Resource.Drawable.ic_action_search);
             Footer.SetOnTouchListener(null);
             Footer.SetOnClickListener(this);
         }
         DrawableCompat.SetTint(DrawableCompat.Wrap(drawable), AXEmojiManager.EmojiViewTheme.FooterItemColor);
         Img.SetImageDrawable(drawable);
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
Ejemplo n.º 2
0
        public static AXEmojiPager LoadView(Activity context, AXEmojiEditText editText, string typePage)
        {
            try
            {
                AXEmojiPager emojiPager = new AXEmojiPager(context);

                if (MSingleEmojiView)
                {
                    //add single emoji view
                    AXSingleEmojiView singleEmojiView = new AXSingleEmojiView(context);
                    emojiPager.AddPage(singleEmojiView, Resource.Drawable.ic_action_sentiment_satisfied_alt);
                }

                if (MEmojiView)
                {
                    // add emoji view (with viewpager)
                    AXEmojiView emojiView = new AXEmojiView(context);
                    emojiPager.AddPage(emojiView, Resource.Drawable.ic_action_sentiment_satisfied_alt);
                }

                if (MStickerView)
                {
                    //add Sticker View
                    StickerView = new AXStickerView(context, "stickers", new WoWonderProvider());
                    emojiPager.AddPage(StickerView, Resource.Drawable.ic_msg_panel_stickers);
                    StickerView.SetOnStickerActionsListener(new MyStickerActions(context, typePage));
                }

                if (MCustomView)
                {
                    emojiPager.AddPage(new LoadingView(context), Resource.Drawable.msg_round_load_m);
                }

                editText.SetEmojiSize(Utils.DpToPx(context, 23));
                // set target emoji edit text to emojiViewPager
                emojiPager.EditText = editText;

                emojiPager.SetSwipeWithFingerEnabled(true);

                if (MCustomFooter)
                {
                    InitCustomFooter(context, emojiPager);
                }
                else
                {
                    //wael remove icon search
                    //emojiPager.SetLeftIcon(Resource.Drawable.ic_action_search);
                    //emojiPager.SetOnFooterItemClicked(new MyFooterItemClicked());
                }

                return(emojiPager);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
                return(null);
            }
        }
Ejemplo n.º 3
0
        private void InitComponent()
        {
            try
            {
                CollapsingToolbar       = (CollapsingToolbarLayout)FindViewById(Resource.Id.collapsingToolbar);
                CollapsingToolbar.Title = "";

                AppBarLayout = FindViewById <AppBarLayout>(Resource.Id.appBarLayout);
                AppBarLayout.SetExpanded(true);
                AppBarLayout.AddOnOffsetChangedListener(this);

                MRecycler    = (RecyclerView)FindViewById(Resource.Id.userRecyler);
                TxtGroupName = FindViewById <AXEmojiEditText>(Resource.Id.groupName);
                ImageGroup   = FindViewById <ImageView>(Resource.Id.groupCover);
                BtnImage     = FindViewById <Button>(Resource.Id.btn_selectimage);

                ChatEmojImage = FindViewById <ImageView>(Resource.Id.emojiicon);

                BtnAdd = FindViewById <FloatingActionButton>(Resource.Id.fab);

                BtnDeleteGroup            = FindViewById <Button>(Resource.Id.deleteGroupButton);
                BtnDeleteGroup.Visibility = ViewStates.Gone;

                BtnExitGroup            = FindViewById <TextView>(Resource.Id.exitGroupButton);
                BtnExitGroup.Visibility = ViewStates.Gone;

                if (AppSettings.SetTabDarkTheme)
                {
                    TxtGroupName.SetTextColor(Color.White);
                    TxtGroupName.SetHintTextColor(Color.White);
                }
                else
                {
                    TxtGroupName.SetTextColor(Color.ParseColor("#444444"));
                    TxtGroupName.SetHintTextColor(Color.ParseColor("#444444"));
                }

                if (AppSettings.SetTabDarkTheme)
                {
                    EmojisViewTools.LoadDarkTheme();
                }
                else
                {
                    EmojisViewTools.LoadTheme(AppSettings.MainColor);
                }

                EmojisViewTools.MStickerView = false;
                AXEmojiPager emojiPager        = EmojisViewTools.LoadView(this, TxtGroupName, "");
                AXEmojiPopup popup             = new AXEmojiPopup(emojiPager);
                var          EmojisViewActions = new EmojisViewActions(this, "", popup, TxtGroupName, ChatEmojImage);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Ejemplo n.º 4
0
        public static void InitCustomFooter(Context context, AXEmojiPager emojiPager)
        {
            try
            {
                FrameLayout footer   = new FrameLayout(context);
                Drawable    drawable = AppCompatResources.GetDrawable(context, Resource.Drawable.circle);
                if (DarkMode)
                {
                    DrawableCompat.SetTint(DrawableCompat.Wrap(drawable), Color.ParseColor("#1B242D"));
                }
                footer.Background = drawable;
                if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
                {
                    footer.Elevation = Utils.Dp(context, 4);
                }

                var lp = new AXEmojiLayout.LayoutParams(Utils.Dp(context, 48), Utils.Dp(context, 48))
                {
                    RightMargin = Utils.Dp(context, 12), BottomMargin = Utils.Dp(context, 12)
                };
                footer.LayoutParameters = lp;
                emojiPager.SetCustomFooter(footer, true);

                ImageView img = new ImageView(context);
                var       lp2 = new FrameLayout.LayoutParams(Utils.Dp(context, 22), Utils.Dp(context, 22))
                {
                    Gravity = GravityFlags.Center
                };
                footer.AddView(img, lp2);

                emojiPager.SetOnEmojiPageChangedListener(new MyEmojiPagerPageChanged(context, footer, img));
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }