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

Add capabilities to support BottomNavigation #2

Closed
rh-id opened this issue Sep 28, 2021 · 1 comment
Closed

Add capabilities to support BottomNavigation #2

rh-id opened this issue Sep 28, 2021 · 1 comment

Comments

@rh-id
Copy link
Owner

rh-id commented Sep 28, 2021

Current API doesn't have the capabilities to specify which view can be changed for navigator. It directly uses Activity as a whole page / view. This is a problem when using bottom navigation where one view contains both the content and static bottom navigation as a remote to switch the content.

Possible approach is to let user specify the content container id and pass the container id for navigator to handle

<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
 
    <FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
 
    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottomNavigationView"
        android:layout_width="match_parent"
        android:layout_height="75dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:menu="@menu/bottom_nav_menu"/>
     
</androidx.constraintlayout.widget.ConstraintLayout>
@rh-id
Copy link
Owner Author

rh-id commented Oct 9, 2021

Fix ebc0930

This feature also support multiple navigator to navigate view

@rh-id rh-id closed this as completed Oct 9, 2021
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

1 participant