예제 #1
0
  @Override
  public void onResume() {
    super.onResume();
    mProgressDialog.setMessage(getResources().getString(R.string.loading));
    mProgressDialog.show();

    // stage and commit changes to the current project
    Project p = AppContext.projectManager().getSelectedProject();
    if (p != null) {
      p.commit(
          new Project.OnCommitComplete() {
            @Override
            public void success() {
              init();
              mProgressDialog.dismiss();
            }

            @Override
            public void error(Throwable e) {
              mProgressDialog.dismiss();
              AppContext.context().showToastMessage(R.string.project_share_exception);
              finish();
            }
          });
    } else {
      init();
      mProgressDialog.dismiss();
    }
  }
예제 #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sharing);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    mProgressDialog = new ProgressDialog(SharingActivity.this);

    // hook up list view
    ListView list = (ListView) findViewById(R.id.sharingListView);
    mAdapter = new ToolAdapter(mSharingTools, this);
    list.setAdapter(mAdapter);
    list.setOnItemClickListener(
        new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            if (mSharingTools.size() > i && i >= 0) {
              ToolItem tool = mSharingTools.get(i);
              // execute the sharing action
              if (tool.isEnabled()) {
                tool.getAction().run();
              } else {
                app().showToastMessage(tool.getDisabledNotice());
              }
            }
          }
        });
  }
예제 #3
0
  public void onDestroy() {

    super.onDestroy();
  }