Comments (6)
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.
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.
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.
please see this at .setNavigationChangeListener is showing an error
error: cannot find symbol method setNavigationChangeListener()
from bubble-navigation.
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.
thanks it's done
from bubble-navigation.
Related Issues (20)
- Text disabled but animation of icon always active HOT 2
- Auto-Hide On Scroll HOT 1
- Items getting hidden.
- how to make item not selectable ?
- [RFC] Closing pull requests while a new build is starting causes failures
- Cannot use databinding with bt_title
- How to add icon progrmatically HOT 1
- Need to change font of title
- Shift this library on mavencentral HOT 4
- how to can I set title below icon ?
- OnResume How to State change in Java Code HOT 1
- Font Family for text
- Use multiple drawable for items .
- How to show the text regardless if the item is selected or not? HOT 1
- NavController Support
- Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'. HOT 1
- not showing xml code HOT 1
- Not work in API 32
- Jcenter is not working
- Class problem/Error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bubble-navigation.