use of android.view.animation.RotateAnimation in project remusic by aa112901.
the class RecommendFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mContent = (ViewGroup) inflater.inflate(R.layout.fragment_recommend_container, container, false);
mLayoutInflater = LayoutInflater.from(mContext);
mRecommendView = mLayoutInflater.inflate(R.layout.recommend, container, false);
String date = Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + "";
TextView dailyText = (TextView) mRecommendView.findViewById(R.id.daily_text);
dailyText.setText(date);
mItemLayout = (LinearLayout) mRecommendView.findViewById(R.id.item_change);
mViewContent = (LinearLayout) mRecommendView.findViewById(R.id.recommend_layout);
if (!PreferencesUtility.getInstance(mContext).isCurrentDayFirst(date)) {
PreferencesUtility.getInstance(mContext).setCurrentDate(date);
View dayRec = mLayoutInflater.inflate(R.layout.loading_daymusic, container, false);
ImageView view1 = (ImageView) dayRec.findViewById(R.id.loading_dayimage);
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, 1, 0.5F, 1, 0.5F);
rotateAnimation.setDuration(20000L);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setRepeatCount(Animation.INFINITE);
rotateAnimation.setRepeatMode(Animation.INFINITE);
view1.startAnimation(rotateAnimation);
isDayFirst = true;
mContent.addView(dayRec);
}
mLoadView = mLayoutInflater.inflate(R.layout.loading, null, false);
mItemLayout.setVisibility(View.INVISIBLE);
mViewContent.addView(mLoadView);
mRecomendAdapter = new RecommendAdapter(null);
mNewAlbumsAdapter = new NewAlbumsAdapter(null);
mRadioAdapter = new RadioAdapter(null);
TextView change = (TextView) mRecommendView.findViewById(R.id.change_item_position);
change.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent itent = new Intent(mContext, NetItemChangeActivity.class);
mContext.startActivity(itent);
}
});
mLoodView = (LoodView) mRecommendView.findViewById(R.id.loop_view);
if (!isDayFirst) {
mContent.addView(mRecommendView);
}
return mContent;
}
use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.
the class MenuCircleShowingAnimation method closeRotation.
private void closeRotation() {
rotateCloseAnimation = new RotateAnimation(45, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateCloseAnimation.setFillAfter(true);
rotateCloseAnimation.setFillEnabled(true);
rotateCloseAnimation.setDuration(ANIMATION_TIME);
}
use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.
the class DropDownListView method initDropDownStyle.
/**
* init drop down style, only init once
*/
private void initDropDownStyle() {
if (headerLayout != null) {
if (isDropDownStyle) {
addHeaderView(headerLayout);
} else {
removeHeaderView(headerLayout);
}
return;
}
if (!isDropDownStyle) {
return;
}
headerReleaseMinDistance = context.getResources().getDimensionPixelSize(R.dimen.drop_down_list_header_release_min_distance);
flipAnimation = new RotateAnimation(0, 180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
flipAnimation.setInterpolator(new LinearInterpolator());
flipAnimation.setDuration(250);
flipAnimation.setFillAfter(true);
reverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
reverseFlipAnimation.setInterpolator(new LinearInterpolator());
reverseFlipAnimation.setDuration(250);
reverseFlipAnimation.setFillAfter(true);
headerDefaultText = context.getString(R.string.drop_down_list_header_default_text);
headerPullText = context.getString(R.string.drop_down_list_header_pull_text);
headerReleaseText = context.getString(R.string.drop_down_list_header_release_text);
headerLoadingText = context.getString(R.string.drop_down_list_header_loading_text);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
headerLayout = (RelativeLayout) inflater.inflate(R.layout.drop_down_list_header, this, false);
headerText = (TextView) headerLayout.findViewById(R.id.drop_down_list_header_default_text);
headerImage = (ImageView) headerLayout.findViewById(R.id.drop_down_list_header_image);
headerProgressBar = (ProgressBar) headerLayout.findViewById(R.id.drop_down_list_header_progress_bar);
headerSecondText = (TextView) headerLayout.findViewById(R.id.drop_down_list_header_second_text);
headerLayout.setClickable(true);
headerLayout.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
onDropDown();
}
});
headerText.setText(headerDefaultText);
addHeaderView(headerLayout);
measureHeaderLayout(headerLayout);
headerOriginalHeight = headerLayout.getMeasuredHeight();
headerOriginalTopPadding = headerLayout.getPaddingTop();
currentHeaderStatus = HEADER_STATUS_CLICK_TO_LOAD;
}
use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.
the class DropDownListView method initDropDownStyle.
/**
* init drop down style, only init once
*/
private void initDropDownStyle() {
if (headerLayout != null) {
if (isDropDownStyle) {
addHeaderView(headerLayout);
} else {
removeHeaderView(headerLayout);
}
return;
}
if (!isDropDownStyle) {
return;
}
headerReleaseMinDistance = context.getResources().getDimensionPixelSize(R.dimen.drop_down_list_header_release_min_distance);
flipAnimation = new RotateAnimation(0, 180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
flipAnimation.setInterpolator(new LinearInterpolator());
flipAnimation.setDuration(250);
flipAnimation.setFillAfter(true);
reverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
reverseFlipAnimation.setInterpolator(new LinearInterpolator());
reverseFlipAnimation.setDuration(250);
reverseFlipAnimation.setFillAfter(true);
headerDefaultText = context.getString(R.string.drop_down_list_header_default_text);
headerPullText = context.getString(R.string.drop_down_list_header_pull_text);
headerReleaseText = context.getString(R.string.drop_down_list_header_release_text);
headerLoadingText = context.getString(R.string.drop_down_list_header_loading_text);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
headerLayout = (RelativeLayout) inflater.inflate(R.layout.drop_down_list_header, this, false);
headerText = (TextView) headerLayout.findViewById(R.id.drop_down_list_header_default_text);
headerImage = (ImageView) headerLayout.findViewById(R.id.drop_down_list_header_image);
headerProgressBar = (ProgressBar) headerLayout.findViewById(R.id.drop_down_list_header_progress_bar);
headerSecondText = (TextView) headerLayout.findViewById(R.id.drop_down_list_header_second_text);
headerLayout.setClickable(true);
headerLayout.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
onDropDown();
}
});
headerText.setText(headerDefaultText);
addHeaderView(headerLayout);
measureHeaderLayout(headerLayout);
headerOriginalHeight = headerLayout.getMeasuredHeight();
headerOriginalTopPadding = headerLayout.getPaddingTop();
currentHeaderStatus = HEADER_STATUS_CLICK_TO_LOAD;
}
use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.
the class PullToRefreshView method init.
/**
* init
*
* @param
* @description
*/
private void init() {
// 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);
mInflater = LayoutInflater.from(getContext());
// header view 在此添加,保证是第一个添加到linearlayout的最上端
addHeaderView();
}
Aggregations