Search in sources :

Example 1 with MainFragment

use of ml.qingsu.fuckview.ui.fragments.MainFragment in project fuckView by w568w.

the class MainActivity method onCreate.

@SuppressLint("WorldReadableFiles")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme", false)) {
        setTheme(R.style.DayTheme);
    }
    setContentView(R.layout.activity_main);
    checkAndCallPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
    sSharedPreferences = getSharedPreferences("data", Context.MODE_WORLD_READABLE);
    dealWithIntent();
    if (FirstRun.isFirstRun(this, "app")) {
        setFragmentWithoutBack(new WelcomeFragment());
    } else if ("".equals(readPreferences(LIST_NAME))) {
        setFragmentWithoutBack(new SelectAppWizard());
        if (!isModuleActive()) {
            new AlertDialog.Builder(MainActivity.this).setTitle(R.string.xposed_is_unabled).setMessage(R.string.enable_module).setPositiveButton(R.string.OK, null).show();
        }
    } else {
        setFragmentWithoutBack(new MainFragment());
        if (!isModuleActive()) {
            new AlertDialog.Builder(MainActivity.this).setTitle(R.string.xposed_is_unabled).setMessage(R.string.enable_module).setPositiveButton(R.string.OK, null).show();
        }
    }
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) MainFragment(ml.qingsu.fuckview.ui.fragments.MainFragment) WelcomeFragment(ml.qingsu.fuckview.ui.fragments.WelcomeFragment) SelectAppWizard(ml.qingsu.fuckview.ui.fragments.select_app.SelectAppWizard) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 AlertDialog (android.support.v7.app.AlertDialog)1 MainFragment (ml.qingsu.fuckview.ui.fragments.MainFragment)1 WelcomeFragment (ml.qingsu.fuckview.ui.fragments.WelcomeFragment)1 SelectAppWizard (ml.qingsu.fuckview.ui.fragments.select_app.SelectAppWizard)1