1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-15 22:15:15 -05:00

Use ActionBarSherlock's MenuBuilder for the "more" menu

This commit is contained in:
cketti 2012-09-12 17:20:53 +02:00 committed by Jesse Vincent
parent 103fb948c1
commit 2a05bc0caa
3 changed files with 45 additions and 4 deletions

View File

@ -61,7 +61,7 @@
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary" />
<ImageButton
<com.fsck.k9.view.ImageButtonAnchor
android:id="@+id/item_menu"
android:layout_width="36dp"
android:layout_height="wrap_content"

View File

@ -47,6 +47,8 @@ import android.widget.TextView;
import android.widget.Toast;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.internal.view.menu.MenuBuilder;
import com.actionbarsherlock.internal.view.menu.MenuPopupHelper;
import com.actionbarsherlock.view.ActionMode;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
@ -2056,8 +2058,11 @@ public class MessageList extends K9ListActivity implements OnItemClickListener {
@Override
public void onClick(View v) {
// Perform action on clicks
setAllSelected(false);
openContextMenu(v);
// setAllSelected(false);
// openContextMenu(v);
MenuBuilder menu = new MenuBuilder(MessageList.this);
menu.add("something");
new MenuPopupHelper(MessageList.this, menu, v).show();
}
};

View File

@ -0,0 +1,36 @@
package com.fsck.k9.view;
import com.actionbarsherlock.internal.view.View_HasStateListenerSupport;
import com.actionbarsherlock.internal.view.View_OnAttachStateChangeListener;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageButton;
public class ImageButtonAnchor extends ImageButton implements View_HasStateListenerSupport {
public ImageButtonAnchor(Context context) {
super(context);
}
public ImageButtonAnchor(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ImageButtonAnchor(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void addOnAttachStateChangeListener(View_OnAttachStateChangeListener listener) {
// TODO Auto-generated method stub
}
@Override
public void removeOnAttachStateChangeListener(View_OnAttachStateChangeListener listener) {
// TODO Auto-generated method stub
}
}