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);
}
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;
}
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);
}
}
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);
}
}
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);
}
}
Aggregations