package cancer.findyourfate.com;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.ImageView; 

public class compatibility extends Fragment{
	
	ImageView taursign,othersign;
	ImageView aries,taurus,gemini,cancer,leo,virgo,libra,scorp,sagg,capri,aquar,pisces;
	String sign;
	View rootView; 
    ProgressDialog progressBar;
	private int progressBarStatus = 0;
	private Handler progressBarHandler = new Handler();

	private long fileSize = 0;

  	   @Override
	   public View onCreateView(LayoutInflater inflater, ViewGroup container,
		        Bundle savedInstanceState) {
                  rootView = inflater.inflate(R.layout.compattab, container, false);
			     
			     String userAgent = new WebView(getActivity()).getSettings().getUserAgentString();
					if (userAgent.contains("Mobile")) {
					rootView = inflater.inflate(R.layout.compat, container, false);
				 	} 
					else {
					rootView = inflater.inflate(R.layout.compattab, container, false);
					}
			     
			  		taursign=(ImageView) rootView.findViewById(R.id.taurview);
					othersign=(ImageView) rootView.findViewById(R.id.signview);
				 	aries=(ImageView) rootView.findViewById(R.id.aries);
					taurus=(ImageView) rootView.findViewById(R.id.taur);
					gemini=(ImageView) rootView.findViewById(R.id.gemin);
					cancer=(ImageView) rootView.findViewById(R.id.cancer);
					leo=(ImageView) rootView.findViewById(R.id.leo);
					virgo=(ImageView) rootView.findViewById(R.id.virgo);
					libra=(ImageView) rootView.findViewById(R.id.libra);
					scorp=(ImageView) rootView.findViewById(R.id.scorp);
					sagg=(ImageView) rootView.findViewById(R.id.sagg);
					capri=(ImageView) rootView.findViewById(R.id.capri);
					aquar=(ImageView) rootView.findViewById(R.id.aquar);
					pisces=(ImageView) rootView.findViewById(R.id.pisces);
			     
					aries.setOnClickListener(new View.OnClickListener() {
						@Override
						public void onClick(View v) {
							// TODO Auto-generated method stub
							
					 		
						    othersign.setImageResource(R.drawable.aries);
		 					sign="Aries";
		 					
		 					progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility  Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 		
		 					progressBarStatus = 0;
		 					fileSize = 0;
		 					
		 					
		 					new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}

		 							 	 Fragment newFragment = new signs();  
				         					Bundle args = new Bundle();  
				         					args.putString("signs",sign);
				         				 	newFragment.setArguments(args);
				         				 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
				         					transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
				         	 				transaction.replace(R.id.frame, newFragment);  
				         					transaction.commit();  
				         					progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
						 
						while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
							
						}
				 
						return 100;
				 	}
				});
			
			     
				 	taurus.setOnClickListener(new View.OnClickListener() {
					 	@Override
						public void onClick(View v) {
							// TODO Auto-generated method stub
					 		sign="Taurus";
							othersign.setImageResource(R.drawable.taurus);
							
							progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 				 	progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 			progressBarStatus = 0;
		 			fileSize = 0;
		 			new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
					  	           	 		Fragment newFragment = new signs();  
												Bundle args = new Bundle();  
												args.putString("signs",sign);
											 	newFragment.setArguments(args);
											 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
												transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
								 				transaction.replace(R.id.frame, newFragment);  
												transaction.commit();  
												progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
						 
						while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
							
						}
				 
						return 100;
				 	}
				});
					gemini.setOnClickListener(new View.OnClickListener() {
					 	@Override
						public void onClick(View v) {
							// TODO Auto-generated method stub
					 		sign="Gemini";
							othersign.setImageResource(R.drawable.gemini);
							
							progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 		
		 					progressBarStatus = 0;
		 					fileSize = 0;
		 					
		 					
		 					new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
							Fragment newFragment = new signs();  
							Bundle args = new Bundle();  
							args.putString("signs",sign);
						 	newFragment.setArguments(args);
						 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
							transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
			 				transaction.replace(R.id.frame, newFragment);  
							transaction.commit();  
							progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
						 
						while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
							
						}
				 
						return 100;
				 	}
				});
					cancer.setOnClickListener(new View.OnClickListener() {
					 	@Override
						public void onClick(View v) {
					 		sign="Cancer";
							othersign.setImageResource(R.drawable.cancer1);
							progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 		
		 					progressBarStatus = 0;
		 					fileSize = 0;
		 					
		 					
		 					new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
							Fragment newFragment = new signs();  
							Bundle args = new Bundle();  
							args.putString("signs",sign);
						 	newFragment.setArguments(args);
						 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
							transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
			 				transaction.replace(R.id.frame, newFragment);  
							transaction.commit();  
							progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
						 
						while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
							
						}
				 
						return 100;
				 	}
				});
					leo.setOnClickListener(new View.OnClickListener() {
					 	@Override
						public void onClick(View v) {
					 		sign="Leo";
							othersign.setImageResource(R.drawable.leo);
							progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 		
		 					progressBarStatus = 0;
		 					fileSize = 0;
		 					
		 					
		 					new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
							Fragment newFragment = new signs();  
							Bundle args = new Bundle();  
							args.putString("signs",sign);
						 	newFragment.setArguments(args);
						 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
							transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
			 				transaction.replace(R.id.frame, newFragment);  
							transaction.commit();  
							progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
		 				while (fileSize <= 1000000) {
		 					fileSize++;
		 					if (fileSize == 100000) {
								return 10;
							}
						}
						return 100;
				 		}
					});
					
						virgo.setOnClickListener(new View.OnClickListener() {
					 	@Override
						public void onClick(View v) {
						 	sign="Virgo";
							othersign.setImageResource(R.drawable.virgo);
							
							progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		  	progressBarStatus = 0;
		 					fileSize = 0;
		 			 		new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
							Fragment newFragment = new signs();  
							Bundle args = new Bundle();  
							args.putString("signs",sign);
						 	newFragment.setArguments(args);
						 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
							transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
			 				transaction.replace(R.id.frame, newFragment);  
							transaction.commit();  
							progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
						 
						while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
							
						}
				 
						return 100;
				 	}
				});
					
					libra.setOnClickListener(new View.OnClickListener() {
					 	@Override
						public void onClick(View v) {
					 		sign="Libra";
						  	othersign.setImageResource(R.drawable.libra);
						  	progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 		
		 					progressBarStatus = 0;
		 					fileSize = 0;
		 					
		 					
		 					new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
						  	Fragment newFragment = new signs();  
							Bundle args = new Bundle();  
							args.putString("signs",sign);
						 	newFragment.setArguments(args);
						 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
							transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
			 				transaction.replace(R.id.frame, newFragment);  
							transaction.commit();  
							progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
						 
						while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
							
						}
				 
						return 100;
				 	}
				});
					
					scorp.setOnClickListener(new View.OnClickListener() {
					 	@Override
						public void onClick(View v) {
					 		sign="Scorpio";
							othersign.setImageResource(R.drawable.scorpio);
							progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 		
		 					progressBarStatus = 0;
		 					fileSize = 0;
		 					
		 					
		 					new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
							Fragment newFragment = new signs();  
							Bundle args = new Bundle();  
							args.putString("signs",sign);
						 	newFragment.setArguments(args);
						 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
							transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
			 				transaction.replace(R.id.frame, newFragment);  
							transaction.commit();  
							progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
						 
						while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
							
						}
				 
						return 100;
				 	}
				});
					
					sagg.setOnClickListener(new View.OnClickListener() {
					 	@Override
						public void onClick(View v) {
					 		sign="Sagittarius";
							othersign.setImageResource(R.drawable.sagg);
							progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 		
		 					progressBarStatus = 0;
		 					fileSize = 0;
		 					
		 					
		 					new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
							Fragment newFragment = new signs();  
							Bundle args = new Bundle();  
							args.putString("signs",sign);
						 	newFragment.setArguments(args);
						 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
							transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
			 				transaction.replace(R.id.frame, newFragment);  
							transaction.commit();  
							progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
						 
						while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
							
						}
				 
						return 100;
				 	}
				});
					
					capri.setOnClickListener(new View.OnClickListener() {
					 	@Override
						public void onClick(View v) {
					 		sign="Capricorn";
							othersign.setImageResource(R.drawable.capri);
							progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 		
		 					progressBarStatus = 0;
		 					fileSize = 0;
		 					
		 					
		 					new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
							Fragment newFragment = new signs();  
							Bundle args = new Bundle();  
							args.putString("signs",sign);
						 	newFragment.setArguments(args);
						 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
							transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
			 				transaction.replace(R.id.frame, newFragment);  
							transaction.commit();  
							progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
						 
						while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
							
						}
				 
						return 100;
				 	}
				});
					aquar.setOnClickListener(new View.OnClickListener() {
					 	@Override
						public void onClick(View v) {
					 		sign="Aquarius";
							othersign.setImageResource(R.drawable.aquar);
							
							progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 		
		 					progressBarStatus = 0;
		 					fileSize = 0;
		 					
		 					
		 					new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
							Fragment newFragment = new signs();  
							Bundle args = new Bundle();  
							args.putString("signs",sign);
						 	newFragment.setArguments(args);
						 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
							transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
			 				transaction.replace(R.id.frame, newFragment);  
							transaction.commit();  
							progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
					public int doSomeTasks() {
						 
						while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
							
						}
				 
						return 100;
				 	}
				});
					pisces.setOnClickListener(new View.OnClickListener() {
				 	@Override
					public void onClick(View v) {
				 		sign="Pisces";
							othersign.setImageResource(R.drawable.pisces);
							
							progressBar = new ProgressDialog(v.getContext());
		 					progressBar.setProgressDrawable(getActivity().getResources().getDrawable(R.drawable.progress));  
		 					progressBar.setCancelable(true);
		 					progressBar.setTitle("Please Wait ...");
		 					progressBar.setMessage("Compatibility Calculation in progress..  ");
		 					progressBar.setIcon(R.drawable.compat);
		 					progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		 					progressBar.setProgress(0);
		 					progressBar.setMax(20);
		 					progressBar.show();
		 		 
		 		
		 					progressBarStatus = 0;
		 					fileSize = 0;
		 					
		 					
		 					new Thread(new Runnable() {
		 						  public void run() {
		 							while (progressBarStatus < 20) {
		 			 
		 							   progressBarStatus = doSomeTasks();
		 			 
		 						 	  try {
		 								Thread.sleep(1200);
		 							  } catch (InterruptedException e) {
		 								e.printStackTrace();
		 							  }
		 			 
		 						 	  progressBarHandler.post(new Runnable() {
		 								public void run() {
		 								  progressBar.setProgress(progressBarStatus);
		 								}
		 							  });
		 							}
		 			 
		 						 	if (progressBarStatus >= 20) {
		 			 
		 							 	try {
		 									Thread.sleep(1200);
		 								} catch (InterruptedException e) {
		 									e.printStackTrace();
		 								}
		 			 
							Fragment newFragment = new signs();  
							Bundle args = new Bundle();  
							args.putString("signs",sign);
						 	newFragment.setArguments(args);
						 	FragmentTransaction transaction = getFragmentManager().beginTransaction();
							transaction.setCustomAnimations(R.anim.bottom_in,R.anim.top_out);
			 				transaction.replace(R.id.frame, newFragment);  
							transaction.commit();  
							progressBar.dismiss();
		 						 	}
		 						  }
		 					 }).start();
		 			}
				 	
					public int doSomeTasks() {
				 		while (fileSize <= 1000000) {
				 
							fileSize++;
				 
							if (fileSize == 100000) {
								return 10;
							}
					 	}
			 			return 100;
				 	}
				});
				return rootView;
			}
}