Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibilty to initially expand parallax appbarlayout to specific offset smaller than ImageView size #60

Closed
borgwald opened this issue Jan 27, 2016 · 7 comments

Comments

@borgwald
Copy link

Hello,

i am trying to not fully expand my smoothappbarlayout. reason: my imageview inside collapsingtoolbarlayout can contain full sized images in portraitmode and i want to expand my smoothappbarlayout max half size of screen, maintainig the ability to expand further until the whole image is visible.

i tried it with Appbarlayout.Behavior:

CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) getAppBarLayout().getLayoutParams();
AppBarLayout.Behavior behavior = new AppBarLayout.Behavior();
behavior.setTopAndBottomOffset(0);
behavior.onNestedPreScroll(getCoordinatorLayout(), getAppBarLayout(), null, 0, getOffset(), new int[2]);
params.setBehavior(behavior);
getAppBarLayout().setLayoutParams(params);

this does expand my smoothappbarlayout only to the specified offset, but it also breaks overall scrolling behavior with smoothappbarlayout + collapsingtoolbarlayout + recyclerview

for better understanding: whats app is using a similar layout in their profileoverview of other users.

@henrytao-me
Copy link
Owner

Hi @borgwald

I looked into WhatsApp profile style, I am not sure you are asking about cover animation or title/subtitle animation but overall, we can easily achieve this style with SmoothAppBarLayout and SmoothCollapsingToolbarLayout.

I can make an example this weekend and ping you when it's ready.

Cheers,
Henry

@borgwald
Copy link
Author

hello henry.

when you look at whatsapp into the detail of a user, at the initial start of the detailactivity the toolbar is not expanded to the full imagesize. this is what i want to achieve. when you scroll down in whatsapp, the toolbar expands a little more until the whole image is visible. i dont have a good startingpoint on how to achieve this with smoothappbarlayout.

@henrytao-me
Copy link
Owner

Oh. I see what you mean. For that kind of style, I can make it work with ScrollView. Making it work with RecyclerView (with Async loading) is kind of tricky. What's your need right now? ScrollView with pre-design item or RecyclerView with async loading items?

@borgwald
Copy link
Author

hello henry,

first of all thanks for your reply and efforts.

i am using a recyclerview in my layout.

@henrytao-me
Copy link
Owner

;). I found that our needs are always more than existing apps from BigCorp. But that makes things are more interesting. Let me work on it this weekend. Thanks for your consideration to use this library.

Cheers,
Henry

@borgwald borgwald changed the title Possibilty to expand parallax appbarlayout to specific offset. Possibilty to initially expand parallax appbarlayout to specific offset smaller than ImageView size Jan 27, 2016
@borgwald
Copy link
Author

Hello Henry,

did you have any Updates on this?

henrytao-me added a commit that referenced this issue Apr 16, 2016
henrytao-me added a commit that referenced this issue Apr 16, 2016
@henrytao-me
Copy link
Owner

Hi @borgwald

Please upgrade to 23.2.1.2 and check PreScroll example. Note: Use Utils.initPreScroll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants