@Override publicvoidonMenuTabReSelected(@IdResint menuItemId){ if(menuItemId == R.id.nav_home){ // The user reselected item number one, scroll your content to top.
} } });
// Setting colors for different tabs when there's more than three of them. // You can set colors for tabs in three different ways as shown below. mBottomBar.mapColorForTab(0, ContextCompat.getColor(this, R.color.colorPrimaryDark)); mBottomBar.mapColorForTab(1, ContextCompat.getColor(this, R.color.colorPrimaryDark)); mBottomBar.mapColorForTab(2, ContextCompat.getColor(this, R.color.colorPrimaryDark)); mBottomBar.mapColorForTab(3, ContextCompat.getColor(this, R.color.colorPrimaryDark)); mBottomBar.mapColorForTab(4, ContextCompat.getColor(this, R.color.colorPrimaryDark));
// Set the color for the active tab. Ignored on mobile when there are more than three tabs. // mBottomBar.setActiveTabColor("#009688");
// mBottomBar.selectTabAtPosition(1, true);
setNotificationBadge();
}
privatevoidsetNotificationBadge(){
// Make a Badge for the first tab, with red background color and a value of "13". BottomBarBadge unreadMessages = mBottomBar.makeBadgeForTabAt(4,"#FF0000",10);
// Control the badge's visibility unreadMessages.show(); // unreadMessages.hide();
// Change the displayed count for this badge. unreadMessages.setCount(4);
// Change the show / hide animation duration. unreadMessages.setAnimationDuration(200);
// If you want the badge be shown always after unselecting the tab that contains it. unreadMessages.setAutoShowAfterUnSelection(false); }
// Necessary to restore the BottomBar's state, otherwise we would // lose the current tab on orientation change. mBottomBar.onSaveInstanceState(outState); }
Android Swipe Layout This will be the most powerful Android swipe UI component In one of my Project, I have a requirement to create a Swiping Layout For RecyclerView. I looked for different Libraries. I found this Great Library Android Swipe Layout. I have tried this Library for RecyclerView. I have done sample Project using this great Library. This Library Supports ListView and GridView also. Thanks to the Author for Creating this useful Library: https://github.com/daimajia/ Library Link : https://github.com/daimajia/AndroidSwipeLayout/ Wiki Page: https://github.com/daimajia/AndroidSwipeLayout/wiki Step: 1 ====== Add dependency to your build.gradle file 1 2 3 4 dependencies { compile 'com.daimajia.swipelayout:library:1.2.0@aar' } Step: 2 ====== Create a row for RecyclerView using SwipeLayout 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60...
Comments
Post a Comment