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

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

            DB = new Database();

            runRecord = (RunRecord)DB.Find(Intent.Extras.GetString("RunID"), typeof(RunRecord));
            runData   = RunRecord.GetRunDataFromRun(runRecord.ID);

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



            tv_runDate      = (TextView)FindViewById(Resource.Id.tv_run_date);
            tv_runDate.Text = runRecord.dor;

            wrv_laps = (WearableRecyclerView)FindViewById(Resource.Id.wrv_workout_data);
            adapter  = new AdapterRunData(this, wrv_laps, Resource.Layout.item_lap, runData, false);
            wrv_laps.SetAdapter(adapter);
            adapter.NotifyDataSetChanged();

            Console.WriteLine("Lap count" + runData.Count);
        }
Esempio n. 2
0
        private void InitViews()
        {
            _loadingLayout = FindViewById <RelativeLayout>(Resource.Id.layoutLoading);
            _emptyLayout   = FindViewById <RelativeLayout>(Resource.Id.layoutEmpty);
            _offlineLayout = FindViewById <LinearLayout>(Resource.Id.layoutOffline);

            _authList = FindViewById <WearableRecyclerView>(Resource.Id.list);
            _authList.EdgeItemsCenteringEnabled = true;
            _authList.HasFixedSize = true;
            _authList.SetItemViewCacheSize(12);
            _authList.SetItemAnimator(null);

            var layoutCallback = new AuthenticatorListLayoutCallback(this);

            _authList.SetLayoutManager(new WearableLinearLayoutManager(this, layoutCallback));

            _authListAdapter              = new AuthenticatorListAdapter(_authSource, _customIconCache);
            _authListAdapter.ItemClick   += OnItemClick;
            _authListAdapter.HasStableIds = true;
            _authList.SetAdapter(_authListAdapter);

            var categoriesDrawer = FindViewById <WearableNavigationDrawerView>(Resource.Id.drawerCategories);

            _categoryListAdapter = new CategoryListAdapter(this, _categoryCache);
            categoriesDrawer.SetAdapter(_categoryListAdapter);
            categoriesDrawer.ItemSelected += OnCategorySelected;
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activityMain);

            _loadingLayout      = FindViewById <LinearLayout>(Resource.Id.layoutLoading);
            _emptyLayout        = FindViewById <LinearLayout>(Resource.Id.layoutEmpty);
            _disconnectedLayout = FindViewById <LinearLayout>(Resource.Id.layoutDisconnected);

            _retryButton        = FindViewById <MaterialButton>(Resource.Id.buttonRetry);
            _retryButton.Click += OnRetryClick;

            _authList = FindViewById <WearableRecyclerView>(Resource.Id.list);
            _authList.EdgeItemsCenteringEnabled = true;
            _authList.HasFixedSize = true;
            _authList.SetItemViewCacheSize(12);
            _authList.SetItemAnimator(null);

            var layoutCallback = new ScrollingListLayoutCallback(Resources.Configuration.IsScreenRound);

            _authList.SetLayoutManager(new WearableLinearLayoutManager(this, layoutCallback));

            _customIconCache = new CustomIconCache(this);

            _authListAdapter              = new AuthenticatorListAdapter(_customIconCache);
            _authListAdapter.ItemClick   += ItemClick;
            _authListAdapter.HasStableIds = true;
            _authList.SetAdapter(_authListAdapter);
        }
Esempio n. 4
0
        public void Initialize()
        {
            if (weatherView != null)
            {
                View?.SetBackgroundColor(weatherView.PendingBackground);
                // specify an adapter (see also next example)
                RecyclerView.Adapter adapter = null;

                weatherType = (WeatherListType)Arguments?.GetInt("WeatherListType", 0);

                switch (weatherType)
                {
                default:
                case WeatherListType.Forecast:
                    recyclerView.SetLayoutManager(new WearableLinearLayoutManager(Activity));
                    adapter = new ForecastItemAdapter(weatherView.Forecasts.ToList());
                    break;

                case WeatherListType.HourlyForecast:
                    recyclerView.SetLayoutManager(new WearableLinearLayoutManager(Activity));
                    adapter = new HourlyForecastItemAdapter(weatherView.Extras.HourlyForecast.ToList());
                    break;

                case WeatherListType.Alerts:
                    recyclerView.SetLayoutManager(new LinearLayoutManager(Activity));
                    adapter = new WeatherAlertPanelAdapter(weatherView.Extras.Alerts.ToList());
                    break;
                }

                recyclerView.SetAdapter(adapter);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.multi_recycler_view);

            wrv_multiView = (WearableRecyclerView)FindViewById(Resource.Id.wrv_multi_view);
            SnapHelper snapHelper = new LinearSnapHelper();

            snapHelper.AttachToRecyclerView(wrv_multiView);
            adapter = new AdapterMetricsMultiView(this, wrv_multiView, new List <int> {
                ListItemType.MetricsLayout, ListItemType.LapList
            }, false);
            wrv_multiView.SetAdapter(adapter);

            SetAmbientEnabled();


            app           = GlobalDataDash.GetInstance();
            serviceIntent = new Intent(this, typeof(ServiceWorkout));

            serviceConnection = new ServiceConnection(this);

            if (!app.isServiceRunning)
            {
                StartService(serviceIntent);
            }
            DoBindService();

            StartUIThread();
        }
Esempio n. 6
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     empDirListView            = FindViewById <WearableRecyclerView>(Resource.Id.empDirListView);
     leavesRecyclerViewAdapter = new LeavesRecyclerViewAdapter(this);
     SetLeaves();
     empDirListView.SetAdapter(leavesRecyclerViewAdapter);
 }
Esempio n. 7
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     SetContentView(Resource.Layout.activity_employeeDir);
     empDirListView            = FindViewById <WearableRecyclerView>(Resource.Id.empDirListView);
     empDirRecyclerViewAdapter = new EmpDirRecyclerViewAdapter(this);
     SetEmployees();
     empDirListView.SetAdapter(empDirRecyclerViewAdapter);
 }
Esempio n. 8
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activityMain);

            try
            {
                await WearableClass.GetMessageClient(this).AddListenerAsync(this);
                await FindServerNode();
            }
            catch (ApiException) { }

            _loadingLayout = FindViewById <RelativeLayout>(Resource.Id.layoutLoading);
            _emptyLayout   = FindViewById <RelativeLayout>(Resource.Id.layoutEmpty);
            _offlineLayout = FindViewById <LinearLayout>(Resource.Id.layoutOffline);

            _authList = FindViewById <WearableRecyclerView>(Resource.Id.list);
            _authList.EdgeItemsCenteringEnabled = true;
            _authList.HasFixedSize = true;
            _authList.SetItemViewCacheSize(12);
            _authList.SetItemAnimator(null);

            var layoutCallback = new ScrollingListLayoutCallback(Resources.Configuration.IsScreenRound);

            _authList.SetLayoutManager(new WearableLinearLayoutManager(this, layoutCallback));

            _authCache       = new ListCache <WearAuthenticator>("authenticators", this);
            _categoryCache   = new ListCache <WearCategory>("categories", this);
            _customIconCache = new CustomIconCache(this);

            await _authCache.Init();

            _authSource = new AuthenticatorSource(_authCache);

            _authListAdapter              = new AuthenticatorListAdapter(_authSource, _customIconCache);
            _authListAdapter.ItemClick   += OnItemClick;
            _authListAdapter.HasStableIds = true;
            _authList.SetAdapter(_authListAdapter);

            if (_authCache.GetItems().Count > 0 || _serverNode == null)
            {
                UpdateViewState();
            }

            await _categoryCache.Init();

            var categoriesDrawer = FindViewById <WearableNavigationDrawerView>(Resource.Id.drawerCategories);

            _categoryListAdapter = new CategoryListAdapter(this, _categoryCache);
            categoriesDrawer.SetAdapter(_categoryListAdapter);
            categoriesDrawer.ItemSelected += OnCategorySelected;

            await Refresh();
        }
Esempio n. 9
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootView = inflater.Inflate(Resource.Layout.lap_list, container, false);
            app      = GlobalDataDash.GetInstance();

            currentLapData = app.currentLapData;

            rv_lapList = (WearableRecyclerView)rootView.FindViewById(Resource.Id.rv_laps);
            adapter    = new AdapterRunData(Activity, rv_lapList, Resource.Layout.item_lap, currentLapData, false);
            rv_lapList.SetAdapter(adapter);
            adapter.NotifyDataSetChanged();

            return(rootView);
        }
Esempio n. 10
0
        private void InitViews()
        {
            _loadingLayout = FindViewById <RelativeLayout>(Resource.Id.layoutLoading);
            _emptyLayout   = FindViewById <RelativeLayout>(Resource.Id.layoutEmpty);
            _offlineLayout = FindViewById <LinearLayout>(Resource.Id.layoutOffline);

            _authList = FindViewById <WearableRecyclerView>(Resource.Id.list);
            _authList.EdgeItemsCenteringEnabled = true;
            _authList.HasFixedSize = true;
            _authList.SetItemViewCacheSize(12);
            _authList.SetItemAnimator(null);

            var layoutCallback = new AuthenticatorListLayoutCallback(this);

            _authList.SetLayoutManager(new WearableLinearLayoutManager(this, layoutCallback));

            _authListAdapter                = new AuthenticatorListAdapter(_authSource, _customIconCache);
            _authListAdapter.ItemClick     += OnItemClick;
            _authListAdapter.ItemLongClick += OnItemLongClick;
            _authListAdapter.HasStableIds   = true;
            _authListAdapter.DefaultAuth    = _preferences.DefaultAuth;
            _authList.SetAdapter(_authListAdapter);

            _categoryList        = FindViewById <WearableNavigationDrawerView>(Resource.Id.drawerCategories);
            _categoryListAdapter = new CategoryListAdapter(this, _categoryCache);
            _categoryList.SetAdapter(_categoryListAdapter);
            _categoryList.ItemSelected += OnCategorySelected;

            if (_authSource.CategoryId == null)
            {
                return;
            }

            var categoryPosition = _categoryCache.FindIndex(c => c.Id == _authSource.CategoryId) + 1;

            if (categoryPosition <= -1)
            {
                return;
            }

            _preventCategorySelectEvent = true;
            _categoryList.SetCurrentItem(categoryPosition, false);
        }
Esempio n. 11
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);
        }
Esempio n. 12
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();
        }
Esempio n. 13
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = base.OnCreateView(inflater, container, savedInstanceState) as SwipeDismissFrameLayout;

            // Inflate the layout for this fragment
            inflater.Inflate(Resource.Layout.fragment_location_search, view, true);

            swipeViewLayout          = view.FindViewById <SwipeDismissFrameLayout>(Resource.Id.recycler_view_layout);
            swipeCallback            = new SwipeDismissCallback();
            swipeCallback.Dismissed += (layout) =>
            {
                layout.Visibility = ViewStates.Gone;
                //layout.Reset();
            };
            swipeViewLayout.AddCallback(swipeCallback);
            keyboardButton        = view.FindViewById <FloatingActionButton>(Resource.Id.keyboard_button);
            keyboardButton.Click += (sender, e) =>
            {
                mSearchView.Visibility = ViewStates.Visible;
                mSearchView.RequestFocus();
                ShowInputMethod(mSearchView);
            };
            voiceButton        = view.FindViewById <FloatingActionButton>(Resource.Id.voice_button);
            voiceButton.Click += (sender, e) =>
            {
                mSearchView.Visibility = ViewStates.Gone;
                mSearchView.Text       = String.Empty;
                view.RequestFocus();
                Intent intent = new Intent(RecognizerIntent.ActionRecognizeSpeech)
                                .PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm)
                                .PutExtra(RecognizerIntent.ExtraPrompt, mActivity.GetString(Resource.String.location_search_hint));
                StartActivityForResult(intent, REQUEST_CODE_VOICE_INPUT);
            };

            mProgressBar             = view.FindViewById <ProgressBar>(Resource.Id.progressBar);
            mSearchView              = view.FindViewById <EditText>(Resource.Id.search_view);
            mSearchView.TextChanged += (object sender, TextChangedEventArgs e) =>
            {
                // If we're using searchfragment
                // make sure gps feature is off
                if (Settings.FollowGPS)
                {
                    Settings.FollowGPS = false;
                }
            };
            mSearchView.FocusChange += (object sender, View.FocusChangeEventArgs e) =>
            {
                View v = sender as View;

                if (e.HasFocus)
                {
                    ShowInputMethod(v.FindFocus());
                }
                else
                {
                    HideInputMethod(v);
                }
            };
            mSearchView.EditorAction += (object sender, TextView.EditorActionEventArgs e) =>
            {
                if (e.ActionId == ImeAction.Search)
                {
                    DoSearchAction();

                    // If we're using searchfragment
                    // make sure gps feature is off
                    if (Settings.FollowGPS)
                    {
                        Settings.FollowGPS = false;
                    }

                    e.Handled = true;
                }
                e.Handled = false;
            };

            mRecyclerView = view.FindViewById <WearableRecyclerView>(Resource.Id.recycler_view);

            // use this setting to improve performance if you know that changes
            // in content do not change the layout size of the RecyclerView
            mRecyclerView.HasFixedSize = true;

            // To align the edge children (first and last) with the center of the screen
            mRecyclerView.EdgeItemsCenteringEnabled = true;

            // use a linear layout manager
            mLayoutManager = new WearableLinearLayoutManager(mActivity);
            mRecyclerView.SetLayoutManager(mLayoutManager);

            // specify an adapter (see also next example)
            mAdapter            = new LocationQueryAdapter(new List <LocationQueryViewModel>());
            mAdapter.ItemClick += ClickListener;
            mRecyclerView.SetAdapter(mAdapter);

            return(view);
        }