mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-16 06:25:06 -05:00
Add a helper helper so we can get click events on message list menu items
This commit is contained in:
parent
593569f4ad
commit
d876a16893
33
src/com/fsck/k9/helper/MenuPopup.java
Normal file
33
src/com/fsck/k9/helper/MenuPopup.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
package com.fsck.k9.helper;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import com.actionbarsherlock.internal.view.menu.MenuBuilder;
|
||||||
|
import com.actionbarsherlock.internal.view.menu.MenuPopupHelper;
|
||||||
|
public class MenuPopup extends MenuPopupHelper {
|
||||||
|
|
||||||
|
OnMenuItemClickListener onMenuItemClickListener;
|
||||||
|
|
||||||
|
public MenuPopup(Context context, MenuBuilder menu, View anchorView) {
|
||||||
|
super(context, menu, anchorView);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnMenuItemClickListener(
|
||||||
|
OnMenuItemClickListener onMenuItemClickListener) {
|
||||||
|
this.onMenuItemClickListener = onMenuItemClickListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> parent, View view, int position,
|
||||||
|
long id) {
|
||||||
|
super.onItemClick(parent, view, position, id);
|
||||||
|
if (onMenuItemClickListener != null)
|
||||||
|
onMenuItemClickListener.onMenuItemClick(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnMenuItemClickListener{
|
||||||
|
public void onMenuItemClick(int itemID);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user