Android Open Source - Xbox360CollectorsPlace Go To Activity






From Project

Back to project page Xbox360CollectorsPlace.

License

The source code is released under:

MIT License

If you think the Android project Xbox360CollectorsPlace listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.xboxcollectorsplace.ui;
/*from w  ww . ja  va2s .c om*/
import com.xboxcollectorsplace.R;
import com.xboxcollectorsplace.bl.BLParameters;
import com.xboxcollectorsplace.utils.XLog;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;

/**
 * Windowed activity, used by the collection/catalog activities to navigate fast to a certain game.
 * After selecting a title and/or a year, those parameters will return to the collection/catalog 
 * activity, and the list will scroll to the first game that mets them
 */
public class GoToActivity extends Activity implements OnClickListener
{
  //------------------------------------------------------------------------- ATTRIBUTES*/
  
  private EditText _edtTitle;
  private EditText _edtYear;
  private Button _btnAccept;
  private LinearLayout _lytGotoMain;
  
  //------------------------------------------------------------------------- ON CREATE*/
  
  public void onCreate(Bundle savedInstanceState) 
    {
      try
      {
          super.onCreate(savedInstanceState);          
          setContentView(R.layout.activity_goto);
          
          this._edtTitle = (EditText)this.findViewById(R.id.edtGotoTitle);
          this._edtYear = (EditText)this.findViewById(R.id.edtGotoYear);
          this._btnAccept = (Button)this.findViewById(R.id.btnAccept);
          this._lytGotoMain = (LinearLayout)this.findViewById(R.id.lytGotoMain);
              
          this._btnAccept.setOnClickListener(this);
          
          // Used to prevent the editTexts from getting the focus upon creation
          this._lytGotoMain.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
          this._lytGotoMain.setFocusable(true);
          this._lytGotoMain.setFocusableInTouchMode(true);
          this._lytGotoMain.setOnTouchListener(new View.OnTouchListener() 
          {
        public boolean onTouch(View v, MotionEvent event)
        {
                  v.requestFocusFromTouch();
                  return false;
        }
          });
      }
    catch (Exception ex)
    {
      XLog.e("[GoToActivity.onCreate]", ex);
      }
    }
  
  //------------------------------------------------------------------------- EVENTS*/
    
  /**
   * Event related to the touch of the accept button. Returns the selected parameters to the 
   * caller activity
   */
    public void onClick(View view)
  {
    try
    {      
      if (view.getId() == this._btnAccept.getId())
      {
        Intent output = new Intent();
          output.putExtra(BLParameters.PARAMETERS.TITLE, _edtTitle.getText().toString());
          output.putExtra(BLParameters.PARAMETERS.YEAR, _edtYear.getText().toString());
        setResult(Activity.RESULT_OK, output);
        this.finish();
      }
    }
    catch (Exception ex) 
    {
      XLog.e("[GoToActivity.onClick]", ex);
    }
  }    
}




Java Source Code List

com.xboxcollectorsplace.App.java
com.xboxcollectorsplace.bl.BLParameters.java
com.xboxcollectorsplace.bl.BLUtils.java
com.xboxcollectorsplace.bl.controllers.StorageController.java
com.xboxcollectorsplace.bl.entities.Catalog.java
com.xboxcollectorsplace.bl.entities.DLC.java
com.xboxcollectorsplace.bl.entities.Filters.java
com.xboxcollectorsplace.bl.entities.GamePhotoGallery.java
com.xboxcollectorsplace.bl.entities.GamePhoto.java
com.xboxcollectorsplace.bl.entities.Game.java
com.xboxcollectorsplace.bl.entities.Link.java
com.xboxcollectorsplace.bl.entities.OptionString.java
com.xboxcollectorsplace.bl.entities.Options.java
com.xboxcollectorsplace.bl.entities.SelectionFile.java
com.xboxcollectorsplace.bl.entities.Sort.java
com.xboxcollectorsplace.bl.extension.XboxAlarmReceiver.java
com.xboxcollectorsplace.bl.extension.XboxDownloaderService.java
com.xboxcollectorsplace.bl.extension.XboxInitialDownload.java
com.xboxcollectorsplace.ui.CatalogActivity.java
com.xboxcollectorsplace.ui.CollectionActivity.java
com.xboxcollectorsplace.ui.ConfigActivity.java
com.xboxcollectorsplace.ui.EditAchievementsActivity.java
com.xboxcollectorsplace.ui.EditPhotoTitleActivity.java
com.xboxcollectorsplace.ui.FileSelectorActivity.java
com.xboxcollectorsplace.ui.FilterSortActivity.java
com.xboxcollectorsplace.ui.GameDetailActivity.java
com.xboxcollectorsplace.ui.GoToActivity.java
com.xboxcollectorsplace.ui.PhotoGalleryActivity.java
com.xboxcollectorsplace.ui.SummaryActivity.java
com.xboxcollectorsplace.ui.SynopsisDetailActivity.java
com.xboxcollectorsplace.ui.TitleScreenActivity.java
com.xboxcollectorsplace.utils.JustifiedTextView.java
com.xboxcollectorsplace.utils.XComparator.java
com.xboxcollectorsplace.utils.XLog.java