Example #1
0
 private void TimerVideo_Elapsed(object sender, ElapsedEventArgs e)
 {
     try
     {
         RunOnUiThread(() =>
         {
             var ff = videoView.CurrentPosition * 100 / videoView.Duration;
             if (Build.VERSION.SdkInt >= BuildVersionCodes.N)
             {
                 StoriesProgressViewDisplay.SetProgress(ff, true);
             }
             else
             {
                 try
                 {
                     // For API < 24
                     StoriesProgressViewDisplay.Progress = ff;
                 }
                 catch (Exception exception)
                 {
                     Console.WriteLine(exception);
                 }
             }
         });
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
Example #2
0
        private void Timerprogress_Elapsed(object sender, ElapsedEventArgs e)
        {
            try
            {
                RunOnUiThread(() =>
                {
                    progrescount += 1;

                    if (Build.VERSION.SdkInt >= BuildVersionCodes.N)
                    {
                        if (progrescount != 100)
                        {
                            StoriesProgressViewDisplay.SetProgress(progrescount, true);
                        }
                        else
                        {
                            progrescount = 1;
                        }
                    }
                    else
                    {
                        try
                        {
                            // For API < 24
                            if (progrescount != 100)
                            {
                                StoriesProgressViewDisplay.Progress = progrescount;
                            }
                            else
                            {
                                progrescount = 1;
                            }
                        }
                        catch (Exception exception)
                        {
                            Console.WriteLine(exception);
                        }
                    }
                });
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Example #3
0
        public void ChangeStoryView()
        {
            try
            {
                if (!Timerstory.Enabled)
                {
                    Timerstory.Enabled             = true;
                    Timerprogress.Enabled          = true;
                    StoriesProgressViewDisplay.Max = 100;
                }

                progrescount = 0;
                if (Build.VERSION.SdkInt >= BuildVersionCodes.N)
                {
                    StoriesProgressViewDisplay.SetProgress(progrescount, true);
                }
                else
                {
                    try
                    {
                        // For API < 24
                        StoriesProgressViewDisplay.Progress = progrescount;
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine(exception);
                    }
                }

                countstory++;
                CountStoryText.Text = (count - countstory).ToString();

                if (countstory <= count - 1)
                {
                    var dataStory = ListOfStories.FirstOrDefault();
                    if (dataStory.Key != null)
                    {
                        var type = IMethods.AttachmentFiles.Check_FileExtension(dataStory.Key);
                        if (type == "Video")
                        {
                            SetVideoStory(dataStory.Key, dataStory.Value);
                        }
                        else if (type == "Image")
                        {
                            SetImageStory(dataStory.Key, dataStory.Value);
                        }


                        ListOfStories.Remove(dataStory.Key);
                    }
                }
                else
                {
                    Finish();

                    Timerstory.Enabled = false;
                    Timerstory.Stop();

                    Timerprogress.Enabled = false;
                    Timerprogress.Stop();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }