private void DataTemplateFull(View view, int i, ComparisonItemViewModel arg3) { var holder = _comparisonViewHolders[view]; if (holder.ComparisonItemImage.Tag == null || (string)holder.ComparisonItemImage.Tag != arg3.ImgUrl) { holder.ComparisonItemImage.Into(arg3.ImgUrl); } holder.ComparisonItemImgPlaceholder.Visibility = ViewStates.Gone; }
private void DataTemplateFling(View view, int i, ComparisonItemViewModel arg3) { var holder = _comparisonViewHolders[view]; if (holder.ComparisonItemImage.IntoIfLoaded(arg3.ImgUrl)) { holder.ComparisonItemImage.Visibility = ViewStates.Visible; holder.ComparisonItemImgPlaceholder.Visibility = ViewStates.Gone; } else { holder.ComparisonItemImage.Visibility = ViewStates.Invisible; holder.ComparisonItemImgPlaceholder.Visibility = ViewStates.Visible; } }
private void DataTemplateBasic(View view, int i, ComparisonItemViewModel arg3) { var holder = _comparisonViewHolders[view]; holder.ComparisonItemTitle.Text = arg3.Title; holder.ComparisonItemStatus.Text = $"{arg3.MyEntry?.MyStatusBindShort ?? "?"} - {arg3.OtherEntry?.MyStatusBindShort ?? "?"}"; if (arg3.IsOnlyOnMyList) { holder.ComparisonItemOnlyMyStateSection.Visibility = ViewStates.Visible; holder.ComparisonItemOnOtherStateSection.Visibility = ViewStates.Gone; holder.ComparisonItemOnBothStateSection.Visibility = ViewStates.Gone; holder.ComparisonItemNotOnListDescription.Text = $"{ViewModel.OtherData.User.Name} doesn't have this show on list..."; holder.ComparisonItemOnMyMyScore.Text = ScoreToString(arg3.MyEntry.MyScore); holder.ComparisonItemOnMyMyWatched.Text = arg3.MyEntry.MyEpisodesBindShort; } else if (arg3.IsOnlyOnOtherList) { holder.ComparisonItemOnlyMyStateSection.Visibility = ViewStates.Gone; holder.ComparisonItemOnOtherStateSection.Visibility = ViewStates.Visible; holder.ComparisonItemOnBothStateSection.Visibility = ViewStates.Gone; holder.ComparisonItemAddToListButton.Tag = arg3.Wrap(); holder.ComparisonItemOnlyOtherScore.Text = ScoreToString(arg3.OtherEntry.MyScore); holder.ComparisonItemOnlyOtherWatched.Text = arg3.OtherEntry.MyEpisodesBindShort; } else //comparison { holder.ComparisonItemOnlyMyStateSection.Visibility = ViewStates.Gone; holder.ComparisonItemOnOtherStateSection.Visibility = ViewStates.Gone; holder.ComparisonItemOnBothStateSection.Visibility = ViewStates.Visible; holder.ComparisonItemOnBothMyScore.Text = ScoreToString(arg3.MyEntry.MyScore); holder.ComparisonItemOnBothScoreDiff.Text = arg3.ScoreDifferenceBind; holder.ComparisonItemOnBothOtherScore.Text = ScoreToString(arg3.OtherEntry.MyScore); if (arg3.WatchedComparisonBarVisibility) { holder.ComparisonItemOnBothStateSection.WeightSum = 2f; (holder.ComparisonItemOnBothScoreSection.LayoutParameters as LinearLayout.LayoutParams).Weight = 1f; holder.ComparisonItemOnBothWatchedSection.Visibility = ViewStates.Visible; holder.ComparisonItemOnBothMyWatched.Text = arg3.MyEntry.MyEpisodes.ToString(); holder.ComparisonItemOnBothWatchedDiff.Text = arg3.WatchedDifferenceBind; holder.ComparisonItemOnBothOtherWatched.Text = arg3.OtherEntry.MyEpisodes.ToString(); } else { holder.ComparisonItemOnBothStateSection.WeightSum = 1f; (holder.ComparisonItemOnBothScoreSection.LayoutParameters as LinearLayout.LayoutParams).Weight = .5f; holder.ComparisonItemOnBothWatchedSection.Visibility = ViewStates.Gone; } holder.ComparisonItemOnBothScoreDiff.SetTextColor(new Color(ResourcesCompat.GetColor(Resources, GetColorResForDiff(arg3.ScoreDifference), Activity.Theme))); holder.ComparisonItemOnBothWatchedDiff.SetTextColor(new Color(ResourcesCompat.GetColor(Resources, GetColorResForDiff(arg3.WatchedDifference), Activity.Theme))); } int GetColorResForDiff(int diff) { if (diff > 0) { return(Resource.Color.LimeAccentColour); } if (diff < 0) { return(global::Android.Resource.Color.HoloRedDark); } return(ResourceExtension.BrushTextRes); } string ScoreToString(float score) { return(score == 0 ? "?" : score.ToString("N0")); } }