Exemple #1
0
 @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;
 }
Exemple #2
0
 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);
 }
Exemple #3
0
 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);
 }
Exemple #4
0
 @Override
 protected void createPresenters(@NonNull IPresenterManager presenterManager) {
   super.createPresenters(presenterManager);
   homePresenter = PresenterFactory.createHomePresenter(presenterManager);
   homePresenter.setHandler(this);
 }
Exemple #5
0
 @Override
 public void onDownloadAndInstall() {
   homePresenter.downloadInstall();
 }
Exemple #6
0
 @Override
 public void onSync() {
   homePresenter.sync();
 }
Exemple #7
0
 @Override
 public void onOneStep() {
   homePresenter.oneStep();
 }