// Path: app/src/main/java/com/gigabytedevelopersinc/app/calculator/view/PreferencesFragment.java
// public class PreferencesFragment extends PreferenceFragment {
// 
//     //Create New Variable of type InterstitialAd
//     private InterstitialAd mInterstitialAd;
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         addPreferencesFromResource(R.layout.preferences);
//         Preference about = findPreference("ABOUT");
// 
//         // Prepare the interstitial Ad
//         mInterstitialAd = new InterstitialAd(getActivity());
//         // Insert the Ad Unit ID
//         mInterstitialAd.setAdUnitId(getString(R.string.interstitial_ads));
//         AdRequest adRequest = new AdRequest.Builder()
//                 .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
//                 .build();
//         // Load requested Ad
//         mInterstitialAd.loadAd(adRequest);
// 
//         if(about != null) {
//             String versionName = "";
//             try {
//                 versionName = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName;
//             }
//             catch(NameNotFoundException e) {
//                 e.printStackTrace();
//             }
//             about.setTitle(about.getTitle() + " " + versionName);
//             about.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
//                 @Override
//                 public boolean onPreferenceClick(Preference preference) {
//                     if (mInterstitialAd.isLoaded()) {
//                         mInterstitialAd.show();
//                         mInterstitialAd.setAdListener(new AdListener() {
//                             public void onAdClosed() {
//                                 AdRequest adRequest = new AdRequest.Builder()
//                                         .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
//                                         .build();
//                                 mInterstitialAd.loadAd(adRequest);
//                                 Intent github = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/gigabytedevelopers/CalcMate"));
//                                 startActivity(github);
// 
//                             }
//                         });
//                     } else {
//                         Intent github = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/gigabytedevelopers/CalcMate"));
//                         startActivity(github);
//                     }
//                     return false;
//                 }
//             });
//         }
//     }
// }


import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import com.gigabytedevelopersinc.app.calculator.view.PreferencesFragment;
package com.gigabytedevelopersinc.app.calculator;



/**
 * @author Emmanuel Nwokoma (Founder and CEO of Gigabyte Developers INC)
 **/
public class Preferences extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        if (getActionBar() != null)
        {
            getActionBar().setDisplayHomeAsUpEnabled(true);
        }
        super.onCreate(savedInstanceState);
        if(savedInstanceState == null) {
// Path: app/src/main/java/com/gigabytedevelopersinc/app/calculator/view/PreferencesFragment.java
// public class PreferencesFragment extends PreferenceFragment {
// 
//     //Create New Variable of type InterstitialAd
//     private InterstitialAd mInterstitialAd;
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         addPreferencesFromResource(R.layout.preferences);
//         Preference about = findPreference("ABOUT");
// 
//         // Prepare the interstitial Ad
//         mInterstitialAd = new InterstitialAd(getActivity());
//         // Insert the Ad Unit ID
//         mInterstitialAd.setAdUnitId(getString(R.string.interstitial_ads));
//         AdRequest adRequest = new AdRequest.Builder()
//                 .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
//                 .build();
//         // Load requested Ad
//         mInterstitialAd.loadAd(adRequest);
// 
//         if(about != null) {
//             String versionName = "";
//             try {
//                 versionName = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName;
//             }
//             catch(NameNotFoundException e) {
//                 e.printStackTrace();
//             }
//             about.setTitle(about.getTitle() + " " + versionName);
//             about.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
//                 @Override
//                 public boolean onPreferenceClick(Preference preference) {
//                     if (mInterstitialAd.isLoaded()) {
//                         mInterstitialAd.show();
//                         mInterstitialAd.setAdListener(new AdListener() {
//                             public void onAdClosed() {
//                                 AdRequest adRequest = new AdRequest.Builder()
//                                         .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
//                                         .build();
//                                 mInterstitialAd.loadAd(adRequest);
//                                 Intent github = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/gigabytedevelopers/CalcMate"));
//                                 startActivity(github);
// 
//                             }
//                         });
//                     } else {
//                         Intent github = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/gigabytedevelopers/CalcMate"));
//                         startActivity(github);
//                     }
//                     return false;
//                 }
//             });
//         }
//     }
// }


// Path: app/src/main/java/com/gigabytedevelopersinc/app/calculator/Preferences.java
import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import com.gigabytedevelopersinc.app.calculator.view.PreferencesFragment;

package com.gigabytedevelopersinc.app.calculator;



/**
 * @author Emmanuel Nwokoma (Founder and CEO of Gigabyte Developers INC)
 **/
public class Preferences extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        if (getActionBar() != null)
        {
            getActionBar().setDisplayHomeAsUpEnabled(true);
        }
        super.onCreate(savedInstanceState);
        if(savedInstanceState == null) {
            PreferencesFragment preferences = new PreferencesFragment();