question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please provide getSectionCount() and getSection(position)

See original GitHub issue

Please, correct me, if I’m doing something wrong. I have sections with header and items. Each section has id. When I need to add\remove\update item in this section I do:

for (s in 0 until adapter.groupCount) {
	val section = adapter.getGroup(s) as DFLineSection
	if (section.sectionKey != tournamentId) continue
	val groupCount = section.groupCount
	for (i in 1 until groupCount) { // 1 to ignore header
		val item = section.getGroup(i) as DFLineItem
		if (item.event.key != serverMarket.key.eventId) continue
...

The problem - adapter.groupCount returns number of all items I have in the list, not sections. adapter.getGroup(s) works almost correctly - for each s it returns correct section, but as many times as many items this section has. What I believe would be very useful - possibility to get number of and then navigate directly by sections.

Also I would like to have adapter.removeSection(position) and section.removeItem(position), now it is only possible to remove using section\item as argument.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
ValCanBuildcommented, Sep 27, 2019

@AlexMatiash agreed on that point. Those methods need to be named better. Perhaps it’ll be useful to have a getTopLevelGroup(topLevelGroupPosition) type method. I agree the current naming is confusing.

I’ll explore for the next release

0reactions
ValCanBuildcommented, Oct 10, 2019

Now deployed in 2.7.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is static Configuration.GetSection() not available?
Those examples from MS site do not call GetSection as static method: ... public ContentResult OnGet() { positionOptions = Configuration.
Read more >
About Tabs/Sections API - XLineSoft
count(). Returns the number of tabs in the Tab control object. ... The m-th tab is moved to the n-th position. Sections methods....
Read more >
Options pattern in ASP.NET Core - Microsoft Learn
Discover how to use the options pattern to represent groups of related settings in ASP.NET Core apps.
Read more >
ECSCW 2005: Proceedings of the Ninth European Conference on ...
getGID(),“title”, “setter”,newObject[]{title})); } The second option may be ... Our implementation provides two generalpurpose reusable event adapters for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found