private JavaList <Projeto> GetProjetos() { projetos = new JavaList <Projeto>(); Projeto proj; proj = new Projeto("Código de Barras", Resource.Drawable.barcode); projetos.Add(proj); proj = new Projeto("Código de Barras V2", Resource.Drawable.qr_code); projetos.Add(proj); proj = new Projeto("Impressão", Resource.Drawable.print); projetos.Add(proj); proj = new Projeto("NFC Gedi", Resource.Drawable.nfc); projetos.Add(proj); proj = new Projeto("NFC Id", Resource.Drawable.nfc1); projetos.Add(proj); proj = new Projeto("TEF", Resource.Drawable.pos); projetos.Add(proj); proj = new Projeto("SAT", Resource.Drawable.icon_sat); projetos.Add(proj); return(projetos); }
//Get Goal Tasks public static JavaList <GoalTasks> GetGoalTasks(int gId) { var tasks = new JavaList <GoalTasks>(); GoalTasks allTasks = null; tasks.Clear(); DBHelper dbh = new DBHelper(); ICursor c = dbh.ReadAllGoalTasks(gId); while (c.MoveToNext()) { string taskId = c.GetString(0); string task = c.GetString(1); string taskGoal = c.GetString(2); string taskDesc = c.GetString(3); string taskStart = c.GetString(4); string taskDeadline = c.GetString(5); string taskStatus = c.GetString(7); allTasks = new GoalTasks(); allTasks.Id = Convert.ToInt32(taskId); allTasks.Task = task; allTasks.Goal = Convert.ToInt32(taskGoal); allTasks.TaskDesc = taskDesc; allTasks.TaskStart = taskStart; allTasks.TaskDeadline = taskDeadline; allTasks.TaskStatus = taskStatus; tasks.Add(allTasks); } return(tasks); }
public CustomerAdapter(Activity activity, int resourceId, int textsomething, JavaList <CustomerSingle> items) : base(activity, resourceId, textsomething, items) { _activity = activity; _contactList = items; CloneItems(items); }
/* * DATA SOURCE */ private JavaList <Spacecraft> GetSpacecrafts() { spacecrafts = new JavaList <Spacecraft>(); Spacecraft s; s = new Spacecraft("Luxuries bed Price:30k", Resource.Drawable.enterprise); spacecrafts.Add(s); s = new Spacecraft("Couple get-away Price:12k", Resource.Drawable.hubble); spacecrafts.Add(s); s = new Spacecraft("weekend vybz Price:20k", Resource.Drawable.kepler); spacecrafts.Add(s); s = new Spacecraft("College students Price:12k", Resource.Drawable.spitzer); spacecrafts.Add(s); s = new Spacecraft("Affordable rooms Price:15k", Resource.Drawable.rosetta); spacecrafts.Add(s); s = new Spacecraft("Opportunity formula Price:20k", Resource.Drawable.voyager); spacecrafts.Add(s); return(spacecrafts); }
protected override FilterResults PerformFiltering(ICharSequence constraint) { FilterResults filterResults = new FilterResults(); if (constraint != null && constraint.Length() > 0) { string query = constraint.ToString().ToUpper(); JavaList <Item> filteredItems = new JavaList <Item>(); for (int i = 0; i < currentItems.NumItems; i++) { string itemName = currentItems[i].Text; if (itemName.ToUpper().Contains(query.ToString())) { filteredItems.Add(currentItems[i]); } } filterResults.Count = filteredItems.Count; filterResults.Values = filteredItems; } else { filterResults.Count = currentItems.NumItems; filterResults.Values = currentItems.getItems(); } return(filterResults); }
protected override FilterResults PerformFiltering(ICharSequence constraint) { FilteredItems.Clear(); var results = new FilterResults(); if (string.IsNullOrEmpty(constraint?.ToString())) { FilteredItems = new JavaList <FriendItem>(OriginalItems); } else { var filterPattern = constraint.ToString().ToLower().Trim(); foreach (var item in OriginalItems) { if (item.ToString().ToLower().Contains(filterPattern)) { FilteredItems.Add(item); } } } results.Values = FilteredItems; results.Count = FilteredItems.Size(); return(results); }
private Boolean ParseData() { try { JSONArray ja = new JSONArray(jsonData); JSONObject jo; spacecrafts = new JavaList <string>(); for (int i = 0; i < ja.Length(); i++) { jo = ja.GetJSONObject(i); int id = jo.GetInt("id"); string name = jo.GetString("name"); spacecrafts.Add(name); } return(true); } catch (Exception e) { Console.WriteLine(e.Message); } return(false); }
public static JavaList <Projects> SpinnerProjects() { var projects = new JavaList <Projects>(); Projects allProjects = null; projects.Clear(); DBHelper dbh = new DBHelper(); //db conn ICursor c = dbh.ReadAllProjects(); //goal list while (c.MoveToNext()) { string projectId = c.GetString(0); string project = c.GetString(1); string projectDesc = c.GetString(2); string projectStart = c.GetString(3); string projectDeadline = c.GetString(4); string projectBudget = c.GetString(5); string projectStatus = c.GetString(6); allProjects = new Projects(); allProjects.Id = Convert.ToInt32(projectId); allProjects.Project = project; projects.Add(project); } return(projects); }
void UpdateData(JavaList <IDictionary <string, object> > data, ListView lv) { data.Clear(); var testTarget = SetupTestTarget(); foreach (var test in GetChildTests(testTarget)) { TestResult res; AndroidRunner.Results.TryGetValue(test.FullName, out res); if (test is TestSuite) { var suite = test as TestSuite; data.Add(new TestData(suite.FullName, res != null && res.PassCount > 0 ? res.PassCount + " passed" : null, res != null && res.FailCount > 0 ? res.FailCount + " failed" : null, res != null && res.SkipCount > 0 ? res.SkipCount + " ignored" : null, res != null && res.InconclusiveCount > 0 ? res.InconclusiveCount + " inconclusive" : null, res == null ? null : res.ResultState.Status.ToString(), res == null ? null : res.Message)); } else if (test is NUnitTest) { data.Add(new TestData(test.FullName, null, null, null, null, res == null ? null : res.ResultState.Status.ToString(), res == null ? null : res.Message)); } } lv.Adapter = new TestDataAdapter(this, data, Resource.Layout.results, from_cols, to_ids); }
public ImageAlbums() { var projection = new[] { MediaStore.Images.Media.InterfaceConsts.BucketId, MediaStore.Images.Media.InterfaceConsts.BucketDisplayName, MediaStore.Images.Media.InterfaceConsts.Data }; var cursor = Application.Context.ContentResolver.Query(MediaStore.Images.Media.ExternalContentUri, projection, null, null, MediaStore.Images.Media.InterfaceConsts.DateModified); Covers = new JavaList <AlbumCover>(); Images = new Dictionary <long, JavaList <string> >(); if (cursor.MoveToLast()) { do { long albumID = cursor.GetLong(cursor.GetColumnIndex(projection[0])); string imagePath = cursor.GetString(cursor.GetColumnIndex(projection[2])); if (!Images.ContainsKey(albumID)) { Images.Add(albumID, new JavaList <string>()); var cover = new AlbumCover { albumId = albumID, itemName = cursor.GetString(cursor.GetColumnIndex(projection[1])), imagePath = imagePath }; Covers.Add(cover); } Images[albumID].Add(imagePath); } while (cursor.MoveToPrevious()); } }
public static JavaList <Projects> GetProjects() { var projects = new JavaList <Projects>(); Projects allProjects = null; projects.Clear(); DBHelper dbh = new DBHelper(); ICursor c = dbh.ReadAllProjects(); while (c.MoveToNext()) { string projectId = c.GetString(0); string project = c.GetString(1); string projectDesc = c.GetString(2); string projectStart = c.GetString(3); string projectDeadline = c.GetString(4); string projectBudget = c.GetString(5); string projectStatus = c.GetString(6); allProjects = new Projects(); allProjects.Id = Convert.ToInt32(projectId); allProjects.Project = project; allProjects.ProjectDesc = projectDesc; allProjects.ProjectStart = projectStart; allProjects.ProjectDeadline = projectDeadline; allProjects.ProjectBudget = Convert.ToDecimal(projectBudget); allProjects.ProjectStatus = projectStatus; projects.Add(allProjects); } return(projects); }
//Primera sobrecarga del constructor public MyAdapter(JavaList <MisNotas> notasPublic, RecyclerView recyclerNota, Activity activity) { notaspublic = notasPublic; listaFiltrada = notasPublic; this.recyclerNota = recyclerNota; this._context = activity; }
private JavaList <object> FindAllLegalAttackMovesForCurrentPlayer(int currentPlayerColor, int enemyColor) { var moves = new JavaList <object>(); for (var k = 0; k < 32; k++) { if ((_pieces[k] & ~King) == _currentPlayer) { JavaList <object> tempMoves; if ((_pieces[k] & King) == 0) { tempMoves = FindAllLegalSimpleAttackMoves(k, currentPlayerColor, enemyColor); } else // KING { var lastPos = new JavaList <object>(); lastPos.push_back(k); tempMoves = FindAllLegalKingAttackMoves(lastPos, k, LastDirectionNone, currentPlayerColor, enemyColor); } if (Any(tempMoves)) { moves.AppendToTail(tempMoves); } } } return(moves); }
//Get All Shopping Lists public static JavaList <ShoppingLists> GetShoppingLists() { var lists = new JavaList <ShoppingLists>(); ShoppingLists allLists = null; lists.Clear(); DBHelper dbh = new DBHelper(); //db conn ICursor c = dbh.ReadAllShoppingLists(); //shopping lists while (c.MoveToNext()) { string listId = c.GetString(0); string title = c.GetString(1); string listDesc = c.GetString(2); string shoppingDate = c.GetString(3); string expBudget = c.GetString(4); string actBudget = c.GetString(5); string listStatus = c.GetString(6); allLists = new ShoppingLists(); allLists.Id = Convert.ToInt32(listId); allLists.ListTitle = title; allLists.ListDesc = listDesc; allLists.ShoppingDate = shoppingDate; allLists.ExpectedBudget = Convert.ToDecimal(expBudget); allLists.ListStatus = listStatus; lists.Add(allLists); } return(lists); }
protected override FilterResults PerformFiltering(ICharSequence constraint) { if (constraint != null && constraint.Length() > 0) { string query = constraint.ToString().ToUpper(); JavaList <AppUsers> foundFilter = new JavaList <AppUsers>(); for (int i = 0; i < currentList.Size(); i++) { string name = currentList[i].Name; string email = currentList[i].Email; string contact = currentList[i].PhoneNumber; if (name.ToUpper().Contains(query.ToString()) || email.ToUpper().Contains(query.ToString()) || contact.ToUpper().Contains(query.ToString())) { foundFilter.Add(new AppUsers { Name = currentList[i].Name , PhoneNumber = currentList[i].PhoneNumber , Email = currentList[i].Email }); } } filterResults.Count = foundFilter.Size(); filterResults.Values = foundFilter; } else { filterResults.Count = currentList.Size(); filterResults.Values = currentList; } return(filterResults); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.main); var countries = DataSource.GetCountriesAsync(); var team = DataSource.MyTeam().Select(c => new CyclerViewModel() { Id = id++, Name = c.Name }).ToList(); m_team = new JavaList <CyclerViewModel> (team); m_adapter = new AnimatableCellAdapter(this, Resource.Layout.cycler_layout, m_team); m_listView = FindViewById <ListView> (Resource.Id.myListView); m_listView.Adapter = m_adapter; // Get our button from the layout resource, // and attach an event to it FindViewById <Button> (Resource.Id.removeButton).Click += delegate { //RemoveRow(); AnimateCellShrinkingCommon(); }; FindViewById <Button> (Resource.Id.addButton).Click += delegate { AddRow(); }; }
public TaskAdapter(Activity context, JavaList <TaskModel> tasks) { m_Context = context; m_Tasks = tasks; m_UncheckedColor = m_Context.Resources.GetColor(Settings.DarkTheme ? Resource.Color.white : Resource.Color.actionbar_maincolor_darkgray); m_CheckedColor = m_Context.Resources.GetColor(Settings.CheckedColor); }
public ArrayAdapter(Android.Content.Context context, int resource, int textViewResourceId, System.Collections.Generic.IList <T> objects) : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer) { if (Handle != IntPtr.Zero) { return; } IntPtr lrefObjects = JavaList <T> .ToLocalJniHandle(objects); if (GetType() == typeof(ArrayAdapter <T>)) { if (id_ctor_Landroid_content_Context_IILjava_util_List_ == IntPtr.Zero) { id_ctor_Landroid_content_Context_IILjava_util_List_ = JNIEnv.GetMethodID(class_ref, "<init>", "(Landroid/content/Context;IILjava/util/List;)V"); } SetHandle( JNIEnv.StartCreateInstance(class_ref, id_ctor_Landroid_content_Context_IILjava_util_List_, new JValue(context), new JValue(resource), new JValue(textViewResourceId), new JValue(lrefObjects)), JniHandleOwnership.TransferLocalRef); JNIEnv.FinishCreateInstance(Handle, class_ref, id_ctor_Landroid_content_Context_IILjava_util_List_, new JValue(context), new JValue(resource), new JValue(textViewResourceId), new JValue(lrefObjects)); } else { SetHandle( JNIEnv.StartCreateInstance(GetType(), "(Landroid/content/Context;IILjava/util/List;)V", new JValue(context), new JValue(resource), new JValue(textViewResourceId), new JValue(lrefObjects)), JniHandleOwnership.TransferLocalRef); JNIEnv.FinishCreateInstance(Handle, "(Landroid/content/Context;IILjava/util/List;)V", new JValue(context), new JValue(resource), new JValue(textViewResourceId), new JValue(lrefObjects)); } JNIEnv.DeleteLocalRef(lrefObjects); }
public static JavaList <Fruit> GetFruits() { JavaList <Fruit> fruits = new JavaList <Fruit>(); Fruit fruit = null; //ADD FRUITS fruit = new Fruit(); fruit.Name = "Mango"; fruit.Image = Resource.Drawable.mango; fruits.Add(fruit); fruit = new Fruit(); fruit.Name = "Oranges"; fruit.Image = Resource.Drawable.oranges; fruits.Add(fruit); fruit = new Fruit(); fruit.Name = "Coconut"; fruit.Image = Resource.Drawable.coconut; fruits.Add(fruit); fruit = new Fruit(); fruit.Name = "Grapes"; fruit.Image = Resource.Drawable.grapes; fruits.Add(fruit); fruit = new Fruit(); fruit.Name = "Apples"; fruit.Image = Resource.Drawable.apples; fruits.Add(fruit); return(fruits); }
private JavaList <Projeto> GetProjetos() { projetos = new JavaList <Projeto>(); Projeto proj; proj = new Projeto("Código de Barras", Resource.Drawable.barcode); projetos.Add(proj); proj = new Projeto("NFC - NDEF", Resource.Drawable.nfc2); projetos.Add(proj); proj = new Projeto("Sensor de Presença", Resource.Drawable.sensor); projetos.Add(proj); proj = new Projeto("FALA G-Bot", Resource.Drawable.speaker); projetos.Add(proj); proj = new Projeto("Modo Quiosque", Resource.Drawable.kiosk); projetos.Add(proj); proj = new Projeto("Tef", Resource.Drawable.pos); projetos.Add(proj); proj = new Projeto("SAT", Resource.Drawable.icon_sat); projetos.Add(proj); return(projetos); }
public EmptySuggetionRecylerAdapter(Activity context) { ActivityContext = context; SuggetionsMessagesList = new JavaList <SuggetionsMessages>(); SuggetionsMessages a1 = new SuggetionsMessages(); a1.Id = 1; a1.Message = "Say Hi 🖐️"; a1.RealMessage = "Hi 🖐️"; SuggetionsMessages a2 = new SuggetionsMessages(); a2.Id = 2; a2.Message = "How are you?"; a2.RealMessage = "How are you?"; SuggetionsMessages a3 = new SuggetionsMessages(); a3.Id = 3; a3.Message = "Can we speak?"; a3.RealMessage = "Hi"; SuggetionsMessages a4 = new SuggetionsMessages(); a4.Id = 4; a4.Message = "I like your picture ❤️"; a4.RealMessage = "I like your picture ❤️"; SuggetionsMessagesList.Add(a1); SuggetionsMessagesList.Add(a2); SuggetionsMessagesList.Add(a3); SuggetionsMessagesList.Add(a4); }
private object?PlatformCreate(object?value, ServerTimestampBehavior?serverTimestampBehavior) { return(value switch { JavaList list => PlatformCreate(list), AbstractList list => PlatformCreate(list), null => default,
public object?Create(object?value, ServerTimestampBehavior?serverTimestampBehavior) { return(value switch { JavaList list => Create(list), AbstractList list => Create(list), null => default,
public CustomerAdapter PopulateCustomers(Activity activity, int resourceId, int textsomething) { if (customersLock == false) { CustomerAdapter custs = null;//,new List<CustomerSingle>()); JavaList <CustomerSingle> custsList = new JavaList <CustomerSingle>(); if (customers != null) { System.Collections.IEnumerator custEnum = customers.GetEnumerator(); custEnum.Reset(); int i = 0; while (custEnum.MoveNext()) { Customer active = (Customer)custEnum.Current; custsList.Add(new CustomerSingle(active.No_, active.Name, active.Address, i)); i++; } } custs = new CustomerAdapter(activity, resourceId, textsomething, custsList); return(custs); } else { return(null); } }
//Get Goal Names public static JavaList <Goals> SpinnerGoals() { var goals = new JavaList <Goals>(); Goals allGoals = null; goals.Clear(); DBHelper dbh = new DBHelper(); //db conn ICursor c = dbh.ReadAllGoals(); //goal list while (c.MoveToNext()) { string goalId = c.GetString(0); string goal = c.GetString(1); string goalDesc = c.GetString(2); string goalStart = c.GetString(3); string goalDeadline = c.GetString(4); string goalStatus = c.GetString(5); allGoals = new Goals(); allGoals.Id = Convert.ToInt32(goalId); allGoals.Goal = goal; goals.Add(goal); } return(goals); }
public ItemAdapter PopulateItems(Activity activity, int resourceId, int textsomething) { if (itemLock == false) { JavaList <ItemSingle> activeItems = new JavaList <ItemSingle>(); if (item != null) { System.Collections.IEnumerator itemEnum = item.GetEnumerator(); itemEnum.Reset(); int i = 0; while (itemEnum.MoveNext()) { Item active = (Item)itemEnum.Current; activeItems.Add(new ItemSingle(active.No_, active.Description, active.Unit_List_Price, active.Unit_Price, active.Sales_Unit_of_Measure, i)); i++; } } ItemAdapter items = new ItemAdapter(activity, resourceId, textsomething, activeItems); return(items); } else { return(null); } }
public ItemAdapter(Activity activity, int resourceId, int textsomething, JavaList <ItemSingle> items) : base(activity, resourceId, textsomething, items) { this._activity = activity; this._itemList = items; CloneItems(items); }
public static Filter newInstance(JavaList <AppUsers> currentList, AppUsersAdapter adapter1) { FilterHelper.currentList = currentList; adapter = adapter1; return(new FilterHelper()); }
public void CloneItems(JavaList <CustomerSingle> items) { foreach (var item in items) { _originalList.Add(item); } }
private void SetUpRecyclerView(RecyclerView recyclerView) { try { //Task list JavaList <Estates> mTaskList = EstatesAdapter.GetAllEstates(mJson); //Create recycler layout manager mLayoutManager = new LinearLayoutManager(recyclerView.Context); //Set recycler layout manager recyclerView.SetLayoutManager(mLayoutManager); //new DownloadAdapter(recyclerView.Context, mUrl, "GET", recyclerView).Execute(); //Get adapter mDashboardRecyclerAdapter = new DashboardRecyclerAdapter(mTaskList, recyclerView); //on click event mDashboardRecyclerAdapter.ItemClick += MDashboardRecyclerAdapter_ItemClick; //Set adapter recyclerView.SetAdapter(mDashboardRecyclerAdapter); } catch (Exception ex) { Console.WriteLine("Error : " + ex.Message + " trace : " + ex.StackTrace); } }