nova-video-player / aos-AVP

NOVA opeN sOurce Video plAyer: main repository to build them all
Apache License 2.0
3.32k stars 197 forks source link

[Bug]: TV show overview window season grid overlapping other info (UI bug) #581

Open bronnel opened 2 years ago

bronnel commented 2 years ago

Problem description

there is a bug in TV show overview window, this was a long time bug in nova or archos, but I found this when I applied my UI changing code. This is not normally visible, first you must apply my code When a Series has more than one season, Then TV show overview window with season list is accessible, this bug only happens in season grid view , it doesn't happen in season list mode When you go to tv show overview window , you can see the season grid overlapping other info like plot and other info.

When I was trying to find the source of this bug I found another bug inside BrowserWithShowHeader and here is how to catch the bug , if you you navigate all the way to episode list then go back to season grid you will catch it Screenshot_20220221-204914

Steps to reproduce the issue

The bug is a visual bug in TV show overview window

Expected behavior

there must not be overlapping with other info. Screenshot_20220221-204923

Your phone/tablet/androidTV model

LG V50

Operating system version

Android 10

Application version and app store

No response

Additional system information

when you are on tv show overview window, press home button then go back to nova the bug is visually gone

Debug logs

Other bug video of overlapping issue bug disappear video

courville commented 2 years ago

I do not think the picasso error is the source of the issue: must be another UI bug. To be investigated.

bronnel commented 2 years ago

@courville , I will manually update my project with your debug, to pinpoint the issue hopefully , thanks

bronnel commented 2 years ago

@courville The visual bug of overlapping is related to the following method of getView in HeaderGridView.java the problem is specifically related to convertView and if I change the code from this

@Override
        public View getView(int position, View convertView, ViewGroup parent) {
            // Header (negative positions will throw an ArrayIndexOutOfBoundsException)
            int numHeadersAndPlaceholders = getHeadersCount() * mNumColumns ;

            if (position < numHeadersAndPlaceholders) {
                View headerViewContainer = mHeaderViewInfos
                        .get(position / mNumColumns).viewContainer;
                if (position % mNumColumns == 0) {
                    return headerViewContainer;
                } else {
                    if (convertView == null) {
                        convertView = new View(parent.getContext());
                    }
                    // We need to do this because GridView uses the height of the last item
                    // in a row to determine the height for the entire row.
                    convertView.setVisibility(View.INVISIBLE);
                    convertView.setMinimumHeight(headerViewContainer.getHeight());
                    return convertView;
                }
            }
            // Adapter
            final int adjPosition = position - numHeadersAndPlaceholders;
            int adapterCount = 0;
            if (mAdapter != null) {
                adapterCount = mAdapter.getCount();
                if (adjPosition < adapterCount) {
                    return mAdapter.getView(adjPosition, convertView, parent);
                }
            }
            throw new ArrayIndexOutOfBoundsException(position);
        }

To this, then the bug is fixed but now the season grid does not scroll with the header (it scrolls independently) and the info loses styling features like font color so I assume this is not the correct way to fix it, what is your input on this?

 @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            // Header (negative positions will throw an ArrayIndexOutOfBoundsException)
            int numHeadersAndPlaceholders = getHeadersCount() * mNumColumns ;

            if (position < numHeadersAndPlaceholders) {
                View headerViewContainer = mHeaderViewInfos
                        .get(position / mNumColumns).viewContainer;
                return headerViewContainer;
            }
            // Adapter
            final int adjPosition = position - numHeadersAndPlaceholders;
            int adapterCount = 0;
            if (mAdapter != null) {
                adapterCount = mAdapter.getCount();
                if (adjPosition < adapterCount) {
                    return mAdapter.getView(adjPosition, convertView, parent);
                }
            }
            throw new ArrayIndexOutOfBoundsException(position);
        }
courville commented 2 years ago

Thanks @bronnel for the analysis. @PhieF any insight on the above issue since you might remember this code form an other life ;-) ?

bronnel commented 2 years ago

@courville case closed with this commit Season gridview height fixed (overlapping issue fixed)

courville commented 2 years ago

@bronnel could you please make a PR?

bronnel commented 2 years ago

@courville I'm currently on NewUIFeatures branch, I have many commits here , If I make PR it may mess things up on your end because I have unfinished changes , so what you suggest? or I shroud switch to v6, right?

courville commented 2 years ago

Will cherry-pick easier indeed. Thx for the fix!

courville commented 2 years ago

For now the fix causes more issues, I will revert the fix on v6 and let's fix it on your branch.

bronnel commented 2 years ago

@courville , on my branch I don't any issues, but it is due to the viewmore layout, I have compeletly got rid of it , I will reimplent the viewmore in a better way later