internal MoveInfo(RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY)
			{
				this.holder = holder;
				this.fromX = fromX;
				this.fromY = fromY;
				this.toX = toX;
				this.toY = toY;
			}
Exemple #2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            if (items[position].Kind == YtKind.Video)
            {
                SongHolder holder = (SongHolder)viewHolder;
                Song       song   = items[position].song;

                holder.Title.Text         = song.Title;
                holder.Artist.Text        = song.Artist;
                holder.reorder.Visibility = ViewStates.Gone;

                var songAlbumArtUri = Android.Net.Uri.Parse(song.Album);
                Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Color.placeholder).Transform(new RemoveBlackBorder(true)).Into(holder.AlbumArt);

                holder.more.Tag = position;
                if (!holder.more.HasOnClickListeners)
                {
                    holder.more.Click += (sender, e) =>
                    {
                        int tagPosition = (int)((ImageView)sender).Tag;
                        MainActivity.instance.More(items[tagPosition].song);
                    };
                }

                if (song.IsLiveStream)
                {
                    holder.Live.Visibility = ViewStates.Visible;
                }
                else
                {
                    holder.Live.Visibility = ViewStates.Gone;
                }

                float scale = MainActivity.instance.Resources.DisplayMetrics.Density;
                if (position + 1 == items.Count)
                {
                    holder.ItemView.SetPadding((int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), listPadding);
                    LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)holder.more.LayoutParameters;
                    layoutParams.SetMargins(0, 0, 0, listPadding);
                    holder.more.LayoutParameters = layoutParams;
                }
                else
                {
                    holder.ItemView.SetPadding((int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f));
                    LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)holder.more.LayoutParameters;
                    layoutParams.SetMargins(0, 0, 0, 0);
                    holder.more.LayoutParameters = layoutParams;
                }
            }
            else if (items[position].Kind == YtKind.Playlist)
            {
                PlaylistHolder holder   = (PlaylistHolder)viewHolder;
                PlaylistItem   playlist = items[position].playlist;

                holder.Title.Text = playlist.Name;
                holder.Owner.Text = playlist.Owner;

                var songAlbumArtUri = Android.Net.Uri.Parse(playlist.ImageURL);
                Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Color.placeholder).Transform(new RemoveBlackBorder(true)).Into(holder.AlbumArt);

                holder.more.Tag = position;
                if (!holder.more.HasOnClickListeners)
                {
                    holder.more.Click += (sender, e) =>
                    {
                        int tagPosition = (int)((ImageView)sender).Tag;
                        YoutubeSearch.instances[0].PlaylistMore(items[tagPosition].playlist);
                    };
                }
            }
            else if (items[position].Kind == YtKind.Channel)
            {
                RecyclerChannelHolder holder = (RecyclerChannelHolder)viewHolder;
                Channel channel = items[position].channel;

                holder.Title.Text = channel.Name;
                Picasso.With(Android.App.Application.Context).Load(channel.ImageURL).Transform(new CircleTransformation(false)).Into(holder.AlbumArt);

                if (!holder.action.HasOnClickListeners)
                {
                    holder.action.Click += (sender, e) =>
                    {
                        YoutubeManager.MixFromChannel(channel.YoutubeID);
                    };
                }
            }
            else if (items[position].Kind == YtKind.ChannelPreview)
            {
                ChannelPreviewHolder holder = (ChannelPreviewHolder)viewHolder;
                Channel channel             = items[position].channel;

                holder.Name.Text = channel.Name;
                Picasso.With(Android.App.Application.Context).Load(channel.ImageURL).Placeholder(Resource.Color.placeholder).Transform(new CircleTransformation(true)).Into(holder.Logo);


                DisplayMetrics displayMetrics = new DisplayMetrics();
                MainActivity.instance.WindowManager.DefaultDisplay.GetMetrics(displayMetrics);
                int wholeWidth = (displayMetrics.WidthPixels - MainActivity.instance.DpToPx(15)) / 2;
                int mixHeight  = (int)(wholeWidth * 0.5625); /// width / 16 */ 9
                holder.MixOne.LayoutParameters.Height = mixHeight;
                holder.MixOne.RequestLayout();
                holder.MixTwo.LayoutParameters.Height      = mixHeight;
                holder.ChannelLogo.LayoutParameters.Height = mixHeight * 2;

                Picasso.With(Android.App.Application.Context).Load(channel.ImageURL).Placeholder(Resource.Color.placeholder).Fit().CenterCrop().Into(holder.ChannelLogo);

                List <YtFile> files = items.FindAll(x => x.Kind == YtKind.Video && x.song.Artist == channel.Name);
                if (files.Count > 0)
                {
                    Picasso.With(Android.App.Application.Context).Load(files[0].song.Album).Placeholder(Resource.Color.placeholder).Transform(new RemoveBlackBorder()).Into(holder.MixOne);
                }
                if (files.Count > 1)
                {
                    Picasso.With(Android.App.Application.Context).Load(files[1].song.Album).Placeholder(Resource.Color.placeholder).Transform(new RemoveBlackBorder()).Into(holder.MixTwo);
                }

                if (!holder.ChannelHolder.HasOnClickListeners)
                {
                    holder.ChannelHolder.Click += (sender, e) =>
                    {
                        MainActivity.instance.menu.FindItem(Resource.Id.search).ActionView.Focusable = false;
                        MainActivity.instance.menu.FindItem(Resource.Id.search).CollapseActionView();
                        MainActivity.instance.menu.FindItem(Resource.Id.search).ActionView.Focusable = true;
                        MainActivity.instance.FindViewById(Resource.Id.tabs).Visibility = ViewStates.Gone;
                        MainActivity.instance.SupportFragmentManager.BeginTransaction().Replace(Resource.Id.contentView, ChannelDetails.NewInstance(channel)).AddToBackStack("Channel Details").Commit();
                    };
                }

                if (!holder.MixHolder.HasOnClickListeners)
                {
                    holder.MixHolder.Click += (sender, e) =>
                    {
                        YoutubeManager.MixFromChannel(channel.YoutubeID);
                    };
                }
            }
        }
        public override bool OnMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder targetView)
        {
            if (viewHolder.ItemViewType != targetView.ItemViewType)
            {
                return(false);
            }

            _adapter.OnItemMove(viewHolder.AdapterPosition, targetView.AdapterPosition);
            return(true);
        }
        public override bool OnMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target)
        {
            if (viewHolder.ItemViewType != target.ItemViewType)
            {
                return(false);
            }
            if (dragFrom == -1)
            {
                dragFrom = viewHolder.AdapterPosition;
            }
            dragTo = target.AdapterPosition;

            // Notify the adapter of the move
            _mAdapter.OnItemMove(viewHolder.AdapterPosition, target.AdapterPosition);
            return(true);
        }
Exemple #5
0
 public override bool OnMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target)
 {
     throw new NotImplementedException();
 }
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            Customer_BookAppointment_Time_ViewModel_ViewHolder vh = holder as Customer_BookAppointment_Time_ViewModel_ViewHolder;

            vh.txtTime.Text = mTime_List[position].mTxtTime;
        }
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is NearByAdapterViewHolder holder)
                {
                    var users = NearByList[position];
                    if (users != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, users.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Color);

                        //Online Or offline
                        if (users.LastseenStatus == "on")
                        {
                            //Online
                            GlideImageLoader.LoadImage(ActivityContext, "Green_Online", holder.ImageOnline, ImageStyle.CircleCrop, ImagePlaceholders.Color);
                            holder.LastTimeOnline.Text = ActivityContext.GetString(Resource.String.Lbl_Online);
                        }
                        else
                        {
                            GlideImageLoader.LoadImage(ActivityContext, "Grey_Offline", holder.ImageOnline, ImageStyle.CircleCrop, ImagePlaceholders.Color);
                            holder.LastTimeOnline.Text = Methods.Time.TimeAgo(int.Parse(users.LastseenUnixTime), true);
                        }

                        holder.Name.Text = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(users), 14);

                        if (users.IsFollowing == "1" || users.IsFollowing == "yes" || users.IsFollowing == "Yes") // My Friend
                        {
                            holder.Button.SetBackgroundResource(Resource.Drawable
                                                                .follow_button_profile_friends_pressed);
                            holder.Button.SetTextColor(Color.ParseColor("#ffffff"));
                            holder.Button.Text = ActivityContext.GetText(AppSettings.ConnectivitySystem == 1
                                ? Resource.String.Lbl_Following
                                : Resource.String.Lbl_Friends);

                            holder.Button.Tag = "friends";
                        }
                        else //Not Friend
                        {
                            holder.Button.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends);
                            holder.Button.SetTextColor(Color.ParseColor(AppSettings.MainColor));
                            holder.Button.Text = ActivityContext.GetText(AppSettings.ConnectivitySystem == 1
                                ? Resource.String.Lbl_Follow
                                : Resource.String.Lbl_AddFriends);
                            holder.Button.Tag = "false";
                        }

                        if (!holder.Button.HasOnClickListeners)
                        {
                            holder.Button.Click += (sender, args) =>
                            {
                                try
                                {
                                    if (!Methods.CheckConnectivity())
                                    {
                                        Toast.MakeText(ActivityContext,
                                                       ActivityContext.GetString(Resource.String.Lbl_CheckYourInternetConnection),
                                                       ToastLength.Short).Show();
                                    }
                                    else
                                    {
                                        NotifyItemChanged(viewHolder.AdapterPosition,
                                                          holder.Button.Tag.ToString() == "false" ? "true" : "false");

                                        if (Methods.CheckConnectivity())
                                        {
                                            PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                                                () => RequestsAsync.Global.Follow_User(users.UserId)
                                            });
                                        }
                                        else
                                        {
                                            Toast.MakeText(ActivityContext,
                                                           ActivityContext.GetString(Resource.String
                                                                                     .Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                                        }
                                    }
                                }
                                catch (Exception e)
                                {
                                    Console.WriteLine(e);
                                }
                            }
                        }
                        ;
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Exemple #8
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            StepViewHolder viewHolder = holder as StepViewHolder;
            Step           step       = Route.Steps[position];

            // First update
            if (holder.OldPosition == -1)
            {
                viewHolder.Name.Text = step.Stop.Name;

                viewHolder.Rail1.SetBackgroundColor(color);
                viewHolder.Rail2.SetBackgroundColor(color);

                viewHolder.Rail1.Visibility = position == 0 ? ViewStates.Gone : ViewStates.Visible;
                viewHolder.Rail2.Visibility = position == Route.Steps.Length - 1 ? ViewStates.Gone : ViewStates.Visible;
            }

            // Update texts
            viewHolder.Favorite.SetImageResource(step.Stop.GetIsFavorite() ? Resource.Drawable.ic_star : Resource.Drawable.ic_star_border);

            if (stepTimes != null)
            {
                TimeStep[] timeSteps = stepTimes[position];

                if (timeSteps.Length > 0)
                {
                    viewHolder.Description.Text = Utils.GetReadableTimes(timeSteps, DateTime.Now);
                }
                else
                {
                    viewHolder.Description.Text = "Service terminé";
                }
            }
            else
            {
                viewHolder.Description.Text = "Informations non disponibles";
            }

            // Update icon positions
            if (stepTransports != null)
            {
                float density = viewHolder.ItemView.Context.Resources.DisplayMetrics.Density;

                {
                    Transport currentTransport = position == stepTransports.Length ? null : stepTransports[position];
                    float     currentPosition  = currentTransport == null ? 72 : (int)(1 + 36 - 16 + 72 * currentTransport.Progress);

                    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams((int)(32 * density), (int)(32 * density));
                    layoutParams.AddRule(LayoutRules.CenterHorizontal);
                    layoutParams.SetMargins(0, (int)(currentPosition * density), 0, 0);

                    viewHolder.Icon1.LayoutParameters = layoutParams;
                }

                {
                    Transport previousTransport = position == 0 ? null : stepTransports[position - 1];
                    float     previousPosition  = previousTransport == null ? 72 : (int)(-1 - 36 - 16 + 72 * previousTransport.Progress);

                    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams((int)(32 * density), (int)(32 * density));
                    layoutParams.AddRule(LayoutRules.CenterHorizontal);
                    layoutParams.SetMargins(0, (int)(previousPosition * density), 0, 0);

                    viewHolder.Icon2.LayoutParameters = layoutParams;
                }
            }

            if (!viewHolders.Contains(viewHolder))
            {
                viewHolders.Add(viewHolder);
            }
        }
Exemple #9
0
 public override bool OnMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder,
                             RecyclerView.ViewHolder target)
 {
     return(false);
 }
Exemple #10
0
 public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
 {
     if (IsFooter(position))
     {
         _footerDataTemplate(default, holder as TFooterHolder, position);
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is FundingAdaptersViewHolder holder)
                {
                    var item = FundingList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.Image, holder.Image, ImageStyle.CenterCrop, ImagePlaceholders.Drawable);

                        holder.Title.Text = Methods.FunString.DecodeString(item.Title);

                        if (item.UserData != null)
                        {
                            holder.Username.Text = WoWonderTools.GetNameFinal(item.UserData);
                        }
                        else
                        {
                            holder.Username.Visibility = ViewStates.Gone;
                        }

                        try
                        {
                            item.Raised = item.Raised.Replace(AppSettings.CurrencyFundingPriceStatic, "");
                            item.Amount = item.Amount.Replace(AppSettings.CurrencyFundingPriceStatic, "");

                            decimal d = decimal.Parse(item.Raised, CultureInfo.InvariantCulture);
                            holder.Raised.Text = AppSettings.CurrencyFundingPriceStatic + d.ToString("0.00");

                            decimal amount = decimal.Parse(item.Amount, CultureInfo.InvariantCulture);
                            holder.TottalAmount.Text = AppSettings.CurrencyFundingPriceStatic + amount.ToString("0.00");

                            decimal dBar = decimal.Parse(item.Bar, CultureInfo.InvariantCulture);
                            var     bar  = dBar.ToString("0");
                            holder.Progress.Progress = Convert.ToInt32(bar);
                        }
                        catch (Exception exception)
                        {
                            holder.Raised.Text       = AppSettings.CurrencyFundingPriceStatic + item.Raised;
                            holder.TottalAmount.Text = AppSettings.CurrencyFundingPriceStatic + item.Amount;
                            holder.Progress.Progress = Convert.ToInt32(item.Bar);
                            Methods.DisplayReportResultTrack(exception);
                        }

                        holder.DonationTime.Text = IonIconsFonts.IosClockOutline + "  " + Methods.Time.TimeAgo(Convert.ToInt32(item.Time), false);

                        if (!string.IsNullOrEmpty(item.Description))
                        {
                            holder.Description.Text = Methods.FunString.DecodeString(item.Description);
                        }
                        else
                        {
                            ActivityContext.GetText(Resource.String.Lbl_NoAnyDescription);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
			public FcAnimatorListenerAnonymousInnerClassHelper5(FcItemAnimator outerInstance, RecyclerView.ViewHolder newHolder, View oldView, View newView, AnimatorSet animator)
			{
				this.outerInstance = outerInstance;
				this.newHolder = newHolder;
				this.oldView = oldView;
				this.newView = newView;
				this.animator = animator;
			}
			public FcAnimatorListenerAnonymousInnerClassHelper3(FcItemAnimator outerInstance, RecyclerView.ViewHolder holder)
			{
				this.outerInstance = outerInstance;
				this.holder = holder;
			}
 public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
 {
     throw new NotImplementedException();
 }
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            var vh = holder as NotificationViewHolder;

            vh.notifDescription.Text = $"{notifications[position]["SenderName"]}\n{notifications[position]["Message"]}\n{((DateTime)notifications[position]["Time"]).ToShortTimeString()}";
        }
Exemple #16
0
        public void LoadCommentData(CommentObjectExtra item, RecyclerView.ViewHolder viewHolder, int position = 0, bool hasClickEvents = true)
        {
            try
            {
                if (!(viewHolder is CommentAdapterViewHolder holder))
                {
                    return;
                }

                if (AppSettings.FlowDirectionRightToLeft)
                {
                    holder.BubbleLayout.LayoutDirection = LayoutDirection.Rtl;
                }

                if (!string.IsNullOrEmpty(item.Text) || !string.IsNullOrWhiteSpace(item.Text))
                {
                    var changer = new TextSanitizer(holder.CommentText, ActivityContext);
                    changer.Load(Methods.FunString.DecodeString(item.Text));
                }
                else
                {
                    holder.CommentText.Visibility = ViewStates.Gone;
                }

                holder.TimeTextView.Text = Methods.Time.TimeAgo(int.Parse(item.Time));
                holder.UserName.Text     = item.Publisher.Name;

                GlideImageLoader.LoadImage(ActivityContext, item.Publisher.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                var textHighLighter = item.Publisher.Name;
                var textIsPro       = string.Empty;

                if (item.Publisher.Verified == "1")
                {
                    textHighLighter += " " + IonIconsFonts.CheckmarkCircled;
                }

                if (item.Publisher.IsPro == "1")
                {
                    textIsPro        = " " + IonIconsFonts.Flash;
                    textHighLighter += textIsPro;
                }

                var decorator = TextDecorator.Decorate(holder.UserName, textHighLighter).SetTextStyle((int)TypefaceStyle.Bold, 0, item.Publisher.Name.Length);

                if (item.Publisher.Verified == "1")
                {
                    decorator.SetTextColor(Resource.Color.Post_IsVerified, IonIconsFonts.CheckmarkCircled);
                }

                if (item.Publisher.IsPro == "1")
                {
                    decorator.SetTextColor(Resource.Color.text_color_in_between, textIsPro);
                }

                decorator.Build();

                //Image
                if (holder.ItemViewType == 1 || holder.CommentImage != null)
                {
                    if (!string.IsNullOrEmpty(item.CFile) && (item.CFile.Contains("file://") || item.CFile.Contains("content://") || item.CFile.Contains("storage") || item.CFile.Contains("/data/user/0/")))
                    {
                        File file2    = new File(item.CFile);
                        var  photoUri = FileProvider.GetUriForFile(ActivityContext, ActivityContext.PackageName + ".fileprovider", file2);
                        Glide.With(ActivityContext).Load(photoUri).Apply(new RequestOptions()).Into(holder.CommentImage);

                        //GlideImageLoader.LoadImage(ActivityContext,item.CFile, holder.CommentImage, ImageStyle.CenterCrop, ImagePlaceholders.Color);
                    }
                    else
                    {
                        if (!item.CFile.Contains(Client.WebsiteUrl))
                        {
                            item.CFile = WoWonderTools.GetTheFinalLink(item.CFile);
                        }

                        GlideImageLoader.LoadImage(ActivityContext, item.CFile, holder.CommentImage, ImageStyle.CenterCrop, ImagePlaceholders.Color);
                    }
                }

                //Voice
                if (holder.VoiceLayout != null && !string.IsNullOrEmpty(item.Record))
                {
                    LoadAudioItem(holder, position, item);
                }

                if (item.Replies != "0" && item.Replies != null)
                {
                    holder.ReplyTextView.Text = ActivityContext.GetText(Resource.String.Lbl_Reply) + " " + "(" + item.Replies + ")";
                }

                if (item.IsCommentLiked)
                {
                    holder.LikeTextView.Text = ActivityContext.GetText(Resource.String.Btn_Liked);
                    holder.LikeTextView.SetTextColor(Color.ParseColor(AppSettings.MainColor));
                    holder.LikeTextView.Tag = "Liked";
                }
                else
                {
                    holder.LikeTextView.Text = ActivityContext.GetText(Resource.String.Btn_Like);

                    if (AppSettings.SetTabDarkTheme || ThemeColor == "Dark")
                    {
                        holder.ReplyTextView.SetTextColor(Color.White);
                        holder.LikeTextView.SetTextColor(Color.White);
                    }
                    else
                    {
                        holder.ReplyTextView.SetTextColor(Color.Black);
                        holder.LikeTextView.SetTextColor(Color.Black);
                    }

                    holder.LikeTextView.Tag = "Like";
                }

                holder.TimeTextView.Tag = "true";

                if (holder.Image.HasOnClickListeners)
                {
                    return;
                }

                var postEventListener = new CommentClickListener(ActivityContext, "Comment");

                //Create an Event
                holder.MainView.LongClick += (sender, e) => postEventListener.MoreCommentReplyPostClick(new CommentReplyClickEventArgs {
                    CommentObject = item, Position = position, View = holder.MainView
                });

                holder.Image.Click += (sender, args) => postEventListener.ProfilePostClick(new ProfileClickEventArgs {
                    Holder = holder, CommentClass = item, Position = position, View = holder.MainView
                });

                if (hasClickEvents)
                {
                    holder.ReplyTextView.Click += (sender, args) => postEventListener.CommentReplyPostClick(new CommentReplyClickEventArgs {
                        CommentObject = item, Position = position, View = holder.MainView
                    });
                }

                holder.LikeTextView.Click += delegate
                {
                    try
                    {
                        if (holder.LikeTextView.Tag.ToString() == "Liked")
                        {
                            item.IsCommentLiked = false;

                            holder.LikeTextView.Text = ActivityContext.GetText(Resource.String.Btn_Like);
                            if (AppSettings.SetTabDarkTheme || ThemeColor == "Dark")
                            {
                                holder.LikeTextView.SetTextColor(Color.White);
                            }
                            else
                            {
                                holder.LikeTextView.SetTextColor(Color.Black);
                            }

                            holder.LikeTextView.Tag = "Like";

                            //sent api Dislike comment
                            PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                                () => RequestsAsync.Comment.LikeUnLikeCommentAsync(item.Id, false)
                            });
                        }
                        else
                        {
                            item.IsCommentLiked = true;

                            holder.LikeTextView.Text = ActivityContext.GetText(Resource.String.Btn_Liked);
                            holder.LikeTextView.SetTextColor(Color.ParseColor(AppSettings.MainColor));
                            holder.LikeTextView.Tag = "Liked";

                            //sent api like comment
                            PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                                () => RequestsAsync.Comment.LikeUnLikeCommentAsync(item.Id, true)
                            });
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e);
                    }
                };

                if (holder.CommentImage != null)
                {
                    holder.CommentImage.Click += (sender, args) => postEventListener.OpenImageLightBox(item);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
            public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
            {
                MyView myHolder = holder as MyView;

                myHolder.mRoundName.Text = mPerformanceIdList[position];
            }
			public FcAnimatorListenerAnonymousInnerClassHelper(FcItemAnimator outerInstance, RecyclerView.ViewHolder holder, View view, Animator fadeInAnimator)
			{
				this.outerInstance = outerInstance;
				this.holder = holder;
				this.view = view;
				this.fadeInAnimator = fadeInAnimator;
				mCanceled = false;
			}
 public void OnItemMove(RecyclerView recycler, RecyclerView.ViewHolder p1, RecyclerView.ViewHolder p2)
 {
     NotifyItemMoved(p1.AdapterPosition, p2.AdapterPosition);
 }
Exemple #20
0
 public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
 {
     base.OnBindViewHolder(holder, position);
 }
 public void OnItemDismiss(RecyclerView.ViewHolder viewHolder, int p1, object item)
 {
     ItemSwipe?.Execute(item);
     //NotifyItemRemoved(viewHolder.AdapterPosition);
 }
Exemple #22
0
 public override void OnSwiped(RecyclerView.ViewHolder viewHolder, int direction)
 {
     _vacationsAdapter.RemoveItem(viewHolder.AdapterPosition);
 }
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            var vh = holder as PostsViewHolder;

            vh.Bind(_posts[position]);
        }
Exemple #24
0
 public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
 {
     (holder as PostViewHolder).BindView(Posts[position], position);
 }
Exemple #25
0
 protected override void BindSectionHeaderViewHolder(RecyclerView.ViewHolder holder, int section)
 {
     (holder as ViewHolder).TextView.Text = $"Section {section} Header";
 }
 public override void OnSwiped(RecyclerView.ViewHolder viewHolder, int direction)
 {
     // Notify the adapter of the dismissal
     _mAdapter.OnItemDismiss(viewHolder.AdapterPosition);
 }
Exemple #27
0
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (position >= 0)
                {
                    if (viewHolder is LibraryAdapterViewHolder holder)
                    {
                        var item = LibraryList[position];
                        if (item != null)
                        {
                            if (item.SectionId == "1") // Liked
                            {
                                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.SectionIconView, IonIconsFonts.IosHeartOutline);
                                holder.SectionTextView.Text = ActivityContext.GetText(Resource.String.Lbl_Liked);
                            }
                            else if (item.SectionId == "2") // RecentlyPlayed
                            {
                                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.SectionIconView, IonIconsFonts.Play);
                                holder.SectionTextView.Text = ActivityContext.GetText(Resource.String.Lbl_RecentlyPlayed);
                            }
                            else if (item.SectionId == "3") // Favorites
                            {
                                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.SectionIconView, IonIconsFonts.AndroidStarOutline);
                                holder.SectionTextView.Text = ActivityContext.GetText(Resource.String.Lbl_Favorites);
                            }
                            else if (item.SectionId == "4") // LatestDownloads
                            {
                                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.SectionIconView, IonIconsFonts.StatsBars);
                                holder.SectionTextView.Text = ActivityContext.GetText(Resource.String.Lbl_LatestDownloads);
                            }
                            else if (item.SectionId == "5") // Share
                            {
                                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.SectionIconView, IonIconsFonts.AndroidShareAlt);
                                holder.SectionTextView.Text = ActivityContext.GetText(Resource.String.Lbl_Shared);
                            }
                            else if (item.SectionId == "6") // Purchases
                            {
                                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.SectionIconView, IonIconsFonts.SocialUsd);
                                holder.SectionTextView.Text = ActivityContext.GetText(Resource.String.Lbl_Purchases);
                            }

                            if (item.SongsCount == 0)
                            {
                                holder.SectionVideosCounTextView.Visibility = ViewStates.Gone;
                            }
                            else
                            {
                                holder.SectionVideosCounTextView.Visibility = ViewStates.Visible;
                                holder.SectionVideosCounTextView.Text       = item.SongsCount + " " + ActivityContext.GetText(Resource.String.Lbl_Songs);
                            }

                            if (item.BackgroundImage == null)
                            {
                                return;
                            }

                            GlideImageLoader.LoadImage(ActivityContext, item.BackgroundImage, holder.BacgroundImageview, ImageStyle.CenterCrop, ImagePlaceholders.Drawable);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
 public override void OnSwiped(RecyclerView.ViewHolder viewHolder, int p1)
 {
     _adapter.OnItemDismiss(viewHolder.AdapterPosition);
 }
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is HSharedFilesAdapterViewHolder holder)
                {
                    var item = SharedFilesList[position];
                    if (item == null)
                    {
                        return;
                    }
                    switch (item.FileType)
                    {
                    case "Video":
                    {
                        var fileName = item.FilePath.Split('/').Last();
                        var fileNameWithoutExtension = fileName.Split('.').First();

                        FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.PlayIcon, IonIconsFonts.Play);
                        holder.PlayIcon.Visibility = ViewStates.Visible;

                        FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.TypeIcon, IonIconsFonts.Camera);
                        holder.TypeIcon.Visibility = ViewStates.Visible;

                        var videoPlaceHolderImage = Methods.MultiMedia.GetMediaFrom_Gallery(Methods.Path.FolderDcimVideo + "/" + UserId, fileNameWithoutExtension + ".png");
                        if (videoPlaceHolderImage == "File Dont Exists")
                        {
                            var bitmapImage = Methods.MultiMedia.Retrieve_VideoFrame_AsBitmap(ActivityContext, item.FilePath);
                            Methods.MultiMedia.Export_Bitmap_As_Image(bitmapImage, fileNameWithoutExtension, Methods.Path.FolderDcimVideo + "/" + UserId);

                            var imageVideo = Methods.Path.FolderDcimVideo + "/" + UserId + "/" + fileNameWithoutExtension + ".png";

                            File file2    = new File(imageVideo);
                            var  photoUri = FileProvider.GetUriForFile(ActivityContext, ActivityContext.PackageName + ".fileprovider", file2);
                            Glide.With(ActivityContext).Load(photoUri).Apply(new RequestOptions()).Into(holder.Image);
                        }
                        else
                        {
                            File file2    = new File(videoPlaceHolderImage);
                            var  photoUri = FileProvider.GetUriForFile(ActivityContext, ActivityContext.PackageName + ".fileprovider", file2);
                            Glide.With(ActivityContext).Load(photoUri).Apply(new RequestOptions()).Into(holder.Image);
                        }

                        break;
                    }

                    case "Gif":
                    {
                        holder.TypeIcon.Text = ActivityContext.GetText(Resource.String.Lbl_Gif);

                        holder.PlayIcon.Visibility = ViewStates.Gone;
                        holder.TypeIcon.Visibility = ViewStates.Visible;

                        File file2    = new File(item.FilePath);
                        var  photoUri = FileProvider.GetUriForFile(ActivityContext, ActivityContext.PackageName + ".fileprovider", file2);
                        Glide.With(ActivityContext).Load(photoUri).Apply(new RequestOptions()).Into(holder.Image);
                        break;
                    }

                    case "Sticker":
                    {
                        holder.PlayIcon.Visibility = ViewStates.Gone;
                        holder.TypeIcon.Visibility = ViewStates.Gone;

                        File file2    = new File(item.FilePath);
                        var  photoUri = FileProvider.GetUriForFile(ActivityContext, ActivityContext.PackageName + ".fileprovider", file2);
                        Glide.With(ActivityContext).Load(photoUri).Apply(new RequestOptions()).Into(holder.Image);
                        break;
                    }

                    case "Image":
                    {
                        holder.PlayIcon.Visibility = ViewStates.Gone;
                        holder.TypeIcon.Visibility = ViewStates.Gone;

                        File file2    = new File(item.FilePath);
                        var  photoUri = FileProvider.GetUriForFile(ActivityContext, ActivityContext.PackageName + ".fileprovider", file2);
                        Glide.With(ActivityContext).Load(photoUri).Apply(new RequestOptions()).Into(holder.Image);
                        break;
                    }

                    case "Sounds":
                        holder.PlayIcon.Visibility = ViewStates.Gone;
                        holder.TypeIcon.Visibility = ViewStates.Gone;

                        Glide.With(ActivityContext).Load(ActivityContext.GetDrawable(Resource.Drawable.Audio_File)).Apply(new RequestOptions()).Into(holder.Image);
                        break;

                    case "File":
                        holder.PlayIcon.Visibility = ViewStates.Gone;
                        holder.TypeIcon.Visibility = ViewStates.Gone;

                        Glide.With(ActivityContext).Load(ActivityContext.GetDrawable(Resource.Drawable.Image_File)).Apply(new RequestOptions()).Into(holder.Image);
                        break;
                    }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
Exemple #30
0
            public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
            {
                var item    = data[position];
                var vHolder = holder as ViewHolder;

                vHolder.websiteComicTextView.Text = currentWebsite.ComicText;
                vHolder.websiteComicTextView.SetBackgroundColor(Android.Graphics.Color.ParseColor(currentWebsite.Color));
                vHolder.titleTextView.Text   = item.Title;
                vHolder.summaryTextView.Text = item.SummaryText;

                vHolder.dateTextView.Text = GetHumanReadableDate(item.Date);
                if (vHolder.dateTextView.Text == null)
                {
                    vHolder.dateTextView.Visibility = ViewStates.Gone;
                }
                else
                {
                    vHolder.dateTextView.Visibility = ViewStates.Visible;
                }

                if (item?.Authors != null)
                {
                    vHolder.authorTextView.Text       = "By, " + item.Authors[0].Name;//TODO: Extend support for more author and allow individual author to have their options with onClick listener
                    vHolder.authorTextView.Visibility = ViewStates.Visible;
                }
                else
                {
                    vHolder.authorTextView.Visibility = ViewStates.Gone;
                }

                if (item.IsDatabaseConfirmed_SeenOn && !string.IsNullOrEmpty(item.SeenOn))
                {
                    vHolder.titleTextView.Alpha = 0.2f;
                }
                else
                {
                    vHolder.titleTextView.Alpha = 1f;
                }

                //for (int i = 0; i < vHolder.tag.Length; i++)
                //{
                //    if (i >= item.Categorys.Length)
                //    {
                //        vHolder.tag[i].Visibility = ViewStates.Gone;
                //    }
                //    else
                //    {
                //        var category = item.Categorys[i];
                //        vHolder.tag[i].Visibility = ViewStates.Visible;
                //        vHolder.tag[i].Text = item.Categorys[i].Name;
                //        //TODO:Find a way to clear the old callbacks and then add the new one
                //        vHolder.tag[i].Click += new EventHandler((sender, e) =>
                //        {
                //            Toast.MakeText(this.parent, $"Tag: {category.Name}", ToastLength.Short).Show();
                //        });
                //    }
                //}


                if (data.Length - position <= NextPageContentNumber)
                {
                    LoadNextPage?.Invoke(this, null);                                                  //this.parent.LoadNextPage();    //sent a request to load next page
                }
            }
Exemple #31
0
            public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
            {
                var crime = crimes[position];

                ((CrimeHolder)holder).Bind(crime);
            }
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            ScheduleViewHolder vh = holder as ScheduleViewHolder;

            vh.hourAndScheduleTextView.Text = /*listOfSchedules[position].Hour + " " + */ listOfSchedules[position].ShortDescription;
        }
Exemple #33
0
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is ReplyAdapterViewHolder holder)
                {
                    var item = ReplyList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.ReplyUserData.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                        TextSanitizer chnager = new TextSanitizer(holder.CommentText, ActivityContext);
                        chnager.Load(Methods.FunString.DecodeString(item.Text));
                        holder.TimeTextView.Text = item.TextTime;

                        holder.UsernameTextView.Text = AppTools.GetNameFinal(item.ReplyUserData);

                        holder.LikeNumber.Text         = Methods.FunString.FormatPriceValue(Convert.ToInt32(item.ReplyLikes));
                        holder.UnLikeNumber.Text       = Methods.FunString.FormatPriceValue(Convert.ToInt32(item.ReplyDislikes));
                        holder.RepliesCount.Visibility = ViewStates.Invisible;

                        if (item.IsLikedReply == 1)
                        {
                            holder.LikeiconView.SetColorFilter(Color.ParseColor(AppSettings.MainColor));
                            holder.LikeButton.Tag = "1";
                        }
                        else
                        {
                            holder.LikeButton.Tag = "0";
                        }

                        if (item.IsDislikedReply == 1)
                        {
                            holder.UnLikeiconView.SetColorFilter(Color.ParseColor(AppSettings.MainColor));
                            holder.UnLikeButton.Tag = "1";
                        }
                        else
                        {
                            holder.UnLikeButton.Tag = "0";
                        }

                        if (!holder.Image.HasOnClickListeners)
                        {
                            holder.Image.Click += (sender, e) => OnAvatarClick(new AvatarReplyAdapterClickEventArgs {
                                Class = item, Position = position, View = holder.MainView
                            });
                        }

                        if (!holder.LikeButton.HasOnClickListeners)
                        {
                            holder.LikeButton.Click += (sender, e) => OnLikeButtonClick(holder, new ReplyAdapterClickEventArgs {
                                Class = item, Position = position, View = holder.MainView
                            });
                        }

                        if (!holder.UnLikeButton.HasOnClickListeners)
                        {
                            holder.UnLikeButton.Click += (sender, e) => OnUnLikeButtonClick(holder, new ReplyAdapterClickEventArgs {
                                Class = item, Position = position, View = holder.MainView
                            });
                        }

                        if (!holder.ReplyButton.HasOnClickListeners)
                        {
                            holder.ReplyButton.Click += (sender, e) => OnReplyClick(new ReplyAdapterClickEventArgs {
                                Class = item, Position = position, View = holder.MainView
                            });
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
			public VpaListenerAdapterAnonymousInnerClassHelper3(DefaultItemAnimator outerInstance, RecyclerView.ViewHolder holder, View view, int deltaX, int deltaY, ViewPropertyAnimatorCompat animation)
			{
				this.outerInstance = outerInstance;
				this.holder = holder;
				this.view = view;
				this.deltaX = deltaX;
				this.deltaY = deltaY;
				this.animation = animation;
			}
Exemple #35
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            CarViewHolder carViewHolder = holder as CarViewHolder;

            carViewHolder.BindData(cars.ElementAt(position));
        }
			internal ChangeInfo(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder)
			{
				this.oldHolder = oldHolder;
				this.newHolder = newHolder;
			}
 public TouchListenerHelper(RecyclerView.ViewHolder holder, IOnStartDragListener mDragStartListener)
 {
     _itemHolder = holder;
     _mDragStartListener = mDragStartListener;
 }