I've a TopAppBar in a Scaffold that uses scrollBeh...
# compose-android
a
I've a TopAppBar in a Scaffold that uses scrollBehavior which hides/shows the TopAppBar on scroll. How can I achieve the same with a LazyRow? I want the LazyRow to behave exactly like a TopAppBar. For example: in YouTube app on Android, when you scroll down the TopAppBar and the filtering of content LazyRow get hidden, while on scrolling up, they show.
m
Basically, you'll need to listen for scroll delta changes & offset your lazy row accordingly. This article talks about this in detail: https://medium.com/androiddevelopers/understanding-nested-scrolling-in-jetpack-compose-eb57c1ea0af0
a
Thanks. Any other solutions that allow Apache License? The article you mentioned contains code under Google license.
m
It is licensed under Apache-2.0, scroll down to the end of the article and you'll see that.
a
Yes and it also says code is licensed under Google license.
m
I'm not sure what is the problem here. happy to be corrected if you can enlighten me, Does google license prevent you from using the code in a commercial project or what? Is there any kind of legal issues here?
a
I don't want to use any code that is not licensable under Apache 2.0
m
The code in the Medium post is licensed under Apache 2.0. At the bottom, you will see:
Copy code
Code snippets license: Copyright 2024 Google LLC.

SPDX-License-Identifier: Apache-2.0
SPDX is a standard for declaring licensing.
Apache-2.0
is the SPDX short identifier for the Apache License 2.0.
☝️ 1
a
So it's equivalent to:
Copy code
Copyright (C) 2024 Google LLC. 
<Apache 2.0 license here>
For the entirety of the code in the medium article?
👌 2
Oh my gosh! Thank you so much! I thought they were two separate licenses. One of Google (they've their own license; very similar to Apache 2.0 but not quite the same) and one of Apache 2.0. That's great!