Example #1
0
        protected override void OnStart()
        {
            try
            {
                base.OnStart();

                IMethods.Set_TextViewIcon("1", BackIcon, IonIcons_Fonts.AndroidArrowBack);

                //profile_picture
                ImageCacheLoader.LoadImage(UserDetails.avatar, UserProfileImage, false, true);

                if (!string.IsNullOrEmpty(UserDetails.Full_name))
                {
                    usernameText.Text = UserDetails.Full_name;
                }
                else
                {
                    usernameText.Text = UserDetails.Username;
                }

                ActivityListItems.Clear();

                if (Type == "image")
                {
                    SetImageStory(Uri);
                }
                else
                {
                    SetvideoStory(Uri);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #2
0
        protected override void OnStart()
        {
            try
            {
                base.OnStart();

                IMethods.Set_TextViewIcon("1", BackIcon, IonIcons_Fonts.AndroidArrowBack);

                //profile_picture
                var AvatarSplit = UserDetails.avatar.Split('/').Last();
                if (AvatarSplit == "d-avatar.jpg")
                {
                    var ImageTrancform = ImageService.Instance.LoadUrl("no_profile_image.png");
                    ImageTrancform.LoadingPlaceholder("no_profile_image.png", ImageSource.CompiledResource);
                    ImageTrancform.ErrorPlaceholder("no_profile_image.png", ImageSource.CompiledResource);
                    ImageTrancform.TransformPlaceholders(true);
                    ImageTrancform.Transform(new CircleTransformation(5, "#ffffff"));
                    ImageTrancform.Into(UserProfileImage);
                }
                else
                {
                    var GetImg = IMethods.MultiMedia.GetMediaFrom_Disk(IMethods.IPath.FolderDiskImage, AvatarSplit);
                    if (GetImg == "File Dont Exists")
                    {
                        Task.Run(() =>
                        {
                            IMethods.MultiMedia.DownloadMediaTo_DiskAsync(IMethods.IPath.FolderDiskImage,
                                                                          UserDetails.avatar);
                            IMethods.Load_Image_From_Url(UserProfileImage, UserDetails.avatar);
                        });
                    }
                    else
                    {
                        var file           = Android.Net.Uri.FromFile(new File(GetImg));
                        var ImageTrancform = ImageService.Instance.LoadFile(file.Path);
                        ImageTrancform.LoadingPlaceholder("no_profile_image.png", ImageSource.CompiledResource);
                        ImageTrancform.ErrorPlaceholder("no_profile_image.png", ImageSource.CompiledResource);
                        ImageTrancform.TransformPlaceholders(true);
                        ImageTrancform.Transform(new CircleTransformation(5, "#ffffff"));
                        ImageTrancform.FadeAnimation(false);
                        ImageTrancform.Into(UserProfileImage);
                    }
                }

                if (!string.IsNullOrEmpty(UserDetails.Full_name))
                {
                    usernameText.Text = UserDetails.Full_name;
                }
                else
                {
                    usernameText.Text = UserDetails.Username;
                }

                Txt_AboutStory.SetMessageBoxHint("Add caption");
                Txt_AboutStory.SetSendClickListener(this);

                ActivityListItems.Clear();

                if (Type == "image")
                {
                    SetImageStory(Uri);
                }
                else
                {
                    SetvideoStory(Uri);
                }
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }