package com.example.petish;


import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation.AnimationListener;
import android.widget.ImageView;

public class Loading extends Activity implements AnimationListener {

	ImageView iv;
	ImageView blink;

	// Animation
	Animation animFadein;
	Animation animBlink;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_loading);

		iv = (ImageView) findViewById(R.id.imageView1);
		blink = (ImageView)findViewById(R.id.imageView2);

		// load the animation
		animFadein = AnimationUtils.loadAnimation(getApplicationContext(),
				R.anim.fade_logo);
		animBlink = AnimationUtils.loadAnimation(getApplicationContext(),
				R.anim.blink);
		// set animation listener
		animFadein.setAnimationListener(this);
		
				iv.setVisibility(View.VISIBLE);
				iv.startAnimation(animFadein);
				blink.setVisibility(View.VISIBLE);	
				blink.startAnimation(animBlink);
				
				// SPLASH SCREEN
				Thread loading = new Thread(){
		        	
		        	public void run() {
		        		try{
		        			sleep(5000);
		        		}catch(Exception e){
		        			e.printStackTrace();
		        		}finally{
		        			startActivity(new Intent(getApplicationContext(),Main.class));
		        			finish();
		        		}
		        	}
		        	
		        };
		        loading.start();
			};

	
public class Act extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loading);
        
        
        // Thread for displaying the Splash Screen
        
    }

   
    
}


@Override
public void onAnimationEnd(Animation animation) {
	// TODO Auto-generated method stub
	
}


@Override
public void onAnimationRepeat(Animation animation) {
	// TODO Auto-generated method stub
	
}


@Override
public void onAnimationStart(Animation animation) {
	// TODO Auto-generated method stub
	
}
}
