Reputation: 10280
I have an application that features video and text content in a View Pager (the only functionality is to swipe left and right to change screens with content).
Now I need to add an "About" screen to the application. To be able to do that I'd need to add three-dots-button "..." (I don't know what is the proper name of this). And it turns out there is no other place apart from PagerTitleStrip
line to add this button. If I add the button to some other place I'll need to use a separate area with only this button which will just waste space on screen. That's why I have a question:
Question: How to add a button to PagerTitleStrip
in View Pager? Or, if you know an alternative way, what would be the other place to put "..." button so that it doesn't waste space?
I'll appreciate any suggestion. I suspect there might be some other way to add About page. At the moment I just don't know where to put it keeping interface elegant.
Upvotes: 0
Views: 45
Reputation: 1061
you can add menu file for this. Example
MenuTest.java
public class MenuTest extends Activity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.tmenu, menu);
// return true so that the menu pop up is opened
return true;
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId())
{
case R.id.feeds:
break;
case R.id.friends:
break;
case R.id.about:
break;
}
return true;
}
}
And my XML file is tmenu.xml
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/feeds"
android:title="Feeds"/>
<item
android:id="@+id/friends"
android:title="Friends"/>
<item
android:id="@+id/about"
android:title="About"/>
</menu>
Let me know if it helps you
Upvotes: 0