package kr.co.hanwha.hifive.view.refresh;

import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.ImageView;

import kr.co.hanwha.hifive.R;


/**
 * Created by sanghoonkwon on 2018. 1. 12..
 */

public class FooterView extends FrameLayout implements FooterListener {

//    AnimationDrawable mFrameAnimation;
//    ImageView mImageViewLoading;
//    int mNumberOfFrames;

    public FooterView(Context context) {
        super(context);
        LayoutInflater.from(context).inflate(R.layout.item_refresh_footer, this, true);
//        mImageViewLoading = (ImageView) findViewById(R.id.loading_imageView);
//        mFrameAnimation = (AnimationDrawable) mImageViewLoading.getBackground();
//        mNumberOfFrames = mFrameAnimation.getNumberOfFrames();
    }

    @Override
    public void onLoadBefore(int scrollY) {
//        Drawable background = mImageViewLoading.getBackground();
//        if (background instanceof AnimationDrawable) {
//            ((AnimationDrawable) background).stop();
//        }
//        mImageViewLoading.setBackground(mFrameAnimation.getFrame(0));
    }

    @Override
    public void onLoadAfter(int scrollY) {
    }

    @Override
    public void onLoadReady(int scrollY) {
//        mImageViewLoading.setBackground(mFrameAnimation);
//        ((AnimationDrawable) mImageViewLoading.getBackground()).start();
    }

    @Override
    public void onLoading(int scrollY) {
    }

    @Override
    public void onLoadComplete(int scrollY, boolean isLoadSuccess) {
    }

    @Override
    public void onLoadCancel(int scrollY) {
    }
}
