protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); Dictionary <string, Type> listDictionary = new Dictionary <string, Type> { { "Folder Structure Example", typeof(FolderStructureFragment) }, { "Custom Holder Example", typeof(CustomViewHolderFragment) }, { "Selectable Nodes", typeof(SelectableTreeFragment) }, { "2d scrolling", typeof(TwoDScrollingArrowExpandFragment) }, { "Expand with arrow only", typeof(TwoDScrollingFragment) }, }; var list = listDictionary.Keys.ToList(); ListView listview = FindViewById <ListView>(Resource.Id.listview); SimpleArrayAdapter adapter = new SimpleArrayAdapter(this, list); listview.Adapter = adapter; listview.ItemClick += (sender, e) => { Type selectType = listDictionary.Values.ToArray()[e.Position]; Intent i = new Intent(this, typeof(SingleFragmentActivity)); i.PutExtra(SingleFragmentActivity.FRAGMENT_PARAM, FragmentJavaName(selectType)); StartActivity(i); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_using_basic); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); toolbar.NavigationClick += (sender, e) => { Finish(); }; var listView = FindViewById <ListView>(Resource.Id.listview); listView.Adapter = mAdapter = new SimpleArrayAdapter(this); var refreshLayout = FindViewById(Resource.Id.refreshLayout) as IRefreshLayout; refreshLayout.SetEnableAutoLoadmore(true);//开启自动加载功能(非必须) refreshLayout.SetOnRefreshListener(new SimpleOnRefreshListener(this)); refreshLayout.SetOnLoadmoreListener(new SimpleOnLoadmoreListener(this)); //触发自动刷新 refreshLayout.AutoRefresh(); }