Android Open Source - TAQueue Student Queue Fragment






From Project

Back to project page TAQueue.

License

The source code is released under:

MIT License

If you think the Android project TAQueue 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.familybiz.greg.taqueue.view.queue;
/* w  w  w .  ja v a  2s. com*/
import android.app.ActionBar;
import android.view.View;
import android.widget.AdapterView;

import com.familybiz.greg.taqueue.MainActivity;
import com.familybiz.greg.taqueue.R;
import com.familybiz.greg.taqueue.model.Student;

/**
 * Created by Greg Anderson
 */
public class StudentQueueFragment extends QueueFragment {

  public void enterQueue() {
    MainActivity.NETWORK_REQUEST.executeGetRequest("/queue/enter_queue", MainActivity.getUser().getId(), MainActivity.getUser().getToken());
  }

  public void exitQueue() {
    MainActivity.NETWORK_REQUEST.executeGetRequest("/queue/exit_queue", MainActivity.getUser().getId(), MainActivity.getUser().getToken());
  }

  public void signOut() {
    mQueueRequest.deleteUser("students");
    mReadyToRefresh = false;
  }

  @Override
  public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
    // Do nothing
  }

  @Override
  void updateTabs() {

    // Check if user is in queue

    Student student = (Student)MainActivity.getUser();
    ActionBar.Tab tab = MainActivity.mActionBar.getTabAt(0);

    if (mQueue.containsStudent(student.getUsername(), student.getLocation())) {
      if (!tab.getText().equals(getString(R.string.exit_queue_button_text)))
        tab.setText(getString(R.string.exit_queue_button_text));
    }
    else {
      if (!tab.getText().equals(getString(R.string.enter_queue_button_text)))
        tab.setText(getString(R.string.enter_queue_button_text));
    }
  }
}




Java Source Code List

com.familybiz.greg.taqueue.ApplicationTest.java
com.familybiz.greg.taqueue.MainActivity.java
com.familybiz.greg.taqueue.MoreInformationActivity.java
com.familybiz.greg.taqueue.NetworkTestFragment.java
com.familybiz.greg.taqueue.SettingsActivity.java
com.familybiz.greg.taqueue.model.Instructor.java
com.familybiz.greg.taqueue.model.School.java
com.familybiz.greg.taqueue.model.StudentQueue.java
com.familybiz.greg.taqueue.model.Student.java
com.familybiz.greg.taqueue.model.TA.java
com.familybiz.greg.taqueue.model.User.java
com.familybiz.greg.taqueue.model.queue.QueueData.java
com.familybiz.greg.taqueue.model.queue.QueueStudent.java
com.familybiz.greg.taqueue.model.queue.QueueTA.java
com.familybiz.greg.taqueue.network.CustomStringRequest.java
com.familybiz.greg.taqueue.network.NetworkRequest.java
com.familybiz.greg.taqueue.network.QueueRequest.java
com.familybiz.greg.taqueue.network.SchoolRequest.java
com.familybiz.greg.taqueue.network.StudentRequest.java
com.familybiz.greg.taqueue.network.TARequest.java
com.familybiz.greg.taqueue.view.lists.InstructorListFragment.java
com.familybiz.greg.taqueue.view.lists.ListFragment.java
com.familybiz.greg.taqueue.view.lists.QueueListFragment.java
com.familybiz.greg.taqueue.view.lists.SchoolListFragment.java
com.familybiz.greg.taqueue.view.login.LoginFragment.java
com.familybiz.greg.taqueue.view.login.StudentLoginFragment.java
com.familybiz.greg.taqueue.view.login.TALoginFragment.java
com.familybiz.greg.taqueue.view.queue.ColorableStudentArrayAdapter.java
com.familybiz.greg.taqueue.view.queue.ColorableTAArrayAdapter.java
com.familybiz.greg.taqueue.view.queue.QueueFragment.java
com.familybiz.greg.taqueue.view.queue.StudentQueueFragment.java
com.familybiz.greg.taqueue.view.queue.TAQueueFragment.java