Android Open Source - sms-smap-gateway M W Anim Util






From Project

Back to project page sms-smap-gateway.

License

The source code is released under:

GNU General Public License

If you think the Android project sms-smap-gateway listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.android.smap.utils;
/*  w w  w  .j  a va 2  s. co m*/
import android.animation.Animator.AnimatorListener;
import android.animation.ObjectAnimator;
import android.os.Build;
import android.view.View;
import android.view.animation.DecelerateInterpolator;

public class MWAnimUtil {


    public static void pulseDown(View view) {
        pulseDown(view, new TransitionBundle());
    }

    public static void pulseDown(View view, TransitionBundle config) {
        if (supportsHoneycomb()) {
            view.setPivotY(1.0f);
            ObjectAnimator a = ObjectAnimator.ofFloat(view, "scaleY", 1.15f,
                    1.0f);
            a.setInterpolator(new DecelerateInterpolator());
            startWithConfig(a, config);
        }
    }
    
    public static void fadeIn(View view) {
        fadeIn(view, new TransitionBundle());
    }

    public static void fadeIn(View view, TransitionBundle c) {
        if (supportsHoneycomb()) {
            ObjectAnimator a = ObjectAnimator
                    .ofFloat(view, "alpha", 0.0f, 1.0f);
            a.setInterpolator(new DecelerateInterpolator());
            startWithConfig(a, c);
        }
    }
    
    private static void startWithConfig(ObjectAnimator a, TransitionBundle tb) {
        a.setDuration(tb.getDuration());

        if (tb.getListener() != null) {
            a.addListener(tb.getListener());
        }

        a.start();

        if (tb.isReversed()) {
            a.reverse();
        }
    }

    private static boolean supportsHoneycomb() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
    }

    public static class TransitionBundle {

        private static final int DEFAULT_ANIM_DURATION = 300;
        private long mDuration;
        private boolean mReverse;
        private AnimatorListener mListener;
        
        public TransitionBundle() {
            mDuration = DEFAULT_ANIM_DURATION;
            mReverse = false;
        }

        public void setDuration(long duration) {
            mDuration = duration;
        }

        public void setReversed(boolean reverse) {
            mReverse = reverse;
        }

        public void setListener(AnimatorListener listener) {
            mListener = listener;
        }

        public long getDuration() {
            return mDuration;
        }

        public boolean isReversed() {
            return mReverse;
        }

        public AnimatorListener getListener() {
            return mListener;
        }
    }

}




Java Source Code List

com.android.smap.AppConfig.java
com.android.smap.GatewayApp.java
com.android.smap.PhoneStateWrapper.java
com.android.smap.activities.BaseActivity.java
com.android.smap.activities.FragmentWrapperActivity.java
com.android.smap.activities.MainActivity.java
com.android.smap.adapters.MenuDrawerAdapter.java
com.android.smap.api.ApiConstants.java
com.android.smap.api.models.Gojo.java
com.android.smap.api.models.Node.java
com.android.smap.api.models.SmapException.java
com.android.smap.api.models.Status.java
com.android.smap.api.models.validator.ModelValidator.java
com.android.smap.api.models.validator.Required.java
com.android.smap.api.requests.ApiRequest.java
com.android.smap.api.requests.GojoRequest.java
com.android.smap.api.requests.StatusRequest.java
com.android.smap.commonsware.wakefull.AlarmReceiver.java
com.android.smap.commonsware.wakefull.WakefulIntentService.java
com.android.smap.controllers.ControllerErrorListener.java
com.android.smap.controllers.ControllerError.java
com.android.smap.controllers.ControllerFactory.java
com.android.smap.controllers.ControllerListener.java
com.android.smap.controllers.Controller.java
com.android.smap.controllers.EmailController.java
com.android.smap.controllers.GojoController.java
com.android.smap.controllers.UIPagingController.java
com.android.smap.controllers.UIRequestController.java
com.android.smap.fragments.BaseFragment.java
com.android.smap.fragments.HomeFragment.java
com.android.smap.models.MenuDrawerItem.java
com.android.smap.models.TextMessage.java
com.android.smap.samuel.Samuel.java
com.android.smap.sms.CellularModem.java
com.android.smap.sms.GatewayService.java
com.android.smap.sms.MonitorService.java
com.android.smap.sms.ScheduleMonitoringListener.java
com.android.smap.sms.ServiceRebooter.java
com.android.smap.ui.ArrayVelocAdapter.java
com.android.smap.ui.OnErrorTouchedListener.java
com.android.smap.ui.Operation.java
com.android.smap.ui.VelocAdapter.java
com.android.smap.ui.ViewBinder.java
com.android.smap.ui.ViewQuery.java
com.android.smap.ui.views.AnimatedNetworkImageView.java
com.android.smap.ui.views.ErrorView.java
com.android.smap.ui.views.FontableTextView.java
com.android.smap.utils.BitmapLruCache.java
com.android.smap.utils.MWAPNUtils.java
com.android.smap.utils.MWAnimUtil.java
com.android.smap.utils.MWAssetsUtils.java
com.android.smap.utils.MWConnectionUtils.java
com.android.smap.utils.MWEmailUtils.java
com.android.smap.utils.MWUiUtils.java
com.android.smap.utils.PreferenceWrapper.java
com.android.smap.utils.Refresher.java
com.android.smap.utils.UriBuilder.java