-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
DraggableActivity.java
39 lines (32 loc) · 1.41 KB
/
DraggableActivity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.nightonke.boommenusample;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.CompoundButton;
import android.widget.Switch;
import com.nightonke.boommenu.BoomButtons.ButtonPlaceEnum;
import com.nightonke.boommenu.BoomMenuButton;
import com.nightonke.boommenu.ButtonEnum;
import com.nightonke.boommenu.Piece.PiecePlaceEnum;
public class DraggableActivity extends AppCompatActivity {
private BoomMenuButton bmb;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_draggable);
bmb = (BoomMenuButton) findViewById(R.id.bmb);
assert bmb != null;
bmb.setButtonEnum(ButtonEnum.SimpleCircle);
bmb.setPiecePlaceEnum(PiecePlaceEnum.DOT_9_1);
bmb.setButtonPlaceEnum(ButtonPlaceEnum.SC_9_1);
for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++)
bmb.addBuilder(BuilderManager.getSimpleCircleButtonBuilder());
Switch draggableSwitch = (Switch) findViewById(R.id.draggable_switch);
draggableSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
bmb.setDraggable(isChecked);
}
});
draggableSwitch.setChecked(true);
}
}