Esempio n. 1
0
        // This override is called only once during the activity's lifecycle, when it is created.
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // instantiate adapter
            _Adapter = new AcquaintanceCollectionAdapter();

            // load the items
            await _Adapter.LoadAcquaintances();

            // instantiate the layout manager
            var layoutManager = new LinearLayoutManager(this);

            // set the content view
            SetContentView(Resource.Layout.AcquaintanceList);

            // setup the action bar
            SetSupportActionBar(FindViewById <Toolbar>(Resource.Id.toolbar));

            // ensure that the system bar color gets drawn
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);

            // set the title of both the activity and the action bar
            Title = SupportActionBar.Title = "Acquaintances";

            // instantiate/inflate the RecyclerView
            var recyclerView = (RecyclerView)FindViewById(Resource.Id.acquaintanceRecyclerView);

            // set RecyclerView's layout manager
            recyclerView.SetLayoutManager(layoutManager);

            // set RecyclerView's adapter
            recyclerView.SetAdapter(_Adapter);
        }
		// This override is called only once during the activity's lifecycle, when it is created.
		protected override async void OnCreate(Bundle savedInstanceState)
		{
			base.OnCreate(savedInstanceState);

			// instantiate adapter
			var acquaintanceCollectionAdapter = new AcquaintanceCollectionAdapter();

			// load the items
			await acquaintanceCollectionAdapter.LoadAcquaintances();

			// instantiate the layout manager
			var layoutManager = new LinearLayoutManager(this);

			// set the content view
			SetContentView(Resource.Layout.Main);

			// setup the action bar
			SetSupportActionBar(FindViewById<Toolbar>(Resource.Id.toolbar));

			// ensure that the system bar color gets drawn
			Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);

			// set the title of both the activity and the action bar
			Title = SupportActionBar.Title = "Acquaintances";

			// instantiate/inflate the RecyclerView
			var recyclerView = (RecyclerView)FindViewById(Resource.Id.acquaintanceRecyclerView);

			// set RecyclerView's layout manager 
			recyclerView.SetLayoutManager(layoutManager);

			// set RecyclerView's adapter
			recyclerView.SetAdapter(acquaintanceCollectionAdapter);
		}
Esempio n. 3
0
        // This override is called only once during the activity's lifecycle, when it is created.
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            HockeyApp.MetricsManager.TrackEvent("AcquaintanceListActivity.OnCreate");

            // instantiate adapter
            _Adapter = new AcquaintanceCollectionAdapter();

            // instantiate the layout manager
            var layoutManager = new LinearLayoutManager(this);

            // set the content view
            SetContentView(Resource.Layout.AcquaintanceList);

            // setup the action bar
            SetSupportActionBar(FindViewById <Toolbar>(Resource.Id.toolbar));

            // ensure that the system bar color gets drawn
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);

            // set the title of both the activity and the action bar
            Title = SupportActionBar.Title = "Acquaintances";

            _SwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(Resource.Id.acquaintanceListSwipeRefreshContainer);

            _SwipeRefreshLayout.Refresh += async(sender, e) => { await LoadAcquaintances(); };

            _SwipeRefreshLayout.Post(() => _SwipeRefreshLayout.Refreshing = true);

            // instantiate/inflate the RecyclerView
            var recyclerView = (RecyclerView)FindViewById(Resource.Id.acquaintanceRecyclerView);

            // set RecyclerView's layout manager
            recyclerView.SetLayoutManager(layoutManager);

            // set RecyclerView's adapter
            recyclerView.SetAdapter(_Adapter);

            var addButton = (FloatingActionButton)FindViewById(Resource.Id.acquaintanceListFloatingActionButton);

            FeedbackManager.Register(this, Settings.HockeyAppId);

            addButton.Click += (sender, e) => {
                //StartActivity(new Intent(this, typeof(AquaintanceEditActivity)));
                FeedbackManager.ShowFeedbackActivity(ApplicationContext);
            };

            CheckForUpdates();
        }
        // This override is called only once during the activity's lifecycle, when it is created.
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // instantiate adapter
            acquaintanceCollectionAdapter = new AcquaintanceCollectionAdapter(this);

            // instantiate the layout manager
            LinearLayoutManager layoutManager = new LinearLayoutManager(this);

            // set the content view
            SetContentView(Resource.Layout.Main);

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

            // setup the action bar
            SetSupportActionBar(toolbar);

            // ensure that the system bar color gets drawn
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);

            // set the title of both the activity and the action bar
            Title = SupportActionBar.Title = "Lista de Contactos";

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            HelperMethods.SetupAnimations(this);

            // instantiate/inflate the RecyclerView
            recyclerView = FindViewById <RecyclerView>(Resource.Id.acquaintanceRecyclerView);

            // set RecyclerView's layout manager
            recyclerView.SetLayoutManager(layoutManager);

            // set RecyclerView's adapter
            recyclerView.SetAdapter(acquaintanceCollectionAdapter);
        }