Back to project page SpunkyCharts.
The source code is released under:
GNU General Public License
If you think the Android project SpunkyCharts listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jogden.spunkycharts.animations; /* /*from w ww.j a va 2s . com*/ Copyright (C) 2014 Jonathon Ogden < jeog.dev@gmail.com > This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses. */ import com.jogden.spunkycharts.BaseChartFragmentA; import com.jogden.spunkycharts.DockingPanelActivity; import android.animation.Animator; import android.animation.PropertyValuesHolder; import android.animation.TimeInterpolator; import android.animation.ValueAnimator; import android.content.Context; import android.util.AttributeSet; import android.widget.RelativeLayout; import android.animation.ObjectAnimator; /** This is the base class for custom Enter-Exit animations. These * will control frag animations when it enters and exits the screen. * </p> * (CURRENTLY NOT IMPLEMENTED: because android limits * fragment transaction animations, and restricts sub-classing * ObjectAnimator, we are experimenting with other ways to * implement.) */ public abstract class BaseEntExAnimationA extends Animator { private static BaseChartFragmentA _frag = null; private static RelativeLayout.LayoutParams _lParams = null; private static RelativeLayout.LayoutParams _offTopParams = null; private ObjectAnimator _object = new ObjectAnimator(); static public void setFragOnDeck(BaseChartFragmentA frag) { _frag = frag; } static public void setFragParamsOnDeck( RelativeLayout.LayoutParams lParams ){ _lParams = DockingPanelActivity.copyParams(lParams); if(_lParams != null) _offTopParams = DockingPanelActivity.copyParams(_lParams); _offTopParams.height = 0; } // abstract public void setupInitialFragParams(); public BaseEntExAnimationA(Context c, AttributeSet a, int s) { super(); if(_frag != null) this.setTarget(_frag); else throw new RuntimeException("_frag can't be null"); _object.setDuration(10000); _object.setPropertyName("alpha"); _object.setTarget(_frag); _object.setFloatValues(0,1f); } @Override public long getStartDelay() { return _object.getStartDelay(); } @Override public void setStartDelay(long startDelay) { _object.setStartDelay(startDelay); } @Override public Animator setDuration(long duration) { _object.setDuration(duration); return this; } @Override public long getDuration() { return _object.getDuration(); } @Override public void setInterpolator(TimeInterpolator value) { _object.setInterpolator(value); } @Override public boolean isRunning() { return _object.isRunning(); } @Override public void start(){ _object.start(); } }