Skip to content

Commit

Permalink
chore: Remove Keyboard plugin (ionic-team#3636)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Oct 6, 2020
1 parent 50bc12f commit 04917af
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 617 deletions.
2 changes: 0 additions & 2 deletions android/capacitor/src/main/java/com/getcapacitor/Bridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import android.webkit.WebView;
import com.getcapacitor.plugin.App;
import com.getcapacitor.plugin.Geolocation;
import com.getcapacitor.plugin.Keyboard;
import com.getcapacitor.plugin.LocalNotifications;
import com.getcapacitor.plugin.PushNotifications;
import com.getcapacitor.plugin.SplashScreen;
Expand Down Expand Up @@ -383,7 +382,6 @@ private void registerAllPlugins() {
this.registerPlugin(BackgroundTask.class);
this.registerPlugin(LocalNotifications.class);
this.registerPlugin(Geolocation.class);
this.registerPlugin(Keyboard.class);
this.registerPlugin(PushNotifications.class);
this.registerPlugin(SplashScreen.class);
this.registerPlugin(com.getcapacitor.plugin.WebView.class);
Expand Down
155 changes: 0 additions & 155 deletions android/capacitor/src/main/java/com/getcapacitor/plugin/Keyboard.java

This file was deleted.

77 changes: 0 additions & 77 deletions core/src/core-plugin-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export interface PluginRegistry {
App: AppPlugin;
BackgroundTask: BackgroundTaskPlugin;
Geolocation: GeolocationPlugin;
Keyboard: KeyboardPlugin;
LocalNotifications: LocalNotificationsPlugin;
PushNotifications: PushNotificationsPlugin;
SplashScreen: SplashScreenPlugin;
Expand Down Expand Up @@ -261,82 +260,6 @@ export type GeolocationWatchCallback = (

//

export interface KeyboardPlugin extends Plugin {
/**
* Show the keyboard. This method is alpha and may have issues
*/
show(): Promise<void>;
/**
* Hide the keyboard.
*/
hide(): Promise<void>;
/**
* Set whether the accessory bar should be visible on the keyboard. We recommend disabling
* the accessory bar for short forms (login, signup, etc.) to provide a cleaner UI
*/
setAccessoryBarVisible(options: { isVisible: boolean }): Promise<void>;
/**
* Programmatically enable or disable the WebView scroll
*/
setScroll(options: { isDisabled: boolean }): Promise<void>;
/**
* Programmatically set the keyboard style
*/
setStyle(options: KeyboardStyleOptions): Promise<void>;
/**
* Programmatically set the resize mode
*/
setResizeMode(options: KeyboardResizeOptions): Promise<void>;

addListener(
eventName: 'keyboardWillShow',
listenerFunc: (info: KeyboardInfo) => void,
): PluginListenerHandle;
addListener(
eventName: 'keyboardDidShow',
listenerFunc: (info: KeyboardInfo) => void,
): PluginListenerHandle;
addListener(
eventName: 'keyboardWillHide',
listenerFunc: () => void,
): PluginListenerHandle;
addListener(
eventName: 'keyboardDidHide',
listenerFunc: () => void,
): PluginListenerHandle;

/**
* Remove all native listeners for this plugin
*/
removeAllListeners(): void;
}

export interface KeyboardInfo {
keyboardHeight: number;
}

export interface KeyboardStyleOptions {
style: KeyboardStyle;
}

export enum KeyboardStyle {
Dark = 'DARK',
Light = 'LIGHT',
}

export interface KeyboardResizeOptions {
mode: KeyboardResize;
}

export enum KeyboardResize {
Body = 'body',
Ionic = 'ionic',
Native = 'native',
None = 'none',
}

//

export interface LocalNotificationRequest {
id: string;
}
Expand Down
4 changes: 4 additions & 0 deletions ios/Capacitor/Capacitor/CAPBridgeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public class CAPBridgeViewController: UIViewController, CAPBridgeDelegate, WKUID

bridge = CAPBridge(self, messageHandler, capConfig, specifiedScheme)

if let scrollEnabled = bridge!.config.getValue("ios.scrollEnabled") as? Bool {
webView?.scrollView.isScrollEnabled = scrollEnabled
}

if let backgroundColor = (bridge!.config.getValue("ios.backgroundColor") as? String) ?? (bridge!.config.getValue("backgroundColor") as? String) {
webView?.backgroundColor = UIColor.capacitor.color(fromHex: backgroundColor)
webView?.scrollView.backgroundColor = UIColor.capacitor.color(fromHex: backgroundColor)
Expand Down
10 changes: 0 additions & 10 deletions ios/Capacitor/Capacitor/Plugins/DefaultPlugins.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@
CAP_PLUGIN_METHOD(clearWatch, CAPPluginReturnPromise);
)

CAP_PLUGIN(CAPKeyboard, "Keyboard",
CAP_PLUGIN_METHOD(show, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(hide, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(setAccessoryBarVisible, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(setStyle, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(setResizeMode, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(setScroll, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnNone);
)

CAP_PLUGIN(CAPLocalNotificationsPlugin, "LocalNotifications",
CAP_PLUGIN_METHOD(schedule, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(requestPermission, CAPPluginReturnPromise);
Expand Down
11 changes: 0 additions & 11 deletions ios/Capacitor/Capacitor/Plugins/Keyboard.h

This file was deleted.

Loading

0 comments on commit 04917af

Please sign in to comment.