@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentFragment(new ResponsePromptsFragment());

    mImageLoader = ImageLoader.get(this);

    // inflate the campaign-specific info page into the scrolling framelayout
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    // and inflate all the possible commands into the button tray
    inflater.inflate(R.layout.response_info_buttons, mButtonTray, true);

    // Prepare the loader. Either re-connect with an existing one,
    // or start a new one.
    getSupportLoaderManager().initLoader(0, null, this);

    mapViewButton = (TextView) findViewById(R.id.response_info_button_view_map);
    mapViewButton.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            startActivity(new Intent(OhmageApplication.VIEW_MAP, getIntent().getData()));
          }
        });
  }
Beispiel #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    // make the background of the profile striped to indicate it's not used yet
    setContentView(R.layout.profile_layout);

    // set up some generic stuff for the profile, since it's not databound in any respect
    mContext = this;
    mAccountHelper = new AccountActivityHelper(this);
    mIconView.setImageResource(R.drawable.entity_profile);
    mHeadertext.setText(mAccountHelper.getUsername());
    /*
    mSubtext.setVisibility(View.INVISIBLE);
    mNotetext.setVisibility(View.INVISIBLE);
    */

    // fill up the button tray with the profile's regular buttons
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    inflater.inflate(R.layout.profile_info_buttons, mButtonTray, true);

    // create a catch-all handler that we'll pass to both buttons...
    OnClickListener profileActionListener =
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            Analytics.widget(v);
            switch (v.getId()) {
              case R.id.profile_info_button_logout_wipe:
                mAccountHelper.logout();
                break;
              case R.id.profile_info_button_update_password:
                mAccountHelper.updatePassword();
                break;
            }
          }
        };

    // ...and then hook them both up to it
    Button updatePasswordButton = (Button) findViewById(R.id.profile_info_button_update_password);
    Button logoutWipeButton = (Button) findViewById(R.id.profile_info_button_logout_wipe);

    updatePasswordButton.setOnClickListener(profileActionListener);
    logoutWipeButton.setOnClickListener(profileActionListener);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentFragment(new ResponsePromptsFragment());

    mResponseHelper = new ResponseActivityHelper(this);

    mImageLoader = ImageLoader.get(this);

    // inflate the campaign-specific info page into the scrolling framelayout
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    // and inflate all the possible commands into the button tray
    inflater.inflate(R.layout.response_info_buttons, mButtonTray, true);

    // Prepare the loader. Either re-connect with an existing one,
    // or start a new one.
    getSupportLoaderManager().initLoader(0, null, this);

    mapViewButton = (TextView) findViewById(R.id.response_info_button_view_map);
    mapViewButton.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            Analytics.widget(v);
            startActivity(new Intent(OhmageApplication.VIEW_MAP, getIntent().getData()));
          }
        });

    uploadButton = (TextView) findViewById(R.id.response_info_button_upload);
    uploadButton.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            Analytics.widget(v);
            if (mStatus == Response.STATUS_STANDBY)
              mResponseHelper.queueForUpload(getIntent().getData());
            else {
              Bundle bundle = new Bundle();
              bundle.putParcelable(ResponseActivityHelper.KEY_URI, getIntent().getData());
              showDialog(mStatus, bundle);
            }
          }
        });
  }
  @Override
  public void onContentChanged() {
    super.onContentChanged();

    mEntityHeader.setVisibility(View.GONE);
  }