@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_main, container, false); HomeViewModel homeViewModel = new HomeViewModel(view, this); homePresenter.attachView(homeViewModel); return view; }
private void selectApplication() { LaunchArgument argument = LaunchHelper.createArgument( AppListContext.class, getActivity(), (resultCode, data) -> { if (resultCode == Activity.RESULT_OK) { String acs = data.getStringExtra(Key.ApkConfig); ApkConfig apkConfig = JsonHelper.json(acs, ApkConfig.class); homePresenter.updateApkConfig(apkConfig); // TODO : view getActivity() .setTitle(String.format("%s %s", apkConfig.getName(), apkConfig.getType())); } return true; }); launch(argument); }
private void openAppSetting() { ApkConfig apkConfig = homePresenter.getApkConfig(); Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.setData(Uri.parse("package:" + apkConfig.getPackageName())); startActivity(intent); }
@Override protected void createPresenters(@NonNull IPresenterManager presenterManager) { super.createPresenters(presenterManager); homePresenter = PresenterFactory.createHomePresenter(presenterManager); homePresenter.setHandler(this); }
@Override public void onDownloadAndInstall() { homePresenter.downloadInstall(); }
@Override public void onSync() { homePresenter.sync(); }
@Override public void onOneStep() { homePresenter.oneStep(); }