use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.
the class ArcLayout method createShrinkAnimation.
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) {
AnimationSet animationSet = new AnimationSet(false);
animationSet.setFillAfter(true);
final long preDuration = duration / 2;
Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setStartOffset(startOffset);
rotateAnimation.setDuration(preDuration);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setFillAfter(true);
animationSet.addAnimation(rotateAnimation);
Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
translateAnimation.setStartOffset(startOffset + preDuration);
translateAnimation.setDuration(duration - preDuration);
translateAnimation.setInterpolator(interpolator);
translateAnimation.setFillAfter(true);
animationSet.addAnimation(translateAnimation);
return animationSet;
}
use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.
the class ArcMenu method createHintSwitchAnimation.
private static Animation createHintSwitchAnimation(final boolean expanded) {
Animation animation = new RotateAnimation(expanded ? 45 : 0, expanded ? 0 : 45, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animation.setStartOffset(0);
animation.setDuration(100);
animation.setInterpolator(new DecelerateInterpolator());
animation.setFillAfter(true);
return animation;
}
use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.
the class RayMenu method createHintSwitchAnimation.
private static Animation createHintSwitchAnimation(final boolean expanded) {
Animation animation = new RotateAnimation(expanded ? 45 : 0, expanded ? 0 : 45, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animation.setStartOffset(0);
animation.setDuration(100);
animation.setInterpolator(new DecelerateInterpolator());
animation.setFillAfter(true);
return animation;
}
use of android.view.animation.RotateAnimation in project instructure-android by instructure.
the class StudentListView method initListView.
private void initListView(View popupView) {
// get the listview inside our popupwindow and set our adapter to it
mListView = (ListView) popupView.findViewById(R.id.studentList);
mSubmissionsAdapter = new UserSubmissionsListAdapter(mActivity.getApplicationContext(), mSubmissionsList, mAssignment, mListView, ((App) mActivity.getApplication()).showStudentNames(), mListener);
if (isSortByName) {
mSubmissionsAdapter.sortSubmissionsByName(((App) mActivity.getApplication()).showUngradedStudentsFirst());
} else {
mSubmissionsAdapter.sortSubmissionsByGrade();
}
final ViewGroup header = (ViewGroup) LayoutInflater.from(mActivity).inflate(R.layout.student_list_headerview, mListView, false);
final RelativeLayout row = (RelativeLayout) header.findViewById(R.id.row);
final LinearLayout dropDown = (LinearLayout) header.findViewById(R.id.rowDropdown);
final RadioGroup radioGroup = (RadioGroup) header.findViewById(R.id.radioGroup);
final ImageView expandArrow = (ImageView) header.findViewById(R.id.expandArrow);
final TextView sectionTitle = (TextView) header.findViewById(R.id.sectionTitle);
row.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ExpandCollapseAnimation.setHeightForWrapContent(mActivity, dropDown);
ExpandCollapseAnimation expandCollapseAnimation = new ExpandCollapseAnimation(dropDown, 200);
expandCollapseAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
RotateAnimation rotationAnim;
if (dropDown.getHeight() < 50) {
// For some reason, onAnimatinoEnd is getting called slightly before the animation actually ends, causing the height to be a value something greater than 0.
// currently closed
rotationAnim = new RotateAnimation(180, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
} else {
// currently open
rotationAnim = new RotateAnimation(0, 180, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
}
rotationAnim.setDuration(100);
rotationAnim.setFillAfter(true);
expandArrow.startAnimation(rotationAnim);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
dropDown.startAnimation(expandCollapseAnimation);
}
});
// Set our arrow to gray
final Drawable d = CanvasContextColor.getColoredDrawable(mApplicationContext, R.drawable.ic_cv_arrow_down_fill, ContextCompat.getColor(mActivity.getApplicationContext(), R.color.lightGray));
expandArrow.setImageDrawable(d);
mListView.addHeaderView(header);
mListView.setTextFilterEnabled(true);
mListView.setAdapter(mSubmissionsAdapter);
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// show the submission clicked
dismiss();
int positionInList = mSubmissionsAdapter.getPositionForSubmission((Submission) mListView.getItemAtPosition(position));
mListener.onCurrentSubmission(positionInList);
}
});
initSectionsRadioGroup(radioGroup, sectionTitle, header);
}
use of android.view.animation.RotateAnimation in project glitch-hq-android by tinyspeck.
the class PullToRefreshScrollView method init.
public void init(Activity context) {
// Load all of the animations we need in code rather than through XML
mFlipAnimation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
mFlipAnimation.setInterpolator(new LinearInterpolator());
mFlipAnimation.setDuration(250);
mFlipAnimation.setFillAfter(true);
mReverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
mReverseFlipAnimation.setDuration(250);
mReverseFlipAnimation.setFillAfter(true);
mRefreshView = context.findViewById(R.id.pull_to_refresh_header);
mRefreshViewText = (TextView) context.findViewById(R.id.pull_to_refresh_text);
m_rootImage = (View) context.findViewById(R.id.list_footer);
mRefreshViewText_bottom = (TextView) context.findViewById(R.id.pull_to_load_more_label);
mRefreshViewImage = (ImageView) context.findViewById(R.id.pull_to_refresh_image);
mRefreshViewProgress = (ProgressBar) context.findViewById(R.id.pull_to_refresh_progress);
mRefreshViewProgress_bottom = (ProgressBar) context.findViewById(R.id.pull_to_refresh_progress_bottom);
mRefreshViewLastUpdated = (TextView) context.findViewById(R.id.pull_to_refresh_updated_at);
mRefreshViewImage.setMinimumHeight(50);
mRefreshOriginalTopPadding = mRefreshView.getPaddingTop();
mRefreshState = TAP_TO_REFRESH;
// mRefreshView.setVisibility(View.GONE);
// m_rootImage.setVisibility(View.GONE);
measureView(mRefreshView);
mRefreshViewHeight = mRefreshView.getMeasuredHeight();
setSmoothScrollingEnabled(true);
// setOverScrollMode( OVER_SCROLL_IF_CONTENT_SCROLLS );
}
Aggregations