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