public override Object InstantiateItem(ViewGroup view, int position)
        {
            try
            {
                //ImageView
                var layout = Inflater.Inflate(Resource.Layout.Style_MultiImageCoursalVeiw, view, false);
                Image = layout.FindViewById <ImageViewTouch>(Resource.Id.image);

                // set the default image display type
                //Image.SetDisplayType(ImageViewTouchBase.DisplayType.FitIfBigger);

                //var bit = drawable_from_url(new System.Uri(ImagesList[position].Image));
                //image.SetImageBitmap(bit);
                Glide.With(ActivityContext).Load(ImagesList[position].Image).Apply(new RequestOptions()).Into(Image);

                view.AddView(layout);

                return(layout);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(null);
            }
        }
        private void DestroyBasic()
        {
            try
            {
                RewardedVideoAd?.OnDestroy(this);

                PageImage         = null;
                TxtDescription    = null;
                ImgLike           = null;
                ImgWoWonder       = null;
                TxtCountLike      = null;
                TxtCountWoWonder  = null;
                MainLayout        = null;
                InfoImageLiner    = null;
                BtnCountLike      = null;
                BtnCountWoWonder  = null;
                BtnLike           = null;
                BtnComment        = null;
                BtnShare          = null;
                MainSectionButton = null;
                BtnWonder         = null;
                ImgWonder         = null;
                TxtWonder         = null;
                LikeButton        = null;
                ShareText         = null;
                ClickListener     = null;
                RewardedVideoAd   = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void DestroyBasic()
        {
            try
            {
                RewardedVideoAd?.OnDestroy(this);

                PageImage         = null !;
                TxtDescription    = null !;
                ImgLike           = null !;
                ImgWoWonder       = null !;
                TxtCountLike      = null !;
                TxtCountWoWonder  = null !;
                MainLayout        = null !;
                InfoImageLiner    = null !;
                BtnCountLike      = null !;
                BtnCountWoWonder  = null !;
                BtnLike           = null !;
                BtnComment        = null !;
                BtnShare          = null !;
                MainSectionButton = null !;
                BtnWonder         = null !;
                ImgWonder         = null !;
                TxtWonder         = null !;
                LikeButton        = null !;
                ShareText         = null !;
                ClickListener     = null !;
                RewardedVideoAd   = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Пример #4
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.image_detail_activity);

            toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.imageToolBar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);

            imageView            = FindViewById <ImageViewTouch>(Resource.Id.myImageDetailView);
            imageView.LongClick += ImageView_LongClick;
            holdToShareTextView  = FindViewById <TextView>(Resource.Id.holdToShare);

            retrievedFilePath = (string)Intent.Extras.Get("filePath");
            try
            {
                Glide.With(this)
                .Load(Android.Net.Uri.FromFile(new Java.IO.File(retrievedFilePath)))
                .SetDiskCacheStrategy(DiskCacheStrategy.All)
                .Into(imageView);

                original = await Android.Graphics.BitmapFactory.DecodeFileAsync(retrievedFilePath);

                SupportActionBar.Title    = $"{retrievedFilePath.GetFileNameWithoutExtension()}";
                SupportActionBar.Subtitle = $"{original.Width} x {original.Height} | {PathHelper.GetFileLength(retrievedFilePath)} Kb";
            }
            catch
            {
                imageView.ContentDescription = "An error occured.";
            }
        }
Пример #5
0
 private void InitComponent()
 {
     try
     {
         Image      = FindViewById <ImageViewTouch>(Resource.Id.imageview);
         MoreButton = FindViewById <ImageView>(Resource.Id.moreButton);
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
        private void InitComponent()
        {
            try
            {
                Image      = FindViewById <ImageViewTouch>(Resource.Id.imageview);
                MoreButton = FindViewById <ImageView>(Resource.Id.moreButton);

                DragToClose = FindViewById <DragToClose>(Resource.Id.drag_to_close);
                DragToClose.SetCloseOnClick(true);
                DragToClose.SetDragListener(this);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Пример #7
0
        public override Object InstantiateItem(ViewGroup view, int position)
        {
            try
            {
                //ImageView
                var layout = Inflater.Inflate(Resource.Layout.Style_MultiImageCoursalVeiw, view, false);
                Image = layout.FindViewById <ImageViewTouch>(Resource.Id.image);

                var imageUrl = !string.IsNullOrEmpty(ImagesList[position].PostSticker) ? ImagesList[position].PostSticker : ImagesList[position].PostFileFull;
                Glide.With(ActivityContext).Load(imageUrl).Apply(new RequestOptions()).Into(Image);

                view.AddView(layout);

                return(layout);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(null);
            }
        }
        private void InitComponent()
        {
            try
            {
                PageImage      = FindViewById <ImageViewTouch>(Resource.Id.imageview);
                TxtDescription = FindViewById <TextView>(Resource.Id.tv_description);
                ImgLike        = FindViewById <ImageView>(Resource.Id.image_like1);
                ImgWoWonder    = FindViewById <ImageView>(Resource.Id.image_wowonder);

                TxtCountLike     = FindViewById <TextView>(Resource.Id.LikeText1);
                TxtCountWoWonder = FindViewById <TextView>(Resource.Id.WoWonderTextCount);

                MainLayout                = FindViewById <RelativeLayout>(Resource.Id.main);
                InfoImageLiner            = FindViewById <LinearLayout>(Resource.Id.infoImageLiner);
                InfoImageLiner.Visibility = ViewStates.Visible;

                BtnCountLike     = FindViewById <LinearLayout>(Resource.Id.linerlikeCount);
                BtnCountWoWonder = FindViewById <LinearLayout>(Resource.Id.linerwowonderCount);

                BtnLike    = FindViewById <LinearLayout>(Resource.Id.linerlike);
                BtnComment = FindViewById <LinearLayout>(Resource.Id.linercomment);
                BtnShare   = FindViewById <LinearLayout>(Resource.Id.linershare);

                MainSectionButton = FindViewById <LinearLayout>(Resource.Id.mainsection);
                BtnWonder         = FindViewById <LinearLayout>(Resource.Id.linerSecondReaction);
                ImgWonder         = FindViewById <ImageView>(Resource.Id.image_SecondReaction);
                TxtWonder         = FindViewById <TextView>(Resource.Id.SecondReactionText);

                // set the default image display type
                // PageImage.SetDisplayType(ImageViewTouchBase.DisplayType.FitIfBigger);

                LikeButton = FindViewById <ReactButton>(Resource.Id.beactButton);
                LikeButton.SetTextColor(Color.White);

                ShareText = FindViewById <TextView>(Resource.Id.ShareText);
                if (!AppSettings.ShowTextShareButton && ShareText != null)
                {
                    ShareText.Visibility = ViewStates.Gone;
                }

                if (AppSettings.PostButton == PostButtonSystem.ReactionDefault || AppSettings.PostButton == PostButtonSystem.ReactionSubShine || AppSettings.PostButton == PostButtonSystem.Like)
                {
                    MainSectionButton.WeightSum = 3;
                    BtnWonder.Visibility        = ViewStates.Gone;

                    TxtCountWoWonder.Visibility = ViewStates.Gone;
                    BtnCountWoWonder.Visibility = ViewStates.Gone;
                    ImgWoWonder.Visibility      = ViewStates.Gone;
                }
                else if (AppSettings.PostButton == PostButtonSystem.Wonder)
                {
                    MainSectionButton.WeightSum = 4;
                    BtnWonder.Visibility        = ViewStates.Visible;

                    TxtCountWoWonder.Visibility = ViewStates.Visible;
                    BtnCountWoWonder.Visibility = ViewStates.Visible;
                    ImgWoWonder.Visibility      = ViewStates.Visible;

                    ImgWoWonder.SetImageResource(Resource.Drawable.ic_action_wowonder);
                    ImgWonder.SetImageResource(Resource.Drawable.ic_action_wowonder);
                    TxtWonder.Text = Application.Context.GetText(Resource.String.Btn_Wonder);
                }
                else if (AppSettings.PostButton == PostButtonSystem.DisLike)
                {
                    MainSectionButton.WeightSum = 4;
                    BtnWonder.Visibility        = ViewStates.Visible;

                    TxtCountWoWonder.Visibility = ViewStates.Visible;
                    BtnCountWoWonder.Visibility = ViewStates.Visible;
                    ImgWoWonder.Visibility      = ViewStates.Visible;

                    ImgWoWonder.SetImageResource(Resource.Drawable.ic_action_dislike);
                    ImgWonder.SetImageResource(Resource.Drawable.ic_action_dislike);
                    TxtWonder.Text = Application.Context.GetText(Resource.String.Btn_Dislike);
                }

                if (!AppSettings.ShowShareButton && BtnShare != null)
                {
                    BtnShare.Visibility = ViewStates.Gone;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void InitComponent()
        {
            try
            {
                PageImage      = FindViewById <ImageViewTouch>(Resource.Id.imageview);
                TxtDescription = FindViewById <SuperTextView>(Resource.Id.tv_description);
                TxtDescription?.SetTextInfo(TxtDescription);

                ImgLike     = FindViewById <ImageView>(Resource.Id.image_like1);
                ImgWoWonder = FindViewById <ImageView>(Resource.Id.image_wowonder);

                TxtCountLike     = FindViewById <TextView>(Resource.Id.LikeText1);
                TxtCountWoWonder = FindViewById <TextView>(Resource.Id.WoWonderTextCount);

                ShareCount   = FindViewById <TextView>(Resource.Id.Sharecount);
                CommentCount = FindViewById <TextView>(Resource.Id.Commentcount);

                MainLayout                = FindViewById <RelativeLayout>(Resource.Id.main);
                InfoImageLiner            = FindViewById <LinearLayout>(Resource.Id.infoImageLiner);
                InfoImageLiner.Visibility = ViewStates.Visible;

                BtnCountLike     = FindViewById <LinearLayout>(Resource.Id.linerlikeCount);
                BtnCountWoWonder = FindViewById <LinearLayout>(Resource.Id.linerwowonderCount);

                BtnLike    = FindViewById <LinearLayout>(Resource.Id.linerlike);
                BtnComment = FindViewById <LinearLayout>(Resource.Id.linercomment);
                BtnShare   = FindViewById <LinearLayout>(Resource.Id.linershare);

                MainSectionButton = FindViewById <LinearLayout>(Resource.Id.mainsection);
                BtnWonder         = FindViewById <LinearLayout>(Resource.Id.linerSecondReaction);
                ImgWonder         = FindViewById <ImageView>(Resource.Id.image_SecondReaction);
                TxtWonder         = FindViewById <TextView>(Resource.Id.SecondReactionText);

                // set the default image display type
                // PageImage.SetDisplayType(ImageViewTouchBase.DisplayType.FitIfBigger);

                LikeButton = FindViewById <ReactButton>(Resource.Id.ReactButton);
                LikeButton.SetTextColor(Color.ParseColor("#C3C7D0"));

                ShareText            = FindViewById <TextView>(Resource.Id.ShareText);
                ShareText.Visibility = AppSettings.ShowTextShareButton switch
                {
                    false when ShareText != null => ViewStates.Gone,
                               _ => ShareText.Visibility
                };

                switch (AppSettings.PostButton)
                {
                case PostButtonSystem.ReactionDefault:
                case PostButtonSystem.ReactionSubShine:
                case PostButtonSystem.Like:
                    MainSectionButton.WeightSum = 5;
                    BtnWonder.Visibility        = ViewStates.Gone;

                    TxtCountWoWonder.Visibility = ViewStates.Gone;
                    BtnCountWoWonder.Visibility = ViewStates.Gone;
                    ImgWoWonder.Visibility      = ViewStates.Gone;
                    break;

                case PostButtonSystem.Wonder:
                    MainSectionButton.WeightSum = 4;
                    BtnWonder.Visibility        = ViewStates.Visible;

                    TxtCountWoWonder.Visibility = ViewStates.Visible;
                    BtnCountWoWonder.Visibility = ViewStates.Visible;
                    ImgWoWonder.Visibility      = ViewStates.Visible;

                    ImgWoWonder.SetImageResource(Resource.Drawable.ic_action_wowonder);
                    ImgWonder.SetImageResource(Resource.Drawable.ic_action_wowonder);
                    TxtWonder.Text = Application.Context.GetText(Resource.String.Btn_Wonder);
                    break;

                case PostButtonSystem.DisLike:
                    MainSectionButton.WeightSum = 4;
                    BtnWonder.Visibility        = ViewStates.Visible;

                    TxtCountWoWonder.Visibility = ViewStates.Visible;
                    BtnCountWoWonder.Visibility = ViewStates.Visible;
                    ImgWoWonder.Visibility      = ViewStates.Visible;

                    ImgWoWonder.SetImageResource(Resource.Drawable.ic_action_dislike);
                    ImgWonder.SetImageResource(Resource.Drawable.ic_action_dislike);
                    TxtWonder.Text = Application.Context.GetText(Resource.String.Btn_Dislike);
                    break;
                }

                BtnShare.Visibility = AppSettings.ShowShareButton switch
                {
                    false when BtnShare != null => ViewStates.Gone,
                               _ => BtnShare.Visibility
                };
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }