CB-8828 Delete onScrollChanged event

This commit is contained in:
Andrew Grieve 2015-04-08 21:24:36 -04:00
parent 0f73884c8d
commit 4595403a99
4 changed files with 5 additions and 84 deletions

View File

@ -48,12 +48,15 @@ Changes For Plugin Developers:
* Android Studio is now fully supported, and recommended over Eclipse
* Build using Gradle
* All builds [use Gradle by default](Android%20Shell%20Tool%20Guide_building_with_gradle), instead of Ant
* Plugins can add their own gradle build steps!
* Plugins can depend on Maven libraries using `<framework>` tags
* New APIs: `onStart`, `onStop`, `onConfigurationChanged`
* `"onScrollChanged"` message removed. Use `view.getViewTreeObserver().addOnScrollChangedListener(...)` instead
* CB-8702 New API for plugins to override `shouldInterceptRequest` with a stream
#### Other Changes ####
* CB-8378 Removed `hidekeyboard` and `showkeyboard` events (apps should use a plugin instead)
* CB-7085 Add `onConfigurationChanged` hook for plugins
* CB-8735 `bin/create` regex relaxed / better support for numbers
* CB-8702 Add API for plugins to override `shouldInterceptRequest` with a stream
* CB-8699 Fix CordovaResourceApi `copyResource` creating zero-length files when src=uncompressed asset
* CB-8693 CordovaLib should not contain icons / splashscreens
* CB-8592 Fix NPE if lifecycle events reach CordovaWebView before `init()` has been called

View File

@ -421,10 +421,6 @@ public class CordovaActivity extends Activity {
* @return Object or null
*/
public Object onMessage(String id, Object data) {
if (!"onScrollChanged".equals(id)) {
LOG.d(TAG, "onMessage(" + id + "," + data + ")");
}
if ("onReceivedError".equals(id)) {
JSONObject d = (JSONObject) data;
try {

View File

@ -1,65 +0,0 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova;
import android.view.View;
/*
* @deprecated As of release 4.0. Use view.getViewTreeObserver().addOnScrollChangedListener(...) instead.
*/
@Deprecated
public class ScrollEvent {
public int l, t, nl, nt;
private View targetView;
/*
* ScrollEvent constructor
* No idea why it uses l and t instead of x and y
*
* @param x
* @param y
* @param nx
* @param ny
* @param view
*/
public ScrollEvent(int nx, int ny, int x, int y, View view)
{
l = x; y = t; nl = nx; nt = ny;
targetView = view;
}
public int dl()
{
return nl - l;
}
public int dt()
{
return nt - t;
}
public View getTargetView()
{
return targetView;
}
}

View File

@ -10,7 +10,6 @@ import android.webkit.WebViewClient;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.CordovaWebViewEngine;
import org.apache.cordova.ScrollEvent;
/**
* Custom WebView subclass that enables us to capture events needed for Cordova.
@ -59,18 +58,6 @@ public class SystemWebView extends WebView implements CordovaWebViewEngine.Engin
super.setWebChromeClient(client);
}
@Override
public void onScrollChanged(int l, int t, int oldl, int oldt)
{
// TODO: scrolling is perf-sensitive, so we'd be better to not use postMessage
// here, and also not create any new objects. Instead, plugins should use:
// webView.getView().getViewTreeObserver().addOnScrollChangedListener(...)
if (parentEngine != null && parentEngine.pluginManager != null) {
ScrollEvent myEvent = new ScrollEvent(l, t, oldl, oldt, this);
parentEngine.pluginManager.postMessage("onScrollChanged", myEvent);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
Boolean ret = parentEngine.client.onDispatchKeyEvent(event);