package tr.xip.wanikani.settings;

import android.os.Build;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;

import tr.xip.wanikani.R;
import tr.xip.wanikani.managers.PrefManager;

/**
 * Created by xihsa_000 on 4/4/14.
 */
public class SettingsActivity extends PreferenceActivity {

    PrefManager prefMan;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.preferences);

        prefMan = new PrefManager(this);

        Preference mApiKey = findPreference(PrefManager.PREF_API_KEY);
        mApiKey.setSummary(prefMan.getApiKey());
    }

    @Override
    public void onBackPressed() {
        if (Build.VERSION.SDK_INT >= 16) {
            super.onNavigateUp();
        } else {
            super.onBackPressed();
        }
    }
}

@@ -646,16 +646,231 @@
 I_KEY);%0A
+%0A        String apiKey = prefMan.getApiKey();%0A        String maskedApiKey = %22************************%22;%0A%0A        for (int i = 25; i %3C apiKey.length(); i++) %7B%0A            maskedApiKey += apiKey.charAt(i);%0A        %7D%0A%0A
         
@@ -888,35 +888,28 @@
 Summary(
-prefMan.get
+masked
 ApiKey
-()
 );%0A    %7D

Mask the API key shown in settings