TeamAmaze / AmazeFileUtilities

An open source Google Files alternative for Android
https://teamamaze.xyz
GNU General Public License v3.0
316 stars 28 forks source link

One-off error in `ReviewAnalysisAdapter` #151

Closed seelchen closed 8 months ago

seelchen commented 8 months ago

At the top of the analysis review view the number of items is shown. However, it always has an one-off error because of these lines in the ReviewAnalysisAdapter, which add an EMPTY_LAST_ITEM if the list is not empty.

I am not sure why this EMPTY_LAST_ITEM has to be added, but I think that counting it as a item is quite confusing since the item itself not visible to the user. It should be at least subtracted when displaying the number of items. Or maybe the condition is wrong and was meant to check if the list is empty?

one-off-error

VishalNehra commented 8 months ago

I thought I fixed it, EMPTY_LAST_ITEM is added because some analysis are still being performed so we show a loading spinner at the end of the list for user to be aware that we're still processing that analysis. Yea, maybe we need to subtract 1 from the number shown on top. Eg: IMG_20231221_005412

seelchen commented 8 months ago

Ah, I see! There is the getOnlyItemsCount method which probably was meant to fix this, but it still returns the one-off size.

VishalNehra commented 8 months ago

Right, so maybe do a -1 only for ReviewAnalysisAdapter implementation of getOnlyItemsCount.