public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View v = inflater.Inflate(Resource.Layout.Organizator_Trip_VizualizareExcursionisti_GoogleMapsFragment, null, false);

            ImageView PullUpBtn = v.FindViewById <ImageView> (Resource.Id.imageView1);

            PullUpBtn.Click += delegate
            {
                if (UpDown)
                {
                    OvershootInterpolator interpolator = new OvershootInterpolator(2.5f);
                    FragmentContainer.Animate().SetInterpolator(interpolator)
                    .TranslationYBy(-500)
                    .SetDuration(1000);

                    UpDown = false;
                }
                else
                {
                    OvershootInterpolator interpolator = new OvershootInterpolator(1);
                    FragmentContainer.Animate().SetInterpolator(interpolator)
                    .TranslationYBy(500)
                    .SetDuration(500);

                    UpDown = true;
                }
            };

            return(v);
        }
Exemplo n.º 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View   view   = inflater.Inflate(Resource.Layout.Fragment3, container, false);
            Button button = view.FindViewById <Button>(Resource.Id.btnFragment4);

            mFragment4Container = view.FindViewById <FrameLayout>(Resource.Id.fragment4Container);

            var trans = ChildFragmentManager.BeginTransaction();

            trans.Add(mFragment4Container.Id, new Fragment6(), "Fragment 6");
            trans.Commit();

            button.Click += (object sender, EventArgs e) =>
            {
                if (mFragment4Container.TranslationY + 2 >= mFragment4Container.Height)
                {
                    var interpolator = new Android.Views.Animations.OvershootInterpolator(5);
                    mFragment4Container.Animate().SetInterpolator(interpolator)
                    .TranslationYBy(-200)
                    .SetDuration(500);
                }
            };

            mFragment4Container.SetOnTouchListener(this);
            return(view);
        }
Exemplo n.º 3
0
        public void Start()
        {
            if (_words.Count == 0)
            {
                _originalCard = new Card();
                _currentCard  = new Card();
                _words.Add(new Card());

                _activeEditText.Text = string.Empty;

                _isTranslate = false;

                _activeCard.Animate().SetDuration(1000).TranslationX(_zero).Start();
            }

            else
            {
                _originalCard = _words[0];
                _currentCard  = _originalCard;

                _activeEditText.Text = _currentCard.Word1;

                _isTranslate = false;

                _activeCard.Animate().SetDuration(600).TranslationX(_zero).Start();
            }
            _currentIndex = 0;
            _activeEditText.AfterTextChanged += Save;
            UpdateStatus();
        }
Exemplo n.º 4
0
        private void MyGoogleMap_MarkerClick(object sender, GoogleMap.MarkerClickEventArgs e)
        {
            if (busesInformation != null && busesInformation.Count != 0)
            {
                busInfoSender.SendBus(busesInformation[int.Parse(e.Marker.Title)]);
            }

            if (fragmentContainer.TranslationY + 20 >= fragmentContainer.Height)
            {
                var interpolator = new Android.Views.Animations.OvershootInterpolator(5);
                fragmentContainer.Animate().SetInterpolator(interpolator)
                .TranslationYBy(-200)
                .SetDuration(500);
            }
            fragmentContainer.SetOnTouchListener(this);
        }
Exemplo n.º 5
0
        public void MoveRecordButtonAndSlideToCancelBack(RecordButton recordBtn, FrameLayout slideToCancelLayout, float initialX, float difX)
        {
            try
            {
                ValueAnimator positionAnimator = ValueAnimator.OfFloat(recordBtn.GetX(), initialX);
                if (positionAnimator != null)
                {
                    positionAnimator.SetInterpolator(new AccelerateDecelerateInterpolator());
                    positionAnimator.Update += (sender, args) =>
                    {
                        try
                        {
                            float x = (float)args.Animation?.AnimatedValue;
                            recordBtn.SetX(x);
                        }
                        catch (Exception e)
                        {
                            Methods.DisplayReportResultTrack(e);
                        }
                    };

                    recordBtn.StopScale();
                    positionAnimator.SetDuration(0);
                    positionAnimator.Start();
                }

                // if the move event was not called ,then the difX will still 0 and there is no need to move it back
                if (difX != 0)
                {
                    float x = initialX - difX;
                    slideToCancelLayout.Animate()
                    ?.X(x)
                    ?.SetDuration(0)
                    ?.Start();
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen);

            base.OnCreate(savedInstanceState);
            context = this;

            SetContentView(Resource.Layout.Organizator_Trip_VizualizareExcursionisti);

            AfisareTipGrid    = FindViewById <GridView>(Resource.Id.GridViewLay);
            FragmentContainer = FindViewById <FrameLayout>(Resource.Id.FragmentContainer);

            var transact = FragmentManager.BeginTransaction();

            transact.Add(FragmentContainer.Id, new Organizator_Trip_VizualizareExcursionisti_GoogleMapsFragment(FragmentContainer), "GoogleMapsFragment");
            transact.Commit();

            OvershootInterpolator interpolator = new OvershootInterpolator(1);

            FragmentContainer.Animate().SetInterpolator(interpolator)
            .TranslationYBy(-605)
            .SetDuration(100);
        }
Exemplo n.º 7
0
        //Api sent Comment
        private async void ImgSentOnClick(object sender, EventArgs e)
        {
            try
            {
                IsRecording = false;

                if (BtnVoice.Tag?.ToString() == "Audio")
                {
                    var interTortola = new FastOutSlowInInterpolator();
                    TopFragment.Animate().SetInterpolator(interTortola).TranslationY(1200).SetDuration(300);
                    SupportFragmentManager.BeginTransaction().Remove(RecordSoundFragment).Commit();

                    PathVoice = RecorderService.GetRecorded_Sound_Path();
                }

                if (string.IsNullOrEmpty(TxtComment.Text) && string.IsNullOrEmpty(PathImage) && string.IsNullOrEmpty(PathVoice))
                {
                    return;
                }

                if (Methods.CheckConnectivity())
                {
                    var dataUser = ListUtils.MyProfileList.FirstOrDefault();
                    //Comment Code

                    var    unixTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
                    string time2         = unixTimestamp.ToString(CultureInfo.InvariantCulture);

                    CommentObjectExtra comment = new CommentObjectExtra
                    {
                        Id             = unixTimestamp.ToString(),
                        PostId         = PostObject.Id,
                        UserId         = UserDetails.UserId,
                        Text           = TxtComment.Text,
                        Time           = time2,
                        CFile          = PathImage,
                        Record         = PathVoice,
                        Publisher      = dataUser,
                        Url            = dataUser?.Url,
                        Fullurl        = PostObject?.PostUrl,
                        Orginaltext    = TxtComment.Text,
                        Owner          = true,
                        CommentLikes   = "0",
                        CommentWonders = "0",
                        IsCommentLiked = false,
                        Replies        = "0"
                    };

                    MAdapter.CommentList.Add(comment);

                    var index = MAdapter.CommentList.IndexOf(comment);
                    if (index > -1)
                    {
                        MAdapter.NotifyItemInserted(index);
                    }

                    MRecycler.Visibility = ViewStates.Visible;

                    var dd = MAdapter.CommentList.FirstOrDefault();
                    if (dd?.Text == MAdapter.EmptyState)
                    {
                        MAdapter.CommentList.Remove(dd);
                        MAdapter.NotifyItemRemoved(MAdapter.CommentList.IndexOf(dd));
                    }

                    ImgGallery.SetImageDrawable(AppSettings.SetTabDarkTheme ? GetDrawable(Resource.Drawable.ic_action_addpost_Ligth) : GetDrawable(Resource.Drawable.ic_action_AddPost));
                    var text = TxtComment.Text;

                    //Hide keyboard
                    TxtComment.Text = "";

                    (int apiStatus, var respond) = await RequestsAsync.Comment.CreatePostComments(PostObject.PostId, text, PathImage, PathVoice);

                    if (apiStatus == 200)
                    {
                        if (respond is CreateComments result)
                        {
                            var date = MAdapter.CommentList.FirstOrDefault(a => a.Id == comment.Id) ?? MAdapter.CommentList.FirstOrDefault(x => x.Id == result.Data.Id);
                            if (date != null)
                            {
                                var db = Mapper.Map <CommentObjectExtra>(result.Data);

                                date    = db;
                                date.Id = result.Data.Id;

                                index = MAdapter.CommentList.IndexOf(MAdapter.CommentList.FirstOrDefault(a => a.Id == unixTimestamp.ToString()));
                                if (index > -1)
                                {
                                    MAdapter.CommentList[index] = db;

                                    //MAdapter.NotifyItemChanged(index);
                                    //MRecycler.ScrollToPosition(index);
                                }

                                var postFeedAdapter = TabbedMainActivity.GetInstance()?.NewsFeedTab?.PostFeedAdapter;
                                var dataGlobal      = postFeedAdapter?.ListDiffer?.Where(a => a.PostData?.Id == PostObject?.PostId).ToList();
                                if (dataGlobal?.Count > 0)
                                {
                                    foreach (var dataClass in from dataClass in dataGlobal let indexCom = postFeedAdapter.ListDiffer.IndexOf(dataClass) where indexCom > -1 select dataClass)
                                    {
                                        dataClass.PostData.PostComments = MAdapter.CommentList.Count.ToString();

                                        if (dataClass.PostData.GetPostComments?.Count > 0)
                                        {
                                            var dataComment = dataClass.PostData.GetPostComments.FirstOrDefault(a => a.Id == date.Id);
                                            if (dataComment == null)
                                            {
                                                dataClass.PostData.GetPostComments.Add(date);
                                            }
                                        }
                                        else
                                        {
                                            dataClass.PostData.GetPostComments = new List <GetCommentObject>()
                                            {
                                                date
                                            };
                                        }

                                        postFeedAdapter.NotifyItemChanged(postFeedAdapter.ListDiffer.IndexOf(dataClass), "commentReplies");
                                    }
                                }

                                var postFeedAdapter2 = WRecyclerView.GetInstance()?.NativeFeedAdapter;
                                var dataGlobal2      = postFeedAdapter2?.ListDiffer?.Where(a => a.PostData?.Id == PostObject?.PostId).ToList();
                                if (dataGlobal2?.Count > 0)
                                {
                                    foreach (var dataClass in from dataClass in dataGlobal2 let indexCom = postFeedAdapter2.ListDiffer.IndexOf(dataClass) where indexCom > -1 select dataClass)
                                    {
                                        dataClass.PostData.PostComments = MAdapter.CommentList.Count.ToString();

                                        if (dataClass.PostData.GetPostComments?.Count > 0)
                                        {
                                            var dataComment = dataClass.PostData.GetPostComments.FirstOrDefault(a => a.Id == date.Id);
                                            if (dataComment == null)
                                            {
                                                dataClass.PostData.GetPostComments.Add(date);
                                            }
                                        }
                                        else
                                        {
                                            dataClass.PostData.GetPostComments = new List <GetCommentObject>()
                                            {
                                                date
                                            };
                                        }

                                        postFeedAdapter2.NotifyItemChanged(postFeedAdapter2.ListDiffer.IndexOf(dataClass), "commentReplies");
                                    }
                                }
                            }
                        }
                    }
                    //else Methods.DisplayReportResult(this, respond);

                    //Hide keyboard
                    TxtComment.Text = "";
                    PathImage       = "";
                    PathVoice       = "";

                    BtnVoice.Tag = "Free";
                    BtnVoice.SetImageResource(Resource.Drawable.microphone);
                    BtnVoice.ClearColorFilter();
                }
                else
                {
                    Toast.MakeText(this, GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
        //Api sent Comment
        private async void ImgSentOnClick(object sender, EventArgs e)
        {
            try
            {
                IsRecording = false;

                switch (BtnVoice.Tag?.ToString())
                {
                case "Audio":
                {
                    var interTortola = new FastOutSlowInInterpolator();
                    TopFragment.Animate()?.SetInterpolator(interTortola)?.TranslationY(1200)?.SetDuration(300);
                    SupportFragmentManager.BeginTransaction().Remove(RecordSoundFragment)?.Commit();

                    PathVoice = RecorderService.GetRecorded_Sound_Path();
                    break;
                }
                }

                if (string.IsNullOrEmpty(TxtComment.Text) && string.IsNullOrWhiteSpace(TxtComment.Text) && string.IsNullOrEmpty(PathImage) && string.IsNullOrEmpty(PathVoice))
                {
                    return;
                }

                if (Methods.CheckConnectivity())
                {
                    var dataUser = ListUtils.MyProfileList?.FirstOrDefault();
                    //Comment Code

                    var    unixTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
                    string time2         = unixTimestamp.ToString(CultureInfo.InvariantCulture);

                    CommentObjectExtra comment = new CommentObjectExtra
                    {
                        Id             = unixTimestamp.ToString(),
                        PostId         = PostObject.Id,
                        UserId         = UserDetails.UserId,
                        Text           = TxtComment.Text,
                        Time           = time2,
                        CFile          = PathImage,
                        Record         = PathVoice,
                        Publisher      = dataUser,
                        Url            = dataUser?.Url,
                        Fullurl        = PostObject?.PostUrl,
                        Orginaltext    = TxtComment.Text,
                        Owner          = true,
                        CommentLikes   = "0",
                        CommentWonders = "0",
                        IsCommentLiked = false,
                        Replies        = "0",
                        RepliesCount   = "0"
                    };

                    MAdapter.CommentList.Add(comment);

                    var index = MAdapter.CommentList.IndexOf(comment);
                    switch (index)
                    {
                    case > -1:
                        MAdapter.NotifyItemInserted(index);
                        break;
                    }

                    MRecycler.Visibility = ViewStates.Visible;

                    var dd = MAdapter.CommentList.FirstOrDefault();
                    if (dd?.Text == MAdapter.EmptyState)
                    {
                        MAdapter.CommentList.Remove(dd);
                        MAdapter.NotifyItemRemoved(MAdapter.CommentList.IndexOf(dd));
                    }

                    ImgGallery.SetImageDrawable(AppSettings.SetTabDarkTheme ? GetDrawable(Resource.Drawable.ic_action_addpost_Ligth) : GetDrawable(Resource.Drawable.ic_action_AddPost));
                    var text = TxtComment.Text;

                    //Hide keyboard
                    TxtComment.Text = "";

                    var(apiStatus, respond) = await RequestsAsync.Comment.CreatePostCommentsAsync(PostObject.PostId, text, PathImage, PathVoice);

                    switch (apiStatus)
                    {
                    case 200:
                    {
                        switch (respond)
                        {
                        case CreateComments result:
                        {
                            var date = MAdapter.CommentList.FirstOrDefault(a => a.Id == comment.Id) ?? MAdapter.CommentList.FirstOrDefault(x => x.Id == result.Data.Id);
                            if (date != null)
                            {
                                var db = ClassMapper.Mapper?.Map <CommentObjectExtra>(result.Data);

                                date    = db;
                                date.Id = result.Data.Id;

                                index = MAdapter.CommentList.IndexOf(MAdapter.CommentList.FirstOrDefault(a => a.Id == unixTimestamp.ToString()));
                                MAdapter.CommentList[index] = index switch
                                {
                                    > -1 => db,
                                    _ => MAdapter.CommentList[index]
                                };

                                var postFeedAdapter = TabbedMainActivity.GetInstance()?.NewsFeedTab?.PostFeedAdapter;
                                var dataGlobal      = postFeedAdapter?.ListDiffer?.Where(a => a.PostData?.Id == PostObject?.PostId).ToList();
                                switch (dataGlobal?.Count)
                                {
                                case > 0:
                                {
                                    foreach (var dataClass in from dataClass in dataGlobal let indexCom = postFeedAdapter.ListDiffer.IndexOf(dataClass) where indexCom > -1 select dataClass)
                                    {
                                        dataClass.PostData.PostComments = MAdapter.CommentList.Count.ToString();

                                        switch (dataClass.PostData.GetPostComments?.Count)
                                        {
                                        case > 0:
                                        {
                                            var dataComment = dataClass.PostData.GetPostComments.FirstOrDefault(a => a.Id == date.Id);
                                            switch (dataComment)
                                            {
                                            case null:
                                                dataClass.PostData.GetPostComments.Add(date);
                                                break;
                                            }

                                            break;
                                        }

                                        default:
                                            dataClass.PostData.GetPostComments = new List <GetCommentObject> {
                                                date
                                            };
                                            break;
                                        }

                                        postFeedAdapter.NotifyItemChanged(postFeedAdapter.ListDiffer.IndexOf(dataClass), "commentReplies");
                                    }

                                    break;
                                }
                                }

                                var postFeedAdapter2 = WRecyclerView.GetInstance()?.NativeFeedAdapter;
                                var dataGlobal2      = postFeedAdapter2?.ListDiffer?.Where(a => a.PostData?.Id == PostObject?.PostId).ToList();
                                switch (dataGlobal2?.Count)
                                {
                                case > 0:
                                {
                                    foreach (var dataClass in from dataClass in dataGlobal2 let indexCom = postFeedAdapter2.ListDiffer.IndexOf(dataClass) where indexCom > -1 select dataClass)
                                    {
                                        dataClass.PostData.PostComments = MAdapter.CommentList.Count.ToString();

                                        switch (dataClass.PostData.GetPostComments?.Count)
                                        {
                                        case > 0:
                                        {
                                            var dataComment = dataClass.PostData.GetPostComments.FirstOrDefault(a => a.Id == date.Id);
                                            switch (dataComment)
                                            {
                                            case null:
                                                dataClass.PostData.GetPostComments.Add(date);
                                                break;
                                            }

                                            break;
                                        }

                                        default:
                                            dataClass.PostData.GetPostComments = new List <GetCommentObject> {
                                                date
                                            };
                                            break;
                                        }

                                        postFeedAdapter2.NotifyItemChanged(postFeedAdapter2.ListDiffer.IndexOf(dataClass), "commentReplies");
                                    }

                                    break;
                                }
                                }
                            }

                            break;
                        }
                        }

                        break;
                    }
                    }