public class Options
extends Fragment
Data collected here includes which options were selected, the time to select them, and the total time the user spent on the screen.
Modifier and Type | Field and Description |
---|---|
(package private) Activity |
activity
The instance of the current Activity
|
(package private) SSCallback |
callback
The instance of the
SSCallback that allows this fragment to
communicate with the parent activity. |
(package private) boolean |
done
A boolean value indicating if exactly two options have been selected.
|
(package private) TextView |
fact1
The TextViews of each of the different facts for each option.
|
(package private) TextView |
fact2
The TextViews of each of the different facts for each option.
|
(package private) TextView |
fact3
The TextViews of each of the different facts for each option.
|
(package private) TextView |
fact4
The TextViews of each of the different facts for each option.
|
(package private) TextView[] |
facts
TextView arrays of the options and facts.
|
(package private) FrameLayout[] |
highlights
FrameLayout array of the option highlights.
|
(package private) FrameLayout |
o1Highlight
The TextViews of each of the different highlights behind each option.
|
(package private) FrameLayout |
o2Highlight
The TextViews of each of the different highlights behind each option.
|
(package private) FrameLayout |
o3Highlight
The TextViews of each of the different highlights behind each option.
|
(package private) FrameLayout |
o4Highlight
The TextViews of each of the different highlights behind each option.
|
(package private) TextView |
option1
The TextViews of each of the different options on the screen related
to the problem choice the user selected.
|
(package private) TextView |
option2
The TextViews of each of the different options on the screen related
to the problem choice the user selected.
|
(package private) TextView |
option3
The TextViews of each of the different options on the screen related
to the problem choice the user selected.
|
(package private) TextView |
option4
The TextViews of each of the different options on the screen related
to the problem choice the user selected.
|
(package private) int |
optionCounter
an int representing how many options have been selected.
|
(package private) TextView[] |
options
TextView arrays of the options and facts.
|
(package private) java.util.Queue<java.lang.Integer> |
optionsQueue
A Queue containing the indices of which options were selected.
|
(package private) java.lang.String[] |
opts
A String[] containing the options for the problem choice.
|
(package private) java.lang.String[] |
optTimes
A String[] containing the timing data for each individual option.
|
(package private) TextView |
problem
The TextView displaying the current problem the user is working on
|
(package private) SSJsonReader |
reader
The instance of the
SSJsonReader class that reads in the dynamic
content for the application. |
(package private) java.lang.Boolean[] |
shown
A boolean[] indicating which facts were selected by the user.
|
(package private) boolean |
temp1
Boolean values corresponding to which template the user is in.
|
(package private) boolean |
temp2
Boolean values corresponding to which template the user is in.
|
(package private) SSTimer |
timer
The instance of the
SSTimer used for retrieving timing values for
this Fragment. |
(package private) View |
view
The instance of the current View
|
(package private) boolean |
voComplete
A boolean value indicating when the
voMediaPlayer has finished
playing. |
(package private) MediaPlayer |
voMediaPlayer
The instance of voice over MediaPlayer
|
Constructor and Description |
---|
Options(SSJsonReader reader,
int run)
The constructor saves what template type this Fragment is a part of and
copies the instance of the
SSJsonReader into memory. |
Modifier and Type | Method and Description |
---|---|
boolean |
approveNext()
This method checks to see if the voice over has been completed and
and two options have been selected
|
void |
checkNext()
This method checks if the conditions for the next button are met.
|
private void |
deselect(int deselect)
This method removes the option corresponding to the passed in index value in the options queue.
|
void |
onAttach(Activity activity)
This class uses the onAttach method of the android life cycle to save an
instance of the activity and to implement the interface between the main
activity and this fragment activity
|
void |
onClick(View v)
This method is called when an option has been selected by the user.
|
void |
onCompletion(MediaPlayer mp)
This method changes the value within
voComplete to indicate the
voice over file has finished playing. |
View |
onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState)
This method is called by the system to inflate the layout for the
Options screen.
|
void |
onDestroy()
All data is saved within this method and memory with the
voMediaPlayer is released. |
private void |
select(int select)
This method adds the selected option to the options queue.
|
void |
setScreen()
This method populates each options and facts TextView with content from
the
reader class and sets all facts to be invisible. |
void |
unselectLast()
This method removes the head of the options queue.
|
Activity activity
SSCallback callback
SSCallback
that allows this fragment to
communicate with the parent activity.boolean done
TextView fact1
TextView fact2
TextView fact3
TextView fact4
TextView[] facts
reader
instance.
I could simplify the globals down but I'm too afraid to do that because
everything already works.FrameLayout[] highlights
FrameLayout o1Highlight
FrameLayout o2Highlight
FrameLayout o3Highlight
FrameLayout o4Highlight
TextView option1
TextView option2
TextView option3
TextView option4
int optionCounter
TextView[] options
reader
instance.
I could simplify the globals down but I'm too afraid to do that because
everything already works.java.util.Queue<java.lang.Integer> optionsQueue
java.lang.String[] opts
reader
instance.java.lang.String[] optTimes
TextView problem
SSJsonReader reader
SSJsonReader
class that reads in the dynamic
content for the application.java.lang.Boolean[] shown
boolean temp1
boolean temp2
SSTimer timer
SSTimer
used for retrieving timing values for
this Fragment.View view
boolean voComplete
voMediaPlayer
has finished
playing. Default value = false;MediaPlayer voMediaPlayer
public Options(SSJsonReader reader, int run)
SSJsonReader
into memory.reader
- The instance of the SSJsonReader
run
- The integer representation of the corresponding Template the
Fragment is a part of.public boolean approveNext()
false otherwise
public void checkNext()
private void deselect(int deselect)
deselect
- an integer corresponding to the index of the selected option
in the options arraypublic void onAttach(Activity activity)
public void onClick(View v)
public void onCompletion(MediaPlayer mp)
voComplete
to indicate the
voice over file has finished playing. If two options have been selected,
the Fragment indicates to its parent activity that the next button
can now be visible to the user and the user has completed all
required elements within the Fragment.public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
public void onDestroy()
voMediaPlayer
is released.private void select(int select)
select
- an integer corresponding to the index of the selected option
in the options arraypublic void setScreen()
reader
class and sets all facts to be invisible.public void unselectLast()
select
- an integer corresponding to the index of the selected option
in the options array