-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Library structure #9
Comments
I agree, as it's a UI library, it should be added via the layout. Maybe you can refer to how works NagvationView and use menu xml to populate the Bottombar for example? |
@skimarxall
3 & 4. Will do. |
@HugoGresse |
yes right ! java should be used only to override xml attributes |
@roughike I think the position of the bar should be a job of the dev. I know it's nice to have everything out of the box, but normally this leads to workarounds to fix some special cases. Take a look at this gist https://gist.github.com/NikolaDespotoski/1d6fef4949eb9be05a46 He is using the support TabLayout wrapped in a LinearLayout as a BottomNavigation. I think you BottomBar should replace that. So a normal view will look like <android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/long_text"/>
</android.support.v4.widget.NestedScrollView>
<com.roughike.bottombar.BottomBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:tabMenu="@menu/bottom_menu"
app:layout_behavior="@string/bottom_navigation_behavior"
app:tabLayoutId="@+id/tabs"/>
</android.support.design.widget.CoordinatorLayout> Maybe you could even avoid the width and height and force it on the creation of your view. But I am not sure about that. |
@skimarxall |
@roughike that's how it has to be. This is the behaviour defined by the specs. When you scroll the bottom navigation should go away. thus the scroll content should get the full size. Is the dev that needs to let enough padding or spacing at the end in order to avoid content overlapping. Or you use a RelativeLayout and the nested scroll view defines That's is what I actually meant with being flexible, is the dev job to decide this kind of behavior. |
@skimarxall I'm making it usable by XML and I'll provide instructions how to use it in the Readme. |
roughike#4 & roughike#9: Removed attach method and refactored to make it possible to add as normal view in XML. Removed shadow gradient. Added code in app example to display "proper" shadow.
Here's some solutions for your issues:
Here's what I found about the XML issue:
Using the BottomBar should be as simple as possible and same code should work by default for both tablets and phones solution. For these reasons, I'm closing this issue. I really appreciate your feedback though! Feel free to create new issues if something new comes to your mind. |
@roughike how would you then use it with coordinator layout if its not on the xml? At the end is a library decision if you want to give it as xml or java. I think since it's a view it makes more sense to use it as xml even if then it requires some extra configuration. Glad that you implement the other two points though. |
Hi,
First nice job doing this library, but there are few things I would change.
If I have so time this weekend I maybe fork it and make some pull request.
Br,
Marcel
The text was updated successfully, but these errors were encountered: