use of ru.playsoftware.j2meloader.applist.AppListModel in project J2ME-Loader by nikita36078.
the class InstallerDialog method onAttach.
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
AppListModel appListModel = new ViewModelProvider(requireActivity()).get(AppListModel.class);
appRepository = appListModel.getAppRepository();
}
use of ru.playsoftware.j2meloader.applist.AppListModel in project J2ME-Loader by nikita36078.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (FileUtils.isExternalStorageLegacy()) {
permissionsLauncher.launch(STORAGE_PERMISSIONS);
}
appListModel = new ViewModelProvider(this).get(AppListModel.class);
if (savedInstanceState == null) {
Intent intent = getIntent();
Uri uri = null;
if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) {
uri = intent.getData();
}
AppsListFragment fragment = AppsListFragment.newInstance(uri);
getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment).commit();
}
preferences = PreferenceManager.getDefaultSharedPreferences(this);
if (!preferences.contains(PREF_TOOLBAR)) {
boolean enable = !ViewConfiguration.get(this).hasPermanentMenuKey();
preferences.edit().putBoolean(PREF_TOOLBAR, enable).apply();
}
boolean warningShown = preferences.getBoolean(PREF_STORAGE_WARNING_SHOWN, false);
if (!FileUtils.isExternalStorageLegacy() && !warningShown) {
showScopedStorageDialog();
preferences.edit().putBoolean(PREF_STORAGE_WARNING_SHOWN, true).apply();
}
setVolumeControlStream(AudioManager.STREAM_MUSIC);
}
Aggregations