Search in sources :

Example 1 with EverydayModel

use of com.example.jingbin.cloudreader.model.EverydayModel in project CloudReader by youlookwhat.

the class EverydayFragment method onActivityCreated.

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    //        showLoading();
    showContentView();
    bindingView.llLoading.setVisibility(View.VISIBLE);
    animation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    //设置动画持续时间
    animation.setDuration(3000);
    //不停顿
    animation.setInterpolator(new LinearInterpolator());
    animation.setRepeatCount(10);
    bindingView.ivLoading.setAnimation(animation);
    animation.startNow();
    maCache = ACache.get(getContext());
    mEverydayModel = new EverydayModel();
    mBannerImages = (ArrayList<String>) maCache.getAsObject(Constants.BANNER_PIC);
    //        mLists = (ArrayList<List<AndroidBean>>) maCache.getAsObject(Constants.EVERYDAY_CONTENT);
    DebugUtil.error("----mBannerImages: " + (mBannerImages == null));
    DebugUtil.error("----mLists: " + (mLists == null));
    mHeaderBinding = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R.layout.header_item_everyday, null, false);
    // 设置本地数据点击事件等
    initLocalSetting();
    initRecyclerView();
    mIsPrepared = true;
    /**
         * 因为启动时先走loadData()再走onActivityCreated,
         * 所以此处要额外调用load(),不然最初不会加载内容
         */
    loadData();
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) EverydayModel(com.example.jingbin.cloudreader.model.EverydayModel)

Aggregations

LinearInterpolator (android.view.animation.LinearInterpolator)1 RotateAnimation (android.view.animation.RotateAnimation)1 EverydayModel (com.example.jingbin.cloudreader.model.EverydayModel)1