Search in sources :

Example 1 with BoomMenuButton

use of com.nightonke.boommenu.BoomMenuButton in project BoomMenu by Nightonke.

the class ListViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list_view);
    ListView listView = (ListView) findViewById(R.id.list_view);
    assert listView != null;
    listView.setAdapter(new MyAdapter());
    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            BoomMenuButton bmb = (BoomMenuButton) view.findViewById(R.id.bmb1);
            bmb.boom();
        }
    });
}
Also used : BoomMenuButton(com.nightonke.boommenu.BoomMenuButton) ListView(android.widget.ListView) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 2 with BoomMenuButton

use of com.nightonke.boommenu.BoomMenuButton in project BoomMenu by Nightonke.

the class ActionBarActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_action_bar);
    ActionBar mActionBar = getSupportActionBar();
    assert mActionBar != null;
    mActionBar.setDisplayShowHomeEnabled(false);
    mActionBar.setDisplayShowTitleEnabled(false);
    LayoutInflater mInflater = LayoutInflater.from(this);
    View actionBar = mInflater.inflate(R.layout.custom_actionbar, null);
    TextView mTitleTextView = (TextView) actionBar.findViewById(R.id.title_text);
    mTitleTextView.setText(R.string.app_name);
    mActionBar.setCustomView(actionBar);
    mActionBar.setDisplayShowCustomEnabled(true);
    ((Toolbar) actionBar.getParent()).setContentInsetsAbsolute(0, 0);
    BoomMenuButton leftBmb = (BoomMenuButton) actionBar.findViewById(R.id.action_bar_left_bmb);
    BoomMenuButton rightBmb = (BoomMenuButton) actionBar.findViewById(R.id.action_bar_right_bmb);
    leftBmb.setButtonEnum(ButtonEnum.TextOutsideCircle);
    leftBmb.setPiecePlaceEnum(PiecePlaceEnum.DOT_9_1);
    leftBmb.setButtonPlaceEnum(ButtonPlaceEnum.SC_9_1);
    for (int i = 0; i < leftBmb.getPiecePlaceEnum().pieceNumber(); i++) leftBmb.addBuilder(BuilderManager.getTextOutsideCircleButtonBuilderWithDifferentPieceColor());
    rightBmb.setButtonEnum(ButtonEnum.Ham);
    rightBmb.setPiecePlaceEnum(PiecePlaceEnum.HAM_4);
    rightBmb.setButtonPlaceEnum(ButtonPlaceEnum.HAM_4);
    for (int i = 0; i < rightBmb.getPiecePlaceEnum().pieceNumber(); i++) rightBmb.addBuilder(BuilderManager.getHamButtonBuilderWithDifferentPieceColor());
}
Also used : BoomMenuButton(com.nightonke.boommenu.BoomMenuButton) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

Example 3 with BoomMenuButton

use of com.nightonke.boommenu.BoomMenuButton in project BoomMenu by Nightonke.

the class BMBFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View fragment = inflater.inflate(R.layout.fragment_bmb, container, false);
    TextView text = (TextView) fragment.findViewById(R.id.text);
    text.setText(String.valueOf(position));
    BoomMenuButton bmb1 = (BoomMenuButton) fragment.findViewById(R.id.bmb1);
    for (int i = 0; i < bmb1.getPiecePlaceEnum().pieceNumber(); i++) bmb1.addBuilder(BuilderManager.getSimpleCircleButtonBuilder());
    BoomMenuButton bmb2 = (BoomMenuButton) fragment.findViewById(R.id.bmb2);
    for (int i = 0; i < bmb2.getPiecePlaceEnum().pieceNumber(); i++) bmb2.addBuilder(BuilderManager.getSimpleCircleButtonBuilder());
    return fragment;
}
Also used : BoomMenuButton(com.nightonke.boommenu.BoomMenuButton) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

View (android.view.View)3 TextView (android.widget.TextView)3 BoomMenuButton (com.nightonke.boommenu.BoomMenuButton)3 ActionBar (android.support.v7.app.ActionBar)1 Toolbar (android.support.v7.widget.Toolbar)1 LayoutInflater (android.view.LayoutInflater)1 AdapterView (android.widget.AdapterView)1 ListView (android.widget.ListView)1