Search in sources :

Example 6 with CacheWordHandler

use of info.guardianproject.cacheword.CacheWordHandler in project storymaker by StoryMaker.

the class FirstStartActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    // this seems to be getting created after the user has already accepted the EULA
    /*
        final SharedPreferences prefsEula = getSharedPreferences(Globals.PREFERENCES_EULA, Activity.MODE_PRIVATE);
        boolean eulaAccepted = prefsEula.getBoolean(Globals.PREFERENCE_EULA_ACCEPTED, false);
        if (eulaAccepted) {
            // if the preferences show the EULA was already accepted, do not show the EULA screen again
            Intent mainIntent = new Intent(this, HomeActivity.class);
            startActivity(mainIntent);
            finish();
        } else {
            // if the preferences show the EULA was not yet accepted, show the EULA screen
            requestWindowFeature(Window.FEATURE_NO_TITLE);
            setContentView(R.layout.activity_first_start);
            mTosAccepted = false;
            mTosButton = (Button) findViewById(R.id.btnTos);
        }
        */
    super.onCreate(savedInstanceState);
    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    int timeout = Integer.parseInt(settings.getString("pcachewordtimeout", BaseActivity.CACHEWORD_TIMEOUT));
    mCacheWordHandler = new CacheWordHandler(this, timeout);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_first_start);
    mTosAccepted = false;
    mTosButton = (Button) findViewById(R.id.btnTos);
}
Also used : SharedPreferences(android.content.SharedPreferences) CacheWordHandler(info.guardianproject.cacheword.CacheWordHandler)

Example 7 with CacheWordHandler

use of info.guardianproject.cacheword.CacheWordHandler in project storymaker by StoryMaker.

the class ProjectsProvider method onCreate.

@Override
public boolean onCreate() {
    // NEW/CACHEWORD
    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getContext().getApplicationContext());
    int timeout = Integer.parseInt(settings.getString("pcachewordtimeout", BaseActivity.CACHEWORD_TIMEOUT));
    mCacheWordHandler = new CacheWordHandler(getContext(), this, timeout);
    mCacheWordHandler.connectToService();
    mDBHelper = new StoryMakerDB(mCacheWordHandler, getContext());
    return true;
}
Also used : CacheWordHandler(info.guardianproject.cacheword.CacheWordHandler)

Aggregations

CacheWordHandler (info.guardianproject.cacheword.CacheWordHandler)7 SharedPreferences (android.content.SharedPreferences)5 Intent (android.content.Intent)4 SuppressLint (android.annotation.SuppressLint)1 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1 LinearLayout (android.widget.LinearLayout)1 ViewFlipper (android.widget.ViewFlipper)1 StoryMakerDB (org.storymaker.app.db.StoryMakerDB)1 JobTable (org.storymaker.app.model.JobTable)1 PublishJobTable (org.storymaker.app.model.PublishJobTable)1