Exemplo n.º 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootView        = inflater.Inflate(Resource.Layout.frag_history_list, container, false);
            workoutListView = (WearableRecyclerView)rootView.FindViewById(Resource.Id.rv_history);

            DB         = new Database();
            runRecords = DB.GetAllObjects(nameof(RunRecord)).Cast <RunRecord>().ToList();
            if (runRecords == null)
            {
                runRecords = new List <RunRecord>();
            }
            runRecords.Reverse();
            adapter = new AdapterRunHistory(Activity, workoutListView, Resource.Layout.item_history, runRecords, true);
            workoutListView.SetAdapter(adapter);
            workoutListView.CenterEdgeItems = true;
            workoutListView.SetLayoutManager(new CurvedChildLayoutManager(Activity));
            //workoutListView.SetLayoutManager(new CustomCurvedChildLayoutManager(Activity));
            adapter.NotifyDataSetChanged();
            return(rootView);
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activity_start);

            actionDrawer = (WearableActionDrawer)FindViewById(Resource.Id.ad_start);
            actionDrawer.SetOnMenuItemClickListener(new MenuItemClickListener(this));
            actionDrawer.PeekDrawer();

            sv_workouts = (ScrollView)FindViewById(Resource.Id.sv_workout_list);
            sv_workouts.RequestFocus();
            sv_workouts.SmoothScrollingEnabled = true;

            PopulateList();

            wrv_workouts = (WearableRecyclerView)FindViewById(Resource.Id.wrv_workout_list);
            adapter      = new AdapterRunHistory(this, wrv_workouts, Resource.Layout.item_history, runRecords, true);
            wrv_workouts.SetAdapter(adapter);
            adapter.NotifyDataSetChanged();
        }