예제 #1
0
        private void DataTemplateBasic(View view, int i, AnimeVideoData animeVideoData)
        {
            var str = new SpannableString($"{animeVideoData.Name} - {animeVideoData.AnimeTitle}");

            str.SetSpan(PrefixStyle, 0, animeVideoData.Name.Length, SpanTypes.InclusiveInclusive);
            str.SetSpan(PrefixColorStyle, 0, animeVideoData.Name.Length, SpanTypes.InclusiveInclusive);
            view.FindViewById <TextView>(Resource.Id.PromoVideosPageItemSubtitle)
            .SetText(str.SubSequenceFormatted(0, str.Length()), TextView.BufferType.Spannable);
        }
예제 #2
0
        private void SetItemBindingsFling(View view, AnimeVideoData animeVideoData)
        {
            view.FindViewById(Resource.Id.PromoVideosPageItemImgPlaceholder).Visibility = ViewStates.Visible;
            view.FindViewById(Resource.Id.PromoVideosPageItemImage).Visibility          = ViewStates.Invisible;

            var str = new SpannableString($"{animeVideoData.Name} - {animeVideoData.AnimeTitle}");

            str.SetSpan(PrefixStyle, 0, animeVideoData.Name.Length, SpanTypes.InclusiveInclusive);
            str.SetSpan(PrefixColorStyle, 0, animeVideoData.Name.Length, SpanTypes.InclusiveInclusive);
            view.FindViewById <TextView>(Resource.Id.PromoVideosPageItemSubtitle)
            .SetText(str.SubSequenceFormatted(0, str.Length()), TextView.BufferType.Spannable);
        }
예제 #3
0
        private void SetItemBindingsFull(View view, AnimeVideoData animeVideoData)
        {
            var img = view.FindViewById <ImageViewAsync>(Resource.Id.PromoVideosPageItemImage);

            if ((string)img.Tag != animeVideoData.YtLink)
            {
                view.FindViewById(Resource.Id.PromoVideosPageItemImgPlaceholder).Visibility = ViewStates.Gone;
                img.Tag = animeVideoData.YtLink;
                img.Into(animeVideoData.Thumb);
            }

            var str = new SpannableString($"{animeVideoData.Name} - {animeVideoData.AnimeTitle}");

            str.SetSpan(PrefixStyle, 0, animeVideoData.Name.Length, SpanTypes.InclusiveInclusive);
            str.SetSpan(PrefixColorStyle, 0, animeVideoData.Name.Length, SpanTypes.InclusiveInclusive);
            view.FindViewById <TextView>(Resource.Id.PromoVideosPageItemSubtitle)
            .SetText(str.SubSequenceFormatted(0, str.Length()), TextView.BufferType.Spannable);
        }
예제 #4
0
        public void OnItemCheckedStateChanged(ActionMode mode, int position, long id, bool check)
        {
            int checkedCount = _EdicolaGridView.CheckedItemCount;

            switch (checkedCount)
            {
            case 0:
                mode.Title = null;
                break;

            case 1:
                mode.Title = GetString(Resource.String.edic_itemSelected);
                break;

            default:
                mode.Title = string.Format(GetString(Resource.String.edic_itemsSelected), checkedCount);
                break;
            }

            SpannableString text = new SpannableString(mode.Title != null ? mode.Title : "");

            text.SetSpan(new ForegroundColorSpan(Color.Transparent.FromHex(DataManager.Get <ISettingsManager>().Settings.TintColor)), 0, text.Length(), SpanTypes.InclusiveInclusive);
            Java.Lang.ICharSequence sequence = text.SubSequenceFormatted(0, text.Length());
            mode.TitleFormatted = sequence;

            var doneId = Resources.GetIdentifier("action_mode_close_button", "id", "android");
            var abDone = Activity.FindViewById <ViewGroup>(doneId);

            if (abDone != null && abDone.ChildCount > 0)
            {
                var img = abDone.GetChildAt(0);

                if (img != null && img.GetType() == typeof(ImageView))
                {
                    var img2 = img as ImageView;

                    img2.Colorize(DataManager.Get <ISettingsManager>().Settings.TintColor);
                }
            }
        }