List of usage examples for android.inputmethodservice Keyboard Keyboard
public Keyboard(Context context, int xmlLayoutResId)
From source file:com.smapley.vehicle.utils.LicenseKeyboardUtil.java
public LicenseKeyboardUtil(Activity ctx, EditText edits[]) { this.edits = edits; k1 = new Keyboard(ctx, R.xml.province_short_keyboard); k2 = new Keyboard(ctx, R.xml.lettersanddigit_keyboard); keyboardView = (KeyboardView) ((Activity) ctx).findViewById(R.id.set_keyboard); keyboardView.setKeyboard(k1);//from w w w . j ava 2s .c o m keyboardView.setEnabled(true); //true,popup?<key>android:popupCharacters="" keyboardView.setPreviewEnabled(false); //? keyboardView.setOnKeyboardActionListener(listener); provinceShort = new String[] { "", "", "", "?", "", "", "", "?", "", "", "?", "", "", "", "", "", "", "", "", "", "?", "?", "", "", "?", "", "", "?", "?", "", "", "", "?", "?" }; letterAndDigit = new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "A", "S", "D", "F", "G", "H", "J", "K", "L", "Z", "X", "C", "V", "B", "N", "M" }; if (ArrayUtils.isNotEmpty(edits)) { for (int i = 0; i < edits.length; i++) { setSoftKeyboradHide(ctx, edits[i]); edits[i].setCursorVisible(false); int finalI = i; edits[i].setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { currentEditText = finalI; if (currentEditText < 1) { //?? keyboardView.setKeyboard(k1); } else { keyboardView.setKeyboard(k2); } showKeyboard(); v.setBackgroundColor(ContextCompat.getColor(ctx, R.color.cyan2)); } else { v.setBackgroundColor(ContextCompat.getColor(ctx, R.color.gray3)); } } }); } } }
From source file:com.magestore.app.pos.SalesActivity.java
@Override protected void initLayout() { Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_category); toolbar_order = (Toolbar) findViewById(R.id.toolbar_order); rl_customer = (RelativeLayout) toolbar_order.findViewById(R.id.rl_customer); rl_change_customer = (ImageButton) toolbar_order.findViewById(R.id.rl_change_customer); initToolbarMenu(toolbar_order);//from ww w .ja v a2 s . c o m // Nt tab to n hng mi FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("MagestoreStatementAction", null).show(); } }); // Xc nh l 2 pane hay 1 pane if (findViewById(R.id.toolbar_category) != null) { mTwoPane = true; } // product list mProductListPanel = (ProductListPanel) findViewById(R.id.product_list_panel); // check out list & detail mCheckoutListPanel = (CheckoutListPanel) findViewById(R.id.checkout_list_panel); mCheckoutDetailPanel = (CheckoutDetailPanel) findViewById(R.id.checkout_detail_panel); // order success panel mCheckoutSuccessPanel = (CheckoutSuccessPanel) findViewById(R.id.checkout_success_panel); // checkout payment webview mCheckoutPaymentWebviewPanel = (CheckoutPaymentWebviewPanel) findViewById(R.id.checkout_webview_panel); // cart item panel mCartItemListPanel = (CartItemListPanel) mCheckoutListPanel.findViewById(R.id.order_item_panel); mCartItemDetailPanel = new CartItemDetailPanel(this.getContext()); mProductOptionPanel = new ProductOptionPanel(getContext()); mCheckoutCustomSalePanel = new CheckoutCustomSalePanel(getContext()); mCartOrderListPanel = (CartOrderListPanel) mCheckoutListPanel.findViewById(R.id.checkout_item_panel); // shipping list panel mCheckoutShippingListPanel = (CheckoutShippingListPanel) mCheckoutDetailPanel .findViewById(R.id.checkout_shipping_list_panel); // payment list panel mCheckoutPaymentListPanel = (CheckoutPaymentListPanel) mCheckoutDetailPanel .findViewById(R.id.checkout_payment_list_panel); // payment thod panel mPaymentMethodListPanel = (PaymentMethodListPanel) mCheckoutDetailPanel .findViewById(R.id.payment_method_list_panel); // payment creditcard mCheckoutPaymentCreditCardPanel = (CheckoutPaymentCreditCardPanel) mCheckoutDetailPanel .findViewById(R.id.checkout_payment_credit_card); // shipping address panel mCheckoutAddressListPanel = (CheckoutAddressListPanel) mCheckoutDetailPanel .findViewById(R.id.address_list_panel); // add payment panel mCheckoutAddPaymentPanel = new CheckoutAddPaymentPanel(getContext()); // category list panel mCategoryListPanel = (CategoryListPanel) mProductListPanel.findViewById(R.id.category); mSpinnerListPanel = (SpinnerListPanel) findViewById(R.id.panel_category); // plugins giftcard mPluginGiftCardPanel = (PluginGiftCardPanel) mCheckoutDetailPanel.findViewById(R.id.rl_gift_card); mPluginGiftCardListPanel = (PluginGiftCardListPanel) mPluginGiftCardPanel .findViewById(R.id.gift_card_list_panel); // plugin reward point mPluginRewardPointPanel = (PluginRewardPointPanel) mCheckoutDetailPanel.findViewById(R.id.rl_reward_point); // plugin store credit mPluginStoreCreditPanel = (PluginStoreCreditPanel) mCheckoutDetailPanel.findViewById(R.id.rl_store_credit); // config print ConfigUtil.setTypePrint(getString(R.string.print_type_star_print)); PrinterSetting printerSetting = new PrinterSetting(getContext()); int print_type = printerSetting.getPrintArea(); if (print_type == 0) { ConfigUtil.setStarPrintArea(384); } else if (print_type == 1) { ConfigUtil.setStarPrintArea(576); } else { ConfigUtil.setStarPrintArea(832); } ConfigUtil.setOpenCash(printerSetting.getOpenCashAfterPrint()); ConfigUtil.setAutoPrint(printerSetting.getAutoPrint()); // keyboard ll_custom_keyboard = (LinearLayout) findViewById(R.id.ll_custom_keyboard); Keyboard mKeyboard = new Keyboard(this, R.xml.keyboard_checkout); mKeyboardView = (KeyboardView) findViewById(R.id.keyboardview); // Attach the keyboard to the view mKeyboardView.setKeyboard(mKeyboard); // Install the key handler // mKeyboardView.setOnKeyboardActionListener(mOnKeyboardActionListener); // Hide the standard keyboard initially getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); // Dev license dev_license = (TextView) findViewById(R.id.dev_license); checkDevLicense(); }
From source file:com.freerdp.freerdpcore.presentation.SessionActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // show status bar or make fullscreen? if (GlobalSettings.getHideStatusBar()) getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); this.setContentView(R.layout.session); rladvertising = (AdvertisingView) findViewById(R.id.advertising); rladvertising.startImagePlay();/*from ww w . j a v a2 s .c o m*/ final View activityRootView = findViewById(R.id.session_root_view); // activityRootView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { screen_width = activityRootView.getWidth(); screen_height = activityRootView.getHeight(); if (!sessionRunning && getIntent() != null) { thread = new Thread(SessionActivity.this); thread.start(); sessionRunning = true; } } }); sessionView = (SessionView) findViewById(R.id.sessionView); sessionView.setScaleGestureDetector(new ScaleGestureDetector(this, new PinchZoomListener())); sessionView.setSessionViewListener(this); sessionView.requestFocus(); touchPointerView = (TouchPointerView) findViewById(R.id.touchPointerView); touchPointerView.setTouchPointerListener(this); keyboardMapper = new KeyboardMapper(); keyboardMapper.init(this); keyboardMapper.reset(this); modifiersKeyboard = new Keyboard(getApplicationContext(), R.xml.modifiers_keyboard); specialkeysKeyboard = new Keyboard(getApplicationContext(), R.xml.specialkeys_keyboard); numpadKeyboard = new Keyboard(getApplicationContext(), R.xml.numpad_keyboard); cursorKeyboard = new Keyboard(getApplicationContext(), R.xml.cursor_keyboard); // hide keyboard below the sessionView keyboardView = (KeyboardView) findViewById(R.id.extended_keyboard); keyboardView.setKeyboard(specialkeysKeyboard); keyboardView.setOnKeyboardActionListener(this); modifiersKeyboardView = (KeyboardView) findViewById(R.id.extended_keyboard_header); modifiersKeyboardView.setKeyboard(modifiersKeyboard); modifiersKeyboardView.setOnKeyboardActionListener(this); scrollView = (ScrollView2D) findViewById(R.id.sessionScrollView); scrollView.setScrollViewListener(this); uiHandler = new UIHandler(); libFreeRDPBroadcastReceiver = new LibFreeRDPBroadcastReceiver(); zoomControls = (ZoomControls) findViewById(R.id.zoomControls); zoomControls.hide(); zoomControls.setOnZoomInClickListener(new View.OnClickListener() { @Override public void onClick(View v) { resetZoomControlsAutoHideTimeout(); zoomControls.setIsZoomInEnabled(sessionView.zoomIn(ZOOMING_STEP)); zoomControls.setIsZoomOutEnabled(true); } }); zoomControls.setOnZoomOutClickListener(new View.OnClickListener() { @Override public void onClick(View v) { resetZoomControlsAutoHideTimeout(); zoomControls.setIsZoomOutEnabled(sessionView.zoomOut(ZOOMING_STEP)); zoomControls.setIsZoomInEnabled(true); } }); toggleMouseButtons = false; createDialogs(); // register freerdp events broadcast receiver IntentFilter filter = new IntentFilter(); filter.addAction(GlobalApp.ACTION_EVENT_FREERDP); registerReceiver(libFreeRDPBroadcastReceiver, filter); mClipboardManager = ClipboardManagerProxy.getClipboardManager(this); mClipboardManager.addClipboardChangedListener(this); }
From source file:com.freerdp.freerdpcore.presentation.SessionActivity.java
@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // reload keyboard resources (changed from landscape) modifiersKeyboard = new Keyboard(getApplicationContext(), R.xml.modifiers_keyboard); specialkeysKeyboard = new Keyboard(getApplicationContext(), R.xml.specialkeys_keyboard); numpadKeyboard = new Keyboard(getApplicationContext(), R.xml.numpad_keyboard); cursorKeyboard = new Keyboard(getApplicationContext(), R.xml.cursor_keyboard); keyboardView.setKeyboard(specialkeysKeyboard); modifiersKeyboardView.setKeyboard(modifiersKeyboard); }
From source file:keyboard.ecloga.com.eclogakeyboard.EclogaKeyboard.java
public void onRotate() { Display display = ((WindowManager) this.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); int rotation = display.getRotation(); if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) { orient = "portrait"; } else if (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) { orient = "landscape"; }/* w w w . ja va2 s . c o m*/ if (orient.equals("portrait")) { if (lang.equals("prilang")) { keyboard = prilang; } else if (lang.equals("seclang")) { keyboard = seclang; } slideAnimation(); kv.setKeyboard(keyboard); doubleUp = 1; screen = 1; caps = true; if (allCaps) { capsLock = false; } kv.invalidateAllKeys(); keyboard.setShifted(caps); kv.invalidateAllKeys(); } else if (orient.equals("landscape")) { switch (screen) { case 1: if (lang.equals("prilang")) { keyboard = prilang_landscape; } else if (lang.equals("seclang")) { keyboard = seclang_landscape; } break; case 2: if (number == 1) { keyboard = new Keyboard(this, R.xml.numeric_landscape); } else if (number == 2) { keyboard = new Keyboard(this, R.xml.symbols_landscape); } break; } slideAnimation(); kv.setKeyboard(keyboard); doubleUp = 1; screen = 1; caps = true; if (allCaps) { capsLock = false; } kv.invalidateAllKeys(); keyboard.setShifted(caps); kv.invalidateAllKeys(); } }
From source file:keyboard.ecloga.com.eclogakeyboard.EclogaKeyboard.java
@Override public void onKey(int primaryCode, int[] keyCodes) { final InputConnection ic = getCurrentInputConnection(); playClick();/*from w w w.j a va 2s. c o m*/ printChar = true; if (primaryCode != 126 && primaryCode != -5 && primaryCode != -1 && primaryCode != EmojiKeyboardView.KEYCODE_EMOJI_1 && primaryCode != EmojiKeyboardView.KEYCODE_EMOJI_2 && primaryCode != EmojiKeyboardView.KEYCODE_EMOJI_3 && primaryCode != EmojiKeyboardView.KEYCODE_EMOJI_4 && primaryCode != EmojiKeyboardView.KEYCODE_EMOJI_5) { keyPressCounter++; if (keyPressCounter > 100 && keyPressCounter <= 1000 && keypresscounter1.equals("false")) { NotificationManager notif = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); Notification notify = new Notification(R.drawable.notify, "Ecloga Keyboard", System.currentTimeMillis()); PendingIntent pending = PendingIntent.getActivity(this, 0, new Intent(this, Home.class), 0); notify.setLatestEventInfo(getApplicationContext(), "Warming up!", "Type more than 100 characters", pending); notif.notify(0, notify); Preferences.setDefaults("keypresscounter1", "true", getApplicationContext()); } else if (keyPressCounter > 10000 && keyPressCounter <= 10000 && keypresscounter2.equals("false")) { NotificationManager notif = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); Notification notify = new Notification(R.drawable.notify, "Ecloga Keyboard", System.currentTimeMillis()); PendingIntent pending = PendingIntent.getActivity(this, 0, new Intent(this, Home.class), 0); notify.setLatestEventInfo(getApplicationContext(), "Keep it up!", "Type more than 1000 characters", pending); notif.notify(0, notify); Preferences.setDefaults("keypresscounter2", "true", getApplicationContext()); } else if (keyPressCounter > 10000 && keypresscounter3.equals("false")) { NotificationManager notif = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); Notification notify = new Notification(R.drawable.notify, "Ecloga Keyboard", System.currentTimeMillis()); PendingIntent pending = PendingIntent.getActivity(this, 0, new Intent(this, Home.class), 0); notify.setLatestEventInfo(getApplicationContext(), "Typing master!", "Type more than 10000 characters", pending); notif.notify(0, notify); Preferences.setDefaults("keypresscounter3", "true", getApplicationContext()); } Preferences.setDefaults("keypresses", String.valueOf(keyPressCounter), getApplicationContext()); } switch (primaryCode) { case 58: ic.commitText(":", 1); if (autoSpacing) { ic.commitText(" ", 1); } break; case 59: ic.commitText(";", 1); if (autoSpacing) { ic.commitText(" ", 1); } break; case 33: ic.commitText("!", 1); if (autoSpacing) { ic.commitText(" ", 1); } if (autoCapitalize) { caps = true; keyboard.setShifted(caps); kv.invalidateAllKeys(); printChar = false; } break; case 63: ic.commitText("?", 1); if (autoSpacing) { ic.commitText(" ", 1); } if (autoCapitalize) { caps = true; keyboard.setShifted(caps); kv.invalidateAllKeys(); printChar = false; } break; case -5: if (lang.equals("seclang")) { if (orient.equals("portrait")) { keyboard = prilang; } else if (orient.equals("landscape")) { keyboard = prilang_landscape; } kv.setKeyboard(keyboard); kv.invalidateAllKeys(); lang = "prilang"; } else if (lang.equals("prilang")) { if (orient.equals("portrait")) { keyboard = seclang; } else if (orient.equals("landscape")) { keyboard = seclang_landscape; } kv.setKeyboard(keyboard); kv.invalidateAllKeys(); lang = "seclang"; } break; case 32: ic.commitText(" ", 1); if (autoCapitalize) { if (String.valueOf(ic.getTextBeforeCursor(2, 0)).equals(". ")) { caps = true; keyboard.setShifted(caps); kv.invalidateAllKeys(); printChar = false; } } break; case 126: ic.deleteSurroundingText(1, 0); if (autoCapitalize) { if (String.valueOf(ic.getTextBeforeCursor(1, 0)).equals(".") || String.valueOf(ic.getTextBeforeCursor(2, 0)).equals(". ") || String.valueOf(ic.getTextBeforeCursor(2, 0)).equals("")) { caps = true; keyboard.setShifted(caps); kv.invalidateAllKeys(); printChar = false; } } break; case 44: ic.commitText(",", 1); if (autoSpacing) { ic.commitText(" ", 1); } break; case 46: ic.commitText(".", 1); if (autoSpacing) { ic.commitText(" ", 1); } if (autoCapitalize) { caps = true; keyboard.setShifted(caps); kv.invalidateAllKeys(); printChar = false; } break; case -1: ic.performEditorAction(EditorInfo.IME_ACTION_GO); break; case EmojiKeyboardView.KEYCODE_EMOJI_1: keyboard = new Keyboard(this, R.xml.emoji_a1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); emoji = 1; eScreen = 1; break; case EmojiKeyboardView.KEYCODE_EMOJI_2: keyboard = new Keyboard(this, R.xml.emoji_b1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); emoji = 2; eScreen = 1; break; case EmojiKeyboardView.KEYCODE_EMOJI_3: keyboard = new Keyboard(this, R.xml.emoji_c1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); emoji = 3; eScreen = 1; break; case EmojiKeyboardView.KEYCODE_EMOJI_4: keyboard = new Keyboard(this, R.xml.emoji_d1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); emoji = 4; eScreen = 1; break; case EmojiKeyboardView.KEYCODE_EMOJI_5: keyboard = new Keyboard(this, R.xml.emoji_e1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); emoji = 5; eScreen = 1; break; default: char code = (char) primaryCode; if (allCaps) { if (Character.isLetter(code) && capsLock) { code = Character.toLowerCase(code); } else if (Character.isLetter(code) && !capsLock) { code = Character.toUpperCase(code); } } else { if (Character.isLetter(code) && caps) { code = Character.toUpperCase(code); } } String character = String.valueOf(code); ic.commitText(character, 1); } if (printedDifferent) { ic.deleteSurroundingText(1, 0); } if (printedDot) { ic.deleteSurroundingText(1, 0); if (autoCapitalize) { caps = true; keyboard.setShifted(caps); kv.invalidateAllKeys(); printChar = false; } } if (doubleUp == 2) { capsChange(); } else { changeCaps(); } }
From source file:keyboard.ecloga.com.eclogakeyboard.EclogaKeyboard.java
public void switchEmojiUp() { switch (emoji) { case 1:// www . ja v a2s. co m switch (eScreen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_a4); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 4; break; case 2: keyboard = new Keyboard(this, R.xml.emoji_a1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 1; break; case 3: keyboard = new Keyboard(this, R.xml.emoji_a2); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 2; break; case 4: keyboard = new Keyboard(this, R.xml.emoji_a3); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 3; break; } break; case 2: switch (eScreen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_b2); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 2; break; case 2: keyboard = new Keyboard(this, R.xml.emoji_b1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 1; break; } break; case 3: switch (eScreen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_c5); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 5; break; case 2: keyboard = new Keyboard(this, R.xml.emoji_c1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 1; break; case 3: keyboard = new Keyboard(this, R.xml.emoji_c2); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 2; break; case 4: keyboard = new Keyboard(this, R.xml.emoji_c3); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 3; break; case 5: keyboard = new Keyboard(this, R.xml.emoji_c4); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 4; break; } break; case 4: switch (eScreen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_d3); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 3; break; case 2: keyboard = new Keyboard(this, R.xml.emoji_d1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 1; break; case 3: keyboard = new Keyboard(this, R.xml.emoji_d2); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 2; break; } break; case 5: switch (eScreen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_e4); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 4; break; case 2: keyboard = new Keyboard(this, R.xml.emoji_e1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 1; break; case 3: keyboard = new Keyboard(this, R.xml.emoji_e2); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 2; break; case 4: keyboard = new Keyboard(this, R.xml.emoji_e3); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 3; break; } } }
From source file:keyboard.ecloga.com.eclogakeyboard.EclogaKeyboard.java
public void switchEmojiDown() { switch (emoji) { case 1://from w w w .j a va2s . c om switch (eScreen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_a2); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 2; break; case 2: keyboard = new Keyboard(this, R.xml.emoji_a3); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 3; break; case 3: keyboard = new Keyboard(this, R.xml.emoji_a4); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 4; break; case 4: keyboard = new Keyboard(this, R.xml.emoji_a1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 1; break; } break; case 2: switch (eScreen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_b2); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 2; break; case 2: keyboard = new Keyboard(this, R.xml.emoji_b1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 1; break; } break; case 3: switch (eScreen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_c2); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 2; break; case 2: keyboard = new Keyboard(this, R.xml.emoji_c3); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 3; break; case 3: keyboard = new Keyboard(this, R.xml.emoji_c4); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 4; break; case 4: keyboard = new Keyboard(this, R.xml.emoji_c5); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 5; break; case 5: keyboard = new Keyboard(this, R.xml.emoji_c1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 1; break; } break; case 4: switch (eScreen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_d2); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 2; break; case 2: keyboard = new Keyboard(this, R.xml.emoji_d3); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 3; break; case 3: keyboard = new Keyboard(this, R.xml.emoji_d1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 1; break; } break; case 5: switch (eScreen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_e2); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 2; break; case 2: keyboard = new Keyboard(this, R.xml.emoji_e3); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 3; break; case 3: keyboard = new Keyboard(this, R.xml.emoji_e4); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 4; break; case 4: keyboard = new Keyboard(this, R.xml.emoji_e1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); eScreen = 1; break; } } }
From source file:keyboard.ecloga.com.eclogakeyboard.EclogaKeyboard.java
public void onSwipeDown() { if (allCaps) { caps = true;/*from w w w. ja v a2s . c o m*/ capsLock = true; } else { caps = false; } keyboard.setShifted(caps); kv.invalidateAllKeys(); printChar = true; doubleUp = 0; if (screen == 3) { switchEmojiDown(); } else if (screen == 2) { switch (number) { case 1: if (orient.equals("portrait")) { keyboard = new Keyboard(this, R.xml.symbols); } else if (orient.equals("landscape")) { keyboard = new Keyboard(this, R.xml.symbols_landscape); } kv.setKeyboard(keyboard); kv.invalidateAllKeys(); number = 2; break; case 2: if (orient.equals("portrait")) { keyboard = new Keyboard(this, R.xml.numeric); } else if (orient.equals("landscape")) { keyboard = new Keyboard(this, R.xml.numeric_landscape); } kv.setKeyboard(keyboard); kv.invalidateAllKeys(); number = 1; break; } } }
From source file:keyboard.ecloga.com.eclogakeyboard.EclogaKeyboard.java
public void onSwipeLeft() { slideAnimation();//from w ww. java 2 s . c om switch (screen) { case 1: keyboard = new Keyboard(this, R.xml.emoji_a1); kv.setKeyboard(keyboard); kv.invalidateAllKeys(); screen = 3; break; case 2: if (orient.equals("portrait")) { keyboard = prilang; } else if (orient.equals("landscape")) { keyboard = prilang_landscape; } kv.setKeyboard(keyboard); kv.invalidateAllKeys(); screen = 1; break; case 3: if (orient.equals("portrait")) { keyboard = new Keyboard(this, R.xml.numeric); } else if (orient.equals("landscape")) { keyboard = new Keyboard(this, R.xml.numeric_landscape); } kv.setKeyboard(keyboard); kv.invalidateAllKeys(); if (caps) { caps = true; kv.setShifted(caps); kv.invalidateAllKeys(); } else { if (allCaps) { caps = true; } else { caps = false; } kv.setShifted(caps); kv.invalidateAllKeys(); } screen = 2; number = 1; break; } }