You are on page 1of 1

public class LoadingManager{ private RelativeLayout loadingLayout;

private View layout; public LoadingManager(Context context, View view,


View layout){ loadingLayout = (RelativeLayout)
view.findViewById(R.id.loading_layout); this.layout = layout; final
GifImageView imageView = (GifImageView)
view.findViewById(R.id.loader);
imageView.setImageResource(R.drawable.loader); final GifDrawable
drawable = (GifDrawable) imageView.getDrawable(); //To make the gif
drawable infinity drawable.setLoopCount(0); } public void
showLoading(){ layout.setVisibility(View.GONE);
loadingLayout.setVisibility(View.VISIBLE); } public void stopLoading(){
layout.setVisibility(View.VISIBLE);
loadingLayout.setVisibility(View.GONE); }}

You might also like