Android Open Source - GroupSmart-Android Major Select






From Project

Back to project page GroupSmart-Android.

License

The source code is released under:

Copyright (C) <2014> <Derek Argueta - Hunter Kehoe> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), ...

If you think the Android project GroupSmart-Android 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.dargueta.groupsmart;
//from   w  ww.  j a v  a2s  .c om
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;

import com.google.analytics.tracking.android.EasyTracker;

/**
 * 
 * @author Hunter Kehoe
 * 
 * Provides the activity where the user can select a major for their profile.
 *
 */
public class MajorSelect extends Activity {
  
  private ListView lv;
  ArrayAdapter<String> adapter;
  EditText search;
  TextView tvFind;
  
  protected void onCreate(Bundle savedInstanceState) {
    
    super.onCreate(savedInstanceState);
    setContentView(R.layout.course_selector);
    
    String majors[] = {"Undeclared", "Accounting* - BS","Acting* - BFA","Actuarial Science - BS","American Studies - BA","Ancient Near Eastern Studies - BA","Animation* - BFA","Anthropology (sociocultural double major) - BA","Anthropology: Archaeology - BA","Anthropology: Sociocultural - BA","Arabic Language (2nd major program) - BA","Art Education (K-12)* - BA","Art History and Curatorial Studies - BA","Asian Studies: China Studies - BA","Asian Studies: Japan Studies - BA","Asian Studies: Korea Studies - BA","Athletic Training - BS","Biochemistry - BS","Bioinformatics - BS","Biological Science Education - BS","Biology - BS","Biophysics - BS","Chemical Engineering - BS","Chemistry - BA","Chemistry - BS","Chemistry Education - BS","Chinese - BA","Civil Engineering - BS","Classical Studies: Classical Civilization - BA","Classical Studies: Classics - BA","Classical Studies: Greek - BA","Classical Studies: Latin - BA","Commercial Music* - BM","Communication Disorders* - BS","Communications: Advertising* - BA","Communications: Journalism* - BA","Communications: Public Relations* - BA","Comparative Literature - BA","Computer Engineering - BS","Computer Science - BS","Computer Science: Animation* - BS","Computer Science: Bioinformatics - BS","Conservation Biology - BS","Construction Management* - BS","Dance Education* - BA","Dance* - BA","Dietetics* - BS","Early Childhood Education - BS","Earth and Space Science Education - BS","Economics - BA","Economics - BS","Electrical Engineering - BS","Elementary Education - BS","English - BA","English Language - BA","English Teaching* - BA","Environmental Science - BS","European Studies - BA","Exercise Science - BS","Exercise and Wellness - BS","Facility and Property Management* - BS","Family History-Genealogy - BA","Family Life: Family Studies - BS","Family Life: Human Development - BS","Family and Consumer Sciences Education - BS","Finance* - BS","Food Science - BS","French -  BA","French Studies (secondary major program) - BA","French Teaching - BA","General Studies: American Studies* - BGS","General Studies: English* - BGS","General Studies: Family Life* - BGS","General Studies: History* - BGS","General Studies: Management* - BGS","General Studies: Psychology* - BGS","Genetics and Biotechnology - BS","Geography: Environmental Studies - BS","Geography: Geographic Information Systems - BS","Geography: Geospatial Intelligence - BS","Geography: Global Studies - BS","Geography: Tourism Studies - BS","Geography: Urban & Regional Planning - BS","Geology - BS","Geology: Environmental Geology - BS","German - BA","German Studies (secondary major program) - BA","German Teaching - BA","German: Linguistics - BA","German: Literature - BA","Graphic Design* - BFA","History - BA","History Teaching - BA","Illustration* - BFA","Industrial Design* - BFA","Information Systems* - BS","Information Technology - BS","Interdisciplinary Humanities - BA","International Relations - BA","Italian - BA","Italian Studies (secondary major program) - BA","Japanese - BA","Korean - BA","Landscape Management - BS","Latin American Studies - BA","Latin Teaching - BA","Linguistics - BA","Management: Entrepreneurship* - BS","Management: General Business* - BS","Management: Global Suplly Chain Management* - BS","Management: Marketing Management* - BS","Management: Orgnztnl Behavior/HR Mgt* - BS","Management: Strategy* - BS","Manufacturing Engineering Technology - BS","Mathematics - BS","Mathematics Education - BS","Mathematics: Applied and Computational Mathematics - BS","Mechanical Engineering* - BS","Media Arts Studies* - BA","Medical Laboratory Science* - BS","Microbiology - BS","Middle East Studies/Arabic - BA","Molecular Biology - BS","Music Composition* - BM","Music Dance Theatre* - BFA","Music Education: Elementary Music Specialist* - BM","Music Education: K-12 Choral* - BM","Music Education: K-12 Instrumental* - BM","Music Performance: Brass* - BM","Music Performance: Combined Piano and Organ* - BM","Music Performance: Organ* - BM","Music Performance: Percussion* - BM","Music Performance: Piano* - BM","Music Performance: String* - BM","Music Performance: Vocal* - BM","Music Performance: Woodwind* - BM","Music* - BA","Neuroscience - BS","Nursing* - BS","Nutritional Science - BS","Philosophy - BA","Photography* - BFA","Physical Education Teaching/Coaching (K-12) - BS","Physical Science, Teaching - BS","Physics - BS","Physics Teaching - BS","Physics, Applied - BS","Physics-Astronomy - BS","Physiology and Developmental Biology - BS","Political Science - BA","Portuguese - BA","Portuguese Studies (secondary major program) - BA","Psychology - BS","Public Health: Environmental/Occupational Health - BS","Public Health: Epidemiology - BS","Public Health: Health Promotion - BS","Public Health: Health Science - BS","Recreation Management: Experience Industry Management - BS","Recreation Management: Therapeutic Recreation - BS","Russian - BA","School Health Education - BS","Social Science, Teaching - BS","Sociology - BS","Spanish - BA","Spanish Studies (secondary major program) - BA","Spanish Teaching* - BA","Spanish Translation* - BA","Special Education: Mild/Moderate Disabilites* - BS","Special Education: Severe Disabilities* - BS","Statistics: Applied Statistics & Analytics - BS","Statistics: Biostatistics - BS","Statistics: Statistical Science - BS","Studio Arts* - BFA","Technology and Engineering  Education* - BS","Theatre Arts Education K-12 - BA","Theatre Arts Studies - BA","Visual Arts: Graphic Design* - BA","Visual Arts: Illustration* - BA","Visual Arts: Photography* - BA","Visual Arts: Studio Arts* - BA","Wildlife and Wildlands Conservation - BS"};
    
    lv = (ListView) findViewById(R.id.lvCourses);
    search = (EditText) findViewById(R.id.etSearch);
    
    tvFind = (TextView) findViewById(R.id.tvFind);
    tvFind.setText("Find a Major");
    
    adapter = new ArrayAdapter<String>(this, R.layout.list_item, R.id.tvCourseName, majors);
    lv.setAdapter(adapter);
    
    search.addTextChangedListener(new TextWatcher() {
      
      public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
        
        MajorSelect.this.adapter.getFilter().filter(cs);
      }
      
      public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
        
      }
      
      public void afterTextChanged(Editable arg0) {
        
      }
    });
    
    lv.setOnItemClickListener(new OnItemClickListener() {
      
      public void onItemClick(AdapterView<?> parent, final View v, int position, long id) {
        
        Intent resultIntent = new Intent();
        resultIntent.putExtra(Constants.NAME_KEY, (String) parent.getItemAtPosition(position));
        setResult(Activity.RESULT_OK, resultIntent);
        finish();
      }
    });
  }
  
  public void onBackPressed() {
    
    Intent resultIntent = new Intent();
    setResult(Activity.RESULT_CANCELED, resultIntent);
    finish();
  }
  
  // Google Analytics
  public void onStart() {
    
    super.onStart();
    EasyTracker.getInstance(this).activityStart(this);
  }
  
  public void onStop() {
    
    super.onStop();
    EasyTracker.getInstance(this).activityStop(this);
  }
}




Java Source Code List

com.dargueta.groupsmart.ChangePassword.java
com.dargueta.groupsmart.Constants.java
com.dargueta.groupsmart.CourseSelect.java
com.dargueta.groupsmart.CreateGroup.java
com.dargueta.groupsmart.Feedback.java
com.dargueta.groupsmart.FindGroup.java
com.dargueta.groupsmart.GroupInfo.java
com.dargueta.groupsmart.Login.java
com.dargueta.groupsmart.Main.java
com.dargueta.groupsmart.MajorSelect.java
com.dargueta.groupsmart.Profile.java
com.dargueta.groupsmart.Register.java
com.dargueta.groupsmart.ServiceHandler.java
com.dargueta.groupsmart.Settings.java
com.dargueta.groupsmart.UpdateGroup.java
com.dargueta.groupsmart.UpdateProfile.java