@@ -0,0 +1,1962 @@
+/*******************************************************************************%0A * Copyright 2014 Naver Business Platform Corp.%0A * %0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *******************************************************************************/%0Apackage com.handmark.pulltorefresh.library;%0A%0Aimport android.view.View;%0Aimport android.view.animation.AlphaAnimation;%0Aimport android.view.animation.Animation.AnimationListener;%0A/**%0A * AlphaAnimation Helper%0A * Just supports fade-in and fade-out%0A * @author Wonjun Kim%0A *%0A */%0Aclass AlphaAnimator %7B%0A%09%0A%09public static void fadein(View view, int duration) %7B%0A%09%09fadein(view, duration, null);%0A%09%7D%0A%09public static void fadein(View view, int duration, AnimationListener listener) %7B%0A%09%09animate(view, duration, listener, 0.0f, 1.0f);%0A%09%7D%0A%09%0A%09public static void fadeout(View view, int duration) %7B%0A%09%09fadeout(view, duration, null);%0A%09%7D%0A%09%0A%09public static void fadeout(View view, int duration, AnimationListener listener) %7B%0A%09%09animate(view, duration, listener, 1.0f, 0.0f);%0A%09%7D%0A%09%0A%09private static void animate(View view, int duration, AnimationListener listener, float fromAlpha, float targetAlpha) %7B%0A%09%09// Create new animation%0A%09%09AlphaAnimation newAnimation = new AlphaAnimation(fromAlpha, targetAlpha);%0A%09%09%0A%09%09newAnimation.setDuration(duration);%0A%09%09// Force fillAfter flag to be true%0A%09%09newAnimation.setFillAfter(true);%0A%09%09newAnimation.setAnimationListener(listener);%0A%09%09// Start fading%0A%09%09view.startAnimation(newAnimation);%0A%09%09%0A%09%7D%0A%7D%0A

Add AlphaAnimator