Search in sources :

Example 86 with SharedPreferences

use of android.content.SharedPreferences in project iosched by google.

the class SettingsUtils method markDataBootstrapDone.

/**
     * Mark that the app has finished loading the {@code R.raw.bootstrap_data bootstrap data}.
     *
     * @param context Context to be used to edit the {@link android.content.SharedPreferences}.
     */
public static void markDataBootstrapDone(final Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    sp.edit().putBoolean(BuildConfig.PREF_DATA_BOOTSTRAP_DONE, true).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 87 with SharedPreferences

use of android.content.SharedPreferences in project iosched by google.

the class SettingsUtils method markTosAccepted.

/**
     * Mark {@code newValue whether} the user has accepted the TOS so the app doesn't ask again.
     *
     * @param context Context to be used to edit the {@link android.content.SharedPreferences}.
     * @param newValue New value that will be set.
     */
public static void markTosAccepted(final Context context, boolean newValue) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    sp.edit().putBoolean(PREF_TOS_ACCEPTED, newValue).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 88 with SharedPreferences

use of android.content.SharedPreferences in project iosched by google.

the class SettingsUtils method setShowSessionFeedbackReminders.

/**
     * @param context  Context to be used to edit the {@link android.content.SharedPreferences}.
     * @param show Whether app should show session feedback reminders
     */
public static void setShowSessionFeedbackReminders(final Context context, boolean show) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    sp.edit().putBoolean(BuildConfig.PREF_SESSION_FEEDBACK_REMINDERS_ENABLED, show).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 89 with SharedPreferences

use of android.content.SharedPreferences in project iosched by google.

the class SettingsUtils method markAnsweredLocalOrRemote.

/**
     * Mark that the user answered whether they're a local or remote I/O attendee.
     *
     * @param context  Context to be used to edit the {@link android.content.SharedPreferences}.
     * @param newValue New value that will be set.
     */
public static void markAnsweredLocalOrRemote(final Context context, boolean newValue) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    sp.edit().putBoolean(PREF_ANSWERED_LOCAL_OR_REMOTE, newValue).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences)

Example 90 with SharedPreferences

use of android.content.SharedPreferences in project iosched by google.

the class SettingsUtils method registerOnSharedPreferenceChangeListener.

/**
     * Helper method to register a settings_prefs listener. This method does not automatically handle
     * {@code unregisterOnSharedPreferenceChangeListener() un-registering} the listener at the end
     * of the {@code context} lifecycle.
     *
     * @param context  Context to be used to lookup the {@link android.content.SharedPreferences}.
     * @param listener Listener to register.
     */
public static void registerOnSharedPreferenceChangeListener(final Context context, SharedPreferences.OnSharedPreferenceChangeListener listener) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    sp.registerOnSharedPreferenceChangeListener(listener);
}
Also used : SharedPreferences(android.content.SharedPreferences)

Aggregations

SharedPreferences (android.content.SharedPreferences)1762 Intent (android.content.Intent)221 View (android.view.View)110 Editor (android.content.SharedPreferences.Editor)100 TextView (android.widget.TextView)74 ArrayList (java.util.ArrayList)67 Context (android.content.Context)59 PendingIntent (android.app.PendingIntent)57 File (java.io.File)57 IOException (java.io.IOException)56 Bundle (android.os.Bundle)45 JSONException (org.json.JSONException)41 JSONObject (org.json.JSONObject)41 DialogInterface (android.content.DialogInterface)37 AdapterView (android.widget.AdapterView)34 ImageView (android.widget.ImageView)34 ListView (android.widget.ListView)34 SuppressLint (android.annotation.SuppressLint)33 JSONArray (run.wallet.common.json.JSONArray)33 ComponentName (android.content.ComponentName)31