当前位置: 首页>>代码示例>>C#>>正文


C# RecyclerView.AddItemDecoration方法代码示例

本文整理汇总了C#中RecyclerView.AddItemDecoration方法的典型用法代码示例。如果您正苦于以下问题:C# RecyclerView.AddItemDecoration方法的具体用法?C# RecyclerView.AddItemDecoration怎么用?C# RecyclerView.AddItemDecoration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RecyclerView的用法示例。


在下文中一共展示了RecyclerView.AddItemDecoration方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreateView

        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.ProjectListFragment, container, false);

            recyclerView = view.FindViewById<RecyclerView> (Resource.Id.ProjectListRecyclerView);
            recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
            recyclerView.AddItemDecoration (new ShadowItemDecoration (Activity));
            recyclerView.AddItemDecoration (new DividerItemDecoration (Activity, DividerItemDecoration.VerticalList));

            emptyStateLayout = view.FindViewById<LinearLayout> (Resource.Id.ProjectListEmptyState);
            searchEmptyState = view.FindViewById<LinearLayout> (Resource.Id.ProjectListSearchEmptyState);
            tabLayout = view.FindViewById<TabLayout> (Resource.Id.WorkspaceTabLayout);
            newProjectFab = view.FindViewById<AddProjectFab> (Resource.Id.AddNewProjectFAB);
            toolBar = view.FindViewById<Toolbar> (Resource.Id.ProjectListToolbar);

            var activity = (Activity)Activity;
            activity.SetSupportActionBar (toolBar);
            activity.SupportActionBar.SetDisplayHomeAsUpEnabled (true);
            activity.SupportActionBar.SetTitle (Resource.String.ChooseTimeEntryProjectDialogTitle);

            HasOptionsMenu = true;
            newProjectFab.Click += OnNewProjectFabClick;
            tabLayout.SetOnTabSelectedListener (this);

            return view;
        }
开发者ID:alfonsogarciacaro,项目名称:mobile,代码行数:26,代码来源:ProjectListFragment.cs

示例2: OnCreate

		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.recyclerview);

			recyclerView = FindViewById<RecyclerView> (Resource.Id.recycler_view);

			// Layout Managers:
			recyclerView.SetLayoutManager (new LinearLayoutManager (this));

			// Item Decorator:
			recyclerView.AddItemDecoration (new DividerItemDecoration (Resources.GetDrawable (Resource.Drawable.divider)));
			recyclerView.SetItemAnimator (new FadeInLeftAnimator ());

			// Adapter:
			var adapterData = new [] {
				"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", 
				"Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", 
				"Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", 
				"Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", 
				"Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", 
				"New Hampshire", "New Jersey", "New Mexico", "New York", 
				"North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", 
				"Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", 
				"Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", 
				"West Virginia", "Wisconsin", "Wyoming"
			};
			adapter = new RecyclerViewAdapter (this, adapterData.ToList ());
			adapter.Mode = Attributes.Mode.Single;
			recyclerView.SetAdapter (adapter);

			// Listeners
			recyclerView.SetOnScrollListener (new ScrollListener ());
		}
开发者ID:Dealtis,项目名称:oldDMS_3,代码行数:34,代码来源:RecyclerViewExample.cs

示例3: OnCreateView

        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.ProjectListFragment, container, false);

            recyclerView = view.FindViewById<RecyclerView> (Resource.Id.ProjectListRecyclerView);
            recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
            recyclerView.AddItemDecoration (new ShadowItemDecoration (Activity));
            recyclerView.AddItemDecoration (new DividerItemDecoration (Activity, DividerItemDecoration.VerticalList));

            var activity = (AppCompatActivity)Activity;
            var toolbar = view.FindViewById<Toolbar> (Resource.Id.ProjectListToolbar);
            activity.SetSupportActionBar (toolbar);

            var actionBar = activity.SupportActionBar;
            actionBar.SetDisplayHomeAsUpEnabled (true);
            actionBar.SetTitle (Resource.String.ChooseTimeEntryProjectDialogTitle);
            HasOptionsMenu = true;

            return view;
        }
开发者ID:peeedge,项目名称:mobile,代码行数:20,代码来源:ProjectListFragment.cs

示例4: OnCreateView

        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.EditGroupedTimeEntryFragment, container, false);
            editTimeEntryFragment = (SimpleEditTimeEntryFragment) ChildFragmentManager.FindFragmentById (Resource.Id.TimeEntryEditChildFragment);
            HasOptionsMenu = true;

            recyclerView = view.FindViewById<RecyclerView> (Resource.Id.recyclerView);
            recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
            recyclerView.AddItemDecoration (new DividerItemDecoration (Activity, DividerItemDecoration.VerticalList));

            return view;
        }
开发者ID:ZhangLeiCharles,项目名称:mobile,代码行数:12,代码来源:EditGroupedTimeEntryFragment.cs

示例5: OnCreateView

		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Use this to return your custom view for this Fragment
			View v = inflater.Inflate(Resource.Layout.view_recycler, container, false);

			recyclerView = v.FindViewById<RecyclerView> (Resource.Id.recycler_view);
			recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
			recyclerView.AddItemDecoration (new SettingsAdapter.SettingsItemDecoration (Activity));
			recyclerView.SetAdapter(new SettingsAdapter(Activity, settings));

			return v;
		}
开发者ID:edcombs,项目名称:StudyEspanol,代码行数:12,代码来源:SettingsView.cs

示例6: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.NewsList, container, false);
            recyclerView = view.FindViewById<RecyclerView> (Resource.Id.NewsList);

            if (recyclerView != null)
            {
                recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
                recyclerView.AddItemDecoration (new SimpleItemDecoration (Activity));
                IList<Article> articles = DummyModelFactory.Articles;
                adapter = new NewsListRecyclerAdapter (articles);

                View header = inflater.Inflate (Resource.Layout.NewsListParalaxHeader, recyclerView, false);
                adapter.SetParallaxHeader(header, recyclerView);
                recyclerView.SetAdapter (adapter);
            }

            return view;
        }
开发者ID:T-Rex,项目名称:demo-android-article-list,代码行数:19,代码来源:NewsListFragment.cs

示例7: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            SetContentView (Resource.Layout.GraphActivityLayout);

            var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar> (Resource.Id.toolbar);
            SetSupportActionBar (toolbar);
            SupportActionBar.SetDisplayShowTitleEnabled (false);
            SupportActionBar.SetDisplayHomeAsUpEnabled (true);

            graphView = FindViewById<RecyclerView> (Resource.Id.chartView);
            var db = GeofenceDatabase.From (this);
            adapter = new GraphAdapter (db);

            date = DateTime.Now.AddDays (-1);
            var ticks = Intent.GetLongExtra ("dateTime", -1);
            if (ticks != -1)
                date = new DateTime (ticks);
            globalCount = Intent.GetIntExtra ("globalCount", 0);

            adapter.FillUp (EcoPublicApi.CambridgeStation, date);

            graphView.ViewTreeObserver.AddOnGlobalLayoutListener (this);
            graphView.AddItemDecoration (new GraphEntryDecoration ());
            graphView.SetItemAnimator (new GraphEntryAnimator ());

            time = FindViewById<TextView> (Resource.Id.timeText);
            count = FindViewById<TextView> (Resource.Id.countText);
            increment = FindViewById<TextView> (Resource.Id.incrementText);
            meIcon = FindViewById<ImageView> (Resource.Id.meIcon);

            increment.Visibility = ViewStates.Invisible;
            time.Text = date.ToString ("ddd, MMM dd");
            count.Text = globalCount.ToString ();

            adapter.CounterSelected += HandleCounterSelected;

            filterSpinner = FindViewById<Spinner> (Resource.Id.filterSpinner);
        }
开发者ID:garuma,项目名称:Cytotem,代码行数:40,代码来源:GraphActivity.cs


注:本文中的RecyclerView.AddItemDecoration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。