// Path: app/src/main/java/org/secuso/privacyfriendlymemory/Constants.java
// public final class Constants {
// 
//     private Constants(){} // this class should not be initialized
// 
//     // Preferences Constants
//     public final static String FIRST_APP_START          = "FIRST_APP_START";
//     public final static String SELECTED_CARD_DESIGN     = "SELECTED_CARD_DESIGN";
//     public final static String CUSTOM_CARDS_URIS        = "CUSTOM_CARDS_URIS";
// 
//     // Preferences Constants Highscore
//     public final static String HIGHSCORE_EASY           = "HIGHSCORE_EASY";
//     public final static String HIGHSCORE_EASY_TRIES     = "HIGHSCORE_EASY_TRIES";
//     public final static String HIGHSCORE_EASY_TIME      = "HIGHSCORE_EASY_TIME";
// 
//     public final static String HIGHSCORE_MODERATE       = "HIGHSCORE_MODERATE";
//     public final static String HIGHSCORE_MODERATE_TRIES = "HIGHSCORE_MODERATE_TRIES";
//     public final static String HIGHSCORE_MODERATE_TIME  = "HIGHSCORE_MODERATE_TIME";
// 
//     public final static String HIGHSCORE_HARD           = "HIGHSCORE_HARD";
//     public final static String HIGHSCORE_HARD_TRIES     = "HIGHSCORE_HARD_TRIES";
//     public final static String HIGHSCORE_HARD_TIME      = "HIGHSCORE_HARD_TIME";
// 
// 
//     // Preferences Constants Statistics
//     public final static String STATISTICS_DECK_ONE      =  "STATISTICS_DECK_ONE";
//     public final static String STATISTICS_DECK_TWO      =  "STATISTICS_DECK_TWO";
// 
//     // Intent Extra Constants
//     public final static String GAME_DIFFICULTY          = "GAME_DIFFICULTY";
//     public final static String GAME_MODE                = "GAME_MODE";
//     public final static String CARD_DESIGN              = "CARD_DESIGN";
// 
// 
// }
// 
// Path: app/src/main/java/org/secuso/privacyfriendlymemory/ui/AppCompatPreferenceActivity.java
// public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
// 
//     private AppCompatDelegate mDelegate;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         getDelegate().installViewFactory();
//         getDelegate().onCreate(savedInstanceState);
//         super.onCreate(savedInstanceState);
//     }
// 
//     @Override
//     protected void onPostCreate(Bundle savedInstanceState) {
//         super.onPostCreate(savedInstanceState);
//         getDelegate().onPostCreate(savedInstanceState);
//     }
// 
//     public ActionBar getSupportActionBar() {
//         return getDelegate().getSupportActionBar();
//     }
// 
//     public void setSupportActionBar(@Nullable Toolbar toolbar) {
//         getDelegate().setSupportActionBar(toolbar);
//     }
// 
//     @Override
//     public MenuInflater getMenuInflater() {
//         return getDelegate().getMenuInflater();
//     }
// 
//     @Override
//     public void setContentView(@LayoutRes int layoutResID) {
//         getDelegate().setContentView(layoutResID);
//     }
// 
//     @Override
//     public void setContentView(View view) {
//         getDelegate().setContentView(view);
//     }
// 
//     @Override
//     public void setContentView(View view, ViewGroup.LayoutParams params) {
//         getDelegate().setContentView(view, params);
//     }
// 
//     @Override
//     public void addContentView(View view, ViewGroup.LayoutParams params) {
//         getDelegate().addContentView(view, params);
//     }
// 
//     @Override
//     protected void onPostResume() {
//         super.onPostResume();
//         getDelegate().onPostResume();
//     }
// 
//     @Override
//     protected void onTitleChanged(CharSequence title, int color) {
//         super.onTitleChanged(title, color);
//         getDelegate().setTitle(title);
//     }
// 
//     @Override
//     public void onConfigurationChanged(Configuration newConfig) {
//         super.onConfigurationChanged(newConfig);
//         getDelegate().onConfigurationChanged(newConfig);
//     }
// 
//     @Override
//     protected void onStop() {
//         super.onStop();
//         getDelegate().onStop();
//     }
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//         getDelegate().onDestroy();
//     }
// 
//     public void invalidateOptionsMenu() {
//         getDelegate().invalidateOptionsMenu();
//     }
// 
//     private AppCompatDelegate getDelegate() {
//         if (mDelegate == null) {
//             mDelegate = AppCompatDelegate.create(this, null);
//         }
//         return mDelegate;
//     }
// }


import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBar;
import android.view.Menu;
import android.view.MenuItem;
import org.secuso.privacyfriendlymemory.Constants;
import org.secuso.privacyfriendlymemory.ui.AppCompatPreferenceActivity;
import org.secuso.privacyfriendlymemory.ui.R;
import java.util.List;
package org.secuso.privacyfriendlymemory.ui.navigation;





public class HighscoreActivity extends AppCompatPreferenceActivity {

    private FragmentRefreshListener fragmentRefreshListener;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setupActionBar();
    }

    public FragmentRefreshListener getFragmentRefreshListener() {
        return fragmentRefreshListener;
    }

    public void setFragmentRefreshListener(FragmentRefreshListener fragmentRefreshListener) {
        this.fragmentRefreshListener = fragmentRefreshListener;
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_highscore, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        switch(id){
            case android.R.id.home:
                finish();
                return true;
            case R.id.menu_highscore_reset:
                SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
                // reset score, tries and time for each mode
// Path: app/src/main/java/org/secuso/privacyfriendlymemory/Constants.java
// public final class Constants {
// 
//     private Constants(){} // this class should not be initialized
// 
//     // Preferences Constants
//     public final static String FIRST_APP_START          = "FIRST_APP_START";
//     public final static String SELECTED_CARD_DESIGN     = "SELECTED_CARD_DESIGN";
//     public final static String CUSTOM_CARDS_URIS        = "CUSTOM_CARDS_URIS";
// 
//     // Preferences Constants Highscore
//     public final static String HIGHSCORE_EASY           = "HIGHSCORE_EASY";
//     public final static String HIGHSCORE_EASY_TRIES     = "HIGHSCORE_EASY_TRIES";
//     public final static String HIGHSCORE_EASY_TIME      = "HIGHSCORE_EASY_TIME";
// 
//     public final static String HIGHSCORE_MODERATE       = "HIGHSCORE_MODERATE";
//     public final static String HIGHSCORE_MODERATE_TRIES = "HIGHSCORE_MODERATE_TRIES";
//     public final static String HIGHSCORE_MODERATE_TIME  = "HIGHSCORE_MODERATE_TIME";
// 
//     public final static String HIGHSCORE_HARD           = "HIGHSCORE_HARD";
//     public final static String HIGHSCORE_HARD_TRIES     = "HIGHSCORE_HARD_TRIES";
//     public final static String HIGHSCORE_HARD_TIME      = "HIGHSCORE_HARD_TIME";
// 
// 
//     // Preferences Constants Statistics
//     public final static String STATISTICS_DECK_ONE      =  "STATISTICS_DECK_ONE";
//     public final static String STATISTICS_DECK_TWO      =  "STATISTICS_DECK_TWO";
// 
//     // Intent Extra Constants
//     public final static String GAME_DIFFICULTY          = "GAME_DIFFICULTY";
//     public final static String GAME_MODE                = "GAME_MODE";
//     public final static String CARD_DESIGN              = "CARD_DESIGN";
// 
// 
// }
// 
// Path: app/src/main/java/org/secuso/privacyfriendlymemory/ui/AppCompatPreferenceActivity.java
// public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
// 
//     private AppCompatDelegate mDelegate;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         getDelegate().installViewFactory();
//         getDelegate().onCreate(savedInstanceState);
//         super.onCreate(savedInstanceState);
//     }
// 
//     @Override
//     protected void onPostCreate(Bundle savedInstanceState) {
//         super.onPostCreate(savedInstanceState);
//         getDelegate().onPostCreate(savedInstanceState);
//     }
// 
//     public ActionBar getSupportActionBar() {
//         return getDelegate().getSupportActionBar();
//     }
// 
//     public void setSupportActionBar(@Nullable Toolbar toolbar) {
//         getDelegate().setSupportActionBar(toolbar);
//     }
// 
//     @Override
//     public MenuInflater getMenuInflater() {
//         return getDelegate().getMenuInflater();
//     }
// 
//     @Override
//     public void setContentView(@LayoutRes int layoutResID) {
//         getDelegate().setContentView(layoutResID);
//     }
// 
//     @Override
//     public void setContentView(View view) {
//         getDelegate().setContentView(view);
//     }
// 
//     @Override
//     public void setContentView(View view, ViewGroup.LayoutParams params) {
//         getDelegate().setContentView(view, params);
//     }
// 
//     @Override
//     public void addContentView(View view, ViewGroup.LayoutParams params) {
//         getDelegate().addContentView(view, params);
//     }
// 
//     @Override
//     protected void onPostResume() {
//         super.onPostResume();
//         getDelegate().onPostResume();
//     }
// 
//     @Override
//     protected void onTitleChanged(CharSequence title, int color) {
//         super.onTitleChanged(title, color);
//         getDelegate().setTitle(title);
//     }
// 
//     @Override
//     public void onConfigurationChanged(Configuration newConfig) {
//         super.onConfigurationChanged(newConfig);
//         getDelegate().onConfigurationChanged(newConfig);
//     }
// 
//     @Override
//     protected void onStop() {
//         super.onStop();
//         getDelegate().onStop();
//     }
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//         getDelegate().onDestroy();
//     }
// 
//     public void invalidateOptionsMenu() {
//         getDelegate().invalidateOptionsMenu();
//     }
// 
//     private AppCompatDelegate getDelegate() {
//         if (mDelegate == null) {
//             mDelegate = AppCompatDelegate.create(this, null);
//         }
//         return mDelegate;
//     }
// }


// Path: app/src/main/java/org/secuso/privacyfriendlymemory/ui/navigation/HighscoreActivity.java
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBar;
import android.view.Menu;
import android.view.MenuItem;
import org.secuso.privacyfriendlymemory.Constants;
import org.secuso.privacyfriendlymemory.ui.AppCompatPreferenceActivity;
import org.secuso.privacyfriendlymemory.ui.R;
import java.util.List;

package org.secuso.privacyfriendlymemory.ui.navigation;





public class HighscoreActivity extends AppCompatPreferenceActivity {

    private FragmentRefreshListener fragmentRefreshListener;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setupActionBar();
    }

    public FragmentRefreshListener getFragmentRefreshListener() {
        return fragmentRefreshListener;
    }

    public void setFragmentRefreshListener(FragmentRefreshListener fragmentRefreshListener) {
        this.fragmentRefreshListener = fragmentRefreshListener;
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_highscore, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        switch(id){
            case android.R.id.home:
                finish();
                return true;
            case R.id.menu_highscore_reset:
                SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
                // reset score, tries and time for each mode
                preferences.edit().putInt(Constants.HIGHSCORE_EASY, 0).commit();