本文整理汇总了Java中com.nightonke.boommenu.BoomMenuButton类的典型用法代码示例。如果您正苦于以下问题:Java BoomMenuButton类的具体用法?Java BoomMenuButton怎么用?Java BoomMenuButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BoomMenuButton类属于com.nightonke.boommenu包,在下文中一共展示了BoomMenuButton类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initSettingsBoom
import com.nightonke.boommenu.BoomMenuButton; //导入依赖的package包/类
/**
*
*/
private void initSettingsBoom() {
int[] settingsBtns = {R.drawable.ic_backup, R.drawable.ic_recover_wallet, R.drawable.ic_info};
String[] settingsStrs = { "Backup Wallet" , "Recover Wallet", "Info & Credits" };
_settingsBmb = (BoomMenuButton) _act.findViewById(R.id.main_settings_boom);
for (int i = 0; i < _settingsBmb.getButtonPlaceEnum().buttonNumber(); i++) {
_settingsBmb.addBuilder(new HamButton.Builder()
.normalImageRes(settingsBtns[i])
.imagePadding(new Rect(10, 10, 10, 10))
.normalText(settingsStrs[i])
);
}
_settingsBmb.setOnBoomListener(new SettingsBoomListener(_act));
}
示例2: initCircleMenuBoom
import com.nightonke.boommenu.BoomMenuButton; //导入依赖的package包/类
/**
*
*/
private void initCircleMenuBoom() {
int[] boomsButtons = { R.drawable.ic_send, R.drawable.ic_receive};
_bmb = (BoomMenuButton) _act.findViewById(R.id.bmb);
for (int i = 0; i < _bmb.getButtonPlaceEnum().buttonNumber(); i++) {
_bmb.addBuilder(new SimpleCircleButton.Builder()
.normalImageRes(boomsButtons[i])
);
}
_bmb.setOnBoomListener(new MainBoomListener(_act));
}
示例3: onCreate
import com.nightonke.boommenu.BoomMenuButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_operation_mode_result_view);
activity = this;
self = this;
addEventBtn = (BoomMenuButton) findViewById(R.id.add_event_to_timeline_btn);
reactionPerformanceLabel = (TextView) findViewById(R.id.reaction_time_performance_chart);
recyclerTimeLineView = (RecyclerView) findViewById(R.id.recyclerView);
expandImage = (ImageView) findViewById(R.id.expand_icon);
}
示例4: onWindowFocusChanged
import com.nightonke.boommenu.BoomMenuButton; //导入依赖的package包/类
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (isInitialized) return;
isInitialized = true;
Drawable[] subButtonDrawables = new Drawable[3];
int[] drawablesResource = new int[]{
R.drawable.ic_alarm_add_white_36dp,
R.drawable.ic_mic_white_36dp,
R.drawable.ic_note_add_white_36dp
};
int itemCount = 3;
for (int i = 0; i < itemCount; i++)
subButtonDrawables[i] = ContextCompat.getDrawable(this, drawablesResource[i]);
final String[] subButtonTexts = new String[]{getResources().getString(R.string.add_reaction_test), getResources().getString(R.string.add_audio), getResources().getString(R.string.add_event)};
int[][] subButtonColors = new int[3][2];
for (int i = 0; i < itemCount; i++) {
subButtonColors[i][1] = ContextCompat.getColor(this, R.color.colorPrimary);
subButtonColors[i][0] = Util.getInstance().getPressedColor(subButtonColors[i][1]);
}
addEventBtn.init(
subButtonDrawables, // The drawables of images of sub buttons. Can not be null.
subButtonTexts, // The texts of sub buttons, ok to be null.
subButtonColors, // The colors of sub buttons, including pressed-state and normal-state.
ButtonType.HAM, // The button type.
BoomType.LINE, // The boom type.
PlaceType.HAM_3_1, // The place type.
null, // Ease type to move the sub buttons when showing.
null, // Ease type to scale the sub buttons when showing.
null, // Ease type to rotate the sub buttons when showing.
null, // Ease type to move the sub buttons when dismissing.
null, // Ease type to scale the sub buttons when dismissing.
null, // Ease type to rotate the sub buttons when dismissing.
null // Rotation degree.
);
final Activity activity = this;
addEventBtn.setOnSubButtonClickListener(new BoomMenuButton.OnSubButtonClickListener() {
@Override
public void onClick(int buttonIndex) {
//TastyToast.makeText(getApplicationContext(), subButtonTexts[buttonIndex] + " clicked", TastyToast.LENGTH_LONG, TastyToast.SUCCESS);
int addNewReactionTestIndex = 0;
int recordAudioIndex = 1;
int addEventIndex = 2;
if (buttonIndex == recordAudioIndex) {
boolean isAudioRecordAllowed = UtilsRG.permissionAllowed(activity, Manifest.permission.RECORD_AUDIO);
if (isAudioRecordAllowed) {
UtilsRG.info("add audio record has been selected");
openAudioDialog(activity);
} else {
UtilsRG.info("isAudioRecordAllowed = false");
String[] permissions = {Manifest.permission.RECORD_AUDIO, Manifest.permission.WRITE_EXTERNAL_STORAGE};
if (UtilsRG.requestPermission(activity, permissions, AudioRecorder.REQUEST_CODE_RECORD_AUDIO)) {
UtilsRG.startInstalledAppDetailsActivity(activity);
}
}
} else if (buttonIndex == addEventIndex) {
UtilsRG.info("addEventIndex has been selected");
MaterialDialog dialog = initNoteDialog(activity);
initEventTypeSwipeSelector(dialog, activity);
initTimePicker(dialog, activity);
} else if (buttonIndex == addNewReactionTestIndex) {
startIntentNewReactionTest(activity);
}
}
});
}