Search in sources :

Example 31 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project android_frameworks_base by AOSPA.

the class ZoomControls method fade.

private void fade(int visibility, float startAlpha, float endAlpha) {
    AlphaAnimation anim = new AlphaAnimation(startAlpha, endAlpha);
    anim.setDuration(500);
    startAnimation(anim);
    setVisibility(visibility);
}
Also used : AlphaAnimation(android.view.animation.AlphaAnimation)

Example 32 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project AisenWeiBo by wangdan.

the class DatePickerDialog method onCreateView.

public View onCreateView(LayoutInflater layoutInflater, ViewGroup parent, Bundle bundle) {
    getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    View view = layoutInflater.inflate(R.layout.date_picker_dialog, null);
    mDayOfWeekView = ((TextView) view.findViewById(R.id.date_picker_header));
    mMonthAndDayView = ((LinearLayout) view.findViewById(R.id.date_picker_month_and_day));
    mMonthAndDayView.setOnClickListener(this);
    mSelectedMonthTextView = ((TextView) view.findViewById(R.id.date_picker_month));
    mSelectedDayTextView = ((TextView) view.findViewById(R.id.date_picker_day));
    mYearView = ((TextView) view.findViewById(R.id.date_picker_year));
    mYearView.setOnClickListener(this);
    int listPosition = -1;
    int currentView = MONTH_AND_DAY_VIEW;
    int listPositionOffset = 0;
    if (bundle != null) {
        mWeekStart = bundle.getInt(KEY_WEEK_START);
        mMinYear = bundle.getInt(KEY_YEAR_START);
        mMaxYear = bundle.getInt(KEY_YEAR_END);
        currentView = bundle.getInt(KEY_CURRENT_VIEW);
        listPosition = bundle.getInt(KEY_LIST_POSITION);
        listPositionOffset = bundle.getInt(KEY_LIST_POSITION_OFFSET);
    }
    Activity activity = getActivity();
    mDayPickerView = new DayPickerView(activity, this);
    mYearPickerView = new YearPickerView(activity, this);
    Resources resources = getResources();
    mDayPickerDescription = resources.getString(R.string.day_picker_description);
    mSelectDay = resources.getString(R.string.select_day);
    mYearPickerDescription = resources.getString(R.string.year_picker_description);
    mSelectYear = resources.getString(R.string.select_year);
    mAnimator = ((AccessibleDateAnimator) view.findViewById(R.id.animator));
    mAnimator.addView(mDayPickerView);
    mAnimator.addView(mYearPickerView);
    mAnimator.setDateMillis(mCalendar.getTimeInMillis());
    AlphaAnimation inAlphaAnimation = new AlphaAnimation(0.0F, 1.0F);
    inAlphaAnimation.setDuration(300L);
    mAnimator.setInAnimation(inAlphaAnimation);
    AlphaAnimation outAlphaAnimation = new AlphaAnimation(1.0F, 0.0F);
    outAlphaAnimation.setDuration(300L);
    mAnimator.setOutAnimation(outAlphaAnimation);
    mDoneButton = ((Button) view.findViewById(R.id.done));
    mDoneButton.setOnClickListener(new View.OnClickListener() {

        public void onClick(View view) {
            onDoneButtonClick();
        }
    });
    updateDisplay(false);
    setCurrentView(currentView, true);
    if (listPosition != -1) {
        if (currentView == MONTH_AND_DAY_VIEW) {
            mDayPickerView.postSetSelection(listPosition);
        }
        if (currentView == YEAR_VIEW) {
            mYearPickerView.postSetSelectionFromTop(listPosition, listPositionOffset);
        }
    }
    return view;
}
Also used : Button(android.widget.Button) Activity(android.app.Activity) TextView(android.widget.TextView) Resources(android.content.res.Resources) View(android.view.View) TextView(android.widget.TextView) LinearLayout(android.widget.LinearLayout) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 33 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project wire-android by wireapp.

the class TabbedParticipantBodyFragment method onCreateAnimation.

@Override
public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
    final Fragment parent = getParentFragment();
    // is being removed.
    if (!enter && parent != null && parent.isRemoving()) {
        // This is a workaround for the bug where child fragments disappear when
        // the parent is removed (as all children are first removed from the parent)
        // See https://code.google.com/p/android/issues/detail?id=55228
        Animation doNothingAnim = new AlphaAnimation(1, 1);
        doNothingAnim.setDuration(ViewUtils.getNextAnimationDuration(parent));
        return doNothingAnim;
    } else {
        return super.onCreateAnimation(transit, enter, nextAnim);
    }
}
Also used : Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation) Fragment(android.support.v4.app.Fragment) BaseFragment(com.waz.zclient.pages.BaseFragment) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 34 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project wire-android by wireapp.

the class ParticipantHeaderFragment method onCreateAnimation.

@Override
public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
    final Fragment parent = getParentFragment();
    // is being removed.
    if (!enter && parent != null && parent.isRemoving()) {
        // This is a workaround for the bug where child fragments disappear when
        // the parent is removed (as all children are first removed from the parent)
        // See https://code.google.com/p/android/issues/detail?id=55228
        Animation doNothingAnim = new AlphaAnimation(1, 1);
        doNothingAnim.setDuration(ViewUtils.getNextAnimationDuration(parent));
        return doNothingAnim;
    } else {
        return super.onCreateAnimation(transit, enter, nextAnim);
    }
}
Also used : Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation) Fragment(android.support.v4.app.Fragment) BaseFragment(com.waz.zclient.pages.BaseFragment) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 35 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project wire-android by wireapp.

the class ParticipantBodyFragment method onCreateAnimation.

@Override
public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
    final Fragment parent = getParentFragment();
    // is being removed.
    if (!enter && parent != null && parent.isRemoving()) {
        // This is a workaround for the bug where child fragments disappear when
        // the parent is removed (as all children are first removed from the parent)
        // See https://code.google.com/p/android/issues/detail?id=55228
        Animation doNothingAnim = new AlphaAnimation(1, 1);
        doNothingAnim.setDuration(ViewUtils.getNextAnimationDuration(parent));
        return doNothingAnim;
    } else {
        return super.onCreateAnimation(transit, enter, nextAnim);
    }
}
Also used : Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation) Fragment(android.support.v4.app.Fragment) BaseFragment(com.waz.zclient.pages.BaseFragment) AlphaAnimation(android.view.animation.AlphaAnimation)

Aggregations

AlphaAnimation (android.view.animation.AlphaAnimation)349 Animation (android.view.animation.Animation)152 TranslateAnimation (android.view.animation.TranslateAnimation)102 AnimationSet (android.view.animation.AnimationSet)101 ScaleAnimation (android.view.animation.ScaleAnimation)65 View (android.view.View)33 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)30 LinearInterpolator (android.view.animation.LinearInterpolator)28 WindowAnimation_activityCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation)26 WindowAnimation_activityCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation)26 WindowAnimation_activityOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation)26 WindowAnimation_activityOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation)26 WindowAnimation_taskCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation)26 WindowAnimation_taskCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation)26 WindowAnimation_taskOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation)26 WindowAnimation_taskOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation)26 WindowAnimation_taskToBackEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation)26 WindowAnimation_taskToBackExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation)26 WindowAnimation_taskToFrontEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation)26 WindowAnimation_taskToFrontExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation)26