public override void OnCreate(Bundle savedInstanceState)
 {
     try
     {
         base.OnCreate(savedInstanceState);
         HasOptionsMenu       = true;
         MainContext          = MediaPlayerActivity.GetInstance();
         CommentClickListener = new ResponseCommentClickListener(Activity, "Comment");
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Пример #2
0
        public override void SetupDialog(Dialog dialog, int style)
        {
            try
            {
                base.SetupDialog(dialog, style);
                View contentView = View.Inflate(Context, Resource.Layout.Style_Bottom_Sheet_Reply, null);
                dialog.SetContentView(contentView);
                var layoutParams = (CoordinatorLayout.LayoutParams)((View)contentView.Parent).LayoutParameters;
                var behavior     = layoutParams.Behavior;

                if (behavior != null && behavior.GetType() == typeof(BottomSheetBehavior))
                {
                    ((BottomSheetBehavior)behavior).SetBottomSheetCallback(MBottomSheetBehaviorCallback);
                }

                Instance = this;

                Type = Arguments.GetString("Type");

                if (Arguments.ContainsKey("Object"))
                {
                    Comment = JsonConvert.DeserializeObject <CommentObject>(Arguments.GetString("Object"));
                }

                if (Type == "video")
                {
                    ActivityContext = MediaPlayerActivity.GetInstance();
                }

                InitComponent(contentView);
                SetRecyclerViewAdapters();

                CommentClickListener = new ResponseCommentClickListener(ActivityContext, "Reply");
                SendButton.Click    += SendButton_Click;
                LikeButton.Click    += OnLikeButtonClick;
                UnLikeButton.Click  += OnUnLikeButtonClick;

                LoadReplies();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
 public ResponseCommentClickListener(Activity context, string typeClass)
 {
     Context     = context;
     MainContext = MediaPlayerActivity.GetInstance();
     TypeClass   = typeClass;
 }