add bunch of new java APIs: mostly stubs or copied from AOSP

Many of these classes are only needed to be subclassed by androidx
support library, which is used in many android apps
This commit is contained in:
Julian Winkler
2023-08-17 10:46:24 +02:00
parent a8e39cd613
commit 82744e9e5e
87 changed files with 2746 additions and 46 deletions

View File

@@ -0,0 +1,9 @@
package android.animation;
public class Animator {
public void setTarget(Object target) {}
public void start() {}
}

View File

@@ -0,0 +1,11 @@
package android.animation;
import android.content.Context;
public class AnimatorInflater {
public static Animator loadAnimator(Context context, int resId) {
return new Animator();
}
}

View File

@@ -0,0 +1,56 @@
/*
* Copyright (C) 2010 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.animation;
/**
* This adapter class provides empty implementations of the methods from {@link android.animation.Animator.AnimatorListener}.
* Any custom listener that cares only about a subset of the methods of this listener can
* simply subclass this adapter class instead of implementing the interface directly.
*/
public abstract class AnimatorListenerAdapter /*implements Animator.AnimatorListener,
Animator.AnimatorPauseListener*/ {
/**
* {@inheritDoc}
*/
public void onAnimationCancel(Animator animation) {
}
/**
* {@inheritDoc}
*/
public void onAnimationEnd(Animator animation) {
}
/**
* {@inheritDoc}
*/
public void onAnimationRepeat(Animator animation) {
}
/**
* {@inheritDoc}
*/
public void onAnimationStart(Animator animation) {
}
/**
* {@inheritDoc}
*/
public void onAnimationPause(Animator animation) {
}
/**
* {@inheritDoc}
*/
public void onAnimationResume(Animator animation) {
}
}

View File

@@ -0,0 +1,5 @@
package android.animation;
public class LayoutTransition {
}

View File

@@ -0,0 +1,33 @@
package android.animation;
public class ValueAnimator {
public static ValueAnimator ofFloat(float... values) {
return new ValueAnimator();
}
public ValueAnimator setDuration(long duration) {
return this;
}
public void addUpdateListener(AnimatorUpdateListener listener) {}
public static long getFrameDelay() {
return 20; // 20ms frame interval
}
/**
* Implementors of this interface can add themselves as update listeners
* to an <code>ValueAnimator</code> instance to receive callbacks on every animation
* frame, after the current frame's values have been calculated for that
* <code>ValueAnimator</code>.
*/
public static interface AnimatorUpdateListener {
/**
* <p>Notifies the occurrence of another frame of the animation.</p>
*
* @param animation The animation which was repeated.
*/
void onAnimationUpdate(ValueAnimator animation);
}
}