use of com.wm.remusic.widget.LoodView 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;
}
Aggregations