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;
/*www.java2s.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
*/publicclass StudentQueueFragment extends QueueFragment {
publicvoid enterQueue() {
MainActivity.NETWORK_REQUEST.executeGetRequest("/queue/enter_queue", MainActivity.getUser().getId(), MainActivity.getUser().getToken());
}
publicvoid exitQueue() {
MainActivity.NETWORK_REQUEST.executeGetRequest("/queue/exit_queue", MainActivity.getUser().getId(), MainActivity.getUser().getToken());
}
publicvoid signOut() {
mQueueRequest.deleteUser("students");
mReadyToRefresh = false;
}
@Override
publicvoid 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));
}
}
}