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;
        }
Пример #2
0
		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 ());
		}
Пример #3
0
        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;
        }
Пример #4
0
		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;
		}
        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;
        }
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activityManageCategories);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            _progressBar = FindViewById <ProgressBar>(Resource.Id.appBarProgressBar);
            SetSupportActionBar(toolbar);

            SupportActionBar.SetTitle(Resource.String.categories);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_action_arrow_back);

            _rootLayout = FindViewById <RelativeLayout>(Resource.Id.layoutRoot);

            _addButton        = FindViewById <FloatingActionButton>(Resource.Id.buttonAdd);
            _addButton.Click += OnAddClick;

            _connection = await Database.Connect(this);

            _categorySource                   = new CategorySource(_connection);
            _categoryListAdapter              = new ManageCategoriesListAdapter(_categorySource);
            _categoryListAdapter.MenuClick   += OnMenuClick;
            _categoryListAdapter.HasStableIds = true;

            _categoryList     = FindViewById <RecyclerView>(Resource.Id.list);
            _emptyStateLayout = FindViewById <LinearLayout>(Resource.Id.layoutEmptyState);

            _categoryList.SetAdapter(_categoryListAdapter);
            _categoryList.HasFixedSize = true;

            var layout = new FixedGridLayoutManager(this, 1);

            _categoryList.SetLayoutManager(layout);

            var callback    = new ReorderableListTouchHelperCallback(_categoryListAdapter, layout);
            var touchHelper = new ItemTouchHelper(callback);

            touchHelper.AttachToRecyclerView(_categoryList);

            var decoration = new DividerItemDecoration(this, layout.Orientation);

            _categoryList.AddItemDecoration(decoration);

            var layoutAnimation =
                AnimationUtils.LoadLayoutAnimation(this, Resource.Animation.layout_animation_fade_in);

            _categoryList.LayoutAnimation = layoutAnimation;

            await Refresh();
        }
Пример #7
0
        private void SetupRecyclerView()
        {
            _recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            _albums       = new List <Album>();
            _adapter      = new AlbumsAdapter(this, _albums);
            LayoutManager layoutManager = new GridLayoutManager(this, 2);

            _recyclerView.SetLayoutManager(layoutManager);
            _recyclerView.AddItemDecoration(new GridSpacingItemDecoration(2, dpToPx(10), true));
            _recyclerView.SetItemAnimator(new DefaultItemAnimator());
            _recyclerView.SetAdapter(_adapter);
            PrepareAlbums();
        }
Пример #8
0
        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);
        }
        private void SetupViews( )
        {
            LinearLayoutManager   layoutManager         = new LinearLayoutManager(this);
            DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this, layoutManager.Orientation);

            _recyclerView.SetLayoutManager(layoutManager);
            _recyclerView.AddItemDecoration(dividerItemDecoration);

            MaintenanceListAdapter adapter = new MaintenanceListAdapter(_maintenanceStatus);

            adapter.ItemClicked += (s, e) => Adapter_ItemClicked(e, adapter);
            _recyclerView.SetAdapter(adapter);
        }
Пример #10
0
        private void InitializeRecyclerView()
        {
            _chatsRecyclerView.HasFixedSize = true;
            _chatsRecyclerView.SetLayoutManager(new GuardedLinearLayoutManager(Activity));
            _chatsRecyclerView.AddItemDecoration(new LeftOffsetItemDecoration(Activity, Resource.Color.chat_divider_color, 72));
            _chatsRecyclerView.SetAdapter(new ChatObservableRecyclerViewAdapter(ViewModel.Chats,
                                                                                CreateChatViewHolder, _chatsRecyclerView.SmoothScrollToPosition));

            var swipeItemCallback    = new SwipeCallback(Activity, _chatsRecyclerView, ConfigureSwipeForViewHolder);
            var swipeItemTouchHelper = new ItemTouchHelper(swipeItemCallback);

            swipeItemTouchHelper.AttachToRecyclerView(_chatsRecyclerView);
        }
        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);
        }
Пример #12
0
        protected void InitView()
        {
            SetContentView(Resource.Layout.ViewCities);

            RecyclerView       = FindViewById <MvxRecyclerView>(Resource.Id.RecyclerView);
            FastScrollerLayout = FindViewById <FastScrollerLayout>(Resource.Id.FastScroller);

            RecyclerView.AddItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.Vertical));
            RecyclerView.HasFixedSize = true;

            FastScrollerLayout.RecyclerView = RecyclerView;
            FastScrollerLayout.TitleFactory = GetTitle;
        }
Пример #13
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            rvMenu     = FindViewById <RecyclerView>(Resource.Id.rvMenu);
            rvRequests = FindViewById <RecyclerView>(Resource.Id.rvRequests);

            GridLayoutManager lm = new GridLayoutManager(this, 2);

            rvMenu.SetLayoutManager(lm);

            DividerItemDecoration dividerItemDecoration  = new DividerItemDecoration(this, DividerItemDecoration.Vertical);
            DividerItemDecoration dividerItemDecoration2 = new DividerItemDecoration(this, DividerItemDecoration.Horizontal);

            rvMenu.AddItemDecoration(dividerItemDecoration);
            rvMenu.AddItemDecoration(dividerItemDecoration2);


            MainMenuAdapter adapter = new MainMenuAdapter(menuItems);

            adapter.ItemClick += Adapter_ItemClick;
            rvMenu.SetAdapter(adapter);

            LinearLayoutManager manager = new LinearLayoutManager(this);

            rvRequests.SetLayoutManager(manager);
            rvRequests.AddItemDecoration(dividerItemDecoration2);

            serviceRequests = await Repository.GetPendingRequests();

            if (serviceRequests.Count < 1)
            {
                serviceRequests = await ServiceHelper.GetServiceRequests();
            }

            adapter2 = new RequestsAdapter(serviceRequests.ToArray(), _currentLocation);
            rvRequests.SetAdapter(adapter2);
            adapter2.ItemClick += Adapter2_ItemClick;

            if ((int)Build.VERSION.SdkInt < 23)
            {
                InitializeLocationManager();
                return;
            }
            else
            {
                GetLocationPermissionAsync();
            }
        }
Пример #14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            _addButton        = FindViewById(Resource.Id.button_add);
            _sessionsRecycler = FindViewById <RecyclerView>(Resource.Id.recycler_sessions);
            _sessionsRecycler.SetLayoutManager(new LinearLayoutManager(this));
            _sessionsRecycler.AddItemDecoration(new VerticalSpaceItemDecoration((int)Resources.GetDimension(Resource.Dimension.session_card_margin)));

            _sessionsRecycler.SetAdapter(_adapter);
        }
Пример #15
0
        private void SetUpRecyclerView(RecyclerView _recyclerView)
        {
            //Create our layout manager
            _recyclerView.AddItemDecoration(horizontalDecoration);
            _recyclerView.HasFixedSize = true;
            var layoutManager = new LinearLayoutManager(this);

            onScrollListener = new XamarinRecyclerViewOnScrollListener(layoutManager);
            onScrollListener.LoadMoreEvent += OnScrollListener_LoadMoreEventAsync;
            onScrollListener.OnHide        += OnScrollListener_OnHide;
            onScrollListener.OnShow        += OnScrollListener_OnShow;
            _recyclerView.AddOnScrollListener(onScrollListener);
            _recyclerView.SetLayoutManager(layoutManager);
        }
Пример #16
0
        protected override void LoadSyncElements()
        {
            _recyclerView = FindViewById <RecyclerView>(Resource.Id.list_credit_resyclerView);
            var layoutManager = new LinearLayoutManager(this);

            _recyclerView.SetLayoutManager(layoutManager);
            _recyclerView.AddItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.Vertical));

            _refresher          = FindViewById <SwipeRefreshLayout>(Resource.Id.list_credit_refresher);
            _refresher.Refresh += RefresherOnRefresh;

            _createCreditButton        = FindViewById <FloatingActionButton>(Resource.Id.fab);
            _createCreditButton.Click += CreateCreditButtonOnClick;
        }
Пример #17
0
        private async void addProtal()
        {
            ArcGISPortal portal = await ArcGISPortal.CreateAsync(new Uri("http://esrichina3d.arcgisonline.cn/arcgis/sharing/rest"));

            PortalQueryParameters para = PortalQueryParameters.CreateForItemsOfType(PortalItemType.WebScene);

            para.Limit = 20;
            PortalQueryResultSet <PortalItem> items = await portal.FindItemsAsync(para);

            int sum = 0;

            productList = new List <Product>();
            try
            {
                OpenFileActivity.item = items.Results.First();
                foreach (PortalItem item in items.Results)
                {
                    System.IO.Stream st = await item.GetDataAsync();

                    System.IO.StreamReader reader = new StreamReader(st);
                    st.Position = 0;
                    string json = reader.ReadToEnd();
                    reader.Close();
                    st.Close();
                    productList.Add(new Product(item.ThumbnailUri.ToString(), item.Title, json));
                }
            }
            catch
            { }

            RecyclerView recyclerView = (RecyclerView)FindViewById(Resource.Id.recyclerView);

            //设置layoutManager 布局模式
            recyclerView.SetLayoutManager(new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.Vertical));

            //  recyclerView.SetLayoutManager(new LinearLayoutManager(this));
            //设置adapter

            Context        context = this.BaseContext;
            MasonryAdapter WebSceneItemsAdapter = new MasonryAdapter(productList, context);

            WebSceneItemsAdapter.ItemClick += WebSceneItemsAdapter_ItemClick;
            recyclerView.SetAdapter(WebSceneItemsAdapter);

            //设置item之间的间隔
            SpacesItemDecoration decoration = new SpacesItemDecoration(16);

            recyclerView.AddItemDecoration(decoration);
        }
        /// <summary>
        /// Acquiring all views and initializing them with event-handlers
        /// </summary>
        /// <param name="root">Root layout</param>
        private void InitializeUI(View root)
        {
            _newNoteButton    = root.FindViewById <Button>(Resource.Id.newNoteButton);
            _deleteNoteButton = root.FindViewById <Button>(Resource.Id.deleteNoteButton);
            _sceneRoot        = root.FindViewById <RelativeLayout>(Resource.Id.layout);
            _nullStateTile    = root.FindViewById <RelativeLayout>(Resource.Id.nullStateTile);
            _notesGrid        = root.FindViewById <RecyclerView>(Resource.Id.recyclerView);

            root.FindViewById <TextView>(Resource.Id.nullStateHintTop).Typeface    = Typeface.CreateFromAsset(_rootActivity.Assets, "fonts/MINIONPRO-REGULAR.OTF");
            root.FindViewById <TextView>(Resource.Id.nullStateHintBottom).Typeface = Typeface.CreateFromAsset(_rootActivity.Assets, "fonts/MINIONPRO-REGULAR.OTF");

            _notesGrid.AddItemDecoration(new RecyclerViewItemSpacing(15));
            _newNoteButton.Click    += (object sender, EventArgs e) => StartActivity(new Intent(_rootActivity, typeof(NoteActivity)));
            _deleteNoteButton.Click += (object sender, EventArgs e) => DeleteNotes();
        }
Пример #19
0
        ///<inehritdoc/>
        protected override RecyclerView HandleRecyclerView(Android.Views.View fragmentView)
        {
            RecyclerView recView = fragmentView.FindViewById <RecyclerView>(Resource.Id.questRecyclerViewRefId);

            recView.SetLayoutManager(new LinearLayoutManager(this.Context));
            recView.SetAdapter(QuestsAdapter = new AvailableQuestsAdapter(this.Activity, ViewModel, this));

            DividerItemDecoration decor = new DividerItemDecoration(this.Context, DividerItemDecoration.Vertical);
            Drawable dr = ResourcesCompat.GetDrawable(this.Resources,
                                                      Resource.Drawable.questItemDivider, null);

            decor.SetDrawable(dr);
            recView.AddItemDecoration(decor);
            return(recView);
        }
Пример #20
0
        private void SetUpLoggerRecycler(RecyclerView recyclerView, View view)
        {
            ((SimpleItemAnimator)recyclerView.GetItemAnimator()).SupportsChangeAnimations = false;
            recyclerView.SetLayoutManager(new LinearLayoutManager(Context));
            recyclerView.AddItemDecoration(new VerticalSpaceItemDecoration(20)
            {
                ShouldShowBeforeFirst = true
            });

            /*_loggerAdapter = new IncidentLoggerAdapter(Activity, GetIncidentLoggers().ToList());
             * //_loggerAdapter.SetMultiChoiceModeListener(this);
             * _loggerAdapter.ItemClick += (s, args) => FragmentHelper.Push(Activity, IncidentDetailsFragment.Instantiate(args.Item.PetID, args.Item.IncidentTypeID));
             * _loggerAdapter.IncidentLogged += LoggerAdapter_IncidentLogged;
             *
             * recyclerView.SetAdapter(_loggerAdapter);*/
        }
Пример #21
0
            public ClassroomScheduleViewHolder(View itemView, IToItemScroller scroller, IFreeClassrooomsShower shower) : base(itemView)
            {
                _textViewLesson  = itemView.FindViewById <TextView>(Resource.Id.text_number_of_lesson);
                _listViewLessons = itemView.FindViewById <RecyclerView>(Resource.Id.classroom_schedule_list_view);
                itemView.FindViewById <Button>(Resource.Id.free_classroooms_button).Click += FreeClassroomsOnClick;
                _shower = shower;
                var manager = new LinearLayoutManager(itemView.Context);

                _listViewLessons.SetLayoutManager(manager);
                _listViewLessons.AddItemDecoration(new DividerItemDecoration(itemView.Context, manager.Orientation));
                _listViewLessons.Visibility = ViewStates.Gone;

                if (itemView.Clickable)
                {
                    return;
                }
                itemView.Clickable = true;
                itemView.Click    += (sender, args) =>
                {
                    if (_listViewLessons.Visibility == ViewStates.Gone)
                    {
                        _listViewLessons.Measure(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
                        _listViewLessons.Visibility = ViewStates.Visible;

                        var mAnimator = SlideAnimator(0, _listViewLessons.MeasuredHeight);
                        mAnimator.Start();
                        mAnimator.SetDuration(300);
                        mAnimator.AnimationEnd += (o, eventArgs) =>
                        {
                            scroller.ScrollTo(_lessonNum);
                        };
                    }
                    else
                    {
                        var finalHeight = _listViewLessons.Height;

                        var mAnimator = SlideAnimator(finalHeight, 0);
                        mAnimator.Start();
                        mAnimator.SetDuration(300);
                        mAnimator.AnimationEnd += (intentSender, arg) =>
                        {
                            _listViewLessons.Visibility = ViewStates.Gone;
                        };
                    }
                };
            }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view  = inflater.Inflate(Resource.Layout.fragment_labor, container, false);
            var title = view.FindViewById <TextView>(Resource.Id.labordialog_laborTitle);

            title.Text = this.title;
            laborList  = view.FindViewById <RecyclerView>(Resource.Id.labordialog_laborList);
            laborList.SetLayoutManager(new LinearLayoutManager(this.Context));
            var dividerItemDecoration = new DividerItemDecoration(laborList.Context, DividerItemDecoration.Vertical);

            dividerItemDecoration.SetDrawable(ContextCompat.GetDrawable(this.Context, Resource.Drawable.line_devider));
            laborList.AddItemDecoration(dividerItemDecoration);
            acceptDialogButton        = view.FindViewById <Button>(Resource.Id.labordialog_acceptDialogButton);
            acceptDialogButton.Click += AcceptDialogButton_Click;
            this.Dialog.Window.SetDimAmount(0);
            return(view);
        }
Пример #23
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.multidataset_service_manual_activity);
            var sharedPreferences       = GetSharedPreferences(LocalAutofillDataSource.SHARED_PREF_KEY, FileCreationMode.Private);
            var defaultFieldTypesSource = DefaultFieldTypesLocalJsonSource.GetInstance(Resources, new GsonBuilder().Create());
            var autofillDao             = AutofillDatabase.GetInstance(this, defaultFieldTypesSource, new AppExecutors()).AutofillDao();

            mLocalAutofillDataSource = LocalAutofillDataSource.GetInstance(sharedPreferences, autofillDao, new AppExecutors());
            mPackageName             = PackageName;
            mPreferences             = MyPreferences.GetInstance(this);
            mRecyclerView            = FindViewById <RecyclerView>(Resource.Id.suggestionsList);
            mRecyclerView.AddItemDecoration(new DividerItemDecoration(this, OrientationHelper.Vertical));
            mLocalAutofillDataSource.GetAllAutofillDatasets(new DataCallback {
                that = this
            });
        }
        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;
        }
Пример #25
0
        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);
        }