rhodes 7.4.1 → 7.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG +319 -0
- data/CREDITS +3 -1
- data/LICENSE +1 -1
- data/README.md +6 -16
- data/Rakefile +55 -43
- data/SECURITY.md +19 -0
- data/appveyor.yml +66 -8
- data/azure-pipelines.yml +67 -0
- data/bin/rhodes-setup +22 -8
- data/extensions/emdk3-manager/ext/platform/android/src/com/rho/emdk3/EMDK3Extension.java +14 -5
- data/extensions/instrumentation/ext/platform/android/src/com/rho/instrumentation/Instrumentation.java +29 -15
- data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/src/com/rhomobile/rhoelements/ans/ANSManager.java +3 -3
- data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/ElementsCore.java +12 -9
- data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/BatteryIndicator.java +2 -2
- data/lib/commonAPI/barcode/ext/platform/android/AndroidManifest.xml +3 -1
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/BarcodeCaptureActivity.java +11 -13
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/BarcodeGraphicTracker.java +1 -1
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/ui/camera/CameraSource.java +3 -3
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/ui/camera/CameraSourcePreview.java +1 -1
- data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro +1 -1
- data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro.erb +2 -2
- data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/QZXing.pri +9 -21
- data/lib/commonAPI/barcode/ext.yml +5 -8
- data/lib/commonAPI/bluetooth/ext/platform/qt/Bluetooth.pro +1 -1
- data/lib/commonAPI/bluetooth/ext/platform/qt/Bluetooth.pro.erb +1 -1
- data/lib/commonAPI/bluetooth/ext/platform/qt/src/bluetooth/bluetoothhelper.h +1 -1
- data/lib/commonAPI/coreapi/RhoSystemApi.rb +6 -0
- data/lib/commonAPI/coreapi/ext/Intent.xml +4 -0
- data/lib/commonAPI/coreapi/ext/platform/android/Rakefile +0 -12
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/intent/IntentSingleton.java +6 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/Notification.java +5 -2
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationScheduler.java +4 -4
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationSingleton.java +1 -1
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/webview/WebViewSingleton.java +40 -27
- data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +5 -6
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/Intent.h +1 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/Intent.m +3 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.h +2 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.m +10 -0
- data/lib/commonAPI/coreapi/ext/platform/wm/src/IntentImpl.cpp +3 -0
- data/lib/commonAPI/coreapi/ext/push.xml +5 -2
- data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.cpp +13 -0
- data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.h +2 -0
- data/lib/commonAPI/coreapi/ext/system.xml +3 -0
- data/lib/commonAPI/mediacapture/ext/camera.xml +4 -9
- data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationCameraActivity.erb +2 -2
- data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationFileProvider.erb +1 -1
- data/lib/commonAPI/mediacapture/ext/platform/android/ext_java.files +2 -9
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraExtension.java +0 -2
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraFactory.java +19 -24
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraObject.java +322 -730
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java +247 -433
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/{CameraSingletonObject.java → CameraSingleton.java} +68 -74
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/mediacapture/RhoCameraFileProvider.java +6 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/MediaCapture.pro.erb +1 -1
- data/lib/commonAPI/mediacapture/ext/platform/qt/Mediacapture.pro +1 -1
- data/lib/commonAPI/printing_zebra/ext/platform/android/src/com/rhomobile/printing/zebra/impl/ZebraPrintingProviderImpl.java +2 -1
- data/lib/commonAPI/signature/ext/platform/iphone/impl/readme.txt +7 -0
- data/lib/commonAPI/signature/ext/platform/qt/Signature.pro +3 -10
- data/lib/commonAPI/signature/ext/platform/qt/Signature.pro.erb +2 -2
- data/lib/extensions/fcm-push/ext/android/ApplicationManifestAdds.erb +15 -17
- data/lib/extensions/fcm-push/ext/android/Rakefile +59 -34
- data/lib/extensions/fcm-push/ext/android/ext_java.files +0 -1
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMFacade.java +13 -17
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMIntentService.java +81 -80
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMListener.java +0 -16
- data/lib/extensions/fcm-push/ext/iphone/Podfile +15 -2
- data/lib/extensions/fcm-push/ext/iphone/fcm-push.xcodeproj/project.pbxproj +6 -7
- data/lib/extensions/fcm-push/ext.yml +1 -1
- data/lib/extensions/gmaps/ext/platform/android/ApplicationManifestAdds.erb +1 -0
- data/lib/extensions/gmaps/ext/platform/android/src/com/rhomobile/rhodes/gmaps/GMapActivity.java +12 -4
- data/lib/extensions/gmaps/ext.yml +3 -1
- data/lib/extensions/nfc/ext/platform/android/src/com/rhomobile/nfc/Nfc.java +2 -1
- data/lib/extensions/serialport/ext/serialport.pro +1 -1
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
- data/platform/android/Rhodes/jni/src/MethodResultJni.cpp +4 -0
- data/platform/android/Rhodes/jni/src/fileapi.cpp +4 -0
- data/platform/android/Rhodes/res/drawable/baseline_check_24.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_check_240.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_close_24.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_close_240.xml +5 -0
- data/platform/android/Rhodes/res/layout/overlay_layout.xml +39 -0
- data/platform/android/Rhodes/res/layout/perrmission_alert_dialog.xml +267 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +183 -66
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +38 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoFileProvider.java +32 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +532 -92
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +259 -163
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/StatusNotification.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +14 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +5 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +79 -38
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +20 -15
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +18 -9
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/CallReceiver.java +22 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/IKioskMode.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/KioskManager.java +18 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyAccessibilityService.java +230 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyNotificationListenerService.java +16 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyOverlayService.java +197 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/PermissionManager.java +232 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +34 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality26.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/permissioncheck/CheckDrawable.java +53 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/permissioncheck/PermissionListGenerate.java +366 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/rhodes.iml +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +782 -41
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoInputConnectionWrapper.java +146 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoInputListener.java +21 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +92 -32
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/TauWebViewOptions.java +118 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebSettingsProviderBase.java +18 -17
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebSettingsProviderEclairMR1.java +4 -4
- data/platform/android/build/RhodesSRC_build.files +13 -0
- data/platform/android/build/{aab_builder.rb → aapt2_helper.rb} +94 -37
- data/platform/android/build/android-repack.rake +8 -1
- data/platform/android/build/android.rake +238 -238
- data/platform/android/build/android_tools.rb +10 -10
- data/platform/android/build/androidcommon.rb +31 -14
- data/platform/android/build/build_tools_finder.rb +46 -0
- data/platform/android/build/config.yml +8 -0
- data/platform/android/build/dex_builder.rb +88 -0
- data/platform/android/build/hostplatform.rb +9 -0
- data/platform/android/build/manifest_generator.rb +15 -10
- data/platform/android/build/maven_deps_extractor.rb +29 -22
- data/platform/android/build/ndkwrapper.rb +92 -51
- data/platform/android/proguard/proguard-base-rules.pro +5 -0
- data/platform/android/proguard/proguard.jar +0 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +3 -1
- data/platform/iphone/Classes/Camera/PickImageDelegate.h +2 -0
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +45 -23
- data/platform/iphone/Classes/CocoaServer/CCocoaServer.h +27 -0
- data/platform/iphone/Classes/CocoaServer/CCocoaServer.m +107 -0
- data/platform/iphone/Classes/CocoaServer/RhoHTTPConnection.h +16 -0
- data/platform/iphone/Classes/CocoaServer/RhoHTTPConnection.m +226 -0
- data/platform/iphone/Classes/RhoAppBaseLib-Bridging-Header.h +4 -0
- data/platform/iphone/Classes/RhoAppBaseStandaloneLib-Bridging-Header.h +4 -0
- data/platform/iphone/Classes/RhoCryptAESGCM.swift +105 -0
- data/platform/iphone/Classes/RhoUIWebView.h +1 -1
- data/platform/iphone/Classes/RhoUIWebView.m +1 -1
- data/platform/iphone/Classes/RhoWKWebView.h +1 -1
- data/platform/iphone/Classes/RhoWKWebView.mm +110 -15
- data/platform/iphone/Classes/RhoWebView.h +1 -1
- data/platform/iphone/Classes/RhoWebViewFabrique.m +13 -2
- data/platform/iphone/Classes/Rhodes.m +3 -0
- data/platform/iphone/Classes/SimpleMainView.m +5 -5
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +21 -10
- data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +4 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDData.h +14 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDData.m +158 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDNumber.h +12 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDNumber.m +88 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDRange.h +56 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDRange.m +104 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPAuthenticationRequest.h +45 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPAuthenticationRequest.m +195 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPConnection.h +120 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPConnection.m +2708 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPLogging.h +136 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPMessage.h +48 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPMessage.m +113 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPResponse.h +149 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPServer.h +205 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPServer.m +772 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.h +65 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.m +529 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.h +33 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.m +86 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.h +23 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.m +211 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.h +75 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.m +405 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDataResponse.h +13 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDataResponse.m +79 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.h +52 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.m +292 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.h +9 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.m +38 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPFileResponse.h +25 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPFileResponse.m +237 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.h +12 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.m +73 -0
- data/platform/iphone/CocoaHTTPServer/Core/WebSocket.h +105 -0
- data/platform/iphone/CocoaHTTPServer/Core/WebSocket.m +791 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.h +7 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.m +160 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.h +11 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.m +372 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.h +7 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.m +49 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.h +8 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.m +69 -0
- data/platform/iphone/CocoaHTTPServer/LICENSE.txt +18 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/About.txt +4 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.h +1226 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m +8528 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/About.txt +33 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDASLLogger.h +41 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDASLLogger.m +99 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDAbstractDatabaseLogger.m +727 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDFileLogger.h +334 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDFileLogger.m +1353 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDLog.h +601 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDLog.m +1083 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDTTYLogger.h +167 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDTTYLogger.m +1479 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/ContextFilterLogFormatter.h +65 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/ContextFilterLogFormatter.m +191 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/DispatchQueueLogFormatter.h +116 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/DispatchQueueLogFormatter.m +251 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/README.txt +7 -0
- data/platform/iphone/Framework/RhoApplication/RhoApplication.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/Framework/Rhodes/Rhodes.xcodeproj/project.pbxproj +2 -2
- data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +410 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +4 -1
- data/platform/iphone/rbuild/iphone.rake +13 -8
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +4 -1
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip +0 -0
- data/platform/sailfish/build/{harbour-SailfishRhodes.pro.erb → SailfishRhodes.pro.erb} +10 -17
- data/platform/sailfish/build/rhodes.pro.erb +7 -17
- data/platform/sailfish/build/rpm/SailfishRhodes.desktop.erb +12 -0
- data/platform/sailfish/build/rpm/SailfishRhodes.erb +2 -0
- data/platform/sailfish/build/rpm/SailfishRhodes.spec.erb +43 -0
- data/platform/sailfish/build/rubylib.pro.erb +29 -29
- data/platform/sailfish/build/sailfish.rake +188 -180
- data/platform/sailfish/keys/regular_cert.pem +14 -0
- data/platform/sailfish/keys/regular_key.pem +4 -0
- data/platform/shared/common/RhodesApp.cpp +59 -10
- data/platform/shared/common/iphone/RhoCryptImpl.mm +130 -54
- data/platform/shared/net/HttpServer.cpp +20 -0
- data/platform/shared/qt/RhoSimulator.pro +1 -1
- data/platform/shared/qt/rhodes/rhodes.pro +4 -11
- data/platform/shared/qt/sailfish/SailfishRhodes.desktop +3 -4
- data/platform/shared/qt/sailfish/SailfishRhodes.pro +9 -10
- data/platform/shared/qt/sailfish/icons/108x108/108x108.png +0 -0
- data/platform/shared/qt/sailfish/privileges/sailfishrhodes +2 -0
- data/platform/shared/qt/sailfish/qml/pages/FirstPageWK.qml +7 -11
- data/platform/shared/qt/sailfish/qml/{harbour-sailfishrhodes.qml → sailfishrhodes.qml} +1 -1
- data/platform/shared/qt/sailfish/rpm/sailfishrhodes.spec +80 -0
- data/platform/shared/qt/sailfish/rpm/{harbour-sailfishrhodes.yaml → sailfishrhodes.yaml} +2 -2
- data/platform/shared/qt/sailfish/src/QtMainWindow.cpp +1 -1
- data/platform/shared/qt/sailfish/src/QtMainWindow.h +1 -1
- data/platform/shared/qt/sailfish/src/main.cpp +6 -38
- data/platform/shared/qt/sailfish/src/rootdelegate.h +2 -14
- data/platform/shared/ruby/aurora/ruby/config.h +386 -0
- data/platform/shared/ruby/aurora/ruby/constdefs.c +5866 -0
- data/platform/shared/ruby/aurora/ruby/constdefs.h +1788 -0
- data/platform/shared/ruby/osx/ruby/config.h +2 -0
- data/platform/shared/ruby/win32/win32.c +10 -3
- data/platform/shared/sqlite/crypto.c +14 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/win32/build/rhodes.nsi +3 -3
- data/platform/win32/build/win32.rake +1 -1
- data/rakefile.rb +55 -43
- data/res/build-tools/RhoRuby.exe +0 -0
- data/res/build-tools/aapt2/linux/aapt2 +0 -0
- data/res/build-tools/aapt2/osx/aapt2 +0 -0
- data/res/build-tools/iphonesim/build/Release/iphonesim_8 +4 -4
- data/res/generators/templates/application/AndroidManifest.erb +28 -6
- data/res/generators/templates/application/build.yml +18 -11
- data/res/generators/templates/application/resources/android/res/xml/provider_paths.xml +4 -0
- data/res/generators/templates/application/rhoconfig.txt +15 -1
- data/res/generators/templates/iphone_project/Bremen8.xcodeproj/project.pbxproj +24 -1
- data/res/generators/templates/iphone_project/Classes/SimpleSwiftClass.swift +20 -0
- data/res/generators/templates/iphone_project/Classes/rhorunner-Bridging-Header.h +4 -0
- data/rhobuild.yml.example +4 -4
- data/rhodes.gemspec +4 -3
- data/version +1 -1
- metadata +157 -57
- data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/drawable/camera_btn.xml +0 -14
- data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/layout/camera_land.xml +0 -23
- data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/layout/camera_port.xml +0 -23
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraActivity.java +0 -156
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraEclair.java +0 -227
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraGingerbread.java +0 -152
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraPreview.java +0 -183
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonEclair.java +0 -14
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonGingerbread.java +0 -60
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraObject.java +0 -20
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraSingletonObject.java +0 -8
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMTokenRefresherService.java +0 -27
- data/platform/android/Rhodes/AndroidManifest.xml.erb +0 -89
- data/platform/sailfish/build/rho_build.cmd.erb +0 -14
- data/platform/sailfish/build/rho_clean.cmd.erb +0 -14
- data/platform/sailfish/build/rho_deploy.cmd.erb +0 -15
- data/platform/sailfish/build/rho_rpm.cmd.erb +0 -14
- data/platform/sailfish/build/rho_rpmvalidation.cmd.erb +0 -14
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.desktop.erb +0 -7
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.erb +0 -2
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.yaml.erb +0 -37
- data/platform/shared/qt/sailfish/harbour-sailfishrhodes.desktop +0 -6
- data/platform/shared/qt/sailfish/icons/108x108/harbour-sailfishrhodes.png +0 -0
- data/platform/shared/qt/sailfish/privileges/harbour-sailfishrhodes +0 -2
- data/platform/shared/qt/sailfish/qml/pages/FirstPageWE.qml +0 -236
- /data/platform/shared/qt/sailfish/icons/128x128/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
- /data/platform/shared/qt/sailfish/icons/172x172/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
- /data/platform/shared/qt/sailfish/icons/86x86/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
@@ -2,6 +2,10 @@ package com.rhomobile.rhodes.webview;
|
|
2
2
|
|
3
3
|
import java.io.File;
|
4
4
|
import java.io.FileOutputStream;
|
5
|
+
import java.util.Timer;
|
6
|
+
import java.util.TimerTask;
|
7
|
+
import java.util.HashMap;
|
8
|
+
import java.util.Map;
|
5
9
|
|
6
10
|
import com.rhomobile.rhodes.LocalFileProvider;
|
7
11
|
import com.rhomobile.rhodes.Logger;
|
@@ -14,24 +18,640 @@ import com.rhomobile.rhodes.osfunctionality.OsVersionManager;
|
|
14
18
|
import com.rhomobile.rhodes.util.PerformOnUiThread;
|
15
19
|
import com.rhomobile.rhodes.RhoConf;
|
16
20
|
|
21
|
+
import android.util.Log;
|
17
22
|
import android.app.Activity;
|
18
23
|
import android.graphics.Bitmap;
|
19
24
|
import android.graphics.Canvas;
|
20
25
|
import android.graphics.Picture;
|
26
|
+
import android.graphics.Rect;
|
21
27
|
import android.net.Uri;
|
22
28
|
import android.os.Build;
|
23
29
|
import android.view.View;
|
24
30
|
import android.view.ViewGroup;
|
31
|
+
import android.view.ViewGroup.LayoutParams;
|
25
32
|
import android.webkit.URLUtil;
|
26
33
|
import android.webkit.WebBackForwardList;
|
34
|
+
import android.webkit.WebHistoryItem;
|
27
35
|
import android.webkit.WebChromeClient;
|
28
36
|
import android.webkit.WebSettings;
|
29
37
|
import android.webkit.WebViewClient;
|
30
38
|
import android.webkit.CookieManager;
|
39
|
+
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
|
40
|
+
|
41
|
+
import android.widget.EditText;
|
42
|
+
import android.widget.TextView;
|
43
|
+
import android.text.InputType;
|
44
|
+
|
45
|
+
import android.view.inputmethod.InputMethodManager;
|
46
|
+
import android.view.inputmethod.InputConnection;
|
47
|
+
import android.view.inputmethod.InputConnectionWrapper;
|
48
|
+
import android.view.inputmethod.BaseInputConnection;
|
49
|
+
import android.view.inputmethod.EditorInfo;
|
50
|
+
import android.view.inputmethod.ExtractedTextRequest;
|
51
|
+
import android.view.inputmethod.ExtractedText;
|
52
|
+
import android.view.inputmethod.CompletionInfo;
|
53
|
+
import android.view.inputmethod.CorrectionInfo;
|
54
|
+
import android.view.inputmethod.InputContentInfo;
|
55
|
+
|
56
|
+
|
57
|
+
import android.content.Context;
|
58
|
+
import android.view.View;
|
59
|
+
import android.view.WindowManager;
|
60
|
+
import android.view.Display;
|
61
|
+
import android.view.MotionEvent;
|
62
|
+
|
63
|
+
import android.content.SharedPreferences;
|
64
|
+
import android.provider.Settings;
|
65
|
+
|
66
|
+
import android.os.Looper;
|
67
|
+
import android.os.Handler;
|
68
|
+
import android.util.TypedValue;
|
69
|
+
import android.os.Bundle;
|
70
|
+
import android.view.KeyEvent;
|
71
|
+
|
72
|
+
import android.view.inputmethod.SurroundingText;
|
73
|
+
|
74
|
+
//import android.annotation.IntRange;
|
75
|
+
//import android.annotation.NonNull;
|
76
|
+
//import android.annotation.Nullable;
|
77
|
+
|
78
|
+
//import android.os.LocaleList;
|
79
|
+
//import java.util.Locale;
|
31
80
|
|
32
81
|
|
33
82
|
public class GoogleWebView implements IRhoWebView {
|
34
|
-
private static final String TAG = GoogleWebView.class.getSimpleName();
|
83
|
+
private static final String TAG = GoogleWebView.class.getSimpleName();
|
84
|
+
|
85
|
+
private static String tauSipValue = "com.tau.taubrowser/com.tau.TauKeyboard";
|
86
|
+
|
87
|
+
public static String mSavedEnabledInputMethods = null;
|
88
|
+
public static String mSavedDefaultInputMethod = null;
|
89
|
+
|
90
|
+
private boolean mIsCanRunAgain = true;
|
91
|
+
|
92
|
+
private boolean mIsShouldKillKeyboardMethodUse = true;
|
93
|
+
|
94
|
+
Timer mKillKeyboardTimer = null;
|
95
|
+
|
96
|
+
private static boolean ourShouldDisableKeyboard = false;
|
97
|
+
|
98
|
+
private OnGlobalLayoutListener mOnGlobalLayoutListener = null;
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
/*
|
104
|
+
public class RhoInputConnectionWrapper extends InputConnectionWrapper {
|
105
|
+
private String TAG = RhoInputConnectionWrapper.class.getSimpleName();
|
106
|
+
|
107
|
+
public RhoInputConnectionWrapper(InputConnection connection) {
|
108
|
+
super(connection, true);
|
109
|
+
}
|
110
|
+
|
111
|
+
/*
|
112
|
+
@Override
|
113
|
+
public CharSequence getTextBeforeCursor(int n, int flags) {
|
114
|
+
Logger.I(this.TAG, ".getTextBeforeCursor()");
|
115
|
+
hideAnyKeyboard();
|
116
|
+
return super.getTextBeforeCursor(n, flags);
|
117
|
+
}
|
118
|
+
|
119
|
+
@Override
|
120
|
+
public CharSequence getTextAfterCursor(int n, int flags) {
|
121
|
+
Logger.T(this.TAG, ".getTextAfterCursor()");
|
122
|
+
hideAnyKeyboard();
|
123
|
+
return super.getTextAfterCursor(n, flags);
|
124
|
+
}
|
125
|
+
|
126
|
+
@Override
|
127
|
+
public CharSequence getSelectedText(int flags) {
|
128
|
+
Logger.T(this.TAG, ".getSelectedText()");
|
129
|
+
hideAnyKeyboard();
|
130
|
+
return super.getSelectedText(flags);
|
131
|
+
}
|
132
|
+
|
133
|
+
@Override
|
134
|
+
public SurroundingText getSurroundingText(int beforeLength, int afterLength, int flags) {
|
135
|
+
Logger.T(this.TAG, ".getSurroundingText()");
|
136
|
+
hideAnyKeyboard();
|
137
|
+
return super.getSurroundingText(beforeLength, afterLength, flags);
|
138
|
+
}
|
139
|
+
|
140
|
+
@Override
|
141
|
+
public int getCursorCapsMode(int reqModes) {
|
142
|
+
Logger.T(this.TAG, ".getCursorCapsMode()");
|
143
|
+
hideAnyKeyboard();
|
144
|
+
return super.getCursorCapsMode(reqModes);
|
145
|
+
}
|
146
|
+
|
147
|
+
@Override
|
148
|
+
public ExtractedText getExtractedText(ExtractedTextRequest request, int flags) {
|
149
|
+
Logger.T(this.TAG, ".getExtractedText()");
|
150
|
+
hideAnyKeyboard();
|
151
|
+
return super.getExtractedText(request, flags);
|
152
|
+
}
|
153
|
+
|
154
|
+
@Override
|
155
|
+
public boolean setComposingText(CharSequence text, int newCursorPosition) {
|
156
|
+
Logger.T(this.TAG, ".setComposingText()");
|
157
|
+
hideAnyKeyboard();
|
158
|
+
return super.setComposingText(text, newCursorPosition);
|
159
|
+
}
|
160
|
+
|
161
|
+
//@Override
|
162
|
+
//public boolean setComposingText(@NonNull CharSequence text,
|
163
|
+
// int newCursorPosition, @Nullable TextAttribute textAttribute) {
|
164
|
+
// hideAnyKeyboard();
|
165
|
+
// return super.setComposingText(text, newCursorPosition, textAttribute);
|
166
|
+
//}
|
167
|
+
|
168
|
+
@Override
|
169
|
+
public boolean setComposingRegion(int start, int end) {
|
170
|
+
Logger.T(this.TAG, ".setComposingRegion()");
|
171
|
+
hideAnyKeyboard();
|
172
|
+
return super.setComposingRegion(start, end);
|
173
|
+
}
|
174
|
+
|
175
|
+
//@Override
|
176
|
+
//public boolean setComposingRegion(int start, int end, @Nullable TextAttribute textAttribute) {
|
177
|
+
// hideAnyKeyboard();
|
178
|
+
// return super.setComposingRegion(start, end, textAttribute);
|
179
|
+
//}
|
180
|
+
|
181
|
+
@Override
|
182
|
+
public boolean finishComposingText() {
|
183
|
+
Logger.T(this.TAG, ".finishComposingText()");
|
184
|
+
hideAnyKeyboard();
|
185
|
+
return super.finishComposingText();
|
186
|
+
}
|
187
|
+
|
188
|
+
@Override
|
189
|
+
public boolean commitText(CharSequence text, int newCursorPosition) {
|
190
|
+
Logger.T(this.TAG, ".commitText()");
|
191
|
+
hideAnyKeyboard();
|
192
|
+
return super.commitText(text, newCursorPosition);
|
193
|
+
}
|
194
|
+
|
195
|
+
//@Override
|
196
|
+
//public boolean commitText(@NonNull CharSequence text, int newCursorPosition,
|
197
|
+
// @Nullable TextAttribute textAttribute) {
|
198
|
+
// hideAnyKeyboard();
|
199
|
+
// return super.commitText(text, newCursorPosition, textAttribute);
|
200
|
+
//}
|
201
|
+
|
202
|
+
@Override
|
203
|
+
public boolean commitCompletion(CompletionInfo text) {
|
204
|
+
Logger.T(this.TAG, ".commitCompletion()");
|
205
|
+
hideAnyKeyboard();
|
206
|
+
return super.commitCompletion(text);
|
207
|
+
}
|
208
|
+
|
209
|
+
@Override
|
210
|
+
public boolean commitCorrection(CorrectionInfo correctionInfo) {
|
211
|
+
Logger.T(this.TAG, ".commitContent()");
|
212
|
+
hideAnyKeyboard();
|
213
|
+
return super.commitCorrection(correctionInfo);
|
214
|
+
}
|
215
|
+
|
216
|
+
@Override
|
217
|
+
public boolean setSelection(int start, int end) {
|
218
|
+
Logger.T(this.TAG, ".setSelection()");
|
219
|
+
hideAnyKeyboard();
|
220
|
+
return super.setSelection(start, end);
|
221
|
+
}
|
222
|
+
|
223
|
+
@Override
|
224
|
+
public boolean performEditorAction(int editorAction) {
|
225
|
+
Logger.T(this.TAG, ".performEditorAction()");
|
226
|
+
hideAnyKeyboard();
|
227
|
+
return super.performEditorAction(editorAction);
|
228
|
+
}
|
229
|
+
|
230
|
+
@Override
|
231
|
+
public boolean performContextMenuAction(int id) {
|
232
|
+
Logger.T(this.TAG, ".performContextMenuAction()");
|
233
|
+
hideAnyKeyboard();
|
234
|
+
return super.performContextMenuAction(id);
|
235
|
+
}
|
236
|
+
|
237
|
+
@Override
|
238
|
+
public boolean beginBatchEdit() {
|
239
|
+
Logger.T(this.TAG, ".beginBatchEdit()");
|
240
|
+
hideAnyKeyboard();
|
241
|
+
return super.beginBatchEdit();
|
242
|
+
}
|
243
|
+
|
244
|
+
@Override
|
245
|
+
public boolean endBatchEdit() {
|
246
|
+
Logger.T(this.TAG, ".endBatchEdit()");
|
247
|
+
hideAnyKeyboard();
|
248
|
+
return super.endBatchEdit();
|
249
|
+
}
|
250
|
+
|
251
|
+
@Override
|
252
|
+
public boolean sendKeyEvent(KeyEvent event) {
|
253
|
+
Logger.T(this.TAG, ".sendKeyEvent()");
|
254
|
+
hideAnyKeyboard();
|
255
|
+
return super.sendKeyEvent(event);
|
256
|
+
}
|
257
|
+
|
258
|
+
@Override
|
259
|
+
public boolean clearMetaKeyStates(int states) {
|
260
|
+
Logger.T(this.TAG, ".clearMetaKeyStates()");
|
261
|
+
hideAnyKeyboard();
|
262
|
+
return super.clearMetaKeyStates(states);
|
263
|
+
}
|
264
|
+
|
265
|
+
@Override
|
266
|
+
public boolean reportFullscreenMode(boolean enabled) {
|
267
|
+
Logger.T(this.TAG, ".reportFullscreenMode()");
|
268
|
+
//hideAnyKeyboard();
|
269
|
+
boolean h = false;
|
270
|
+
try {
|
271
|
+
h = super.reportFullscreenMode(enabled);
|
272
|
+
}
|
273
|
+
catch (Exception ex) {
|
274
|
+
Logger.E(this.TAG, ".reportFullscreenMode() ERROR = "+ex.getMessage());
|
275
|
+
}
|
276
|
+
return h;
|
277
|
+
}
|
278
|
+
|
279
|
+
@Override
|
280
|
+
public boolean performSpellCheck() {
|
281
|
+
Logger.T(this.TAG, ".performSpellCheck()");
|
282
|
+
hideAnyKeyboard();
|
283
|
+
return super.performSpellCheck();
|
284
|
+
}
|
285
|
+
|
286
|
+
@Override
|
287
|
+
public boolean performPrivateCommand(String action, Bundle data) {
|
288
|
+
Logger.T(this.TAG, ".performPrivateCommand()");
|
289
|
+
hideAnyKeyboard();
|
290
|
+
return super.performPrivateCommand(action, data);
|
291
|
+
}
|
292
|
+
|
293
|
+
@Override
|
294
|
+
public boolean requestCursorUpdates(int cursorUpdateMode) {
|
295
|
+
Logger.T(this.TAG, ".requestCursorUpdates()");
|
296
|
+
hideAnyKeyboard();
|
297
|
+
return super.requestCursorUpdates(cursorUpdateMode);
|
298
|
+
}
|
299
|
+
|
300
|
+
@Override
|
301
|
+
public Handler getHandler() {
|
302
|
+
Logger.T(this.TAG, ".getHandler()");
|
303
|
+
//hideAnyKeyboard();
|
304
|
+
Handler h = null;
|
305
|
+
try {
|
306
|
+
h = super.getHandler();
|
307
|
+
}
|
308
|
+
catch (Exception ex) {
|
309
|
+
Logger.E(this.TAG, ".getHandler() ERROR = "+ex.getMessage());
|
310
|
+
}
|
311
|
+
if (h == null) {
|
312
|
+
h = new Handler(Looper.getMainLooper());
|
313
|
+
}
|
314
|
+
return h;
|
315
|
+
}
|
316
|
+
|
317
|
+
@Override
|
318
|
+
public void closeConnection() {
|
319
|
+
Logger.T(this.TAG, ".closeConnection()");
|
320
|
+
//hideAnyKeyboard();
|
321
|
+
try {
|
322
|
+
super.closeConnection();
|
323
|
+
}
|
324
|
+
catch (Exception ex) {
|
325
|
+
Logger.E(this.TAG, ".closeConnection() ERROR = "+ex.getMessage());
|
326
|
+
}
|
327
|
+
}
|
328
|
+
|
329
|
+
@Override
|
330
|
+
public boolean commitContent(InputContentInfo inputContentInfo, int flags, Bundle opts) {
|
331
|
+
Logger.T(this.TAG, ".commitContent()");
|
332
|
+
hideAnyKeyboard();
|
333
|
+
return super.commitContent(inputContentInfo, flags, opts);
|
334
|
+
}
|
335
|
+
|
336
|
+
@Override
|
337
|
+
public boolean setImeConsumesInput(boolean imeConsumesInput) {
|
338
|
+
Logger.T(this.TAG, ".setImeConsumesInput()");
|
339
|
+
hideAnyKeyboard();
|
340
|
+
return super.setImeConsumesInput(imeConsumesInput);
|
341
|
+
}
|
342
|
+
|
343
|
+
private void hideAnyKeyboard() {
|
344
|
+
if (ourShouldDisableKeyboard) {
|
345
|
+
if (mIsShouldKillKeyboardMethodUse) {
|
346
|
+
hideKeyboard();
|
347
|
+
}
|
348
|
+
}
|
349
|
+
}
|
350
|
+
|
351
|
+
}
|
352
|
+
*/
|
353
|
+
|
354
|
+
|
355
|
+
public class TauWebView extends android.webkit.WebView {
|
356
|
+
|
357
|
+
private String TAG = TauWebView.class.getSimpleName();
|
358
|
+
|
359
|
+
|
360
|
+
public void setDisableKeyboard(boolean disable) {
|
361
|
+
ourShouldDisableKeyboard = disable;
|
362
|
+
if (disable) {
|
363
|
+
setupOurTauKeyboard();
|
364
|
+
}
|
365
|
+
else {
|
366
|
+
restoreKeyboardSettings();
|
367
|
+
}
|
368
|
+
}
|
369
|
+
|
370
|
+
public TauWebView(Activity activity) {
|
371
|
+
super(activity);
|
372
|
+
|
373
|
+
//if (ourShouldDisableKeyboard) {
|
374
|
+
setupOurTauKeyboard();
|
375
|
+
RhodesActivity.safeGetInstance().getWindow().setSoftInputMode(android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
|
376
|
+
|
377
|
+
//if (mIsShouldKillKeyboardMethodUse ) {
|
378
|
+
final TauWebView me = this;
|
379
|
+
setOnTouchListener(new View.OnTouchListener() {
|
380
|
+
|
381
|
+
private int mCurrentMax = 0;
|
382
|
+
|
383
|
+
@Override
|
384
|
+
public boolean onTouch(View v, MotionEvent event) {
|
385
|
+
Logger.I(TAG, "TauWebView.onTouch");
|
386
|
+
if ((event.getActionMasked() == MotionEvent.ACTION_UP) || (event.getActionMasked() == MotionEvent.ACTION_POINTER_UP)) {
|
387
|
+
if ((event.getPointerCount() == 3) && (mCurrentMax == 3)) {
|
388
|
+
RhodesActivity.onTripleTap();
|
389
|
+
}
|
390
|
+
if ((event.getPointerCount() == 4) && (mCurrentMax == 4)) {
|
391
|
+
RhodesActivity.onQuadroTap();
|
392
|
+
}
|
393
|
+
if (event.getPointerCount() == 1) {
|
394
|
+
mCurrentMax = 0;
|
395
|
+
}
|
396
|
+
}
|
397
|
+
else if (event.getAction() == MotionEvent.ACTION_CANCEL) {
|
398
|
+
mCurrentMax = 0;
|
399
|
+
}
|
400
|
+
else if ((event.getActionMasked() == MotionEvent.ACTION_DOWN) || (event.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN)) {
|
401
|
+
Logger.I(TAG, "TauWebView.onTouch COUNT = " + String.valueOf(event.getPointerCount()));
|
402
|
+
if (event.getPointerCount() > mCurrentMax) {
|
403
|
+
mCurrentMax = event.getPointerCount();
|
404
|
+
}
|
405
|
+
}
|
406
|
+
//ViewGroup activityRootView = ((ViewGroup) RhodesActivity.safeGetInstance().findViewById(android.R.id.content));
|
407
|
+
//recursiveLoopChildrenForTextEdit(activityRootView);
|
408
|
+
//RhodesActivity.safeGetInstance().getWindow().setFlags( WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
|
409
|
+
// WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
|
410
|
+
if ( ourShouldDisableKeyboard && mIsShouldKillKeyboardMethodUse) {
|
411
|
+
hideKeyboard();
|
412
|
+
}
|
413
|
+
return false;
|
414
|
+
}
|
415
|
+
});
|
416
|
+
//}
|
417
|
+
//}
|
418
|
+
}
|
419
|
+
|
420
|
+
|
421
|
+
private boolean isAutorizationDisable = false;
|
422
|
+
|
423
|
+
public void setDisableHTTPAuthorisation(boolean sa) {
|
424
|
+
isAutorizationDisable = sa;
|
425
|
+
}
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
public void loadUrl(String url) {
|
430
|
+
Logger.I(this.TAG, "TauWebView.loadUrl url = " + url);
|
431
|
+
///*
|
432
|
+
if (isAutorizationDisable) {
|
433
|
+
HashMap<String, String> extraHeaders = new HashMap<String, String>();
|
434
|
+
extraHeaders.put("Authorization", "");
|
435
|
+
//isAutorizationDisable = false;
|
436
|
+
Logger.I(this.TAG, "TauWebView.loadUrl disable Authorization !");
|
437
|
+
loadUrl(url, extraHeaders);
|
438
|
+
return;
|
439
|
+
}
|
440
|
+
//*/
|
441
|
+
super.loadUrl(url);
|
442
|
+
}
|
443
|
+
|
444
|
+
public void loadUrl (String url, Map<String, String> additionalHttpHeaders) {
|
445
|
+
Logger.I(this.TAG, "TauWebView.loadUrl url,additionalHttpHeaders = " + url);
|
446
|
+
/*
|
447
|
+
if (isAutorizationDisable) {
|
448
|
+
HashMap<String, String> extraHeaders = new HashMap<String, String>();
|
449
|
+
extraHeaders.put("Authorization", "");
|
450
|
+
isAutorizationDisable = false;
|
451
|
+
super.loadUrl(url, extraHeaders);
|
452
|
+
return;
|
453
|
+
}
|
454
|
+
*/
|
455
|
+
super.loadUrl(url, additionalHttpHeaders);
|
456
|
+
}
|
457
|
+
|
458
|
+
private InputConnection inputConnection = null;
|
459
|
+
private RhoInputConnectionWrapper rhoInputConnectionWrapper = null;
|
460
|
+
|
461
|
+
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
462
|
+
if (ourShouldDisableKeyboard) {
|
463
|
+
outAttrs.privateImeOptions = "tau browser!";
|
464
|
+
if (mIsShouldKillKeyboardMethodUse) {
|
465
|
+
//recursiveLoopChildrenForTextEdit(this);
|
466
|
+
hideKeyboard();
|
467
|
+
outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
|
468
|
+
outAttrs.inputType = EditorInfo.TYPE_NULL;
|
469
|
+
//outAttrs.hintLocales = new LocaleList(new Locale("en", "US"));
|
470
|
+
}
|
471
|
+
}
|
472
|
+
InputConnection super_connection = super.onCreateInputConnection(outAttrs);
|
473
|
+
inputConnection = super_connection;
|
474
|
+
|
475
|
+
if (ourShouldDisableKeyboard) {
|
476
|
+
if (mIsShouldKillKeyboardMethodUse) {
|
477
|
+
//outAttrs.hintLocales = new LocaleList(new Locale("en", "US"));
|
478
|
+
outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
|
479
|
+
outAttrs.inputType = EditorInfo.TYPE_NULL;
|
480
|
+
hideKeyboard();
|
481
|
+
//ViewGroup activityRootView = ((ViewGroup) RhodesActivity.safeGetInstance().findViewById(android.R.id.content));
|
482
|
+
//recursiveLoopChildrenForTextEdit(activityRootView);
|
483
|
+
}
|
484
|
+
}
|
485
|
+
if (RhoConf.isExist("override_web_view_input_connection") && RhoConf.getBool("override_web_view_input_connection")){
|
486
|
+
rhoInputConnectionWrapper = new RhoInputConnectionWrapper(super_connection);
|
487
|
+
return rhoInputConnectionWrapper;
|
488
|
+
}else
|
489
|
+
return inputConnection;
|
490
|
+
}
|
491
|
+
|
492
|
+
public void recursiveLoopChildrenForTextEdit(ViewGroup parent) {
|
493
|
+
for (int i = 0; i < parent.getChildCount(); i++) {
|
494
|
+
final View child = parent.getChildAt(i);
|
495
|
+
|
496
|
+
//child.setBackgroundColor(0xFF00FF00);
|
497
|
+
if (child instanceof TextView) {
|
498
|
+
TextView et = (TextView)child;
|
499
|
+
et.setRawInputType(InputType.TYPE_CLASS_TEXT);
|
500
|
+
et.setTextIsSelectable(true);
|
501
|
+
et.setBackgroundColor(0xFF00FF00);
|
502
|
+
//et.setInputType(InputType.TYPE_CLASS_TEXT);
|
503
|
+
}
|
504
|
+
|
505
|
+
if (child instanceof ViewGroup) {
|
506
|
+
recursiveLoopChildrenForTextEdit((ViewGroup) child);
|
507
|
+
} else {
|
508
|
+
if (child != null) {
|
509
|
+
}
|
510
|
+
}
|
511
|
+
}
|
512
|
+
}
|
513
|
+
}
|
514
|
+
|
515
|
+
|
516
|
+
private void setupOurTauKeyboard() {
|
517
|
+
if (ourShouldDisableKeyboard) {
|
518
|
+
Logger.I(this.TAG, "TAU KEYBOARD setupOurTauKeyboard() ourShouldDisableKeyboard == true");
|
519
|
+
try {
|
520
|
+
mIsShouldKillKeyboardMethodUse = true;
|
521
|
+
RhodesActivity.safeGetInstance();
|
522
|
+
Context context = RhodesActivity.getContext();
|
523
|
+
String enabledInputmethods = Settings.Secure.getString(context.getContentResolver(), "enabled_input_methods");
|
524
|
+
Logger.I(this.TAG, "TAU KEYBOARD enabled_input_methods = " + enabledInputmethods);
|
525
|
+
|
526
|
+
String default_input_method_local = Settings.Secure.getString(context.getContentResolver(), "default_input_method");
|
527
|
+
Logger.I(this.TAG, "TAU KEYBOARD default_input_method = " + default_input_method_local);
|
528
|
+
|
529
|
+
boolean hasError = false;
|
530
|
+
if (!enabledInputmethods.contains(tauSipValue)) {
|
531
|
+
// should be added !
|
532
|
+
boolean res_added = Settings.Secure.putString(context.getContentResolver(), "enabled_input_methods", enabledInputmethods+":"+tauSipValue);
|
533
|
+
Logger.I(this.TAG, "TAU KEYBOARD add our keyboard to enabled_input_methods res_added = " + res_added);
|
534
|
+
if (res_added) {
|
535
|
+
mSavedEnabledInputMethods = enabledInputmethods;
|
536
|
+
}
|
537
|
+
else {
|
538
|
+
hasError = true;
|
539
|
+
}
|
540
|
+
}
|
541
|
+
else {
|
542
|
+
Logger.I(this.TAG, "TAU KEYBOARD enabled_input_methods already has tau keyboard");
|
543
|
+
}
|
544
|
+
|
545
|
+
if (!hasError) {
|
546
|
+
boolean res_def = Settings.Secure.putString(context.getContentResolver(), "default_input_method", tauSipValue);
|
547
|
+
Logger.I(this.TAG, "TAU KEYBOARD set our keyboard to default_input_method res_def = " + res_def);
|
548
|
+
if (res_def) {
|
549
|
+
mSavedDefaultInputMethod = default_input_method_local;
|
550
|
+
//if (mSavedDefaultInputMethod == null) {
|
551
|
+
mSavedDefaultInputMethod = "com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME";
|
552
|
+
//}
|
553
|
+
}
|
554
|
+
else {
|
555
|
+
hasError = true;
|
556
|
+
}
|
557
|
+
}
|
558
|
+
if (!hasError) {
|
559
|
+
mIsShouldKillKeyboardMethodUse = false;
|
560
|
+
}
|
561
|
+
|
562
|
+
} catch (Exception e) {
|
563
|
+
Logger.E(this.TAG, "TAU KEYBOARD Exception = " + e.getMessage());
|
564
|
+
}
|
565
|
+
|
566
|
+
if (mIsShouldKillKeyboardMethodUse) {
|
567
|
+
Logger.E(this.TAG, "TAU KEYBOARD no android.permission.WRITE_SECURE_SETTINGS permission - use alternative method !");
|
568
|
+
|
569
|
+
if (mKillKeyboardTimer != null) {
|
570
|
+
mKillKeyboardTimer.cancel();
|
571
|
+
}
|
572
|
+
|
573
|
+
mKillKeyboardTimer = new Timer();
|
574
|
+
|
575
|
+
//Update the elapsed time every second
|
576
|
+
mKillKeyboardTimer.schedule(new TimerTask() {
|
577
|
+
@Override
|
578
|
+
public void run() {
|
579
|
+
//hideKeyboardNow();
|
580
|
+
///*
|
581
|
+
if (mIsCanRunAgain) {
|
582
|
+
mIsCanRunAgain = false;
|
583
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
584
|
+
@Override
|
585
|
+
public void run() {
|
586
|
+
hideKeyboardNow();
|
587
|
+
mIsCanRunAgain = true;
|
588
|
+
}
|
589
|
+
});
|
590
|
+
}
|
591
|
+
//*/
|
592
|
+
}
|
593
|
+
}, 100, 5);
|
594
|
+
}
|
595
|
+
setKeyboardListener();
|
596
|
+
}
|
597
|
+
}
|
598
|
+
|
599
|
+
|
600
|
+
private void restoreKeyboardSettings() {
|
601
|
+
Logger.I(this.TAG, "TAU KEYBOARD restoreKeyboardSettings()");
|
602
|
+
if (mKillKeyboardTimer != null) {
|
603
|
+
mKillKeyboardTimer.cancel();
|
604
|
+
mKillKeyboardTimer = null;
|
605
|
+
}
|
606
|
+
if (mSavedEnabledInputMethods != null) {
|
607
|
+
String to_restore = mSavedEnabledInputMethods;
|
608
|
+
mSavedEnabledInputMethods = null;
|
609
|
+
Logger.I(this.TAG, "TAU KEYBOARD restore saved enabled_input_methods");
|
610
|
+
try {
|
611
|
+
RhodesActivity.safeGetInstance();
|
612
|
+
Context context = RhodesActivity.getContext();
|
613
|
+
Settings.Secure.putString(context.getContentResolver(), "enabled_input_methods", to_restore);
|
614
|
+
} catch (Exception e) {
|
615
|
+
Logger.E(this.TAG, "TAU KEYBOARD Exception = " + e.getMessage());
|
616
|
+
}
|
617
|
+
}
|
618
|
+
if (mSavedDefaultInputMethod != null) {
|
619
|
+
String to_restore = mSavedDefaultInputMethod;
|
620
|
+
mSavedDefaultInputMethod = null;
|
621
|
+
Logger.I(this.TAG, "TAU KEYBOARD restore saved default_input_method");
|
622
|
+
try {
|
623
|
+
RhodesActivity.safeGetInstance();
|
624
|
+
Context context = RhodesActivity.getContext();
|
625
|
+
Settings.Secure.putString(context.getContentResolver(), "default_input_method", to_restore);
|
626
|
+
} catch (Exception e) {
|
627
|
+
Logger.E(this.TAG, "TAU KEYBOARD Exception = " + e.getMessage());
|
628
|
+
}
|
629
|
+
}
|
630
|
+
removeKeyboardListener();
|
631
|
+
}
|
632
|
+
|
633
|
+
|
634
|
+
public final void setKeyboardListener() {
|
635
|
+
removeKeyboardListener();
|
636
|
+
final View activityRootView = ((ViewGroup) RhodesActivity.safeGetInstance().findViewById(android.R.id.content)).getChildAt(0);
|
637
|
+
if (mOnGlobalLayoutListener != null) {
|
638
|
+
activityRootView.getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);
|
639
|
+
}
|
640
|
+
}
|
641
|
+
|
642
|
+
public final void removeKeyboardListener() {
|
643
|
+
final View activityRootView = ((ViewGroup) RhodesActivity.safeGetInstance().findViewById(android.R.id.content)).getChildAt(0);
|
644
|
+
|
645
|
+
if (mOnGlobalLayoutListener != null) {
|
646
|
+
try {
|
647
|
+
activityRootView.getViewTreeObserver().removeOnGlobalLayoutListener(mOnGlobalLayoutListener);
|
648
|
+
} catch (Exception e) {
|
649
|
+
|
650
|
+
}
|
651
|
+
}
|
652
|
+
}
|
653
|
+
|
654
|
+
|
35
655
|
|
36
656
|
private WebChromeClient mChromeClient;
|
37
657
|
private WebViewClient mWebViewClient;
|
@@ -42,11 +662,44 @@ public class GoogleWebView implements IRhoWebView {
|
|
42
662
|
private TextZoom mTextZoom = TextZoom.NORMAL;
|
43
663
|
private IRhoConfig mConfig;
|
44
664
|
|
665
|
+
private boolean mIsBackDisabled = false;
|
666
|
+
|
45
667
|
public GoogleWebView(Activity activity) {
|
46
|
-
mWebView = new
|
668
|
+
mWebView = new TauWebView(activity);
|
47
669
|
mWebView.getSettings().setLoadWithOverviewMode(true);
|
48
670
|
mWebView.getSettings().setUseWideViewPort(true);
|
49
671
|
|
672
|
+
tauSipValue = activity.getApplicationContext().getPackageName()+"/com.tau.TauKeyboard";
|
673
|
+
|
674
|
+
//if (ourShouldDisableKeyboard) {
|
675
|
+
mOnGlobalLayoutListener = new OnGlobalLayoutListener() {
|
676
|
+
|
677
|
+
@Override
|
678
|
+
public void onGlobalLayout() {
|
679
|
+
if (ourShouldDisableKeyboard) {
|
680
|
+
hideKeyboard();
|
681
|
+
}
|
682
|
+
}
|
683
|
+
|
684
|
+
};
|
685
|
+
|
686
|
+
|
687
|
+
mWebView.setOnTouchListener(new View.OnTouchListener() {
|
688
|
+
public boolean onTouch(View v, MotionEvent event) {
|
689
|
+
if (ourShouldDisableKeyboard) {
|
690
|
+
hideKeyboard();
|
691
|
+
}
|
692
|
+
return false;
|
693
|
+
}
|
694
|
+
});
|
695
|
+
|
696
|
+
|
697
|
+
// will be set by request only
|
698
|
+
//if (mIsShouldKillKeyboardMethodUse) {
|
699
|
+
// setKeyboardListener();
|
700
|
+
//}
|
701
|
+
//}
|
702
|
+
|
50
703
|
synchronized(mInitialized) {
|
51
704
|
if (!mInitialized) {
|
52
705
|
mWebView.clearCache(true);
|
@@ -57,10 +710,52 @@ public class GoogleWebView implements IRhoWebView {
|
|
57
710
|
mChromeClient = new RhoWebChromeClient(activity, this);
|
58
711
|
}
|
59
712
|
|
713
|
+
private void hideKeyboardNow() {
|
714
|
+
try {
|
715
|
+
Activity ctx = RhodesActivity.safeGetInstance();
|
716
|
+
if (ctx != null) {
|
717
|
+
InputMethodManager imm = (InputMethodManager) ctx.getSystemService(Context.INPUT_METHOD_SERVICE);
|
718
|
+
if (imm != null) {
|
719
|
+
imm.hideSoftInputFromWindow(getView().getApplicationWindowToken(), 0);
|
720
|
+
if (ctx.getCurrentFocus() != null) {
|
721
|
+
imm.hideSoftInputFromWindow(ctx.getCurrentFocus().getWindowToken(), 0);
|
722
|
+
}
|
723
|
+
}
|
724
|
+
}
|
725
|
+
}
|
726
|
+
catch (Throwable e) {
|
727
|
+
Logger.E(TAG, e);
|
728
|
+
}
|
729
|
+
}
|
730
|
+
|
731
|
+
private void hideKeyboard() {
|
732
|
+
if(Looper.getMainLooper().getThread() == Thread.currentThread()) {
|
733
|
+
hideKeyboardNow();
|
734
|
+
}
|
735
|
+
else {
|
736
|
+
PerformOnUiThread.exec(new Runnable() {
|
737
|
+
@Override
|
738
|
+
public void run() {
|
739
|
+
hideKeyboardNow();
|
740
|
+
}
|
741
|
+
});
|
742
|
+
}
|
743
|
+
PerformOnUiThread.exec(new Runnable() {
|
744
|
+
@Override
|
745
|
+
public void run() {
|
746
|
+
hideKeyboardNow();
|
747
|
+
}
|
748
|
+
}, 10);
|
749
|
+
}
|
750
|
+
|
751
|
+
public void setBackDisabled(boolean value) {
|
752
|
+
mIsBackDisabled = value;
|
753
|
+
}
|
754
|
+
|
60
755
|
private static void initWebStuff(Activity activity) {
|
61
756
|
|
62
757
|
Logger.I(TAG, "Initialize Google WEbView staff");
|
63
|
-
|
758
|
+
|
64
759
|
OsVersionManager.registerSelector(IWebSettingsProvider.class, WebSettingsProviderBase.class.getCanonicalName());
|
65
760
|
OsVersionManager.registerSelector(Build.VERSION_CODES.ECLAIR, IWebSettingsProvider.class, WebSettingsProviderEclair.class.getCanonicalName());
|
66
761
|
OsVersionManager.registerSelector(Build.VERSION_CODES.ECLAIR_MR1, IWebSettingsProvider.class, WebSettingsProviderEclairMR1.class.getCanonicalName());
|
@@ -71,14 +766,14 @@ public class GoogleWebView implements IRhoWebView {
|
|
71
766
|
|
72
767
|
mInitialized = true;
|
73
768
|
}
|
74
|
-
|
769
|
+
|
75
770
|
private void applyWebSettings() {
|
76
771
|
Logger.I(TAG, "applyWebSettings");
|
77
772
|
// PerformOnUiThread.exec(new Runnable() {
|
78
773
|
// @Override
|
79
774
|
// public void run() {
|
80
775
|
Logger.I(TAG, "Web settings is applying now >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
81
|
-
|
776
|
+
|
82
777
|
double z = getConfig().getDouble(WebViewConfig.PAGE_ZOOM);
|
83
778
|
mWebView.setInitialScale((int)(z * 100));
|
84
779
|
mWebView.setVerticalScrollBarEnabled(true);
|
@@ -87,31 +782,31 @@ public class GoogleWebView implements IRhoWebView {
|
|
87
782
|
mWebView.setHorizontalScrollbarOverlay(true);
|
88
783
|
mWebView.setFocusableInTouchMode(true);
|
89
784
|
int sdkVersion = Build.VERSION.SDK_INT;
|
90
|
-
|
785
|
+
|
91
786
|
if ( sdkVersion >= 21 ) {
|
92
|
-
Logger.I(TAG, "Enabling third-party cookies");
|
93
|
-
CookieManager cm = CookieManager.getInstance();
|
94
|
-
try {
|
95
|
-
java.lang.reflect.Method mtdAllow3Party = cm.getClass().getMethod("setAcceptThirdPartyCookies", android.webkit.WebView.class, boolean.class);
|
96
|
-
mtdAllow3Party.invoke(cm,mWebView,true);
|
97
|
-
Logger.I(TAG, "Enabling third-party cookies done");
|
98
|
-
} catch (SecurityException e) {
|
99
|
-
Logger.W(TAG, "Can't allow third-party cookies explicily due to SecurityException");
|
100
|
-
} catch (NoSuchMethodException e) {
|
101
|
-
Logger.W(TAG, "Can't allow third-party cookies explicily due to NoSuchMethodException");
|
102
|
-
} catch ( Exception e ) {
|
103
|
-
Logger.E(TAG, "Can't allow third-party cookies explicily due to exception: " + e.toString() );
|
104
|
-
}
|
787
|
+
//Logger.I(TAG, "Enabling third-party cookies");
|
788
|
+
//CookieManager cm = CookieManager.getInstance();
|
789
|
+
//try {
|
790
|
+
//java.lang.reflect.Method mtdAllow3Party = cm.getClass().getMethod("setAcceptThirdPartyCookies", android.webkit.WebView.class, boolean.class);
|
791
|
+
//mtdAllow3Party.invoke(cm,mWebView,true);
|
792
|
+
//Logger.I(TAG, "Enabling third-party cookies done");
|
793
|
+
//} catch (SecurityException e) {
|
794
|
+
//Logger.W(TAG, "Can't allow third-party cookies explicily due to SecurityException");
|
795
|
+
//} catch (NoSuchMethodException e) {
|
796
|
+
//Logger.W(TAG, "Can't allow third-party cookies explicily due to NoSuchMethodException");
|
797
|
+
//} catch ( Exception e ) {
|
798
|
+
//Logger.E(TAG, "Can't allow third-party cookies explicily due to exception: " + e.toString() );
|
799
|
+
//}
|
105
800
|
}
|
106
|
-
|
801
|
+
|
107
802
|
/* if(sdkVersion <19){
|
108
803
|
mWebView.getSettings().setLoadWithOverviewMode(true);
|
109
804
|
mWebView.getSettings().setUseWideViewPort(true);
|
110
805
|
}*/
|
111
|
-
|
806
|
+
|
112
807
|
IWebSettingsProvider provider = OsVersionManager.getFeature(IWebSettingsProvider.class);
|
113
808
|
provider.fillSettings(mWebView.getSettings(), mConfig);
|
114
|
-
|
809
|
+
|
115
810
|
RhodesActivity.safeGetInstance().notifyUiCreated();
|
116
811
|
// }
|
117
812
|
// });
|
@@ -128,13 +823,13 @@ public class GoogleWebView implements IRhoWebView {
|
|
128
823
|
}
|
129
824
|
});
|
130
825
|
}
|
131
|
-
|
826
|
+
|
132
827
|
@Override
|
133
828
|
public void setConfig(IRhoConfig config) {
|
134
829
|
mConfig = config;
|
135
830
|
applyWebSettings();
|
136
831
|
}
|
137
|
-
|
832
|
+
|
138
833
|
public IRhoConfig getConfig() {
|
139
834
|
return mConfig;
|
140
835
|
}
|
@@ -161,11 +856,50 @@ public class GoogleWebView implements IRhoWebView {
|
|
161
856
|
|
162
857
|
@Override
|
163
858
|
public void goBack() {
|
859
|
+
if (mIsBackDisabled) {
|
860
|
+
return;
|
861
|
+
}
|
862
|
+
try {
|
863
|
+
WebBackForwardList history = mWebView.copyBackForwardList();
|
864
|
+
int current_index = history.getCurrentIndex();
|
865
|
+
if (current_index > 0) {
|
866
|
+
// can go back
|
867
|
+
WebHistoryItem item = history.getItemAtIndex(current_index-1);
|
868
|
+
if (item != null) {
|
869
|
+
String url = item.getUrl();
|
870
|
+
if (url != null) {
|
871
|
+
// inform about back with this url
|
872
|
+
RhoExtManager.getImplementationInstance().onGoBack(mWebView, getUrl(), url);
|
873
|
+
}
|
874
|
+
}
|
875
|
+
}
|
876
|
+
}
|
877
|
+
catch (Throwable e) {
|
878
|
+
Logger.E(TAG, e);
|
879
|
+
}
|
164
880
|
mWebView.goBack();
|
165
881
|
}
|
166
882
|
|
167
883
|
@Override
|
168
884
|
public void goForward() {
|
885
|
+
try {
|
886
|
+
WebBackForwardList history = mWebView.copyBackForwardList();
|
887
|
+
int current_index = history.getCurrentIndex();
|
888
|
+
if (current_index > 0) {
|
889
|
+
// can go back
|
890
|
+
WebHistoryItem item = history.getItemAtIndex(current_index-1);
|
891
|
+
if (item != null) {
|
892
|
+
String url = item.getUrl();
|
893
|
+
if (url != null) {
|
894
|
+
// inform about back with this url
|
895
|
+
RhoExtManager.getImplementationInstance().onGoForward(mWebView, getUrl(), url);
|
896
|
+
}
|
897
|
+
}
|
898
|
+
}
|
899
|
+
}
|
900
|
+
catch (Throwable e) {
|
901
|
+
Logger.E(TAG, e);
|
902
|
+
}
|
169
903
|
mWebView.goForward();
|
170
904
|
}
|
171
905
|
|
@@ -190,7 +924,7 @@ public class GoogleWebView implements IRhoWebView {
|
|
190
924
|
@Override
|
191
925
|
public void loadUrl(String url) {
|
192
926
|
Logger.profStart("BROWSER_PAGE");
|
193
|
-
|
927
|
+
|
194
928
|
RhoExtManager.getImplementationInstance().onBeforeNavigate(mWebView, url);
|
195
929
|
|
196
930
|
Uri uri = LocalFileProvider.overrideUri(Uri.parse(url));
|
@@ -252,7 +986,7 @@ public class GoogleWebView implements IRhoWebView {
|
|
252
986
|
}
|
253
987
|
mWebView.getSettings().setTextSize(googleTextZoom);
|
254
988
|
}
|
255
|
-
|
989
|
+
|
256
990
|
@Override
|
257
991
|
public TextZoom getTextZoom()
|
258
992
|
{
|
@@ -266,19 +1000,26 @@ public class GoogleWebView implements IRhoWebView {
|
|
266
1000
|
|
267
1001
|
@Override
|
268
1002
|
public void onPause() {
|
1003
|
+
// lost foreground - restore keyboard settings !
|
1004
|
+
restoreKeyboardSettings();
|
1005
|
+
|
1006
|
+
|
269
1007
|
//AndroidFunctionalityManager.getAndroidFunctionality().pauseWebView(mWebView,true);
|
270
1008
|
}
|
271
1009
|
|
272
1010
|
@Override
|
273
1011
|
public void onResume() {
|
1012
|
+
setupOurTauKeyboard();
|
1013
|
+
|
274
1014
|
//AndroidFunctionalityManager.getAndroidFunctionality().pauseWebView(mWebView,false);
|
275
1015
|
}
|
276
1016
|
|
277
1017
|
@Override
|
278
1018
|
public void destroy() {
|
1019
|
+
restoreKeyboardSettings();
|
279
1020
|
mWebView.destroy();
|
280
1021
|
}
|
281
|
-
|
1022
|
+
|
282
1023
|
@Override
|
283
1024
|
public WebBackForwardList copyBackForwardList() {
|
284
1025
|
return mWebView.copyBackForwardList();
|
@@ -301,26 +1042,26 @@ public class GoogleWebView implements IRhoWebView {
|
|
301
1042
|
break;
|
302
1043
|
}
|
303
1044
|
}
|
304
|
-
|
1045
|
+
|
305
1046
|
private void saveJpeg(String path) {
|
306
1047
|
Picture picture = mWebView.capturePicture();
|
307
|
-
|
1048
|
+
|
308
1049
|
if ( ( picture == null ) || ( picture.getWidth() == 0 ) || picture.getHeight() == 0 ) {
|
309
1050
|
Logger.E(TAG, "Can't capture picture from WebView.");
|
310
1051
|
return;
|
311
1052
|
}
|
312
|
-
|
313
|
-
Bitmap bitmap = Bitmap.createBitmap( picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
|
314
|
-
Canvas canvas = new Canvas(bitmap);
|
315
|
-
picture.draw(canvas);
|
316
|
-
FileOutputStream fos = null;
|
317
|
-
try {
|
318
|
-
fos = new FileOutputStream(path);
|
319
|
-
if ( fos != null )
|
320
|
-
{
|
321
|
-
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, fos );
|
322
|
-
fos.close();
|
323
|
-
}
|
1053
|
+
|
1054
|
+
Bitmap bitmap = Bitmap.createBitmap( picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
|
1055
|
+
Canvas canvas = new Canvas(bitmap);
|
1056
|
+
picture.draw(canvas);
|
1057
|
+
FileOutputStream fos = null;
|
1058
|
+
try {
|
1059
|
+
fos = new FileOutputStream(path);
|
1060
|
+
if ( fos != null )
|
1061
|
+
{
|
1062
|
+
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, fos );
|
1063
|
+
fos.close();
|
1064
|
+
}
|
324
1065
|
}
|
325
1066
|
catch (Throwable e){
|
326
1067
|
Logger.E(TAG, e);
|