From a4601316cacc2a43f86a592e63aeeb46afb17ef6 Mon Sep 17 00:00:00 2001 From: Mark Struchkov Date: Fri, 17 May 2019 00:32:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=B5=D0=BD=D1=83=D0=B6=D0=BD=D0=BE=D0=B3=D0=BE?= =?UTF-8?q?=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vkbot/core/keyboard/KeyBoardService.java | 62 ------------------- 1 file changed, 62 deletions(-) delete mode 100644 src/main/java/org/sadtech/vkbot/core/keyboard/KeyBoardService.java diff --git a/src/main/java/org/sadtech/vkbot/core/keyboard/KeyBoardService.java b/src/main/java/org/sadtech/vkbot/core/keyboard/KeyBoardService.java deleted file mode 100644 index dcecd16..0000000 --- a/src/main/java/org/sadtech/vkbot/core/keyboard/KeyBoardService.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.sadtech.vkbot.core.keyboard; - -import com.vk.api.sdk.objects.messages.*; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -public class KeyBoardService { - - private KeyBoardService() { - throw new IllegalStateException(); - } - - public static Keyboard keyBoardYesNo() { - KeyboardButton yesButton = new KeyboardButton(); - KeyboardButtonAction buttonActionYes = new KeyboardButtonAction(); - buttonActionYes.setLabel("Да"); - buttonActionYes.setType(KeyboardButtonActionType.TEXT); - buttonActionYes.setPayload("{\"button\": \"yes\"}"); - yesButton.setAction(buttonActionYes); - yesButton.setColor(KeyboardButtonColor.POSITIVE); - - KeyboardButton noButton = new KeyboardButton(); - KeyboardButtonAction buttonActionNo = new KeyboardButtonAction(); - buttonActionNo.setLabel("Да"); - buttonActionNo.setType(KeyboardButtonActionType.TEXT); - buttonActionNo.setPayload("{\"button\": \"no\"}"); - noButton.setAction(buttonActionNo); - noButton.setColor(KeyboardButtonColor.NEGATIVE); - - List line1 = new ArrayList<>(); - line1.add(yesButton); - line1.add(noButton); - - Keyboard keyboard = new Keyboard(); - keyboard.setButtons(Collections.singletonList(line1)); - keyboard.setOneTime(true); - return keyboard; - } - - public static Keyboard verticalKeyboard(List labelButtons) { - Keyboard keyBoard = new Keyboard(); - keyBoard.setOneTime(true); - List menu = new ArrayList<>(); - for (String labelButton : labelButtons) { - KeyboardButton button = new KeyboardButton(); - button.setColor(KeyboardButtonColor.DEFAULT); - - KeyboardButtonAction buttonAction = new KeyboardButtonAction(); - buttonAction.setPayload("{\"button\": \"" + labelButton + "\"}"); - buttonAction.setType(KeyboardButtonActionType.TEXT); - buttonAction.setLabel(labelButton); - - button.setAction(buttonAction); - menu.add(button); - } - keyBoard.setButtons(Collections.singletonList(menu)); - return keyBoard; - } -}