package com.androidsx.rateme.demo1;

import android.app.Activity;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import androidcourse.t4.t6.R;

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

public class SampleProject extends Activity {
    private Button buttonRateMe;
    private String myPackageName = "com.androidsx.smileys";
    
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_contacts); 
		buttonRateMe = (Button)findViewById(R.id.buttonrateme);		
		buttonRateMe.setOnClickListener(new OnClickListener() {          
            @Override
            public void onClick(View v) {
                AlertMenu();            
            }
        });
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.delete, menu);
		return true;
	}
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Take appropriate action for each action item click

		switch (item.getItemId()) {
		case R.id.RateMe:
		    AlertMenu();

		default:
			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");
        }
        
    }
	
    private void AlertMenu (){
//	    DialogFragment dialogo = libraryRateMe.newInstance(
//                getPackageName());
	    DialogFragment dialogo = DialogRateMe.newInstance(
	    		myPackageName);
        dialogo.show(getFragmentManager(), "dialog");
	}
}

@@ -510,29 +510,31 @@
  String 
-myPackageName
+MY_PACKAGE_NAME
  = %22com.
@@ -554,16 +554,162 @@
 leys%22;%0D%0A
+    private String EMAIL = %22yourmail@mail.com%22;%0D%0A    private static final int INSTALL_DAYS = 20;%0D%0A    private static final int LAUNCH_TIMES = 5;%0D%0A
     %0D%0A%09@
@@ -1681,24 +1681,114 @@
 onStart();%0D%0A
+        RateMeDialogTimer rateDialog = new RateMeDialogTimer(INSTALL_DAYS,LAUNCH_TIMES);%0D%0A
         Rate
@@ -1813,24 +1813,24 @@
 art(this);%0D%0A
-
         if (
@@ -1962,29 +1962,37 @@
         
-myPackageName
+MY_PACKAGE_NAME,EMAIL
 );%0D%0A    
@@ -2113,106 +2113,8 @@
 )%7B%0D%0A
-//%09    DialogFragment dialogo = libraryRateMe.newInstance(%0D%0A//                getPackageName());%0D%0A
 %09   
@@ -2175,23 +2175,37 @@
     
-%09%09myPackageName
+        MY_PACKAGE_NAME,EMAIL
 );%0D%0A

create Constants in project