public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.StudyCardLayout, container, false);
            mRecyclerView = view.FindViewById<RecyclerView> (Resource.Id.recyclerView);
            //mListView = view.FindViewById<ListView> (Resource.Id.lvToDoList);
            mFab = view.FindViewById<FloatingActionButton> (Resource.Id.fab);
            mFab.Click += (sender, e) => {
                createFragment(null,true);
            };
            mStudyGroup = new List<StudyGroup> ();
            StudyRequest asyncStudyRquest = new StudyRequest ();
            Task<StudyResponse> data = asyncStudyRquest.StudyRequestAsync (LoginInfo.username, LoginInfo.KEY);

            StudyResponse results = data.Result;
            List<StudyGroup> resultsList = new List<StudyGroup> (results.studyGroups);

            for (int i = 0; i <resultsList.Count; i++) {

                mStudyGroup.Add (resultsList[i]);
            }

            mLayoutManager = new LinearLayoutManager (view.Context);
            mRecyclerView.SetLayoutManager (mLayoutManager);
            mAdapter = new RecyclerAdapter (mStudyGroup,mRecyclerView,this);
            mRecyclerView.SetAdapter (mAdapter);

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

            // Instantiate the photo album:
            mPhotoAlbum = new PhotoAlbum();

			// Set our view from the "main" layout resource:
			SetContentView (Resource.Layout.Main);

            // Get our RecyclerView layout:
			mRecyclerView = FindViewById<RecyclerView> (Resource.Id.recyclerView);

            //............................................................
            // Layout Manager Setup:

            // Use the built-in linear layout manager:
			mLayoutManager = new LinearLayoutManager (this);

            // Or use the built-in grid layout manager (two horizontal rows):
            // mLayoutManager = new GridLayoutManager
            //        (this, 2, GridLayoutManager.Horizontal, false);

            // Plug the layout manager into the RecyclerView:
            mRecyclerView.SetLayoutManager (mLayoutManager);

            //............................................................
            // Adapter Setup:

            // Create an adapter for the RecyclerView, and pass it the
            // data set (the photo album) to manage:
			mAdapter = new PhotoAlbumAdapter (mPhotoAlbum);

            // Register the item click handler (below) with the adapter:
            mAdapter.ItemClick += OnItemClick;

            // Plug the adapter into the RecyclerView:
			mRecyclerView.SetAdapter (mAdapter);

            //............................................................
            // Random Pick Button:

            // Get the button for randomly swapping a photo:
            Button randomPickBtn = FindViewById<Button>(Resource.Id.randPickButton);

            // Handler for the Random Pick Button:
            randomPickBtn.Click += delegate
            {
                if (mPhotoAlbum != null)
                {
                    // Randomly swap a photo with the top:
                    int idx = mPhotoAlbum.RandomSwap();

                    // Update the RecyclerView by notifying the adapter:
                    // Notify that the top and a randomly-chosen photo has changed (swapped):
                    mAdapter.NotifyItemChanged(0);
                    mAdapter.NotifyItemChanged(idx);
                }
            };
		}
        public override void OnBindViewHolder (RecyclerView.ViewHolder holder, int position)
        {
            var itemHolder = (ItemViewHolder)holder;

            itemHolder.textView.Text = mItems.ElementAt(position);
            itemHolder.handleView.SetOnTouchListener (new TouchListenerHelper(itemHolder, mDragStartListener));
        }
		public  override void OnBindViewHolder (RecyclerView.ViewHolder holder, int position)
		{
			if (holder.GetType () == typeof(MyVote_ViewHolder)) {
				
				var vh = holder as MyVote_ViewHolder;
				string tempURL = mVoteData [position].imageString;

				//call the local picasso function
			
				//set a tag for the button to the current clicked position
				vh.IVDetail.SetTag (Resource.Id.ivDetails, position);
				vh.IVPoster.SetTag (Resource.Id.ivPoster, position);
				vh.IVVote.SetTag (Resource.Id.ivVote, position);

				vh.PBimgVote.Visibility = ViewStates.Invisible;
				intialButton (vh.IVVote, vh.PBimgVote, mVoteData [position].voteStat); 
			
				PicassoSetImage (tempURL, vh.IVPoster, vh);

				//define a handle click
				vh.IVVote.Click += IVVote_Click;
				vh.IVDetail.Click += IVDetail_Click;
				vh.IVPoster.Click += IVPoster_Click;
				vh.TVLike.Visibility = ViewStates.Invisible;

				vh.IVDetail.Visibility = ViewStates.Invisible;
			}
		}
		public MyHealth_TakwimViewHolder (View itemView, Action<int> listener) : base(itemView)
		{
			tvTitle = itemView.FindViewById <TextView> (Resource.Id.tvCardHeader);
			mRViewList = itemView.FindViewById <RecyclerView> (Resource.Id.takwimRecyclerViewList);

			itemView.Click += (sender, e) => listener (base.Position);
		}
 public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
 {
     var movieViewHolder = (MovieViewHolder)holder;
     movieViewHolder.MovieNameTextView.Text = movies[position].title;
     movieViewHolder.DirectedByTextView.Text = "Directed by " + movies[position].director;
     movieViewHolder.ReleasedOnTextView.Text = "Released on " + movies[position].release_date;
 }
    public override void OnScrollStateChanged(RecyclerView recyclerView, int newState)
    {
      if (OnScrollListener != null)
        OnScrollListener.OnScrollStateChanged(recyclerView, newState);

      base.OnScrollStateChanged(recyclerView, newState);
    }
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            recyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerView);
            activityIndicator = FindViewById<ProgressBar>(Resource.Id.activityIndicator);

            activityIndicator.Visibility = Android.Views.ViewStates.Visible;

            layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);

            recyclerView.SetLayoutManager(layoutManager);

            var repository = new MoviesRepository();

            var films = await repository.GetAllFilms();

            var moviesAdapter = new MovieAdapter(films.results);

            recyclerView.SetAdapter(moviesAdapter);

            activityIndicator.Visibility = Android.Views.ViewStates.Gone;

            SupportActionBar.SetDisplayHomeAsUpEnabled(false);
            SupportActionBar.SetHomeButtonEnabled(false);
        }
			public override void OnBindViewHolder (RecyclerView.ViewHolder holder, int position)
			{
				var vh = holder as ViewHolder;
				vh.Title.Text = _items [position].Item2;
				co.littlebyte.Utils.CachedImageLoader.LoadImageFromUrl (vh.Icon, _items [position].Item1, null, 12, 12);

			}
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.ProjectListFragment, container, false);

            recyclerView = view.FindViewById<RecyclerView> (Resource.Id.ProjectListRecyclerView);
            recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
            recyclerView.AddItemDecoration (new ShadowItemDecoration (Activity));
            recyclerView.AddItemDecoration (new DividerItemDecoration (Activity, DividerItemDecoration.VerticalList));

            emptyStateLayout = view.FindViewById<LinearLayout> (Resource.Id.ProjectListEmptyState);
            searchEmptyState = view.FindViewById<LinearLayout> (Resource.Id.ProjectListSearchEmptyState);
            tabLayout = view.FindViewById<TabLayout> (Resource.Id.WorkspaceTabLayout);
            newProjectFab = view.FindViewById<AddProjectFab> (Resource.Id.AddNewProjectFAB);
            toolBar = view.FindViewById<Toolbar> (Resource.Id.ProjectListToolbar);

            var activity = (Activity)Activity;
            activity.SetSupportActionBar (toolBar);
            activity.SupportActionBar.SetDisplayHomeAsUpEnabled (true);
            activity.SupportActionBar.SetTitle (Resource.String.ChooseTimeEntryProjectDialogTitle);

            HasOptionsMenu = true;
            newProjectFab.Click += OnNewProjectFabClick;
            tabLayout.SetOnTabSelectedListener (this);

            return view;
        }
 public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
 {
     var viewHolder = holder as PhotoViewHolder;
     if (viewHolder == null) return;
     viewHolder.Image.SetImageResource(_photoAlbum[position].Id);
     viewHolder.Caption.Text = _photoAlbum[position].Caption;
 }
        public bool OnInterceptTouchEvent (RecyclerView rv, MotionEvent e)
        {
            // TODO : this part intercep any touch inside recycler
            // and delete pending items.
            // A better method could be used.

            if (e.Action == MotionEventActions.Down) {
                var undoAdapter = (IUndoAdapter)rv.GetAdapter ();
                View view = GetChildViewUnder (e);

                if (view == null) {
                    undoAdapter.DeleteSelectedItem ();
                } else {
                    int position = recyclerView.GetChildLayoutPosition (view);
                    if (!undoAdapter.IsUndo (position)) {
                        undoAdapter.DeleteSelectedItem ();
                    }
                }
            }

            if (IsEnabled) {
                gestureDetector.OnTouchEvent (e);
            }
            return false;
        }
		/**
		 * Construct the RecyclerViewMaterialAdapter, which inject a header into an actual RecyclerView.Adapter
		 *
		 * @param adapter         The real RecyclerView.Adapter which displays content
		 * @param placeholderSize The number of placeholder items before real items, default is 1
		 */
		public RecyclerViewMaterialAdapter(RecyclerView.Adapter adapter, int placeholderSize)
		{
			_mAdapter = adapter;
			_mPlaceholderSize = placeholderSize;

			RegisterAdapterObserver();
		}
 public override int GetSwipeDirs (RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder)
 {
     if (listener.CanDismiss (recyclerView, viewHolder)) {
         return ItemTouchHelper.Right;
     }
     return 0;
 }
        private void InitComponents()
        {
            _recyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerView);
            _button = FindViewById<Button>(Resource.Id.randPickButton);

            _button.Click += button_Click;
        }
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.activity_recycler_view_add_remove);
			ActionBar.SetDisplayHomeAsUpEnabled (true);
			ActionBar.SetDisplayShowHomeEnabled (true);
			ActionBar.SetIcon (Android.Resource.Color.Transparent);

			recyclerView = FindViewById<RecyclerView> (Resource.Id.recycler_view);
			recyclerView.HasFixedSize = true;


			layoutManager = new LinearLayoutManager (this);
			recyclerView.SetLayoutManager (layoutManager);

			adapter = new RecyclerAdapter (new List<RecyclerItem>());
			recyclerView.SetAdapter (adapter);
			recyclerView.SetItemAnimator (new DefaultItemAnimator ());

			FindViewById<Button>(Resource.Id.add).Click += (sender, e) => {
				adapter.Add(new RecyclerItem { Title = "New Item: " + adapter.ItemCount });
			};

			adapter.OnItemClick = (view, item) => {
				adapter.Remove(adapter.Items.IndexOf(item));
			};
		}
 public override void OnBindViewHolder(RecyclerView.ViewHolder holder, Int32 position)
 {
     var icon = _icons[position];
     var viewHolder = holder as ViewHolder;
     viewHolder.Icon.Text = $"{{{icon.Key}}}";
     viewHolder.Name.Text = icon.Key;
 }
Beispiel #18
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);

			setup();

			// Set our view from the "main" layout resource
			SetContentView(Resource.Layout.Main);

			drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			drawerList = FindViewById<RecyclerView>(Resource.Id.left_drawer);

			drawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow, GravityCompat.Start);
			drawerList.SetLayoutManager(new LinearLayoutManager(this));
			adapter = new MenuAdapter();
			drawerList.SetAdapter(adapter);

			// enable ActionBar app icon to behave as action to toggle nav drawer
			this.ActionBar.SetDisplayHomeAsUpEnabled(true);
			this.ActionBar.SetHomeButtonEnabled(true);
			this.ActionBar.Title = "Test";
			drawerToggle = new MainDrawerToggle(this, drawerLayout,
				Resource.Drawable.ic_drawer,
				Resource.String.drawer_open,
				Resource.String.drawer_close);

			drawerLayout.AddDrawerListener(drawerToggle);

			drawerLayout.CloseDrawer(drawerList);
			vm.NavigatedTo(null);
		}
 /// <summary>
 /// Replaces the content of the view. Invoked by the layout manager
 /// </summary>
 /// <param name="holder">Holder.</param>
 /// <param name="position">Position.</param>
 public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
 {
     var holder2 = holder as ViewHolder;
     holder2.Text.Text = Items [position].Title;
     holder2.Image.SetImageResource (Items [position].Image);
     holder2.ItemView.Tag = Items [position];
 }
		public override void OnBindViewHolder (RecyclerView.ViewHolder holder, int position)
		{
			NewsAdapterWrapper Myholder = holder as NewsAdapterWrapper;
			Myholder.Titulo.Text = mPublicaciones [position].Titulo;
			Myholder.Subtitulo.Text = mPublicaciones [position].Subtitulo;
			Myholder.Fecha.Text = mPublicaciones [position].FechaPublicacion.ToString ();
			Koush.UrlImageViewHelper.SetUrlDrawable (Myholder.Imagen, mPublicaciones [position].Imagen.ToString ());
			Myholder.Detalle.Visibility = ViewStates.Gone;
			Myholder.Imagen.Click += (object sender, EventArgs e) => 
			{
				Intent IntentNews = new Intent(this.mContext,typeof(NewsDetailActivity));
				IntentNews.PutExtra ("TituloDetalle", mPublicaciones [position].Titulo);
				IntentNews.PutExtra ("SubtituloDetalle", mPublicaciones [position].Subtitulo);
				IntentNews.PutExtra ("FechaDetalle", mPublicaciones [position].FechaPublicacion.ToString ());
				IntentNews.PutExtra ("ContenidoDetalle", mPublicaciones [position].Contenido.Trim ());
				IntentNews.PutExtra ("ImagenDetalle", mPublicaciones [position].Imagen.ToString ());

				this.mContext.StartActivity (IntentNews);
			};
//			Myholder.Detalle.Click += (object sender, EventArgs e) => 
//			{
//				Intent IntentNews = new Intent(this.mContext,typeof(NewsDetailActivity));
//				IntentNews.PutExtra ("TituloDetalle", mPublicaciones [position].Titulo);
//				IntentNews.PutExtra ("SubtituloDetalle", mPublicaciones [position].Subtitulo);
//				IntentNews.PutExtra ("FechaDetalle", mPublicaciones [position].FechaPublicacion.ToString ());
//				IntentNews.PutExtra ("ContenidoDetalle", mPublicaciones [position].Contenido.Trim ());
//				IntentNews.PutExtra ("ImagenDetalle", mPublicaciones [position].Imagen.ToString ());
//				this.mContext.StartActivity (IntentNews);
//			};
		}
Beispiel #21
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.PhotoLayout1);
            _RecyclerView = FindViewById<RecyclerView> (Resource.Id.recyclerView);

            var getRequest = new GetRequest ();
            var getResponse = new GetResponse ();
            getRequest.apiKey = "7gXV0uUd54z3ksYKMAG4co595dDPMaTB";
            getRequest.accessToken = "W88EaRR8PiKZXzoDe16eqlnt96CRSj0WFeEfy9ie9N565frGPqM4OVMKVOEdo9qGrYuT4ifeS2eNqrx3P6cBG6hTB3uTFfZawyOh";
            getRequest.langCode = "en-GB";
            String url = String.Format ("http://api.powhealth.com/LabTestService.svc/api/labtests/byuser/list/{0}/{1}/{2}", getRequest.apiKey, getRequest.accessToken, getRequest.langCode);

            WebRequest request = WebRequest.Create (url);
            WebResponse response = request.GetResponse ();

            var dataStream = response.GetResponseStream ();
            StreamReader reader = new StreamReader (dataStream);
            string responseFromServer = reader.ReadToEnd ();
            reader.Close ();
            response.Close ();
            var jsonObject = JsonConvert.DeserializeObject <GetResponse> (responseFromServer);

            //_LayoutManager = new LinearLayoutManager (this);
            _LayoutManager = new GridLayoutManager (this, 2, GridLayoutManager.Vertical, false);
            _RecyclerView.SetLayoutManager (_LayoutManager);
            _Adapter = new RecyclerAdapter (jsonObject.LabTestsUserOnlyResult, _RecyclerView);
            _RecyclerView.SetAdapter (_Adapter);
        }
 public override void GetItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state)
 {
     if (parent.GetChildLayoutPosition(view) != 0)
     {
         outRect.Top = space;
     }
 }
		public MovieCategoryViewHolder (View itemView, int viewType) : base (itemView) {
			//Creates and caches our views defined in our layout
			if (viewType == 0) // TODO: Calculate this. I don't think this is a good way to ensure consistent presentation across different device resolutions
				itemView.SetPadding (itemView.PaddingLeft, itemView.PaddingTop + 110, itemView.PaddingRight, itemView.PaddingBottom);
			this.CategoryName = itemView.FindViewById<TextView>(Resource.Id.movie_category_item_txtCategoryName);
			this.MovieList = itemView.FindViewById<RecyclerView>(Resource.Id.movie_category_item_lstMovies);
		}
		public override void OnBindViewHolder (RecyclerView.ViewHolder holder, int position)
		{
			//int item = mData[position];
			//IWindowManager windowManager = context.GetSystemService(Context.WindowService).JavaCast<IWindowManager>();
			//MyKomuniti_ViewHolder vh = holder as MyKomuniti_ViewHolder;

				/*//calculate the phone screen
				DisplayMetrics dm = new DisplayMetrics ();
				windowManager.DefaultDisplay.GetMetrics (dm);
				int width = dm.WidthPixels;
				int height = dm.HeightPixels;
				int dens = (int)dm.DensityDpi;
				double wi = (double)width / (double)dens;
				double hi = (double)height / (double)dens;
				double x = Math.Pow (wi,2);
				double y = Math.Pow (hi,2);
				double screenInches = Math.Sqrt (x + y);*/
			//vh.tvTitle.Text = mData[position].title;
			//vh.tvContent.Text = mData[position].content;


			//vh.IVLike.SetImageResource (mData[position].like);
			if (holder.GetType () == typeof(MyKomuniti_ViewHolder)) {
				MyKomuniti_ViewHolder vh = holder as MyKomuniti_ViewHolder;
				vh.tvTitle.Text = mData[position].title;
				//vh.tvContent.Text = mData[position].content;
				vh.tvDescription.Text = Html.FromHtml(mData[position].content).ToString();
				//vh.tvDescription.Text = mData[position].content.Replace("s/<(.*?)>//g","");
				vh.tvMKVLIDate.Text = mData [position].date;
				vh.tvMKVLISender.Text = mData [position].sender;
			}
		}
		public override void OnBindViewHolder (RecyclerView.ViewHolder viewHolder, int position)
		{
			var item = items [position];
			var holder = viewHolder as MyViewHolder2;
			holder.imageView.SetBackgroundResource (items[position]);

		}
 /// <summary>
 /// Raises the query text change event.
 /// Filters the user list in the UsersViewModel by wether the entered string is contained in the users first/last name 
 /// </summary>
 /// <param name="newText">Text entered in the SearchView by the user</param>
 public bool OnQueryTextChange(string newText)
 {
     _recyclerView = FindViewById<RecyclerView> (Resource.Id.user_list);
     _filteredUsers = _usersViewModel.Users.ToList ().FindAll (e => (e.FirstName.ToLower() + " " + e.LastName.ToLower()).Contains (newText.ToLower()));
     SetupRecyclerView (_recyclerView);
     return true;
 }
Beispiel #27
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _persoon = Gegevens.GetPerson();
            _groep = Gegevens.CurrentGroup();

            SetContentView(Resource.Layout.Betaalscherm);

            _toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
            ImageView Avatar = _toolbar.FindViewById<ImageView>(Resource.Id.Avatar);
            TextView Title = _toolbar.FindViewById<TextView>(Resource.Id.Title);
            Title.Text = _groep.groepsnaam;

            foreach (var lid in _persoon.KrijgSchuldGroep(_groep))
            {
                deelnemers.Add(new ListItem(lid.Key, Resource.Drawable.iconn, lid.Value, _groep));
            }

            _adapter = new ListItemAdapter(ListItem.Session, deelnemers);
            _adapter.ItemClick += OnItemClick;
            _adapter.ItemLongClick += (sender, e) => {};

            _recyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerview);
            _recyclerView.SetMinimumHeight(ConvertDptoPx(listItemHeight*deelnemers.Count));
            _recyclerView.SetLayoutManager(new LinearLayoutManager(this));
            _recyclerView.SetScrollContainer(true);
            _recyclerView.NestedScrollingEnabled = false;
            _recyclerView.SetAdapter(_adapter);

            SetSupportActionBar(_toolbar);
            SupportActionBar.Title = "";
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
        }
 public bool OnInterceptTouchEvent (RecyclerView rv, MotionEvent e)
 {
     if (IsEnabled) {
         gestureDetector.OnTouchEvent (e);
     }
     return false;
 }
		protected override void OnCreate (Bundle savedInstanceState) {
			base.OnCreate (savedInstanceState);

			// Set our view from the "main" layout resource
			this.SetContentView (Resource.Layout.movie_detail);

			// Create your application here
			var strConfig = this.Intent.Extras.GetString ("Configuration");
			var strSelectedMovie = this.Intent.Extras.GetString ("SelectedMovie");
			this.configuration = JsonConvert.DeserializeObject<ConfigurationResponse> (strConfig);
			this.movieDetail = JsonConvert.DeserializeObject<Movie> (strSelectedMovie);

			this.btnPlay = this.FindViewById<Button> (Resource.Id.movie_detail_btnPlay);
			this.btnPlay.Click += this.btnPlay_Click;
			this.btnFavorite = this.FindViewById<Button> (Resource.Id.movie_detail_btnFavorite);
			this.btnFavorite.Click += this.btnFavorite_Click;
			this.btnClose = this.FindViewById<ImageButton> (Resource.Id.movie_detail_close);
			this.btnClose.Click += this.btnClose_Click;
			this.txtTitle = this.FindViewById<TextView> (Resource.Id.movie_detail_txtTitle);
			this.txtReleaseDate = this.FindViewById<TextView> (Resource.Id.movie_detail_txtReleaseDate);
			this.ratingBar = this.FindViewById<RatingBar> (Resource.Id.movie_detail_ratingBar);
			this.txtVoteCount = this.FindViewById<TextView> (Resource.Id.movie_detail_txtVoteCount);
			this.txtOverview = this.FindViewById<TextView> (Resource.Id.movie_detail_txtOverview);
			this.imgPoster = this.FindViewById<ImageView> (Resource.Id.movie_detail_imgPoster);
			this.vwSimilarMovies = this.FindViewById<RelativeLayout> (Resource.Id.movie_detail_vwSimilarMovies);
			this.movieList = this.FindViewById<RecyclerView>(Resource.Id.movie_detail_lstSimilarMovies);
			this.movieLayoutManager = new LinearLayoutManager (this, LinearLayoutManager.Horizontal, false);
			this.movieList.SetLayoutManager (this.movieLayoutManager);

			this.updateLayout ();
		}
Beispiel #30
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.recyclerview);

			recyclerView = FindViewById<RecyclerView> (Resource.Id.recycler_view);

			// Layout Managers:
			recyclerView.SetLayoutManager (new LinearLayoutManager (this));

			// Item Decorator:
			recyclerView.AddItemDecoration (new DividerItemDecoration (Resources.GetDrawable (Resource.Drawable.divider)));
			recyclerView.SetItemAnimator (new FadeInLeftAnimator ());

			// Adapter:
			var adapterData = new [] {
				"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", 
				"Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", 
				"Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", 
				"Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", 
				"Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", 
				"New Hampshire", "New Jersey", "New Mexico", "New York", 
				"North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", 
				"Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", 
				"Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", 
				"West Virginia", "Wisconsin", "Wyoming"
			};
			adapter = new RecyclerViewAdapter (this, adapterData.ToList ());
			adapter.Mode = Attributes.Mode.Single;
			recyclerView.SetAdapter (adapter);

			// Listeners
			recyclerView.SetOnScrollListener (new ScrollListener ());
		}
Beispiel #31
0
            public override void OnScrollStateChanged(RecyclerView recyclerView, int newState)
            {
                InternalLogger.Info($"OnScrollStateChanged( newState: {newState} )");
                switch (newState)
                {
                case RecyclerView.ScrollStateDragging:
                {
                    if (!_weakNativeView.TryGetTarget(out AndroidHorizontalListViewRenderer nativeView))
                    {
                        return;
                    }

                    if (nativeView.IsScrolling)
                    {
                        return;
                    }

                    if (_cts != null && !_cts.IsCancellationRequested)
                    {
                        // System.Diagnostics.Debug.WriteLine("DEBUG_SCROLL: Cancelling previous update index task");
                        _cts.Cancel();
                    }

                    nativeView.IsScrolling = true;

                    // System.Diagnostics.Debug.WriteLine("DEBUG_SCROLL: BeginScroll command");
                    _element.ScrollBeganCommand?.Execute(null);
                    break;
                }

                case RecyclerView.ScrollStateSettling:
                {
                    if (!_weakNativeView.TryGetTarget(out AndroidHorizontalListViewRenderer nativeView))
                    {
                        return;
                    }

                    nativeView.IsScrolling = true;
                    break;
                }

                case RecyclerView.ScrollStateIdle:
                {
                    if (!_weakNativeView.TryGetTarget(out AndroidHorizontalListViewRenderer nativeView))
                    {
                        return;
                    }

                    if (!nativeView.IsScrolling)
                    {
                        // System.Diagnostics.Debug.WriteLine("DEBUG_SCROLL: returning !nativeView.IsScrolling");
                        return;
                    }

                    if (nativeView.IsSnapHelperBusy)
                    {
                        // System.Diagnostics.Debug.WriteLine("DEBUG_SCROLL: returning nativeView.IsSnapHelperBusy");
                        return;
                    }

                    nativeView.IsScrolling = false;

                    _cts = new CancellationTokenSource();
                    UpdateCurrentIndex(nativeView, _cts.Token);
                    _element.ScrollEndedCommand?.Execute(null);

                    break;
                }
                }
            }
Beispiel #32
0
 public override bool CanDropOver(RecyclerView recyclerView, RecyclerView.ViewHolder current, RecyclerView.ViewHolder target)
 {
     return(target.AdapterPosition != _adapter.ItemCount - 1);
 }
 public WeeklyCurrentAffairAdapter(Activity ac, List <Weekly_Current_Affair_Model> weekly_list, RecyclerView mRecyclerView)
 {
     this.ac            = ac;
     this.mRecyclerView = mRecyclerView;
     this.weekly_list   = weekly_list;
 }
Beispiel #34
0
 public MovieCategoryViewHolder(View itemView, Action <RecyclerClickEventArgs> clickListener,
                                Action <RecyclerClickEventArgs> longClickListener) : base(itemView)
 {
     CategoryTitle        = itemView.FindViewById <TextView>(Resource.Id.movie_title);
     CategoryRecyclerView = itemView.FindViewById <RecyclerView>(Resource.Id.category_recycler_view);
 }
 public DeviceScanAdapter(RecyclerView rvMain)
 {
     this.rvMain = rvMain;
 }
 public override bool OnMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target)
 {
     return(false);
 }
Beispiel #37
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            // Instantiate the photo album:
            mPhotoAlbum = new PhotoAlbum();
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            //DrawerLayout fragment
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            var toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar); // Create ActionBarDrawerToggle button and add it to the toolbar

            SetSupportActionBar(toolbar);
            var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.drawer_open, Resource.String.drawer_close);

            drawerLayout.AddDrawerListener(drawerToggle);
            drawerToggle.SyncState();
            navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);
            setupDrawerContent(navigationView);                                    //Calling Function
            mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); // Get our RecyclerView layout:

            eventlist = new EventCollection();

            //............................................................
            // Layout Manager Setup:

            mLayoutManager = new LinearLayoutManager(this); // Use the built-in linear layout manager:

            // Or use the built-in grid layout manager (two horizontal rows):
            // mLayoutManager = new GridLayoutManager
            //        (this, 2, GridLayoutManager.Horizontal, false);

            var onScrollListener = new XamarinRecyclerViewOnScrollListener(mLayoutManager);

            onScrollListener.LoadMoreEvent += async(object sender, MyEventArgs e) => {
                var eventos = await eventlist.LoadEvents(pageLenght : e.ItemCount + 10);

                mAdapter.NotifyDataSetChanged();
            };

            mRecyclerView.AddOnScrollListener(onScrollListener);



            mRecyclerView.SetLayoutManager(mLayoutManager); // Plug the layout manager into the RecyclerView:

            //............................................................
            // Adapter Setup:

            // Create an adapter for the RecyclerView, and pass it the
            // data set (the photo album) to manage:
            //mAdapter = new PhotoAlbumAdapter(mPhotoAlbum);
            var eventos = await eventlist.LoadEvents();

            mAdapter = new PhotoAlbumAdapter(eventos);

            mAdapter.ItemClick += OnItemClick;  // Register the item click handler (below) with the adapter:

            mRecyclerView.SetAdapter(mAdapter); // Plug the adapter into the RecyclerView:

            //............................................................
            // Random Pick Button:

            /*
             * // Get the button for randomly swapping a photo:
             * Button randomPickBtn = FindViewById<Button>(Resource.Id.randPickButton);
             *
             * // Handler for the Random Pick Button:
             * randomPickBtn.Click += delegate
             * {
             *  if (mPhotoAlbum != null)
             *  {
             *      // Randomly swap a photo with the top:
             *      int idx = mPhotoAlbum.RandomSwap();
             *
             *      // Update the RecyclerView by notifying the adapter:
             *      // Notify that the top and a randomly-chosen photo has changed (swapped):
             *      mAdapter.NotifyItemChanged(0);
             *      mAdapter.NotifyItemChanged(idx);
             *  }
             * };*/
        }
 public override bool OnMove(RecyclerView p0, RecyclerView.ViewHolder p1, RecyclerView.ViewHolder p2)
 {
     return(false);
 }
 public override void OnScrolled(RecyclerView recyclerView, int dx, int dy)
 {
     base.OnScrolled(recyclerView, dx, dy);
     fragment.HandleScroll();
 }
Beispiel #40
0
 public override void ClearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder)
 {
     base.ClearView(recyclerView, viewHolder);
     viewHolder.ItemView.ScaleX = 1;
     viewHolder.ItemView.ScaleY = 1;
 }
Beispiel #41
0
 public override void OnScrollStateChanged(RecyclerView recyclerView, int newState)
 {
     base.OnScrollStateChanged(recyclerView, newState);
     touchListener.IsScrolling = newState != RecyclerView.ScrollStateIdle;
 }
Beispiel #42
0
 public void OnTouchEvent(RecyclerView rv, MotionEvent e)
 {
 }
Beispiel #43
0
        public override View OnCreateView(LayoutInflater inflater,
                                          ViewGroup container, Bundle savedInstanceState)
        {
            StudentCourtView = inflater.Inflate(Resource.Layout.StudentCourtFragmentLayout,
                                                container, false);

            #region NICK's REFRESH LAYOUT CODE
            /* "Pulling" down on the page will refresh the view              */

            /*RefreshLayout =
             *  StudentCourtView.FindViewById<SwipeRefreshLayout>(
             *      Resource.Id.SwipeRefreshStudentCourt);*/

            /*RefreshLayout.SetColorSchemeResources(Resource.Color.primary,
             *  Resource.Color.accent, Resource.Color.primary_text,
             *      Resource.Color.secondary_text);
             * RefreshLayout.Refresh += RefreshLayoutRefresh;*/
            #endregion

            RecyclerView _recyclerview =
                StudentCourtView.FindViewById <RecyclerView>(Resource.Id.PendingReportSlips);

            _adapter = ViewModel.StudentOffenseCard.Offenses.GetRecyclerAdapter
                       (
                BindViewHolder, Resource.Layout.StudentCourtInfractionCardLayout
                       );

            /* "Pulling" down on the page will refresh the view              */
            RefreshLayout =
                StudentCourtView.FindViewById <SwipeRefreshLayout>(
                    Resource.Id.SwipeRefreshStudentCourt);

            RefreshLayout.SetColorSchemeResources(Resource.Color.primary,
                                                  Resource.Color.accent, Resource.Color.primary_text,
                                                  Resource.Color.secondary_text);
            RefreshLayout.Refresh += RefreshLayoutRefresh;

            _recyclerview.SetLayoutManager(new LinearLayoutManager(Activity));
            _recyclerview.SetAdapter(_adapter);

            ParentFragment.View.FindViewById <TabLayout>(Resource.Id.MainTabLayout).TabReselected += TabReselected;

            /* Student court progress bars                                   */
            DemeritsProgBar        = new ProgressBar(Activity);
            DormInfractionsProgBar = new ProgressBar(Activity);
            AbsencesProgBar        = new ProgressBar(Activity);
            LateDormProgBar        = new ProgressBar(Activity);

            DemeritsProgBar =
                StudentCourtView.FindViewById <ProgressBar>(Resource.Id.DemeritsProgressBar);
            DormInfractionsProgBar =
                StudentCourtView.FindViewById <ProgressBar>(Resource.Id.DormInfractionsProgressBar);
            AbsencesProgBar =
                StudentCourtView.FindViewById <ProgressBar>(Resource.Id.AbsencesProgressBar);
            LateDormProgBar =
                StudentCourtView.FindViewById <ProgressBar>(Resource.Id.LateDormProgressBar);

            /* Set max value for progress bars                               */
            DemeritsProgBar.Max        = App.StudentCourt.MaxDemerits;
            DormInfractionsProgBar.Max = App.StudentCourt.MaxDormInfractions;
            AbsencesProgBar.Max        = App.StudentCourt.MaxAbsences;
            LateDormProgBar.Max        = App.StudentCourt.MaxLateDormInfraction;

            StudentCourtView.Post(() => SetUpProgressBars());

            /*****************************************************************/
            /* Create Student Court Gradient                                 */
            /*****************************************************************/

            int      startColor = Color.Transparent;
            int      endColor;
            Color    startColorAndroidGraphics;
            TextView statusText =
                StudentCourtView.FindViewById <TextView>(Resource.Id.StudentCourtStatusText);
            ImageView studentCourtImage =
                StudentCourtView.FindViewById <ImageView>(Resource.Id.StudentCourtCircle);
            Drawable imageBackground = studentCourtImage.Background;

            /* Convert dp stroke width to pixels for student court circle    */
            int            strokeWidthDp  = 4;
            DisplayMetrics displayMetrics = Resources.DisplayMetrics;
            float          strokeWidth    = TypedValue.ApplyDimension(
                ComplexUnitType.Dip, strokeWidthDp, displayMetrics);

            switch (ViewModel.StudentOffenseCard.StudentCourtStatus)
            {
            case App.StudentCourtStatus.Green:
            {
                startColor = ResourcesCompat.GetColor(
                    Resources, Resource.Color.green_500, null);
                statusText.Text =
                    "You are not required to attend Student Court.";
            }
            break;

            case App.StudentCourtStatus.Gray:
            {
                startColor = ResourcesCompat.GetColor(
                    Resources, Resource.Color.body_text_soft_light_theme, null);
                statusText.Text =
                    "You are not required to attend Student Court.";
            }
            break;

            case App.StudentCourtStatus.Red:
            {
                startColor = ResourcesCompat.GetColor(
                    Resources, Resource.Color.red_a700, null);
                statusText.Text =
                    "You are required to attend Student Court.";
            }
            break;
            }

            /* Set color for circle image                                    */
            startColorAndroidGraphics = new Color(startColor);
            GradientDrawable shapeDrawable = (GradientDrawable)imageBackground;
            shapeDrawable.SetStroke((int)strokeWidth, startColorAndroidGraphics);

            /* Set text color for student court status                       */
            StudentCourtView.FindViewById <TextView>(Resource.Id.StudentCourtStatusText)
            .SetTextColor(startColorAndroidGraphics);

            /* Get the name of the current theme                             */
            TypedValue attrValue = new TypedValue();
            Activity.Theme.ResolveAttribute(
                Resource.Attribute.modThemeName, attrValue, true);

            /* Set the end color for gradient based on the current theme     */
            if (attrValue.String.ToString() == "ModAppCompatLightTheme")
            {
                endColor = ResourcesCompat.GetColor(
                    Resources, Resource.Color.window_background, null);
            }
            else
            {
                endColor = ResourcesCompat.GetColor(
                    Resources, Resource.Color.window_background_dark_theme, null);
            }

            int[] gradientColors = { startColor, endColor };

            /* Set the gradient's start and end colors                       */
            GradientDrawable gradient = new GradientDrawable(
                GradientDrawable.Orientation.TopBottom, gradientColors);
            StudentCourtView.FindViewById <ImageView>(Resource.Id.GradientStudentCourt)
            .Background = gradient;



            /*****************************************************************/
            /* Click events for info icons                                   */
            /*****************************************************************/
            StudentCourtView.FindViewById <ImageView>(Resource.Id.DormInfractionsInfoIcon).Click += ShowInfoIconDialog;
            StudentCourtView.FindViewById <ImageView>(Resource.Id.AbsencesInfoIcon).Click        += ShowInfoIconDialog;
            StudentCourtView.FindViewById <ImageView>(Resource.Id.LateDormInfoIcon).Click        += ShowInfoIconDialog;

            /* Use this to return your custom view for this Fragment         */
            return(StudentCourtView);
        }
Beispiel #44
0
 public SnapManager(RecyclerView recyclerView)
 {
     _recyclerView = recyclerView;
 }
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            try
            {
                SetContentView(Resource.Layout.RegionForSearching);
                InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
                searchET                = FindViewById <EditText>(Resource.Id.searchET);
                close_searchBn          = FindViewById <ImageButton>(Resource.Id.close_searchBn);
                activityIndicatorSearch = FindViewById <ProgressBar>(Resource.Id.activityIndicatorSearch);
                search_recyclerView     = FindViewById <RecyclerView>(Resource.Id.search_recyclerView);
                searchLL                = FindViewById <LinearLayout>(Resource.Id.searchLL);
                nothingIV               = FindViewById <ImageView>(Resource.Id.nothingIV);
                searchIV                = FindViewById <ImageView>(Resource.Id.searchIV);
                nothingTV               = FindViewById <TextView>(Resource.Id.nothingTV);
                your_city_valueTV       = FindViewById <TextView>(Resource.Id.your_city_valueTV);
                recyclerView            = FindViewById <RecyclerView>(Resource.Id.recyclerView);
                layoutManager           = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);
                recyclerView.SetLayoutManager(layoutManager);
                back_button        = FindViewById <ImageButton>(Resource.Id.back_button);
                autolocatonBn      = FindViewById <Button>(Resource.Id.autolocatonBn);
                backRelativeLayout = FindViewById <RelativeLayout>(Resource.Id.backRelativeLayout);
                tintLL             = FindViewById <RelativeLayout>(Resource.Id.tintLL);
                noTV              = FindViewById <TextView>(Resource.Id.noTV);
                yesTV             = FindViewById <TextView>(Resource.Id.yesTV);
                activityIndicator = FindViewById <ProgressBar>(Resource.Id.activityIndicator);
                activityIndicator.IndeterminateDrawable.SetColorFilter(Resources.GetColor(Resource.Color.buttonBackgroundColor), Android.Graphics.PorterDuff.Mode.Multiply);
                activityIndicatorSearch.IndeterminateDrawable.SetColorFilter(Resources.GetColor(Resource.Color.buttonBackgroundColor), Android.Graphics.PorterDuff.Mode.Multiply);
                search_layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);
                search_recyclerView.SetLayoutManager(search_layoutManager);
                Typeface tf = Typeface.CreateFromAsset(Assets, "Roboto-Regular.ttf");
                FindViewById <TextView>(Resource.Id.headerTV).SetTypeface(tf, TypefaceStyle.Bold);
                autolocatonBn.SetTypeface(tf, TypefaceStyle.Normal);
                searchET.SetTypeface(tf, TypefaceStyle.Normal);
                FindViewById <TextView>(Resource.Id.textView5).SetTypeface(tf, TypefaceStyle.Normal);
                your_city_valueTV.SetTypeface(tf, TypefaceStyle.Normal);
                yesTV.SetTypeface(tf, TypefaceStyle.Normal);
                noTV.SetTypeface(tf, TypefaceStyle.Normal);
                nothingTV.SetTypeface(tf, TypefaceStyle.Normal);
                backRelativeLayout.Click += (s, e) =>
                {
                    OnBackPressed();
                };
                back_button.Click += (s, e) =>
                {
                    OnBackPressed();
                };

                searchET.TextChanged += async(s, e) =>
                {
                    if (!String.IsNullOrEmpty(searchET.Text))
                    {
                        nothingIV.Visibility               = ViewStates.Gone;
                        nothingTV.Visibility               = ViewStates.Gone;
                        searchLL.Visibility                = ViewStates.Visible;
                        close_searchBn.Visibility          = ViewStates.Visible;
                        activityIndicatorSearch.Visibility = ViewStates.Visible;
                        search_recyclerView.Visibility     = ViewStates.Gone;
                        var search_content = await countryMethods.RegionsSearch(city_coord_for_edit_prefs.GetString("country_id", String.Empty), searchET.Text);

                        if (!search_content.ToLower().Contains("пошло не так".ToLower()) && !search_content.Contains("null"))
                        //try
                        {
                            search_recyclerView.Visibility = ViewStates.Visible;
                            deserialized_search            = JsonConvert.DeserializeObject <List <RegionSearch> >(search_content.ToString());
                            List <RegionSearch> searchDisplayings = new List <RegionSearch>();
                            foreach (var item in deserialized_search)
                            {
                                searchDisplayings.Add(new RegionSearch {
                                    id = item.id, region = item.region
                                });
                            }

                            regionsSearchAdapter = new RegionsSearchProfileCityEditAdapter(searchDisplayings, this, tf);
                            regionsSearchAdapter.NotifyDataSetChanged();
                            search_recyclerView.SetAdapter(regionsSearchAdapter);

                            regionsSearchAdapter.NotifyDataSetChanged();
                        }
                        //catch
                        else
                        {
                            search_recyclerView.Visibility = ViewStates.Gone;
                            nothingIV.Visibility           = ViewStates.Visible;
                            nothingTV.Visibility           = ViewStates.Visible;
                        }

                        activityIndicatorSearch.Visibility = ViewStates.Gone;
                    }
                    else
                    {
                        searchIV.Visibility       = ViewStates.Visible;
                        close_searchBn.Visibility = ViewStates.Gone;
                        searchLL.Visibility       = ViewStates.Gone;
                    }
                };
                close_searchBn.Click += (s, e) =>
                {
                    searchET.Text = null;
                    imm.HideSoftInputFromWindow(searchET.WindowToken, 0);
                    searchLL.Visibility = ViewStates.Gone;
                };

                searchET.EditorAction += (object sender, EditText.EditorActionEventArgs e) =>
                {
                    imm.HideSoftInputFromWindow(searchET.WindowToken, 0);
                };


                activityIndicator.Visibility = ViewStates.Visible;
                var regionsJson = await countryMethods.GetRegions(city_coord_for_edit_prefs.GetString("country_id", String.Empty));

                activityIndicator.Visibility = ViewStates.Gone;
                var deserialized_regions = JsonConvert.DeserializeObject <List <RegionSearch> >(regionsJson);

                var countryAdapter = new RegionForProfileCityEditAdapter(deserialized_regions, this, tf);
                recyclerView.SetAdapter(countryAdapter);
            }
            catch
            {
                StartActivity(typeof(MainActivity));
            }
        }
Beispiel #46
0
 public override void bindViews()
 {
     mRvMaleCategory   = FindViewById <RecyclerView>(Resource.Id.rvMaleCategory);
     mRvFeMaleCategory = FindViewById <RecyclerView>(Resource.Id.rvFemaleCategory);
 }
Beispiel #47
0
 public override void OnScrolled(RecyclerView recyclerView, int dx, int dy)
 {
     base.OnScrolled(recyclerView, dx, dy);
     // Could hide open views here if you wanted.
 }
Beispiel #48
0
        private void InitComponent()
        {
            try
            {
                TxtSave = FindViewById <TextView>(Resource.Id.toolbar_title);

                Image     = FindViewById <ImageView>(Resource.Id.image);
                TxtAddImg = FindViewById <TextView>(Resource.Id.addImg);

                IconTitle = FindViewById <TextView>(Resource.Id.IconTitle);
                TxtTitle  = FindViewById <EditText>(Resource.Id.TitleEditText);

                IconLocation = FindViewById <TextView>(Resource.Id.IconLocation);
                TxtLocation  = FindViewById <EditText>(Resource.Id.LocationEditText);

                IconSalary = FindViewById <TextView>(Resource.Id.IconSalary);
                TxtMinimum = FindViewById <EditText>(Resource.Id.MinimumEditText);
                TxtMaximum = FindViewById <EditText>(Resource.Id.MaximumEditText);

                IconCurrency  = FindViewById <TextView>(Resource.Id.IconCurrency);
                TxtCurrency   = FindViewById <EditText>(Resource.Id.CurrencyEditText);
                TxtSalaryDate = FindViewById <EditText>(Resource.Id.SalaryDateEditText);

                IconJobType = FindViewById <TextView>(Resource.Id.IconJobType);
                TxtJobType  = FindViewById <EditText>(Resource.Id.JobTypeEditText);

                IconCategory = FindViewById <TextView>(Resource.Id.IconCategory);
                TxtCategory  = FindViewById <EditText>(Resource.Id.CategoryEditText);

                IconDescription = FindViewById <TextView>(Resource.Id.IconDescription);
                TxtDescription  = FindViewById <EditText>(Resource.Id.DescriptionEditText);

                TxtAddQuestion      = FindViewById <EditText>(Resource.Id.AddQuestionEditText);
                TxtAddQuestion.Text = GetText(Resource.String.Lbl_AddQuestion) + "(0)";

                MRecycler = FindViewById <RecyclerView>(Resource.Id.Recyler);

                FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconTitle, FontAwesomeIcon.User);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconLocation, FontAwesomeIcon.MapMarkedAlt);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconSalary, FontAwesomeIcon.MoneyBillAlt);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconCurrency, FontAwesomeIcon.DollarSign);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconJobType, FontAwesomeIcon.Briefcase);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconDescription, FontAwesomeIcon.Paragraph);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeBrands, IconCategory, FontAwesomeIcon.Buromobelexperte);

                Methods.SetColorEditText(TxtTitle, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtLocation, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtMinimum, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtMaximum, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtCurrency, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtSalaryDate, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtJobType, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtDescription, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtAddQuestion, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                Methods.SetColorEditText(TxtCategory, AppSettings.SetTabDarkTheme ? Color.White : Color.Black);

                Methods.SetFocusable(TxtCurrency);
                Methods.SetFocusable(TxtSalaryDate);
                Methods.SetFocusable(TxtJobType);
                Methods.SetFocusable(TxtCategory);
                Methods.SetFocusable(TxtAddQuestion);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #49
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.production_storage_detail_activity);

            context = Android.App.Application.Context;

            index = int.Parse(Intent.GetStringExtra("INDEX"));
            string       in_no          = Intent.GetStringExtra("IN_NO");
            string       item_no        = Intent.GetStringExtra("ITEM_NO");
            string       in_date        = Intent.GetStringExtra("IN_DATE");
            string       made_no        = Intent.GetStringExtra("MADE_NO");
            string       store_type     = Intent.GetStringExtra("STORE_TYPE");
            string       dept_no        = Intent.GetStringExtra("DEPT_NO");
            string       dept_name      = Intent.GetStringExtra("DEPT_NAME");
            string       part_no        = Intent.GetStringExtra("PART_NO");
            string       part_desc      = Intent.GetStringExtra("PART_DESC");
            string       stock_no       = Intent.GetStringExtra("STOCK_NO");
            string       locate_no      = Intent.GetStringExtra("LOCATE_NO");
            string       locate_no_scan = Intent.GetStringExtra("LOCATE_NO_SCAN");
            string       batch_no       = Intent.GetStringExtra("BATCH_NO");
            string       qty            = Intent.GetStringExtra("QTY");
            string       stock_unit     = Intent.GetStringExtra("STOCK_UNIT");
            string       count_no       = Intent.GetStringExtra("COUNT_NO");
            string       sock_no_name   = Intent.GetStringExtra("STOCK_NO_NAME");
            RecyclerView listView       = FindViewById <RecyclerView>(Resource.Id.productionStorageDetailListView);

            //ActionBar actionBar = getSupportActionBar();
            Android.App.ActionBar actionBar = ActionBar;
            if (actionBar != null)
            {
                actionBar.SetDisplayHomeAsUpEnabled(true);
                actionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_chevron_left_white_24dp);
                actionBar.Title = "";
            }

            ProductionDetailList.Clear();

            //in_no
            ProductionStorageDetailItem item1 = new ProductionStorageDetailItem();

            item1.setHeader(GetString(Resource.String.item_title_check_sp));
            item1.setContent(in_no);
            ProductionDetailList.Add(item1);
            //item_no
            ProductionStorageDetailItem item2 = new ProductionStorageDetailItem();

            item2.setHeader(GetString(Resource.String.production_storage_index));
            item2.setContent(item_no);
            ProductionDetailList.Add(item2);
            //in_date
            ProductionStorageDetailItem item3 = new ProductionStorageDetailItem();

            item3.setHeader(GetString(Resource.String.production_storage_in_date));
            item3.setContent(in_date);
            ProductionDetailList.Add(item3);
            //made_no
            ProductionStorageDetailItem item4 = new ProductionStorageDetailItem();

            item4.setHeader(GetString(Resource.String.production_storage_made_no));
            item4.setContent(made_no);
            ProductionDetailList.Add(item4);
            //store_type
            ProductionStorageDetailItem item5 = new ProductionStorageDetailItem();

            item5.setHeader(GetString(Resource.String.production_storage_store_type));
            item5.setContent(store_type);
            ProductionDetailList.Add(item5);
            //dept_no
            ProductionStorageDetailItem item6 = new ProductionStorageDetailItem();

            item6.setHeader(GetString(Resource.String.production_storage_dept_no));
            item6.setContent(dept_no);
            ProductionDetailList.Add(item6);
            //dept_name
            ProductionStorageDetailItem item7 = new ProductionStorageDetailItem();

            item7.setHeader(GetString(Resource.String.production_storage_dept));
            item7.setContent(dept_name);
            ProductionDetailList.Add(item7);
            //part_no
            ProductionStorageDetailItem item8 = new ProductionStorageDetailItem();

            item8.setHeader(GetString(Resource.String.production_storage_part_no));
            item8.setContent(part_no);
            ProductionDetailList.Add(item8);
            //part_desc
            ProductionStorageDetailItem item9 = new ProductionStorageDetailItem();

            item9.setHeader(GetString(Resource.String.production_storage_part_desc));
            item9.setContent(part_desc);
            ProductionDetailList.Add(item9);
            //stock_no
            ProductionStorageDetailItem item10 = new ProductionStorageDetailItem();

            item10.setHeader(GetString(Resource.String.production_storage_stock_no));
            item10.setContent(stock_no);
            ProductionDetailList.Add(item10);
            //locate_no
            ProductionStorageDetailItem item11 = new ProductionStorageDetailItem();

            item11.setHeader(GetString(Resource.String.production_storage_locate_no));
            item11.setContent(locate_no);
            ProductionDetailList.Add(item11);
            //locate_no_scan
            ProductionStorageDetailItem item12 = new ProductionStorageDetailItem();

            item12.setHeader(GetString(Resource.String.production_storage_locate_no_scan));
            item12.setContent(locate_no_scan);
            ProductionDetailList.Add(item12);
            //batch_no
            ProductionStorageDetailItem item13 = new ProductionStorageDetailItem();

            item13.setHeader(GetString(Resource.String.production_storage_batch_no));
            item13.setContent(batch_no);
            ProductionDetailList.Add(item13);
            //qty
            ProductionStorageDetailItem item14 = new ProductionStorageDetailItem();

            item14.setHeader(GetString(Resource.String.production_storage_qty));
            item14.setContent(qty);
            ProductionDetailList.Add(item14);
            //stock_unit
            ProductionStorageDetailItem item15 = new ProductionStorageDetailItem();

            item15.setHeader(GetString(Resource.String.production_storage_unit));
            item15.setContent(stock_unit);
            ProductionDetailList.Add(item15);
            //count_no
            ProductionStorageDetailItem item16 = new ProductionStorageDetailItem();

            item16.setHeader(GetString(Resource.String.production_storage_count_no));
            item16.setContent(count_no);
            ProductionDetailList.Add(item16);
            //stock_no_name
            ProductionStorageDetailItem item17 = new ProductionStorageDetailItem();

            item17.setHeader(GetString(Resource.String.production_storage_stock_no_name));
            item17.setContent(sock_no_name);
            ProductionDetailList.Add(item17);

            productionStorageDetailItemAdapter = new ProductionStorageDetailItemAdapter(this, Resource.Layout.production_storage_list_detail_item, ProductionDetailList);

            /*productionStorageDetailItemAdapter.ItemClick += (sender, e) =>
             * {
             *  Log.Debug(TAG, "Click Sender = " + sender.ToString() + " e = " + e.ToString());
             *
             *  if (e == 9) //quantity
             *  {
             *      Intent clearIntent = new Intent(Constants.ACTION_ENTERING_WAREHOUSE_DIVIDED_DIALOG_SHOW);
             *      clearIntent.PutExtra("INDEX", e.ToString());
             *      //clearIntent.putExtra("BARCODE", barcode);
             *      context.SendBroadcast(clearIntent);
             *
             *      Finish();
             *  }
             * };*/
            listView.SetAdapter(productionStorageDetailItemAdapter);
        }
Beispiel #50
0
 public override void OnScrollStateChanged(RecyclerView recyclerView, int newState)
 {
     base.OnScrollStateChanged(recyclerView, newState);
     Console.WriteLine("RecyclerView: OnScrollStateChanged");
 }
        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;
        }
 public OnScroll(RecyclerView recyclerView, Action <int> onItemSelected)
 {
     this.recyclerView   = recyclerView;
     this.onItemSelected = onItemSelected;
     __currentIndex      = 0;
 }
Beispiel #53
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.potroseniMaterijali_Lista);
            Android.Widget.Toolbar toolbar = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbarHomePage);
            materijaliListView = FindViewById <RecyclerView>(Resource.Id.materijaliListView);
            searchInput        = FindViewById <EditText>(Resource.Id.searchInput);
            resultMessage      = FindViewById <TextView>(Resource.Id.resultMessage);
            potvrdaBtn         = FindViewById <Button>(Resource.Id.potvrdaBtn);
            noviMaterijalBtn   = FindViewById <Button>(Resource.Id.noviMaterijalBtn);
            izradaPotvrde      = FindViewById <LinearLayout>(Resource.Id.izradaPotvrde);

            SetActionBar(toolbar);
            ActionBar.Title         = "Odabir materijala";
            radniNalog              = localRadniNalozi.GetInt("id", 0);
            lokacijaId              = localKomitentLokacija.GetInt("lokacijaId", 0);
            potvrdaBtn.Click       += PotvrdaBtn_Click;
            noviMaterijalBtn.Click += NoviMaterijalBtn_Click;
            searchInput.KeyPress   += SearchInput_KeyPress;
            skladiste = db.Query <DID_RadniNalog>(
                "SELECT * " +
                "FROM DID_RadniNalog " +
                "WHERE Id = ?", radniNalog).FirstOrDefault().PokretnoSkladiste;

            if (!localOdradeneAnkete.GetBoolean("visited", false))
            {
                potvrdaBtn.Visibility = Android.Views.ViewStates.Visible;
            }
            else
            {
                HidePotvrdaButton();
            }

            if (!localMaterijali.GetBoolean("materijaliPoPoziciji", false))
            {
                ProvjeriIzdavanjePotvrde();
            }
            else
            {
                HidePotvrdaButton();
            }

            //Prikaz svih materijala na skladistu
            materijaliListaSkladiste = db.Query <DID_StanjeSkladista>(
                "SELECT * " +
                "FROM DID_StanjeSkladista " +
                "WHERE Skladiste = ? " +
                "GROUP BY MaterijalNaziv", skladiste);

            materijaliListaSkladisteFiltered = materijaliListaSkladiste;

            if (materijaliListaSkladisteFiltered.Any())
            {
                mLayoutManager = new LinearLayoutManager(this);
                mAdapter       = new Adapter_MatrijalSkladisteRecycleView(materijaliListaSkladisteFiltered);
                materijaliListView.SetLayoutManager(mLayoutManager);
                mAdapter.ItemClick += MAdapter_ItemClick;
                materijaliListView.SetAdapter(mAdapter);
                resultMessage.Visibility = Android.Views.ViewStates.Gone;
            }
            else
            {
                resultMessage.Text       = "Nema dostupnih materijala na skladištu!";
                resultMessage.Visibility = Android.Views.ViewStates.Visible;
                Window.SetSoftInputMode(SoftInput.StateAlwaysHidden);
            }

            searchInput.TextChanged += delegate
            {
                string input = searchInput.Text.ToLower();
                if (!string.IsNullOrEmpty(input))
                {
                    resultMessage.Visibility         = Android.Views.ViewStates.Invisible;
                    materijaliListaSkladisteFiltered = materijaliListaSkladiste.Where(i =>
                                                                                      (i.Materijal != null && i.Materijal.ToLower().Contains(input)) ||
                                                                                      (i.MaterijalNaziv != null && i.MaterijalNaziv.ToLower().Contains(input))).ToList();

                    if (materijaliListaSkladisteFiltered.Any())
                    {
                        mLayoutManager = new LinearLayoutManager(this);
                        mAdapter       = new Adapter_MatrijalSkladisteRecycleView(materijaliListaSkladisteFiltered);
                        materijaliListView.SetLayoutManager(mLayoutManager);
                        mAdapter.ItemClick += MAdapter_ItemClick;
                        materijaliListView.SetAdapter(mAdapter);
                        resultMessage.Visibility = Android.Views.ViewStates.Gone;
                    }
                    else
                    {
                        mLayoutManager = new LinearLayoutManager(this);
                        mAdapter       = new Adapter_MatrijalSkladisteRecycleView(materijaliListaSkladisteFiltered);
                        materijaliListView.SetLayoutManager(mLayoutManager);
                        mAdapter.ItemClick += MAdapter_ItemClick;
                        materijaliListView.SetAdapter(mAdapter);
                        resultMessage.Text       = "Nije pronađen materijal sa unesenim pojmom!";
                        resultMessage.Visibility = Android.Views.ViewStates.Visible;
                    }
                }
                else
                {
                    materijaliListaSkladisteFiltered = materijaliListaSkladiste;

                    if (materijaliListaSkladisteFiltered.Any())
                    {
                        mLayoutManager = new LinearLayoutManager(this);
                        mAdapter       = new Adapter_MatrijalSkladisteRecycleView(materijaliListaSkladisteFiltered);
                        materijaliListView.SetLayoutManager(mLayoutManager);
                        mAdapter.ItemClick += MAdapter_ItemClick;
                        materijaliListView.SetAdapter(mAdapter);
                        resultMessage.Visibility = Android.Views.ViewStates.Gone;
                    }
                    else
                    {
                        resultMessage.Text       = "Nema dostupnih materijala na skladištu!";
                        resultMessage.Visibility = Android.Views.ViewStates.Visible;
                        Window.SetSoftInputMode(SoftInput.StateAlwaysHidden);
                        mLayoutManager = new LinearLayoutManager(this);
                        mAdapter       = new Adapter_MatrijalSkladisteRecycleView(materijaliListaSkladisteFiltered);
                        materijaliListView.SetLayoutManager(mLayoutManager);
                        mAdapter.ItemClick += MAdapter_ItemClick;
                        materijaliListView.SetAdapter(mAdapter);
                        resultMessage.Visibility = Android.Views.ViewStates.Gone;
                    }
                }
            };
        }
Beispiel #54
0
 public GridLayoutSpanSizeLookup(GridItemsLayout gridItemsLayout, RecyclerView recyclerView)
 {
     _gridItemsLayout = gridItemsLayout;
     _recyclerView    = recyclerView;
 }
 public WeeklyViewHolder(View itemview, Action <int> listener, RecyclerView mRecyclerView) : base(itemview)
 {
     Caption         = itemview.FindViewById <TextView>(Resource.Id.week_Title);
     itemview.Click += (sender, e) => listener(mRecyclerView.GetChildAdapterPosition((View)sender));
 }
Beispiel #56
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.vendor_list);
            // Create your application here
            SupportActionBar.Title = "Ride near you";
            vendorImage.Add(Resource.Raw.vendor);
            vendorImage.Add(Resource.Raw.vendor);
            vendorImage.Add(Resource.Raw.vendor);
            vendorImage.Add(Resource.Raw.vendor);
            vendorImage.Add(Resource.Raw.vendor);
            vendorImage.Add(Resource.Raw.vendor);
            vendorImage.Add(Resource.Raw.vendor);
            vendorImage.Add(Resource.Raw.vendor);
            vendorImage.Add(Resource.Raw.vendor);
            vendorImage.Add(Resource.Raw.vendor);

            vendorName.Add("Ashish Kumar Rena");
            vendorName.Add("Gurmeet singh");
            vendorName.Add("Kritika sharma");
            vendorName.Add("Reema Handa");
            vendorName.Add("Shivanshu Kumar Anand");
            vendorName.Add("Subah kesar");
            vendorName.Add("Sohrabh Malik");
            vendorName.Add("Jagjeet Singh yadav");
            vendorName.Add("Manohar Lal");
            vendorName.Add("Pandey Dharam Rajan");

            vendorLocation.Add("Dehradun");
            vendorLocation.Add("Kullu");
            vendorLocation.Add("Dehradun");
            vendorLocation.Add("Chandigarh");
            vendorLocation.Add("Manali");
            vendorLocation.Add("Dehradun");
            vendorLocation.Add("Dehli");
            vendorLocation.Add("Banglore");
            vendorLocation.Add("Dehradun");
            vendorLocation.Add("Dehradun");

            vendorPrice.Add("200");
            vendorPrice.Add("400");
            vendorPrice.Add("300");
            vendorPrice.Add("200");
            vendorPrice.Add("500");
            vendorPrice.Add("600");
            vendorPrice.Add("900");
            vendorPrice.Add("100");
            vendorPrice.Add("400");
            vendorPrice.Add("200");

            Common.vendorImages   = vendorImage;
            Common.vendorName     = vendorName;
            Common.vendorLocation = vendorLocation;
            Common.vendorPrice    = vendorPrice;

            vendorListRecycle = FindViewById <RecyclerView>(Resource.Id.vendorListRecylceView);

            layoutManager = new LinearLayoutManager(this);
            vendorListRecycle.SetLayoutManager(layoutManager);
            VendorListAdpter adapter = new VendorListAdpter(this, vendorImage, vendorName, vendorLocation, vendorPrice);

            vendorListRecycle.SetAdapter(adapter);

            adapter.ItemClick += Adapter_ItemClick;
        }
 public override bool OnMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target)
 {
     throw new NotImplementedException();
 }
        private void StartDicovery()
        {
            _scanCallback.OnScanResultChanged += OnScanResult;

            _progressBarDialog = new ProgressBarDialog("Va rugam asteptati", "Se cauta dispozitive...", this, false,
                                                       null, null, null, null, "Anulare", (sender, args) => Finish());
            _progressBarDialog.Show();
            RegisterReceiver(_bondingBroadcastReceiver,
                             new IntentFilter(BluetoothDevice.ActionBondStateChanged)
            {
                Priority = (int)IntentFilterPriority.HighPriority
            });
            _bondingBroadcastReceiver.OnBondedStatusChanged += BondedStatusChanged;
            _adapter.ItemClick += async(sender, args) => {
                switch (_device.Manufacturer)
                {
                case SupportedManufacturers.Medisana:
                    var bleDevicesRecords = await SqlHelper <BluetoothDeviceRecords> .CreateAsync();

                    await bleDevicesRecords.Insert(new BluetoothDeviceRecords {
                        Name               = _adapter.GetItem(args.Position).Name,
                        Address            = _adapter.GetItem(args.Position).Address,
                        DeviceType         = DeviceType.Glucose,
                        DeviceManufacturer = _device.Manufacturer
                    });

                    Finish();
                    break;

                case SupportedManufacturers.Caresens:
                    _adapter.GetItem(args.Position).CreateBond();
                    break;

                default:
                    Log.Error("Error", "Unsupported device");
                    break;
                }
            };
            _recyclerView = FindViewById <RecyclerView>(Resource.Id.addNewDeviceRecyclerView);
            _recyclerView.SetLayoutManager(new LinearLayoutManager(this));
            _recyclerView.SetAdapter(_adapter);

            var bluetoothManager = (BluetoothManager)GetSystemService(BluetoothService);

            if (bluetoothManager != null)
            {
                _bluetoothAdapter = bluetoothManager.Adapter;
            }

            if (_bluetoothAdapter == null)
            {
                Toast.MakeText(this, "Dispozitivul nu suporta Bluetooth!", ToastLength.Short).Show();
                Finish();
            }
            else
            {
                if (!_bluetoothAdapter.IsEnabled)
                {
                    StartActivityForResult(new Intent(BluetoothAdapter.ActionRequestEnable), EnableBt);
                }
                else
                {
                    ScanDevices();
                }
            }
        }
Beispiel #59
0
 public ScheduleCardFragmentAdapterViewHolder(View itemView) : base(itemView)
 {
     recyclerView = itemView.FindViewById <RecyclerView>(Resource.Id.recyclerview_card_schedule);;
 }
Beispiel #60
0
            protected override (int First, int Center, int Last) GetVisibleItemsIndex(RecyclerView recyclerView)
            {
                var firstVisibleItemIndex = -1;
                var lastVisibleItemIndex  = -1;
                var centerItemIndex       = -1;

                if (recyclerView.GetLayoutManager() is LinearLayoutManager linearLayoutManager)
                {
                    var firstView  = recyclerView.FindViewHolderForAdapterPosition(linearLayoutManager.FindFirstVisibleItemPosition());
                    var lastView   = recyclerView.FindViewHolderForAdapterPosition(linearLayoutManager.FindLastVisibleItemPosition());
                    var centerView = recyclerView.GetCenteredView();
                    firstVisibleItemIndex = GetIndexFromTemplatedCell(firstView?.ItemView);
                    lastVisibleItemIndex  = GetIndexFromTemplatedCell(lastView?.ItemView);
                    centerItemIndex       = GetIndexFromTemplatedCell(centerView);
                }

                return(firstVisibleItemIndex, centerItemIndex, lastVisibleItemIndex);
            }