private ImageView CreateIcon(SwipeMenuItem item) { ImageView iv = new ImageView(Context); iv.SetImageDrawable(item.Icon); return(iv); }
private TextView CreateTitle(SwipeMenuItem item) { TextView tv = new TextView(Context) { Text = item.Title, Gravity = GravityFlags.Center, TextSize = item.TitleSize }; tv.SetTextColor(item.TitleColor); return(tv); }
private void AddItem(SwipeMenuItem item, int id) { LayoutParams layoutParams = new LayoutParams(item.Width, LayoutParams.MatchParent); LinearLayout parent = new LinearLayout(Context) { Id = id, Orientation = Orientation.Vertical, LayoutParameters = layoutParams, Background = item.Background }; parent.SetGravity(GravityFlags.Center); parent.SetOnClickListener(this); AddView(parent); if (item.Icon != null) { parent.AddView(CreateIcon(item)); } if (!TextUtils.IsEmpty(item.Title)) { parent.AddView(CreateTitle(item)); } }
public void RemoveMenuItem(SwipeMenuItem item) { MenuItems.Remove(item); }
public void AddMenuItem(SwipeMenuItem item) { MenuItems.Add(item); }