package com.androidsx.rateme.demo2;

import android.app.Activity;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import androidsx.rateme.R;

import com.androidsx.rateme.RateMeDialogTimer;
import com.androidsx.rateme.DialogRateMe;

public class HelloWorldActivity extends Activity {
    private Button btnRateme;
    private String myPackageName = "com.androidsx.smileys";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_hello_world);       
        setupUI();            
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.hello_world, menu);
        return super.onCreateOptionsMenu(menu);
    }
    
    public void setupUI (){
        btnRateme = (Button) findViewById(R.id.buttonRateMe);      
        btnRateme.setOnClickListener(new OnClickListener() {
            
            @Override
            public void onClick(View v) {
               alertMenu();
                
            }
        });
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case R.id.RateMeOption:
            alertMenu();
            break;
        default:
            break;
        }
        return super.onOptionsItemSelected(item);
    }
    
    
    @Override
    protected void onStart() {
        super.onStart();
        RateMeDialogTimer.onStart(this);
        if (RateMeDialogTimer.shouldShowRateDialog(this)) {
            DialogFragment dialogo = DialogRateMe.newInstance(
                    myPackageName);
            dialogo.show(getFragmentManager(), "dialog");
        }
        
    }

    public void alertMenu (){
        
//        DialogFragment dialogo = DialogRateMe.newInstance(
//                getPackageName());
//        dialogo.show(getFragmentManager(), "dialog");
	    DialogFragment dialogo = DialogRateMe.newInstance(
	    		myPackageName);
        dialogo.show(getFragmentManager(), "dialog");
    }
}

@@ -523,54 +523,225 @@
 ate 
-String myPackageName = %22com.androidsx.smileys%22
+static final String MY_PACKAGE_NAME = %22com.androidsx.smileys%22;%0A    private static final String EMAIL = %22yourmail@mail.com%22;%0A    private static final int INSTALL_DAYS = 20;%0A    private static final int LAUNCH_TIMES = 5
 ;%0A%0A 
@@ -1856,24 +1856,113 @@
 .onStart();%0A
+        RateMeDialogTimer rateDialog = new RateMeDialogTimer(INSTALL_DAYS,LAUNCH_TIMES);%0A
         Rate
@@ -2075,33 +2075,32 @@
 gFragment dialog
-o
  = DialogRateMe.
@@ -2132,29 +2132,37 @@
         
-myPackageName
+MY_PACKAGE_NAME,EMAIL
 );%0A     
@@ -2166,33 +2166,32 @@
           dialog
-o
 .show(getFragmen
@@ -2432,17 +2432,20 @@
 alog%22);%0A
-%09
+    
     Dial
@@ -2453,33 +2453,32 @@
 gFragment dialog
-o
  = DialogRateMe.
@@ -2494,28 +2494,45 @@
 ce(%0A
-%09
+ 
     
-%09%09myPackageName
+           MY_PACKAGE_NAME,EMAIL
 );%0A 
@@ -2536,33 +2536,32 @@
 ;%0A        dialog
-o
 .show(getFragmen

add constants in demo2