Example #1
0
        private void SetupRecyclerView()
        {
            // Touch listeners.
            itemTouchListener = new ItemTouchListener(recyclerView, this);
            recyclerView.AddOnItemTouchListener(itemTouchListener);

            var touchCallback = new SwipeDismissCallback(ItemTouchHelper.Up | ItemTouchHelper.Down, ItemTouchHelper.Left, this);
            var touchHelper   = new ItemTouchHelper(touchCallback);

            touchHelper.AttachToRecyclerView(recyclerView);

            // Decorations.
            dividerDecoration = new DividerItemDecoration(Activity, DividerItemDecoration.VerticalList);
            shadowDecoration  = new ShadowItemDecoration(Activity);
            recyclerView.AddItemDecoration(dividerDecoration);
            recyclerView.AddItemDecoration(shadowDecoration);

            recyclerView.GetItemAnimator().SupportsChangeAnimations = false;
        }
Example #2
0
        private void SetupRecyclerView(LogTimeEntriesViewModel viewModel)
        {
            // Touch listeners.
            itemTouchListener = new ItemTouchListener(recyclerView, this);
            recyclerView.AddOnItemTouchListener(itemTouchListener);

            // Scroll listener
            recyclerView.AddOnScrollListener(
                new ScrollListener((LinearLayoutManager)recyclerView.GetLayoutManager(), viewModel));

            var touchCallback = new SwipeDismissCallback(ItemTouchHelper.Up | ItemTouchHelper.Down, ItemTouchHelper.Left, this);
            var touchHelper   = new ItemTouchHelper(touchCallback);

            touchHelper.AttachToRecyclerView(recyclerView);

            // Decorations.
            dividerDecoration = new DividerItemDecoration(Activity, DividerItemDecoration.VerticalList);
            shadowDecoration  = new ShadowItemDecoration(Activity);
            recyclerView.AddItemDecoration(dividerDecoration);
            recyclerView.AddItemDecoration(shadowDecoration);
            recyclerView.GetItemAnimator().SupportsChangeAnimations = false;
        }
Example #3
0
        void FnInitialization()
        {
            //gesture initialization
            gestureListener                 = new GestureListener();
            gestureListener.LeftEvent      += GestureLeft;
            gestureListener.RightEvent     += GestureRight;
            gestureListener.SingleTapEvent += SingleTap;
            gestureDetector                 = new GestureDetector(this, gestureListener);

            menuListView      = FindViewById <ListView> (Resource.Id.menuListView);
            menuIconImageView = FindViewById <ImageView> (Resource.Id.menuIconImgView);
            txtActionBarText  = FindViewById <TextView> (Resource.Id.txtActionBarText);
            txtPageName       = FindViewById <ListView> (Resource.Id.txtPage);
            string[]          strMnuText = { "Home", "AboutUs", "Products", "Events", "Serivce", "Clients", "Help", "Solution", "ContactUs" };
            ItemTouchListener itl        = new ItemTouchListener(menuListView);
            ListAdapterClass  adapter    = new ListAdapterClass(this, strMnuText, itl);

            isSingleTapFired    = itl.clgt;
            txtPageName.Adapter = adapter;

            txtDescription  = FindViewById <TextView> (Resource.Id.txtDescription);
            btnDescExpander = FindViewById <ImageView> (Resource.Id.btnImgExpander);
            //changed sliding menu width to 1/3 of screen width
            Display display = this.WindowManager.DefaultDisplay;
            var     point   = new Point();

            display.GetSize(point);
            intDisplayWidth = point.X;
            intDisplayWidth = intDisplayWidth - (intDisplayWidth / 3);
            using (var layoutParams = (RelativeLayout.LayoutParams)menuListView.LayoutParameters) {
                layoutParams.Width            = intDisplayWidth;
                layoutParams.Height           = ViewGroup.LayoutParams.MatchParent;
                menuListView.LayoutParameters = layoutParams;
            }
            //menuListView.LayoutParameters = new RelativeLayout.LayoutParams(intDisplayWidth, ViewGroup.LayoutParams.MatchParent);
        }