Java Code Examples for org.apache.cordova.LOG#v()
The following examples show how to use
org.apache.cordova.LOG#v() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StatusBar.java From app-icon with MIT License | 6 votes |
/** * Sets the context of the Command. This can then be used to do things like * get file paths associated with the Activity. * * @param cordova The context of the main Activity. * @param webView The CordovaWebView Cordova is running in. */ @Override public void initialize(final CordovaInterface cordova, CordovaWebView webView) { LOG.v(TAG, "StatusBar: initialization"); super.initialize(cordova, webView); this.cordova.getActivity().runOnUiThread(new Runnable() { @Override public void run() { // Clear flag FLAG_FORCE_NOT_FULLSCREEN which is set initially // by the Cordova. Window window = cordova.getActivity().getWindow(); window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); // Read 'StatusBarBackgroundColor' from config.xml, default is #000000. setStatusBarBackgroundColor(preferences.getString("StatusBarBackgroundColor", "#000000")); } }); }
Example 2
Source File: LinearLayoutSoftKeyboardDetect.java From IoTgo_Android_App with MIT License | 4 votes |
@Override /** * Start listening to new measurement events. Fire events when the height * gets smaller fire a show keyboard event and when height gets bigger fire * a hide keyboard event. * * Note: We are using app.postMessage so that this is more compatible with the API * * @param widthMeasureSpec * @param heightMeasureSpec */ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); // Get the current height of the visible part of the screen. // This height will not included the status bar.\ int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); // If the oldHeight = 0 then this is the first measure event as the app starts up. // If oldHeight == height then we got a measurement change that doesn't affect us. if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } // Account for orientation change and ignore this event/Fire orientation change else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } // If the height as gotten bigger then we will assume the soft keyboard has // gone away. else if (height > oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('hidekeyboard');"); } // If the height as gotten smaller then we will assume the soft keyboard has // been displayed. else if (height < oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('showkeyboard');"); } // Update the old height for the next event oldHeight = height; oldWidth = width; }
Example 3
Source File: LinearLayoutSoftKeyboardDetect.java From reader with MIT License | 4 votes |
@Override /** * Start listening to new measurement events. Fire events when the height * gets smaller fire a show keyboard event and when height gets bigger fire * a hide keyboard event. * * Note: We are using app.postMessage so that this is more compatible with the API * * @param widthMeasureSpec * @param heightMeasureSpec */ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); // Get the current height of the visible part of the screen. // This height will not included the status bar.\ int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); // If the oldHeight = 0 then this is the first measure event as the app starts up. // If oldHeight == height then we got a measurement change that doesn't affect us. if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } // Account for orientation change and ignore this event/Fire orientation change else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } // If the height as gotten bigger then we will assume the soft keyboard has // gone away. else if (height > oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('hidekeyboard');"); } // If the height as gotten smaller then we will assume the soft keyboard has // been displayed. else if (height < oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('showkeyboard');"); } // Update the old height for the next event oldHeight = height; oldWidth = width; }
Example 4
Source File: LinearLayoutSoftKeyboardDetect.java From reader with MIT License | 4 votes |
@Override /** * Start listening to new measurement events. Fire events when the height * gets smaller fire a show keyboard event and when height gets bigger fire * a hide keyboard event. * * Note: We are using app.postMessage so that this is more compatible with the API * * @param widthMeasureSpec * @param heightMeasureSpec */ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); // Get the current height of the visible part of the screen. // This height will not included the status bar.\ int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); // If the oldHeight = 0 then this is the first measure event as the app starts up. // If oldHeight == height then we got a measurement change that doesn't affect us. if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } // Account for orientation change and ignore this event/Fire orientation change else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } // If the height as gotten bigger then we will assume the soft keyboard has // gone away. else if (height > oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('hidekeyboard');"); } // If the height as gotten smaller then we will assume the soft keyboard has // been displayed. else if (height < oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('showkeyboard');"); } // Update the old height for the next event oldHeight = height; oldWidth = width; }
Example 5
Source File: LinearLayoutSoftKeyboardDetect.java From phonegapbootcampsite with MIT License | 4 votes |
@Override /** * Start listening to new measurement events. Fire events when the height * gets smaller fire a show keyboard event and when height gets bigger fire * a hide keyboard event. * * Note: We are using app.postMessage so that this is more compatible with the API * * @param widthMeasureSpec * @param heightMeasureSpec */ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); // Get the current height of the visible part of the screen. // This height will not included the status bar.\ int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); // If the oldHeight = 0 then this is the first measure event as the app starts up. // If oldHeight == height then we got a measurement change that doesn't affect us. if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } // Account for orientation change and ignore this event/Fire orientation change else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } // If the height as gotten bigger then we will assume the soft keyboard has // gone away. else if (height > oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('hidekeyboard');"); } // If the height as gotten smaller then we will assume the soft keyboard has // been displayed. else if (height < oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('showkeyboard');"); } // Update the old height for the next event oldHeight = height; oldWidth = width; }
Example 6
Source File: LinearLayoutSoftKeyboardDetect.java From CordovaYoutubeVideoPlayer with MIT License | 4 votes |
@Override /** * Start listening to new measurement events. Fire events when the height * gets smaller fire a show keyboard event and when height gets bigger fire * a hide keyboard event. * * Note: We are using app.postMessage so that this is more compatible with the API * * @param widthMeasureSpec * @param heightMeasureSpec */ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); // Get the current height of the visible part of the screen. // This height will not included the status bar.\ int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); // If the oldHeight = 0 then this is the first measure event as the app starts up. // If oldHeight == height then we got a measurement change that doesn't affect us. if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } // Account for orientation change and ignore this event/Fire orientation change else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } // If the height as gotten bigger then we will assume the soft keyboard has // gone away. else if (height > oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('hidekeyboard');"); } // If the height as gotten smaller then we will assume the soft keyboard has // been displayed. else if (height < oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('showkeyboard');"); } // Update the old height for the next event oldHeight = height; oldWidth = width; }
Example 7
Source File: LinearLayoutSoftKeyboardDetect.java From wildfly-samples with MIT License | 4 votes |
@Override /** * Start listening to new measurement events. Fire events when the height * gets smaller fire a show keyboard event and when height gets bigger fire * a hide keyboard event. * * Note: We are using app.postMessage so that this is more compatible with the API * * @param widthMeasureSpec * @param heightMeasureSpec */ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); // Get the current height of the visible part of the screen. // This height will not included the status bar.\ int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); // If the oldHeight = 0 then this is the first measure event as the app starts up. // If oldHeight == height then we got a measurement change that doesn't affect us. if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } // Account for orientation change and ignore this event/Fire orientation change else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } // If the height as gotten bigger then we will assume the soft keyboard has // gone away. else if (height > oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('hidekeyboard');"); } // If the height as gotten smaller then we will assume the soft keyboard has // been displayed. else if (height < oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('showkeyboard');"); } // Update the old height for the next event oldHeight = height; oldWidth = width; }
Example 8
Source File: LinearLayoutSoftKeyboardDetect.java From phonegap-plugin-loading-spinner with Apache License 2.0 | 4 votes |
@Override /** * Start listening to new measurement events. Fire events when the height * gets smaller fire a show keyboard event and when height gets bigger fire * a hide keyboard event. * * Note: We are using app.postMessage so that this is more compatible with the API * * @param widthMeasureSpec * @param heightMeasureSpec */ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); // Get the current height of the visible part of the screen. // This height will not included the status bar.\ int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); // If the oldHeight = 0 then this is the first measure event as the app starts up. // If oldHeight == height then we got a measurement change that doesn't affect us. if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } // Account for orientation change and ignore this event/Fire orientation change else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } // If the height as gotten bigger then we will assume the soft keyboard has // gone away. else if (height > oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('hidekeyboard');"); } // If the height as gotten smaller then we will assume the soft keyboard has // been displayed. else if (height < oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('showkeyboard');"); } // Update the old height for the next event oldHeight = height; oldWidth = width; }
Example 9
Source File: LinearLayoutSoftKeyboardDetect.java From crosswalk-cordova-android with Apache License 2.0 | 4 votes |
@Override /** * Start listening to new measurement events. Fire events when the height * gets smaller fire a show keyboard event and when height gets bigger fire * a hide keyboard event. * * Note: We are using app.postMessage so that this is more compatible with the API * * @param widthMeasureSpec * @param heightMeasureSpec */ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); // Get the current height of the visible part of the screen. // This height will not included the status bar.\ int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); // If the oldHeight = 0 then this is the first measure event as the app starts up. // If oldHeight == height then we got a measurement change that doesn't affect us. if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } // Account for orientation change and ignore this event/Fire orientation change else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } // If the height as gotten bigger then we will assume the soft keyboard has // gone away. else if (height > oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('hidekeyboard');"); } // If the height as gotten smaller then we will assume the soft keyboard has // been displayed. else if (height < oldHeight) { if (app != null) app.appView.sendJavascript("cordova.fireDocumentEvent('showkeyboard');"); } // Update the old height for the next event oldHeight = height; oldWidth = width; }