package findyourfate.com.porutham;


import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;

import android.annotation.SuppressLint;
import androidx.appcompat.widget.Toolbar;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;

public class tamilcontent extends AppCompatActivity {
	public static final String MyPREFERENCES = "MyPrefs";
	public static final String name = "fontsize";
	public static SharedPreferences sharedpreferences;
	private static Typeface mTypeface;
	final Context context = this;

	ImageView image;

	TextView t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23,
			t24;
	TextView title;
	int fsize, ssize;

	@SuppressLint("NewApi")
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.details);

		
        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

		FirebaseDatabase database = FirebaseDatabase.getInstance();
		DatabaseReference ref = database.getReference("Description");
		ref.setValue("Description");

		DisplayMetrics metrics = new DisplayMetrics();
		Activity activity = (Activity) context;
		activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);

		if (metrics.densityDpi <= DisplayMetrics.DENSITY_LOW) {
			// Toast.makeText(this, "low screen",Toast.LENGTH_LONG).show();
			ssize = 13;
		} else if (metrics.densityDpi <= DisplayMetrics.DENSITY_HIGH) {
			// Toast.makeText(this, "high screen",Toast.LENGTH_LONG).show();
			ssize = 15;
		} else if (metrics.densityDpi <= DisplayMetrics.DENSITY_MEDIUM) {
			// Toast.makeText(this, "medium screen",Toast.LENGTH_LONG).show();
			ssize = 17;
		} else if (metrics.densityDpi <= DisplayMetrics.DENSITY_XHIGH) {
			// Toast.makeText(this, "xLarge screen",Toast.LENGTH_LONG).show();
			ssize = 20;
		} else if (metrics.densityDpi <= DisplayMetrics.DENSITY_XXHIGH) {
			// Toast.makeText(this, "xxLarge screen",Toast.LENGTH_LONG).show();
			ssize = 23;
		} else if (metrics.densityDpi <= DisplayMetrics.DENSITY_XXXHIGH) {
			ssize = 25;
		} else {
			ssize = 15;
		}

		String fontkey = getfontName();
		if (fontkey != null) {
			if (fontkey.equals("Small")) {
				fsize = 13;
			} else if (fontkey.equals("Medium")) {
				fsize = 17;
			} else if (fontkey.equals("Large")) {
				fsize = 21;
			}
			if (fontkey.equals("Larger")) {
				fsize = 25;
			}
			if (fontkey.equals("X-Large")) {
				fsize = 28;
			}
		} else {
			fsize = ssize;
		}

		mTypeface = Typeface.createFromAsset(getAssets(), "fonts/Bamini.ttf");
		int titleId = getResources().getIdentifier("action_bar_title", "id",
				"android");
		TextView yourTextView = (TextView) findViewById(titleId);

if (yourTextView != null) {
    yourTextView.setText("10 பொருத்தம்"); // Tamil text
    // Optionally, configure toolbar settings
        if (getSupportActionBar() != null) {
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
            getSupportActionBar().setHomeButtonEnabled(true);
        }
}

		
		title = (TextView) findViewById(R.id.title);
		t1 = (TextView) findViewById(R.id.textView1);
		t2 = (TextView) findViewById(R.id.textView2);
		t3 = (TextView) findViewById(R.id.textView3);
		t4 = (TextView) findViewById(R.id.textView4);
		t5 = (TextView) findViewById(R.id.textView5);
		t6 = (TextView) findViewById(R.id.textView6);
		t7 = (TextView) findViewById(R.id.textView7);
		t8 = (TextView) findViewById(R.id.textView8);
		t9 = (TextView) findViewById(R.id.textView9);
		t10 = (TextView) findViewById(R.id.textView10);
		t11 = (TextView) findViewById(R.id.textView11);
		t12 = (TextView) findViewById(R.id.textView12);
		t13 = (TextView) findViewById(R.id.textView13);
		t14 = (TextView) findViewById(R.id.textView14);
		t15 = (TextView) findViewById(R.id.textView15);
		t16 = (TextView) findViewById(R.id.textView16);
		t17 = (TextView) findViewById(R.id.textView17);
		t18 = (TextView) findViewById(R.id.textView18);
		t19 = (TextView) findViewById(R.id.textView19);
		t20 = (TextView) findViewById(R.id.textView20);
		t21 = (TextView) findViewById(R.id.textView21);
		t22 = (TextView) findViewById(R.id.textView22);
		t23 = (TextView) findViewById(R.id.textView23);
		t24 = (TextView) findViewById(R.id.textView24);

        // mTypeface = Typeface.createFromAsset(tamilcontent.this.getAssets(),
		// "fonts/ARIAL.TTF");

	    
		title.setTypeface(mTypeface);
		title.setText(" 10 nghUj;jk;");
		t1.setTextSize(fsize);
		t1.setTypeface(mTypeface);
		t1.setText("jpUkz nghUj;jk; ,e;jpa Ntj N[hjplj;jpd; gb");
		t2.setTextSize(fsize);
		t2.setTypeface(mTypeface);
		t2.setText(
				"jpUkzk; vd;gJ xU  kdg;G+u;khf  kzkfidAk; > kzkfisAk; ,izf;fpwJ . jpUkzk;  ,e;jpahtpy;  ,e;Jf;fspd; Gdpj jpdkhf fUj;jg;gLfpwJ.nghJthf ek; ehl;by; jpUkdk; nra;Jnfhs;s  Nghfpd;w Mdpd; [hjfj;ijAk;> ngd;dzPd; [hjfj;ijAk; nghUj;jPg; ghu;j;J gpd; ek; ghuk;gupa Kiwg;gbahd jrtpjg; nghUj;jq;fs; cz;L vd;w gpd;Nd fy;ahzk; epr;rak; nra;fpNwhk;.rpwg;ghd jpUkz tho;f;if ngw mtu;fs; jdf;F Vw;w Jiziakzf;f Ntz;Lk;. rpwg;ghd Jiz ahu; vd;gij mwpa  jpUkz  nghUj;jq;fs;  ek; Kd;Ndhu;fshy; Vw;gLj;j gl;ld . gz;ila ,e;jpa Kdptu;fSf;F kw;Wk; Gdpju;fs; 'jpUkz   nghUj;jk;'> '[hjf nghUj;jk;' my;yJ '10 nghUj;jk;' vd;W miof;fg;gLk; jpUkzk; xj;Jg;NghFk; my;yJ jpUkz nghUe;jf;$ba  xU Kiw jpl;lkpl;ldu;.jpUkz nghUj;jj;jpy; kpf Kf;fpa nghUj;jk; vd;gJ  Mz; kw;Wk; ngz; el;rj;jpuq;fis  mbg;gilahf nfhz;lJ.vj;jddNah nghUj;jq;fs; ,Ug;gpDk; (nkhj;jk; ,UgJ nghUj;jq;fs; cs;sd) .  ,jpy; 10 nghUj;jq;fs; kl;LNk epiyahdjhf fUjg;gLfpwJ. NkYk; ,e;jpahtpd; rpy gFjpfspy; 8 nghUj;jq;fs; kl;Lk;  fzf;fplg;gLfpwJ.,JNt jkpopy; 10 nghUj;jk; vd;W miof;fg;gLfpwJ");
		t3.setTextSize(fsize);
		t3.setTypeface(mTypeface);
		t3.setText(" 10 nghUj;jk; / jpUkz nghUj;jk; ");
		t4.setTextSize(fsize);
		t4.setTypeface(mTypeface);
		t4.setText(
				",e;jpa N[hjpl Nfhl;ghLfspd; gb> xU Rw;wpy; 28 el;rj;jpuq;fs; ,Uf;fpd;wd. ,it etf;fpuf kz;lgj;jpy; (xd;gJ fpufq;fs;) vd;W miof;fg;gLfpd;wd.jpUkz   ge;jj;jpy;  ,ida ,Uf;Fk; Mz; kw;Wk; ngz;zpd; gpwe;j el;rj;jpuk; kw;Wk; uhrpia nfhz;L jpUkz nghUj;jq;fs; mwpag;gLfpwJ. rupahd el;rj;jpuq;fs; xd;Wld; xd;W ,ize;jjhy; ed;ikfs; cz;lhFk;. jpUkzj;jpd; NghJ [hjfupd;  el;rj;jpuk;>yf;dk;> ,uz;lhk; tPL> VohtJ tPL>n[d;k uhrp> elf;Fk; jrh Gj;jpfs;   midj;Jk; cWjpg;gLj;jg;gLfpwJ.");
		t5.setTextSize(fsize);
		t5.setTypeface(mTypeface);
		t5.setText(" 1) jpdk; ( jpd MA\\;a MNuhf;ak;)");
		t6.setTextSize(fsize);
		t6.setTypeface(mTypeface);
		t6.setText(
				"fztd; kidtp tWik kw;Wk; Neha;fsplkpUe;J  tpNkhrdj;jpw;F   kw;Wk; midj;J trjpfSk; nfhz;l tho;f;if  cz;lhf    jpd nghUj;jk; mtrpak;.ngz; el;rj;jpuq;fis njhlq;fp vz;Zk; NghJ   2>4>6>8>9>11>13>15>18>20>24 my;yJ 26 fpilj;jhy; jpd nghUj;jk; cz;L. Nuhfpzp>jpUthjpiu> kfk;> tprhfk;>jpUNthzk;>m];jk;>cj;jpuhlk; kw;Wk; Nutjp Mfpa el;rj;jpuq;fs; Mz; ngz; ,UtUf;Fk; xd;whf ,Ue;jhy; jpd nghUj;jk; cz;L.mtu;fs; kpUfrPuplk;> m];tpdp> fhu;j;jpif> Gdu;G+rk;> G+rk;> cj;jpul;lhjp> rpj;jpiu> G+ul;lhjp  Mfpa el;rj;jpuq;fspy; ,Ue;jhy; jpd nghUj;jk;  kj;jpakhf ,Uf;Fk;. ,uz;L el;rj;jpuq;fSk; xd;whf ,Ue;jhy; Mzpd; el;rj;jpuk; toptFf;fpwJ.");
		t7.setTextSize(fsize);
		t7.setTypeface(mTypeface);
		t7.setText("2) fzk; ( N\\hgdk; fzk; vtr;r)  ");
		t8.setTextSize(fsize);
		t8.setTypeface(mTypeface);
		t8.setText(
				",J> kdpj kdq;fs; kw;Wk; mtu;fspd; kNdhepiy nghUe;Jk; MfpwJ.N[hjplj;‌jpd; gb 3 fzk; cs;sd. Njt fzk;> kdpj fzk;> uhl;r] fzk;. ,UtUf;Fk; Njt  my;yJ kdpj  fzk; ,Ug;gpd; jpUkzk; nra;ayhk;. ngz; Njt  fzkhf ,Ue;J Mz;  kdpj fzkhf ,Ue;jhy; fz nghUj;jk; kj;jpak;.  ,uz;L  el;rj;jpuq;fSk; uhl;r]  fzkhf ,Ue;jhy;> mtu;f;fSf;F nghUj;jk; ,y;iy.,e;j xg;ge;jk; jpUkz tho;f;iff;F re;Njh\\j;ij mspf;fpwJ.");
		t9.setTextSize(fsize);
		t9.setTypeface(mTypeface);
		t9.setText("3) Nahdp ( NahdpNjh jk;gjp ];Ne`k;)");
		t10.setTextSize(fsize);
		t10.setTypeface(mTypeface);
		t10.setText(
				"jkpo;  N[hjplj;jpd; gb xt;nthU el;rj;jpuj;jpw;Fk; xU tpyq;F xJf;fg;gLk;.  jpUkzj;jpy; Nahdp nghUj;jk; tpyq;Ffs;> ,ilNa cwT my;yJ gifik kw;Wk; jPu;khdpf;fg;gLfpwJ.Mz; kw;Wk; ngz; gpwe;j el;rj;jpuq;fs; njhlu;Gila Nahdp vjpupfs; my;y vd;why;> mJ rpwe;j Nahdp nghUj;jk; MfpwJ.khL Gyp> ahid kw;Wk; rpq;fk;> Fjpiu kw;Wk; vUJ> eha; kw;Wk;  khd;> vyp kw;Wk;  G+id> ML kw;Wk; Fuq;F> ghk;G kw;Wk; fPupg;gps;is xUtUf;nfhUtu; vjpupfs; vdNt Nahdp nghUj;jk; ,y;iy.gu];gu vjpupfs; el;rj;jpuq;fSf;Fs; cld;ghL ,y;iy. mtu;fs; eha; kw;Wk; khlhf ,Ue;jhy; Nahdp nghUj;jk; kj;jpak;.,e;j xg;ge;jk; fztd; kidtpf;F ,ilNa  gu];gu md;ig mspf;fpwJ.");
		t11.setTextSize(fsize);
		t11.setTypeface(mTypeface);
		t11.setText("4) uhrp ( uhrpdk; tk;rtpUj;jp fpUj;)");
		t12.setTextSize(fsize);
		t12.setTypeface(mTypeface);
		t12.setText(
				",e;j nghUj;jk; xU FLk;gj;jpd; njhlu;r;rpia  mjhtJ tk;r topia cWjp nra;fpwJ.  ngz; ,uhrp ,Ue;J njhlq;fp Mz; ,uhrp tiu vz;zp  2>4>6>8>12 vd ,Ue;jhy; uhrp nghUj;jk;  ,y;iy. 7 Mf ,Ue;jhy; nghUj;jk; cz;L.,uz;L el;rj;jpuq;fSk; xd;whf ,Ue;jhy; nghUj;jk; cz;L Mdhy; Fk;gk;> rpk;kk;> flfk;> kfuk;  Mfpa uhrpfSf;F nghUj;jk; ,y;iy. ,e;j nghUj;jk; ,U FLk;g rk;ge;jpfspd; xw;Wikia Fwpf;fpwJ. ");
		t13.setTextSize(fsize);
		t13.setTypeface(mTypeface);
		t13.setText(" 5) uhrpmjpgjp ( re;jdk; uhrpmjpgjp) ");
		t14.setTextSize(fsize);
		t14.setTypeface(mTypeface);
		t14.setText(
				"Mz; kw;Wk; ngz; ,UtUk; xNu uhrp mjpgjp my;yJ  uhrp mjpgjpf;Fs; el;G  ,Ue;jhy; uhrp mjpgjp nghUj;jk; cs;sJ. gif mjpgjpfshf ,Ue;jhy; nghUj;jk; ,y;iy.Mz; kw;Wk; ngz; uhrpia ghu;f;f> jq;fs; mjpgjpfSf;Fs; el;G my;yJ eLepiy ,Uf;f Ntz;Lk;. ,e;j mk;rk; Foe;ijfis mspf;fpwJ.");
		t15.setTextSize(fsize);
		t15.setTypeface(mTypeface);
		t15.setText(" 6) u[;[{(u[;[{ khq;fy;a tpupjpahrj;)");
		t16.setTextSize(fsize);
		t16.setTypeface(mTypeface);
		t16.setText(
				",e;j nghUj;jk; fztUld; kidtp  ePz;l ehs; kfpo;r;rpahf tho cjTfpwJ. ,J fztdpd;  ePz;l MAis cWjp nra;fpwJ. ,J 10 nghUj;jfspy; Kf;fpakhd nghUj;jkhf fUjg;gLfpwJ.gj;J nghUj;jfspy; xd;gJ nghUj;jq;fs; ,Ue;J u[;[{ nghUj;jk; ,y;iy vd;why; mtu;fs; jpUkzk; nra;J nfhs;s khl;lhu;fs;. u[;[{ Ie;J tifahf gpupf;fg;gLfpwJ. mit jiy>fOj;J>kj;jpak;>njhil kw;Wk; ghj gFjpfs;. Mz; kw;Wk; ngz;zpd; u[;[{ jiy>ghjk;>fOj;J gFjpfshf ,Ue;jhy; u[;[{ nghUj;jk; ,y;iy.,UtUf;Fk; jiy gFjpapy; fz;lwpag;gl;lhy; fztd; tpiutpy; ,wg;ghu; vd;Wk; .fOj;jpy; gFjpapy; ,Ue;jhy; kidtp tpiutpy; ,wg;ghu; vd;Wk;> eLj;ju gFjpapy; ,Ue;jhy;  Foe;ijfs; ,wf;Fk; vd;W   $wg;gLfpwJ. mNj Nghy; njhilapy; gpujpepjpj;Jtk; vd;why;> mJ jPtpu tWik vd;Wk;> fhy; gFjpahf ,Ue;jhy; gupjhgj;jpw;F cupajhfTk; tpsf;fkspf;fg;gLfpwJ. vdNt u[;[{ nghUj;jk; mjp Kf;fpakhf fUjg;gLfpwJ.");
		t17.setTextSize(fsize);
		t17.setTypeface(mTypeface);
		t17.setText("7) Ntj ( Ntj Nrh`erdk; )");
		t18.setTextSize(fsize);
		t18.setTypeface(mTypeface);
		t18.setText(
				"jpUkz tho;tpy; midj;J jPikfsplkpUe;J tpLgl;L tho Ntj nghUj;jk; mtrpak;. ,jd; %yk; xU ,dpa jpUkz tho;f;if  cz;lhFk;. Ntj nghUj;jk; my;yJ thu;j;ij 'fhspjh];' vdg;gLk; ,g;nghUj;jk; ngz; kw;Wk; Mz; gpwe;j el;rj;jpuq;fs; xUtUf;nfhUtu; cld;ghL ,y;iy vd;why; Jd;gk; jUk;. Fwpg;gpl;l rpy el;rj;jpuq;fs; gu];gu vjpu;g;G my;yJ xd;Wld; xd;W vjpu;g;G  nfhz;lit.  mit m];tpdp - Nfl;il>guzp - mD\\k;>fhu;j;jpif- tprhfk;> Nuhfpzp -  Rthjp>kpUfrPuplk;- rpj;jpiu> mtpl;lk;> jpUthjpiu - jpUNthzk;>Gdu;G+rk; - cj;jpuhlk;>G+rk;> -  G+uhlk;>Mapy;ak; - > %yk;>kfk; -  Nutjp>G+uk; -  cj;jpul;lhjp>cj;jpuk; -G+ul;lhjp> m];jk;- rjak;.,e;j  Ntj nghUj;jk; u[;[{ nghUj;jk; Nghd;W kpfTk; Kf;fpakhdJ. ,g;nghUj;jjpy; vjpu;g;G ,Ue;jhy; kfpo;r;rpahf tho KbahJ . ");
		t19.setTextSize(fsize);
		t19.setTypeface(mTypeface);
		t19.setText("8.trpa ( thrpaj; md;dpNahd;dpa thrpa`k; )");
		t20.setTextSize(fsize);
		t20.setTypeface(mTypeface);
		t20.setText(
				"gu];gu md;G kw;Wk; ,izg;ig cWjp nra;a trpa nghUj;jk; cjTfpwJ.xt;nthU uhrpf;Fk; xU Fwpg;gpl;l uhrp trpa nghUj;jkhf cs;sJ.N[hb ,ilNa <u;g;G kw;Wk;  gpupf;f Kbahj  md;Gk; FzKk; kw;Wk;  ,Uf;Fk;.  ,e;j el;rj;jpuq;fSf;Fs; trpa nghUj;jk; cz;L.mit Nk\\k;-rpk;kk;>tpUr;rpfk;> up\\gk;-flfk;>Jyhk;> kpJdk;-fd;dp> flfk;-tpUr;rpfk;>jDR>  rpk;kk;-kfuk;> fd;dp-up\\gk;>kPdk;> Jyhk;-kfuk;> tpUr;rpfk;-flfk;>fd;dp> jDR-kPdk;>   kfuk;-Fk;gk;> Fk;gk;-kPdk; > kPdk;-kfuk;.");
		t21.setTextSize(fsize);
		t21.setTypeface(mTypeface);
		t21.setText("9) kN`e;jpu ( kN`e;jpu Gj;jpu tpupjpahrj;) ");
		t22.setTextSize(fsize);
		t22.setTypeface(mTypeface);
		t22.setText(
				"kNfe;jpu nghUj;jk;  Gj;jpu ghf;fpaj;ij Fwpf;fpwJ. ngz; el;rj;jpuj;jpy; njhlq;fp Mz; el;rj;jpuk; tiu vz;z  4>7>10>13>16>22>25 Mf mike;jhy; kNfe;jpu nghUj;jk; cz;L. ,e;j nghUj;jk; gps;isAk;> nry;tijAk;> mspf;fpwJ.");
		t23.setTextSize(fsize);
		t23.setTypeface(mTypeface);
		t23.setText("10) ];j;uP jPu;f ( ];j;uP jPu;f ru;t rk;gjh )");
		t24.setTextSize(fsize);
		t24.setTypeface(mTypeface);
		t24.setText(
				" ,J nry;tk; FtpAk; kw;Wk; midj;J Rw;W nropg;G cWjp nra;fpwJ.ngz; el;rj;jpuk; ,Ue;J  Mz; el;rj;jpuk; tiu vz;Zk;  NghJ 13 NkNy  vd;why; Rgk;. jw;NghJ rpyu; ,e;j $l;ly; 7 f;F NkNy ,Ue;jhy; NghJk; vd;fpwhu;fs;.,J jpUkz tho;f;if ePz;l fhyk;  ePbf;f cjTfpwJ.");
	}

	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater menuInflater = getMenuInflater();
		menuInflater.inflate(R.menu.activity_main, menu);
		return true;
	}

	protected String getfontName() {

		String restoredText = null;
		sharedpreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
		if (sharedpreferences.contains(name)) {
			restoredText = sharedpreferences.getString("fontsize", name);

			// Toast.makeText(weekly.this, "FontSize Changed"+restoredText,
			// Toast.LENGTH_LONG).show();

		}

		return restoredText;
	}

	public boolean onOptionsItemSelected(MenuItem item) {
		int itemId = item.getItemId();

		if (itemId == android.R.id.home) {
			Intent int_abt = new Intent(this, index.class);
			int_abt.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(int_abt);
			return true;
		}
		else if (itemId == R.id.claculator) {
			Intent icon_calc = new Intent(this, poruthamcalculator.class);
			icon_calc.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(icon_calc);
			return true;
		}
		else if (itemId == R.id.Nakshatra) {
			Intent icon_find = new Intent(this, findnakshatra.class);
			icon_find.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(icon_find);
			return true;
		}
		else if (itemId == R.id.guru) {
			AlertDialog.Builder alt_compat = new AlertDialog.Builder(this);
			String desc = "App to find out when Guru Peyarchi or Jupiter transit takes place.";
			alt_compat.setTitle("Guru Peyarchi");
			alt_compat.setMessage(desc)
					.setCancelable(false)
					.setPositiveButton("Later", new DialogInterface.OnClickListener() {
						public void onClick(DialogInterface dialog, int id) {
							dialog.cancel();
						}
					})
					.setNegativeButton("Never/Already", new DialogInterface.OnClickListener() {
						public void onClick(DialogInterface dialog, int id) {
							dialog.cancel();
						}
					})
					.setNeutralButton("Open", new DialogInterface.OnClickListener() {
						public void onClick(DialogInterface dialog, int id) {
							Intent browserIntent = new Intent(Intent.ACTION_VIEW,
									Uri.parse("market://details?id=findyourfate.com.gurupeyarchi"));
							startActivity(browserIntent);
						}
					});
			AlertDialog alert = alt_compat.create();
			alert.show();
			return true;
		}
		else if (itemId == R.id.icon_exit) {
			AlertDialog.Builder builder = new AlertDialog.Builder(this);
			builder.setMessage("Are you sure you want to leave this App.")
					.setCancelable(false)
					.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
						public void onClick(DialogInterface dialog, int id) {
							Intent intent = new Intent(Intent.ACTION_MAIN);
							intent.addCategory(Intent.CATEGORY_HOME);
							intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
							startActivity(intent);
						}
					})
					.setNegativeButton("No", new DialogInterface.OnClickListener() {
						public void onClick(DialogInterface dialog, int id) {
							dialog.cancel();
						}
					});
			AlertDialog alert1 = builder.create();
			alert1.setTitle("Close App.");
			alert1.setIcon(R.drawable.alert);
			alert1.show();
			return true;
		}
		else if (itemId == R.id.share) {
			Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
			emailIntent.setType("text/plain");
			emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "10 Porutham by findyourfate.com");
			emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
					"Hi, I would like to suggest this 10 Porutham App to you. Click this link to download the app http://goo.gl/38FZui"
							+ "\n\n" + " Regards");
			startActivity(Intent.createChooser(emailIntent, "Share using"));
			return true;
		}
		else {
			return super.onOptionsItemSelected(item);
		}
	}


	private void initiatePopupWindow() {

		LayoutInflater layoutInflater = (LayoutInflater) getBaseContext()
				.getSystemService(LAYOUT_INFLATER_SERVICE);
		final View popupView = layoutInflater.inflate(R.layout.fontchange, null);
		final PopupWindow popupWindow = new PopupWindow(
				popupView,
				LayoutParams.WRAP_CONTENT,
				LayoutParams.WRAP_CONTENT);

		Button btnDismiss = (Button) popupView.findViewById(R.id.btncancel);
		final RadioGroup radioSexGroup = (RadioGroup) popupView.findViewById(R.id.rgOpinion);
		Button btnDisplay = (Button) popupView.findViewById(R.id.btnDisplay);
		RadioButton s = (RadioButton) popupView.findViewById(R.id.small);
		RadioButton m = (RadioButton) popupView.findViewById(R.id.normal);
		RadioButton l = (RadioButton) popupView.findViewById(R.id.large);
		RadioButton ll = (RadioButton) popupView.findViewById(R.id.larger);
		RadioButton xl = (RadioButton) popupView.findViewById(R.id.xlarge);
		sharedpreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
		if (sharedpreferences.contains(name)) {
			String fontsize = sharedpreferences.getString("fontsize", name);
			if (fontsize.equals("Small")) {
				s.setChecked(true);
			} else if (fontsize.equals("Medium")) {
				m.setChecked(true);
			} else if (fontsize.equals("Large")) {
				l.setChecked(true);
			} else if (fontsize.equals("Larger")) {
				ll.setChecked(true);
			} else if (fontsize.equals("X-Large")) {
				xl.setChecked(true);
			}

			else {
				m.setChecked(true);
			}
		}

		btnDismiss.setOnClickListener(new Button.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				popupWindow.dismiss();
			}
		});

		btnDisplay.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				int selectedId = radioSexGroup.getCheckedRadioButtonId();
				RadioButton radioSexButton = (RadioButton) popupView.findViewById(selectedId);
				String fontsize = radioSexButton.getText().toString();
				// Toast.makeText(fontchange.this,"vv"+fontsize, Toast.LENGTH_SHORT).show();

				Editor editor = sharedpreferences.edit();
				editor.putString(name, fontsize);
				editor.commit();
				popupWindow.dismiss();
				Intent icon_home1 = new Intent(tamilcontent.this, tamilcontent.class);
				icon_home1.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				startActivity(icon_home1);

			}

		});

		popupWindow.showAtLocation(popupView, Gravity.CENTER, 0, 0);
		popupWindow.showAsDropDown(popupView, 50, -30);
	}

}