コード例 #1
0
        void FillDataModel()
        {
            this.RunOnUiThread(delegate()
            {
                mRecyclerView.HasFixedSize = true;
                mLayoutManager             = new LinearLayoutManager(this);
                mRecyclerView.SetLayoutManager(mLayoutManager);
                mViewAdapter = new DersProgramiRecyclerViewAdapter(DersProgramiDTO1, this);
                mRecyclerView.SetAdapter(mViewAdapter);
                mViewAdapter.ItemClick += MViewAdapter_ItemClick;
                mLayoutManager          = new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false);
                mRecyclerView.SetLayoutManager(mLayoutManager);
                try
                {
                    SnapHelper snapHelper = new LinearSnapHelper();
                    snapHelper.AttachToRecyclerView(mRecyclerView);
                }
                catch
                {
                }

                var scrollpos = EnyYakinTarihGetir();
                if (scrollpos != -1)
                {
                    mLayoutManager.ScrollToPosition(scrollpos);
                }
            });
        }
コード例 #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View RootView = inflater.Inflate(Resource.Layout.HaritaListeBaseFragment, container, false);

            mRecyclerView = RootView.FindViewById <RecyclerView>(Resource.Id.recyclerView1);
            var a = MapDataModel1;

            mRecyclerView.HasFixedSize = true;
            mLayoutManager             = new LinearLayoutManager(this.Activity);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            boldd        = Typeface.CreateFromAsset(this.Activity.Assets, "Fonts/muliBold.ttf");
            normall      = Typeface.CreateFromAsset(this.Activity.Assets, "Fonts/muliRegular.ttf");
            mViewAdapter = new AnaMainRecyclerViewAdapter(this, (Android.Support.V7.App.AppCompatActivity) this.Activity, this.normall, this.boldd);
            mRecyclerView.SetAdapter(mViewAdapter);
            mViewAdapter.ItemClick += MViewAdapter_ItemClick;
            mLayoutManager          = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mRecyclerView.AddOnScrollListener(new HaritaListeRecyclerViewOnScrollListener(mLayoutManager, this));
            try
            {
                SnapHelper snapHelper = new LinearSnapHelper();
                snapHelper.AttachToRecyclerView(mRecyclerView);
            }
            catch
            {
            }
            return(RootView);
        }
コード例 #3
0
        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();
        }
        private void CreateView(HorizontalListView horizontalList)
        {
            if (_isFirstInitialization)
            {
                Element.CheckConsistency();
                _isFirstInitialization = false;
            }

            var recyclerView = new SlowRecyclerView(Context, Element.ScrollSpeed)
            {
                HasFixedSize = false
            };

            SetListLayout(recyclerView);

            SetNativeControl(recyclerView);

            if (Element.SnapStyle != SnapStyle.None)
            {
                LinearSnapHelper snapHelper = Element.SnapStyle == SnapStyle.Start
                    ? new StartSnapHelper(this)
                    : new CenterSnapHelper(this);
                snapHelper.AttachToRecyclerView(Control);
            }

            Control.HorizontalScrollBarEnabled = false;

            if (Element.ItemsSource != null)
            {
                UpdateItemsSource();
            }

            if (LinearLayoutManager != null)
            {
                Control.AddOnScrollListener(new OnControlScrollChangedListener(this, horizontalList));

                ProcessDisableScroll();

                if (HorizontalLinearLayoutManager != null)
                {
                    ScrollToCurrentItem();
                }
            }

            Control.ViewTreeObserver.PreDraw += OnPreDraw;
        }
コード例 #5
0
        private void CreateView(HorizontalListView horizontalList)
        {
            if (_isFirstInitialization)
            {
                Element.CheckConsistency();
                _isFirstInitialization = false;
            }

            var recyclerView = new SlowRecyclerView(Context, Element.ScrollSpeed)
            {
                HasFixedSize = true
            };

            if (Element.ListLayout == HorizontalListViewLayout.Grid)
            {
                recyclerView.SetLayoutManager(new ResponsiveGridLayoutManager(Context, Element));
            }
            else
            {
                recyclerView.SetLayoutManager(new CustomLinearLayoutManager(Context, OrientationHelper.Horizontal, false));
            }

            if (Element.ItemSpacing > 0 || Element.CollectionPadding != new Thickness(0))
            {
                recyclerView.AddItemDecoration(new SpaceItemDecoration(Element.ItemSpacing, Element.CollectionPadding));

                if (!(Element.ListLayout == HorizontalListViewLayout.Grid && Element.ColumnCount == 0))
                {
                    recyclerView.SetPadding(
                        PlatformHelper.Instance.DpToPixels(Element.CollectionPadding.Left),
                        PlatformHelper.Instance.DpToPixels(Element.CollectionPadding.Top),
                        PlatformHelper.Instance.DpToPixels(Element.CollectionPadding.Right),
                        PlatformHelper.Instance.DpToPixels(Element.CollectionPadding.Bottom));
                }

                recyclerView.SetClipToPadding(false);
            }

            SetNativeControl(recyclerView);

            if (Element.SnapStyle != SnapStyle.None)
            {
                LinearSnapHelper snapHelper = Element.SnapStyle == SnapStyle.Start
                    ? new StartSnapHelper(this)
                    : new CenterSnapHelper(this);
                snapHelper.AttachToRecyclerView(Control);
            }

            Control.HorizontalScrollBarEnabled = false;

            if (Element.ItemsSource != null)
            {
                UpdateItemsSource();
            }

            if (LinearLayoutManager != null)
            {
                Control.AddOnScrollListener(new OnControlScrollChangedListener(this, horizontalList));

                ProcessDisableScroll();

                if (HorizontalLinearLayoutManager != null)
                {
                    ScrollToCurrentItem();
                }
            }

            Control.ViewTreeObserver.PreDraw += OnPreDraw;
        }
コード例 #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            ActionBar.SetDisplayHomeAsUpEnabled(true);

            SetContentView(Resource.Layout.activity_tutorial);

            left = FindViewById(Resource.Id.left);
            left.SetOnClickListener(new ViewClickAction((v) => {
                scroller.ScrollLeft();
            }));

            right = FindViewById(Resource.Id.right);
            right.SetOnClickListener(new ViewClickAction((v) => {
                scroller.ScrollRight();
            }));

            FindViewById(Resource.Id.button).SetOnClickListener(new ViewClickAction((view) => {
                Finish();
            }));

            FindViewById(Resource.Id.help).SetOnClickListener(new ViewClickAction((v) => {
                ion.portal.SendAppSupportEmail(ion, this);
            }));

            list      = FindViewById <RecyclerView>(Resource.Id.list);
            tabLayout = FindViewById <TextView>(Resource.Id.tab_1);

            adapter = new Adapter();

            // WORKBENCH
            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_workbench,
                imageResource   = Resource.Drawable.tutorial_workbench,
                contentResource = Resource.String.tutorial_workbench_description,
                xPercent        = -1f,
                yPercent        = -1f,
            });

            // WORKBENCH ADD VIEWER
            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_workbench,
                imageResource   = Resource.Drawable.tutorial_workbench,
                contentResource = Resource.String.tutorial_workbench_add_viewer,
                xPercent        = 0.5f,
                yPercent        = 0.3248945148f,
            });

            // DEVICE MANAGER
            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_device_manager,
                imageResource   = Resource.Drawable.tutorial_device_manager,
                contentResource = Resource.String.tutorial_device_manager_description,
                xPercent        = -1f,
                yPercent        = -1f,
            });

            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_device_manager,
                imageResource   = Resource.Drawable.tutorial_device_manager_scan,
                contentResource = Resource.String.tutorial_device_manager_scan,
                xPercent        = 0.9435f,
                yPercent        = 0.05907173f,
            });

            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_device_manager,
                imageResource   = Resource.Drawable.tutorial_device_manager,
                contentResource = Resource.String.tutorial_device_manager_connect,
                xPercent        = 0.94375f,
                yPercent        = 0.1814345992f,
            });

            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_device_manager,
                imageResource   = Resource.Drawable.tutorial_device_manager,
                contentResource = Resource.String.tutorial_device_manager_add,
                xPercent        = 0.85f,
                yPercent        = 0.2362869198f,
            });

            // WORKBENCH CONTINUED
            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_workbench,
                imageResource   = Resource.Drawable.tutorial_workbench_actions,
                contentResource = Resource.String.tutorial_workbench_actions,
                xPercent        = 0.5f,
                yPercent        = 0.168777f,
            });

            // NAVIGATION DRAWER
            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_navigation,
                imageResource   = Resource.Drawable.tutorial_navigation_drawer,
                contentResource = Resource.String.tutorial_navigation_description,
                xPercent        = 0.075f,
                yPercent        = 0.05907173f,
            });

            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_navigation,
                imageResource   = Resource.Drawable.tutorial_navigation_drawer,
                contentResource = Resource.String.tutorial_navigation_exit,
                xPercent        = 0.25f,
                yPercent        = 0.683544f,
            });

            // WORKBENCH CONTINUED
            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_workbench,
                imageResource   = Resource.Drawable.tutorial_workbench,
                contentResource = Resource.String.tutorial_workbench_data_log,
                xPercent        = 0.9475f,         //4375f,
                yPercent        = 0.05907173f,
            });

            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_workbench,
                imageResource   = Resource.Drawable.tutorial_workbench,
                contentResource = Resource.String.tutorial_workbench_screenshot,
                xPercent        = 0.84f,         //0.8375f,
                yPercent        = 0.05907173f,
            });

            // ANALYZER
            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_analyzer,
                imageResource   = Resource.Drawable.tutorial_analyzer,
                contentResource = Resource.String.tutorial_analyzer_description,
                xPercent        = -1f,
                yPercent        = -1f,
            });

            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_analyzer,
                imageResource   = Resource.Drawable.tutorial_analyzer,
                contentResource = Resource.String.tutorial_analyzer_add,
                xPercent        = 0.34375f,
                yPercent        = 0.1603376f,
            });

            adapter.AddPage(new TutorialPage()
            {
                titleResource   = Resource.String.tutorial_analyzer,
                imageResource   = Resource.Drawable.tutorial_analyzer_actions,
                contentResource = Resource.String.tutorial_analyzer_actions,
                xPercent        = -1,         //0.26f,
                yPercent        = -1,         //0.616034f,
            });

            scroller = new OnScroll(list, UpdatePosition);
            list.SetLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false));
            list.AddOnScrollListener(scroller);
            var snap = new LinearSnapHelper();

            snap.AttachToRecyclerView(list);
            list.SetAdapter(adapter);
            left.Visibility = ViewStates.Invisible;

            tabLayout.Text = 1 + " / " + adapter.ItemCount;
        }