mikepenz/AboutLibraries

Strange animation if header is set

Paschmid opened this issue · 3 comments

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

  • [ 10.8.3 ] Used library version
  • [ 8.1.0 ] Used gradle build tools version
  • [ 2022.3.1 Patch 1 ] Used tooling / Android Studio version

Checklist

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.

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.

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