Search in sources :

Example 1 with MongolMenuItem

use of net.studymongolian.mongollibrary.MongolMenuItem in project mongol-library by suragch.

the class MongolMenuActivity method onNoIconsClick.

public void onNoIconsClick(View view) {
    MongolMenu menu = new MongolMenu(this);
    menu.add(new MongolMenuItem("ᠨᠢᠭᠡ"));
    menu.add(new MongolMenuItem("ᠬᠤᠶᠠᠷ"));
    menu.add(new MongolMenuItem("ᠭᠤᠷᠪᠠ"));
    menu.setOnMenuItemClickListener(new MongolMenu.OnMenuItemClickListener() {

        public boolean onMenuItemClick(MongolMenuItem item) {
            MongolToast.makeText(MongolMenuActivity.this, item.getTitle(), MongolToast.LENGTH_SHORT).show();
            return true;
        }
    });
    menu.showAsDropDown(view, 0, 0);
}
Also used : MongolMenu(net.studymongolian.mongollibrary.MongolMenu) MongolMenuItem(net.studymongolian.mongollibrary.MongolMenuItem)

Example 2 with MongolMenuItem

use of net.studymongolian.mongollibrary.MongolMenuItem in project mongol-library by suragch.

the class MongolMenuActivity method getMenu.

private MongolMenu getMenu() {
    MongolMenu menu = new MongolMenu(this);
    menu.add(new MongolMenuItem("ᠨᠢᠭᠡ", R.drawable.ic_sun));
    menu.add(new MongolMenuItem("ᠬᠤᠶᠠᠷ", R.drawable.ic_moon));
    menu.add(new MongolMenuItem("ᠭᠤᠷᠪᠠ", R.drawable.ic_star));
    menu.setOnMenuItemClickListener(new MongolMenu.OnMenuItemClickListener() {

        public boolean onMenuItemClick(MongolMenuItem item) {
            MongolToast.makeText(MongolMenuActivity.this, item.getTitle(), MongolToast.LENGTH_SHORT).show();
            return true;
        }
    });
    return menu;
}
Also used : MongolMenu(net.studymongolian.mongollibrary.MongolMenu) MongolMenuItem(net.studymongolian.mongollibrary.MongolMenuItem)

Example 3 with MongolMenuItem

use of net.studymongolian.mongollibrary.MongolMenuItem in project mongol-library by suragch.

the class MongolEditTextActivity method getMongolEditTextContextMenu.

@Override
public MongolMenu getMongolEditTextContextMenu(MongolEditText met) {
    // This is a demo menu only
    // You will need to implement your own functionality
    // See the MongolEditText source code for examples
    MongolMenu menu = new MongolMenu(this);
    menu.add(new MongolMenuItem("ᠨᠢᠭᠡ", R.drawable.ic_sun));
    menu.add(new MongolMenuItem("ᠬᠤᠶᠠᠷ", R.drawable.ic_moon));
    menu.add(new MongolMenuItem("ᠭᠤᠷᠪᠠ", R.drawable.ic_star));
    menu.setOnMenuItemClickListener(new MongolMenu.OnMenuItemClickListener() {

        public boolean onMenuItemClick(MongolMenuItem item) {
            MongolToast.makeText(MongolEditTextActivity.this, item.getTitle(), MongolToast.LENGTH_SHORT).show();
            return true;
        }
    });
    return menu;
}
Also used : MongolMenu(net.studymongolian.mongollibrary.MongolMenu) MongolMenuItem(net.studymongolian.mongollibrary.MongolMenuItem)

Aggregations

MongolMenu (net.studymongolian.mongollibrary.MongolMenu)3 MongolMenuItem (net.studymongolian.mongollibrary.MongolMenuItem)3