blob: c02eeb4804c3424b9822140a380dccb86ba84632 [file] [log] [blame]
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed 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 android.support.v4.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.widget.EdgeEffect;
/**
* Stub implementation that contains a real EdgeEffect on ICS.
*
* This class is an implementation detail for EdgeEffectCompat
* and should not be used directly.
*/
class EdgeEffectCompatIcs {
public static Object newEdgeEffect(Context context) {
return new EdgeEffect(context);
}
public static void setSize(Object edgeEffect, int width, int height) {
((EdgeEffect) edgeEffect).setSize(width, height);
}
public static boolean isFinished(Object edgeEffect) {
return ((EdgeEffect) edgeEffect).isFinished();
}
public static void finish(Object edgeEffect) {
((EdgeEffect) edgeEffect).finish();
}
public static boolean onPull(Object edgeEffect, float deltaDistance) {
((EdgeEffect) edgeEffect).onPull(deltaDistance);
return true;
}
public static boolean onRelease(Object edgeEffect) {
EdgeEffect eff = (EdgeEffect) edgeEffect;
eff.onRelease();
return eff.isFinished();
}
public static boolean onAbsorb(Object edgeEffect, int velocity) {
((EdgeEffect) edgeEffect).onAbsorb(velocity);
return true;
}
public static boolean draw(Object edgeEffect, Canvas canvas) {
return ((EdgeEffect) edgeEffect).draw(canvas);
}
}