I'm currently creating an Android application which contain a ToolBar moved to the bottom of the screen to act as a "switching scene" menu.
You can see the result on the right bottom of this screenshot
What I wanted to do is to adapt the ToolBar to display it vertically on the bottom right side (instead of horizontally) like this.
ToolBar code:
<android.support.v7.widget.Toolbar
android:id="@+id/menuToolbar"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom|right"
android:background="?attr/colorPrimary"
android:elevation="15dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
Then I call initToolbar() in my OnCreate() method.
private void initToolbar() {
Toolbar toolbarBottom = (Toolbar) findViewById(R.id.menuToolbar);
toolbarBottom.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch(item.getItemId()){
case R.id.action_addPoi:
Intent addPoi = new Intent(MainActivity.this, AddPoi.class);
startActivity(addPoi);
break;
case R.id.action_calendar:
Intent calen = new Intent(MainActivity.this, Calendar.class);
startActivity(calen);
break;
}
return true;
}
});
// Inflate a menu to be displayed in the toolbar
toolbarBottom.inflateMenu(R.menu.menumain);
}
Thanks to Ekalips and Warlock I managed to deal with it.
Just added
android:rotation="270"
android:layout_marginBottom="90dp"
android:layout_marginRight="-95dp"
to the first file I gave. Result here.
Thanks! :)