adib2149 / bottomnavbar Goto Github PK
View Code? Open in Web Editor NEWEasily add four tabbed bottom navigation bar in your activity.
Easily add four tabbed bottom navigation bar in your activity.
Let's say I want only 3 or 5 tabs. in that case this library is completely useless
Hi thank you for your library I am using it in my android news app it is possible to increase items to 5 when I have added fifth item. It is giving this exception java.lang.RuntimeException: Unable to start activity ComponentInfo{yodgobekkomilov.edgar.com.worldnews/yodgobekkomilov.edgar.com.worldnews.MainActivity}: java.lang.RuntimeException: List of NavigationPage must contain 4 members.
below my code from MainActivity
public class MainActivity extends BottomBarHolderActivity implements AllJazeeraFragment.OnFragmentInteractionListener, BBCFragment.OnFragmentInteractionListener, CNNFragment.OnFragmentInteractionListener, CBCNewsFragment.OnFragmentInteractionListener {
// private ApiService apiService;
public static final String url_key = "urlKey";
public ArrayList<Article> articleList = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
Article article = new Article(Parcel.obtain());
article.setUrl(article.getUrl());
Intent i = new Intent(this, DetailActivity.class);
i.putExtra("urlKey", article);
// // using the (String name, Parcelable value) overload!
// startActivity(i);
NavigationPage page1 = new NavigationPage("AllJazeera", ContextCompat.getDrawable(this, R.drawable.alljazeera), AllJazeeraFragment.newInstance());
NavigationPage page2 = new NavigationPage("BBC", ContextCompat.getDrawable(this, R.drawable.bbc_icon), CNNFragment.newInstance());
NavigationPage page3 = new NavigationPage("CNN", ContextCompat.getDrawable(this, R.drawable.cnn_icon), AllJazeeraFragment.newInstance());
NavigationPage page4 = new NavigationPage("CBC", ContextCompat.getDrawable(this, R.drawable.cbc_icon), CBCNewsFragment.newInstance());
NavigationPage page5 = new NavigationPage("Menu", ContextCompat.getDrawable(this, R.drawable.icon_menu), Menu.newInstance());
List<NavigationPage> navigationPages = new ArrayList<>();
navigationPages.add(page1);
navigationPages.add(page2);
navigationPages.add(page3);
navigationPages.add(page4);
navigationPages.add(page5);
super.setupBottomBarHolderActivity(navigationPages);
}
public void onClicked() {
Toast.makeText(this, "Clicked!", Toast.LENGTH_SHORT).show();
}
}
and help and suggestion will be appreacited
Android has already offered a widget called BottomNavigationView , which can also do the same things.
What's the advantage of this project?
I only need two, you need at least four, fault tolerance is not high
Is it possible to set selected tab on create instead of first tab/ Home
How do we set which tab is selected.
Lets say I have five tabs, and I want the middle on selected by default?
The library currently shows view after being initialized programmatically. It would be great if it could be done only by XML.
On Screenshots you show examples with toolbar but in the examples provided on the repo you dont have a toolbar set.
How to implement?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.