mikepenz / AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments
http://mikepenz.github.io/AboutLibraries/
Apache License 2.0
3.62k stars 419 forks source link

Strange animation if header is set #919

Closed Paschmid closed 11 months ago

Paschmid commented 12 months ago

About this issue

We use a header for the LibrariesContainer that explains what is shown in the list. Moreover, our entering animation for the screen is slide in from right. This setting leads to a strange animation because the LazyColumn is only shown when the libs are loaded. This means that we now have two animations, the entering animation (slide in from right) and the showing of the LazyColumn when the libs are loaded (slide in from above).

Our current integration looks like the following:

LibrariesContainer(
        modifier = Modifier.fillMaxSize(),
        header = {
            item {
                Column(
                    modifier = Modifier.padding(16.dp),
                    verticalArrangement = Arrangement.spacedBy(8.dp)
                ) {
                    Text(text = stringResource(id = R.string.licences_title))
                    Text(text = stringResource(R.string.licences_text))
                }
            }
        }
    )

IMHO, I would at least expect that the header is always visible even during the loading of the libs to avoid this animation issue. Maybe, we could even go a step further and show some kind of loading indicator during this time. I didn't test a lot of different phones but on the simulator it's about half a second until something is loaded. I assume that older phones have similar performance.

Details

Checklist

mikepenz commented 12 months ago

Good day @Paschmid

Thank you very much for the report.

Having the header show all the time sounds certainly like a good suggestion. I'd be happy to take a PR to improve this behavior.

Having a loading animation could make sense, however it showing up for a brief moment, and disappearing right after, could also be not the best experience for users.

Paschmid commented 11 months ago

I created a PR to improve the header behavior. You're right about the loading animation. If it's always only showing max half a second or even a second, it's better to not show it at all.

mikepenz commented 11 months ago

Thank you very much. I'll review as soon as possible