Android Open Source - YourWiFi Global Resources






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 ww  . jav  a 2s .c  om*/
import android.content.res.Resources;

import com.akisute.yourwifi.app.R;
import com.akisute.yourwifi.app.model.Network;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import javax.inject.Inject;

public class GlobalResources {

    @Inject
    Resources mResources;

    private final Map<Integer, String> mNetworkTypeName;
    private final Map<Integer, String> mCryptoTypeName;
    private final Map<Integer, Integer> mCryptoTypeFontColor;

    @Inject
    public GlobalResources(Resources resources) {
        mResources = resources;
        {
            Map<Integer, String> buffer = new HashMap<Integer, String>();
            buffer.put(Network.NETWORK_UNKNOWN, mResources.getString(R.string.network_unknown));
            buffer.put(Network.NETWORK_WIFI, mResources.getString(R.string.network_wifi));
            buffer.put(Network.NETWORK_CELLULAR, mResources.getString(R.string.network_cellular));
            buffer.put(Network.NETWORK_CELLULAR_GSM, mResources.getString(R.string.network_cellular_gsm));
            buffer.put(Network.NETWORK_CELLULAR_CDMA, mResources.getString(R.string.network_cellular_cdma));
            mNetworkTypeName = Collections.unmodifiableMap(buffer);
        }
        {
            Map<Integer, String> buffer = new HashMap<Integer, String>();
            buffer.put(Network.CRYPTO_NONE, mResources.getString(R.string.crypto_none));
            buffer.put(Network.CRYPTO_WEP, mResources.getString(R.string.crypto_wep));
            buffer.put(Network.CRYPTO_WPA, mResources.getString(R.string.crypto_wpa));
            buffer.put(Network.CRYPTO_WPA2, mResources.getString(R.string.crypto_wpa2));
            mCryptoTypeName = Collections.unmodifiableMap(buffer);
        }
        {
            Map<Integer, Integer> buffer = new HashMap<Integer, Integer>();
            buffer.put(Network.CRYPTO_NONE, mResources.getColor(R.color.font_crypto_none));
            buffer.put(Network.CRYPTO_WEP, mResources.getColor(R.color.font_crypto_wep));
            buffer.put(Network.CRYPTO_WPA, mResources.getColor(R.color.font_crypto_wpa));
            buffer.put(Network.CRYPTO_WPA2, mResources.getColor(R.color.font_crypto_wpa2));
            mCryptoTypeFontColor = Collections.unmodifiableMap(buffer);
        }
    }

    public Resources getResources() {
        return mResources;
    }

    public String getNetworkTypeName(int networkType) {
        return mNetworkTypeName.get(networkType);
    }

    public String getCryptoTypeName(int cryptoType) {
        return mCryptoTypeName.get(cryptoType);
    }

    public int getCryptoTypeFontColor(int cryptoType) {
        return mCryptoTypeFontColor.get(cryptoType);
    }
}




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