public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); RecyclerView mRecyclerView = view.FindViewById <RecyclerView>(Resource.Id.list); mRecyclerView.SetLayoutManager(new GridLayoutManager(this.Activity, 2)); //animator not yet working // mRecyclerView.SetItemAnimator(new SlideInLeftAnimator()); TODO: IconAdapter adapter = new IconAdapter(new List <string>(), Resource.Layout.row_icon); mRecyclerView.SetAdapter(adapter); if (this.Arguments != null) { var fontName = this.Arguments.GetString(FontName); foreach (var iTypeface in Iconics.RegisteredFonts) { if (iTypeface.FontName.Equals(fontName)) { if (iTypeface.Icons != null) { foreach (var icon in iTypeface.Icons) { this.icons.Add(icon); } adapter.SetIcons(this.icons); break; } } } } }
public static Icon GFileInfoIcon(IntPtr info) { return(NativeHelper <Icon> (() => { IntPtr icon = g_file_info_get_icon(info); return IconAdapter.GetObject(g_object_ref(icon), false); }, GIO_NOT_FOUND, "Failed to query icon {0}")); }
public override Dialog OnCreateDialog(Bundle savedInstanceState) { var alert = new AlertDialog.Builder(Activity); alert.SetTitle(Resource.String.changeIcon); alert.SetNegativeButton(Resource.String.cancel, (EventHandler <DialogClickEventArgs>)null); alert.SetCancelable(false); var view = Activity.LayoutInflater.Inflate(Resource.Layout.dialogIcon, null); _searchText = view.FindViewById <EditText>(Resource.Id.dialogIcon_search); _iconList = view.FindViewById <RecyclerView>(Resource.Id.dialogIcon_list); alert.SetView(view); var dialog = alert.Create(); dialog.Show(); dialog.Window.SetSoftInputMode(SoftInput.StateAlwaysVisible); _searchText.TextChanged += SearchChanged; _iconAdapter = new IconAdapter(Context, _iconSource); _iconAdapter.ItemClick += ItemClick; _iconAdapter.SetHasStableIds(true); _iconList.SetAdapter(_iconAdapter); _iconList.HasFixedSize = true; _iconList.SetItemViewCacheSize(20); var layout = new AuthListGridLayoutManager(Context, 6); _iconList.SetLayoutManager(layout); var cancelButton = dialog.GetButton((int)DialogButtonType.Negative); cancelButton.Click += _negativeButtonEvent.Invoke; return(dialog); }
public override View OnCreateView(LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); HasOptionsMenu = true; var view = inflater.Inflate(Resource.Layout.fragment_browse, null); var grid = view.FindViewById <GridView>(Resource.Id.grid); //Get Icons icons = new List <Icon>(); var newIcon = new Icon(); newIcon.name = "default"; newIcon.url = "http://jmprog.com/hzinnovations/icons/pulse2.png"; icons.Add(newIcon); RequestIconList(); adapter = new IconAdapter(Activity, icons); grid.Adapter = adapter; grid.ItemClick += GridOnItemClick; return(view); }