-1

I have to make this type of layout.

like this:

enter image description here

I need this shadow effect, I tried enough but did not get it.

LaurentY
  • 7,495
  • 3
  • 37
  • 55
BPatel
  • 11
  • 4

2 Answers2

0

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

Prakash Bala
  • 315
  • 5
  • 12
0

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");
    }
}
Community
  • 1
  • 1
Aditya Vyas-Lakhan
  • 13,409
  • 16
  • 61
  • 96