Exemple #1
0
    public static ListFragment NewInstance(List <Products> productList)
    {
        _productList = productList;
        ListFragment fragment = new ListFragment();

        return(fragment);
    }
        //@Override
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetTitle(mTitleRes);

            // set the Behind View
            setBehindContentView(Resource.Layout.menu_frame);
            if (savedInstanceState == null)
            {
                FragmentTransaction t = this.SupportFragmentManager.BeginTransaction();
                mFrag = new SampleListFragment();
                t.Replace(Resource.Id.menu_frame, mFrag);
                t.Commit();
            }
            else
            {
                mFrag = (ListFragment)this.SupportFragmentManager.FindFragmentById(Resource.Id.menu_frame);
            }

            // customize the SlidingMenu

            SSlidingMenu sm = getSlidingMenu();
            sm.setShadowWidthRes(Resource.Dimension.shadow_width);
            sm.setShadowDrawable(Resource.Drawable.shadow);
            sm.setBehindOffsetRes(Resource.Dimension.slidingmenu_offset);
            sm.setFadeDegree(0.35f);
            sm.setTouchModeAbove(SSlidingMenu.TOUCHMODE_FULLSCREEN);
            SupportActionBar.SetDefaultDisplayHomeAsUpEnabled(true);            
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if (savedInstanceState == null)
            {
                SupportFragmentManager.BeginTransaction()
                .Add(Resource.Id.sample_content, ListFragment.NewInstance())
                .Commit();
            }
        }
Exemple #4
0
        void ShowList()
        {
            adapter = new ArtistAdapter(this);
            list    = new RdioListFragment();

            var t = FragmentManager.BeginTransaction();

            t.SetTransition(FragmentTransit.FragmentClose);
            t.Replace(Resource.Id.mainContainer, list, "artist-list");
            t.Commit();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);

            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ListViewLayout);

            #region TOOLBAR
            var toolbar = FindViewById <Toolbar>(Resource.Id.list_toolbar);


            SetActionBar(toolbar);
            ActionBar.Title = "";
            var _user = FindViewById <Button>(Resource.Id.tool_user);

            ISharedPreferences pref = PreferenceManager.GetDefaultSharedPreferences(this);
            var shared_UserName     = pref.GetString("shared_FName", "null");
            var shared_Email        = pref.GetString("shared_Email", "null");

            _user.Text         = shared_UserName;
            btnLogout          = FindViewById <ImageButton>(Resource.Id.tool_logout);
            btnBack            = FindViewById <ImageButton>(Resource.Id.tool_back);
            btnBack.Visibility = ViewStates.Invisible;
            #endregion

            myList  = FindViewById <ListView>(Resource.Id._listView);
            adapter = new MyCustomListAdapter(new UserData().Users);
            ListFragment lst = new ListFragment();
            lst.ListAdapter = adapter;

            myList.Adapter = lst.ListAdapter;

            #region swipe to refresh
            refreshList = FindViewById <SwipeRefreshLayout>(Resource.Id.list_swipeRefresh);
            refreshList.SetProgressBackgroundColorSchemeColor(Android.Resource.Color.HoloOrangeLight);

            refreshList.Refresh += delegate
            {
                adapter.UpdateListAdapter();

                refreshList.Refreshing = false;
            };


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

			SetContentView (Resource.Layout.history);

			SetActionBar ();
			list = new ListFragment ();
			list.RetainInstance = true;

			FragmentManager
				.BeginTransaction ()
				.Add (Resource.Id.fragment_host, list)
				.Commit ();

			LoadList ();

		}
Exemple #7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.history);

            SetActionBar();


            list = new ListFragment();
            list.RetainInstance = true;

            FragmentManager
            .BeginTransaction()
            .Add(Resource.Id.fragment_host, list)
            .Commit();

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

            SetContentView(Resource.Layout.history);

            var steps = Helpers.Settings.TotalSteps;

            this.ActionBar.Title = Utils.FormatSteps(steps) + " " + Resources.GetString(Resource.String.steps);
            var miles          = Conversion.StepsToMiles(steps);
            var calorieString  = Resources.GetString(Resource.String.calories_short);
            var distanceString = Resources.GetString(Helpers.Settings.UseKilometeres ? Resource.String.kilometeres : Resource.String.miles);

            var distance = string.Format(distanceString,
                                         Helpers.Settings.UseKilometeres ?
                                         Conversion.StepsToKilometers(steps).ToString("N") :
                                         miles.ToString("N"));

            var lbs      = Helpers.Settings.UseKilometeres ? Helpers.Settings.Weight * 2.20462 : Helpers.Settings.Weight;
            var calories = string.Format(calorieString,
                                         Helpers.Settings.Enhanced ?
                                         Conversion.CaloriesBurnt(miles, (float)lbs, Helpers.Settings.Cadence) :
                                         Conversion.CaloriesBurnt(miles));

            this.ActionBar.Subtitle = distance + " | " + calories;

            shareText = string.Format(Resources.GetString(Resource.String.share_steps_total), Utils.FormatSteps(steps), distance, calories.ToLower());

            list = new ListFragment();
            list.RetainInstance = true;

            FragmentManager
            .BeginTransaction()
            .Add(Resource.Id.fragment_host, list)
            .Commit();



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

			SetContentView (Resource.Layout.history);

			var steps = Helpers.Settings.TotalSteps;
			this.ActionBar.Title = Utils.FormatSteps(steps) + " " + Resources.GetString (Resource.String.steps);
			var miles = Conversion.StepsToMiles (steps);
			var calorieString = Resources.GetString (Resource.String.calories_short);
			var distanceString = Resources.GetString (Helpers.Settings.UseKilometeres ? Resource.String.kilometeres : Resource.String.miles);

			var distance = string.Format (distanceString, 
				               Helpers.Settings.UseKilometeres ? 
				Conversion.StepsToKilometers (steps).ToString ("N") : 
				miles.ToString ("N"));
				
			var lbs = Helpers.Settings.UseKilometeres ? Helpers.Settings.Weight * 2.20462 : Helpers.Settings.Weight;
			var calories = string.Format (calorieString, 
				               Helpers.Settings.Enhanced ? 
				Conversion.CaloriesBurnt (miles, (float)lbs, Helpers.Settings.Cadence) :
				Conversion.CaloriesBurnt (miles));
			this.ActionBar.Subtitle = distance + " | " + calories;

			shareText = string.Format (Resources.GetString (Resource.String.share_steps_total), Utils.FormatSteps(steps), distance, calories.ToLower ());

			list = new ListFragment ();
			list.RetainInstance = true;

			FragmentManager
				.BeginTransaction ()
				.Add (Resource.Id.fragment_host, list)
				.Commit ();



			LoadList ();

		}