Android Open Source - YourWiFi Global Shared Preferences






From Project

Back to project page YourWiFi.

License

The source code is released under:

MIT License

If you think the Android project YourWiFi listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.akisute.yourwifi.app.util;
/* w  w  w.  ja va2s  .co m*/
import android.content.SharedPreferences;

import javax.inject.Inject;

public class GlobalSharedPreferences {

    @Inject
    SharedPreferences mSharedPreferences;
    @Inject
    GlobalEventBus mGlobalEventBus;

    @Inject
    public GlobalSharedPreferences(SharedPreferences sharedPreferences, GlobalEventBus globalEventBus) {
        mSharedPreferences = sharedPreferences;
        mGlobalEventBus = globalEventBus;
    }

    public static final class NetworkListDisplayMode {
        private static final String KEY = "NetworkListDisplayMode";
        public static final int SHOW_ESSIDS = 0;
        public static final int SHOW_RAW_NETWORKS = 1;

        public static final class OnChangeEvent {
        }
    }

    public int getNetworkListDisplayMode() {
        return mSharedPreferences.getInt(NetworkListDisplayMode.KEY, NetworkListDisplayMode.SHOW_ESSIDS);
    }

    public void setNetworkListDisplayMode(int mode) {
        int currentMode = getNetworkListDisplayMode();
        if (currentMode != mode) {
            SharedPreferences.Editor editor = mSharedPreferences.edit();
            editor.putInt(NetworkListDisplayMode.KEY, mode);
            editor.commit();
            mGlobalEventBus.postInMainThread(new NetworkListDisplayMode.OnChangeEvent());
        }
    }
}




Java Source Code List

com.akisute.yourwifi.app.Application.java
com.akisute.yourwifi.app.CloudLoginDialogFragment.java
com.akisute.yourwifi.app.EssidDetailActivity.java
com.akisute.yourwifi.app.EssidDetailFragment.java
com.akisute.yourwifi.app.EssidListFragment.java
com.akisute.yourwifi.app.MainActivity.java
com.akisute.yourwifi.app.NetworkMapFragment.java
com.akisute.yourwifi.app.NetworkRecordingService.java
com.akisute.yourwifi.app.RawNetworkListFragment.java
com.akisute.yourwifi.app.SettingsActivity.java
com.akisute.yourwifi.app.SettingsFragment.java
com.akisute.yourwifi.app.cloud.CloudManager.java
com.akisute.yourwifi.app.dagger.AndroidSystemModule.java
com.akisute.yourwifi.app.dagger.ApplicationModule.java
com.akisute.yourwifi.app.intent.Intents.java
com.akisute.yourwifi.app.model.BssidListAdapter.java
com.akisute.yourwifi.app.model.EssidComparators.java
com.akisute.yourwifi.app.model.EssidListAdapter.java
com.akisute.yourwifi.app.model.Essid.java
com.akisute.yourwifi.app.model.LocationScanManager.java
com.akisute.yourwifi.app.model.NetworkCache.java
com.akisute.yourwifi.app.model.NetworkComparators.java
com.akisute.yourwifi.app.model.NetworkScanManager.java
com.akisute.yourwifi.app.model.Network.java
com.akisute.yourwifi.app.model.RawNetworkListAdapter.java
com.akisute.yourwifi.app.util.GlobalEventBus.java
com.akisute.yourwifi.app.util.GlobalResources.java
com.akisute.yourwifi.app.util.GlobalSharedPreferences.java