Ejemplo n.º 1
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            FSTListViewHolder vh = holder as FSTListViewHolder;

            var item = items[position];

            try
            {
                if (Preferences.Get("DBListImageShow", false))
                {
                    vh.SmallImage.Visibility = ViewStates.Visible;
                    string filePath = Path.Combine(ETC.cachePath, "FST", "Normal_Icon", $"{item.CodeName}.gfdcache");

                    if (File.Exists(filePath))
                    {
                        vh.SmallImage.SetImageDrawable(Android.Graphics.Drawables.Drawable.CreateFromPath(filePath));
                    }
                }
                else
                {
                    vh.SmallImage.Visibility = ViewStates.Gone;
                }

                vh.Type.Text      = item.Type;
                vh.Name.Text      = item.Name;
                vh.RealModel.Text = item.RealModel;
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, context);
                Toast.MakeText(context, "Error Create View", ToastLength.Short).Show();
            }
        }
Ejemplo n.º 2
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.FSTListLayout, parent, false);

            FSTListViewHolder vh = new FSTListViewHolder(view, OnClick);

            return(vh);
        }