added action bar menu to start conversation

This commit is contained in:
iNPUTmice 2014-07-04 11:36:02 +02:00
parent 502a1bdb9c
commit c1ee9e682a
3 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/search"
android:title="@string/search"
android:icon="@drawable/ic_action_search"
android:showAsAction="collapseActionView|ifRoom"
android:actionViewClass="android.widget.SearchView" />
<item android:id="@+id/create_contact"
android:title="@string/create_contact"
android:icon="@drawable/ic_action_add_person"
android:showAsAction="ifRoom"
/>
<item
android:id="@+id/action_accounts"
android:orderInCategory="90"
android:showAsAction="never"
android:title="@string/action_accounts"
/>
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
</menu>

View File

@ -256,4 +256,6 @@
<string name="verify">Verify</string> <string name="verify">Verify</string>
<string name="decrypt">Decrypt</string> <string name="decrypt">Decrypt</string>
<string name="conferences">Conferences</string> <string name="conferences">Conferences</string>
<string name="search">Search</string>
<string name="create_contact">Create Contact</string>
</resources> </resources>

View File

@ -9,6 +9,12 @@ import android.app.ListFragment;
import android.os.Bundle; import android.os.Bundle;
import android.support.v13.app.FragmentPagerAdapter; import android.support.v13.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.PopupMenu;
import android.widget.PopupMenu.OnMenuItemClickListener;
import eu.siacs.conversations.R; import eu.siacs.conversations.R;
public class StartConversation extends XmppActivity { public class StartConversation extends XmppActivity {
@ -82,6 +88,21 @@ public class StartConversation extends XmppActivity {
} }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.start_conversation, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
default:
break;
}
return super.onOptionsItemSelected(item);
}
@Override @Override
void onBackendConnected() { void onBackendConnected() {
// TODO Auto-generated method stub // TODO Auto-generated method stub