I have to make this type of layout.
like this:
I need this shadow effect, I tried enough but did not get it.
I have to make this type of layout.
like this:
I need this shadow effect, I tried enough but did not get it.
Its called bottom bar. It is used for navigation of pages.
Learn More: https://material.google.com/components/bottom-navigation.html#bottom-navigation-usage
Useful Resource: https://github.com/roughike/BottomBar
I suggest you that,you need to create custom shape for bottom navigation,to create bottom navigation see Bottom Navigation then give shadow to selected option, for shadow check this,
public class ThreeButtonsActivity extends AppCompatActivity {
private CoordinatorLayout coordinatorLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_three_buttons);
coordinatorLayout = (CoordinatorLayout) findViewById(R.id.three_buttons_activity);
BottomBar bottomBar = BottomBar.attach(this, savedInstanceState);
bottomBar.setItemsFromMenu(R.menu.three_buttons_menu, new OnMenuTabSelectedListener() {
@Override
public void onMenuItemSelected(int itemId) {
switch (itemId) {
case R.id.recent_item:
Snackbar.make(coordinatorLayout, "Recent Item Selected", Snackbar.LENGTH_LONG).show();
break;
case R.id.favorite_item:
Snackbar.make(coordinatorLayout, "Favorite Item Selected", Snackbar.LENGTH_LONG).show();
break;
case R.id.location_item:
Snackbar.make(coordinatorLayout, "Location Item Selected", Snackbar.LENGTH_LONG).show();
break;
}
}
});
// Set the color for the active tab. Ignored on mobile when there are more than three tabs.
bottomBar.setActiveTabColor("#C2185B");
// Use the dark theme. Ignored on mobile when there are more than three tabs.
//bottomBar.useDarkTheme(true);
// Use custom text appearance in tab titles.
//bottomBar.setTextAppearance(R.style.MyTextAppearance);
// Use custom typeface that's located at the "/src/main/assets" directory. If using with
// custom text appearance, set the text appearance first.
//bottomBar.setTypeFace("MyFont.ttf");
}
}