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
@@ -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 {
@@ -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;
}
}
@@ -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);