Search in sources :

Example 1 with LoodView

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;
}
Also used : Intent(android.content.Intent) SpannableString(android.text.SpannableString) ImageView(android.widget.ImageView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) LoodView(com.wm.remusic.widget.LoodView) NetItemChangeActivity(com.wm.remusic.activity.NetItemChangeActivity) RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) TextView(android.widget.TextView) ImageView(android.widget.ImageView)

Aggregations

Intent (android.content.Intent)1 RecyclerView (android.support.v7.widget.RecyclerView)1 SpannableString (android.text.SpannableString)1 View (android.view.View)1 LinearInterpolator (android.view.animation.LinearInterpolator)1 RotateAnimation (android.view.animation.RotateAnimation)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 SimpleDraweeView (com.facebook.drawee.view.SimpleDraweeView)1 NetItemChangeActivity (com.wm.remusic.activity.NetItemChangeActivity)1 LoodView (com.wm.remusic.widget.LoodView)1