Giter Site home page Giter Site logo

Comments (6)

gauravk95 avatar gauravk95 commented on May 22, 2024

You can use the current active navigation position to change the activity. Note, that the positions are relative to the order of the child Nav items represented by BubbleToggleView

bubbleNavigation.setNavigationChangeListener(new BubbleNavigationChangeListener() {
    @Override
    public void onNavigationChanged(View view, int position) {
        switch (position){
                case 0: launchFirstActivity();
                break;
                case 1: launchSecondActivity();
                break;
         }
    }
});

OR

If you have set layout id's for the child Nav items represented by BubbleToggleView

bubbleNavigation.setNavigationChangeListener(new BubbleNavigationChangeListener() {
    @Override
    public void onNavigationChanged(View view, int position) {
        switch (view.getId()){
                case R.id.first_activity_toggle: launchFirstActivity();
                break;
                case R.id.second_activity_toggle: launchSecondActivity();
                break;
         }
    }
});

from bubble-navigation.

Tanuj1108 avatar Tanuj1108 commented on May 22, 2024
    BubbleNavigationChangeListener bubbleNavigation = (BubbleNavigationChangeListener) findViewById(R.id.bottom_navigation_view_linear);

    bubbleNavigation.setNavigationChangeListener(new BubbleNavigationChangeListener() {
        @Override
        public void onNavigationChanged(View view, int position) {
            switch (view.getId()){
                case R.id.l_item_search:
                    Intent in=new Intent(getBaseContext(),Secondactivity.class);
                    startActivity(in);
                    overridePendingTransition(0, 0);
                    break;
            }
        }
    });

in this .setNavigationChangeListener showing error so what can i do

from bubble-navigation.

gauravk95 avatar gauravk95 commented on May 22, 2024

Please post the Logcat/snippet of the error. Without that I cannot debug the issue...

It seems like the overridePendingTransition(0,0) might be cause problems

from bubble-navigation.

Tanuj1108 avatar Tanuj1108 commented on May 22, 2024

android screenshot

please see this at .setNavigationChangeListener is showing an error
error: cannot find symbol method setNavigationChangeListener()

from bubble-navigation.

gauravk95 avatar gauravk95 commented on May 22, 2024

Your usage is wrong!

R.id.bottom_navigation_view_linear is of the type BubbleNavigationLinearView or it can be of type BubbleNavigationConstraintView

Use like this

BubbleNavigationLinearView bubbleNavigation = findViewById(R.id.bottom_navigation_view_linear);
bubbleNavigation.setNavigationChangeListener(new BubbleNavigationChangeListener() {
        @Override
        public void onNavigationChanged(View view, int position) {
            switch (view.getId()){
                case R.id.l_item_search:
                    Intent in=new Intent(getBaseContext(),Secondactivity.class);
                    startActivity(in);
                    break;
            }
        }

from bubble-navigation.

Tanuj1108 avatar Tanuj1108 commented on May 22, 2024

thanks it's done

from bubble-navigation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.