public class Best
extends Fragment
Data collected here includes which option was selected, the time to select it, 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) java.lang.String |
best
A String corresponding to the letter of the option that would be selected.
|
(package private) SSCallback |
callback
The instance of the
SSCallback that allows this fragment to
communicate with the parent activity. |
(package private) java.lang.String |
choiceTime
A String corresponding to the timing it takes to select an option.
|
(package private) boolean |
done
A boolean value indicating when that an option has been selected.
|
(package private) FrameLayout |
o1Highlight
The frame layouts corresponding to the highlights for each option.
|
(package private) FrameLayout |
o2Highlight
The frame layouts corresponding to the highlights for each option.
|
(package private) java.lang.String[] |
op
A String[] that holds the options array from the
SSJsonReader selected options. |
(package private) SSJsonReader |
reader
The instance of the
SSJsonReader class that reads in the dynamic
content for the application. |
(package private) boolean |
temp1
boolean value indicating what template this fragment is currently apart
of.
|
(package private) boolean |
temp2
boolean value indicating what template this fragment is currently apart
of.
|
(package private) SSTimer |
timer
The instance of the
SSTimer used for retrieving timing values for
this Fragment. |
(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 |
---|
Best(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
an option has selected
|
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) |
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 Best
screen.
|
void |
onDestroy()
All data is saved within this method with the
voMediaPlayer is released. |
Activity activity
java.lang.String best
SSCallback callback
SSCallback
that allows this fragment to
communicate with the parent activity.java.lang.String choiceTime
boolean done
FrameLayout o1Highlight
FrameLayout o2Highlight
java.lang.String[] op
SSJsonReader
selected options.SSJsonReader reader
SSJsonReader
class that reads in the dynamic
content for the application.boolean temp1
boolean temp2
SSTimer timer
SSTimer
used for retrieving timing values for
this Fragment.boolean voComplete
voMediaPlayer
has finished
playing. Default value = false;MediaPlayer voMediaPlayer
public Best(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 onAttach(Activity activity)
public void onClick(View v)
This method sets the highlight for the corresponding button pressed.
If a button is pushed after one has already been selected, the original
highlight is set invisible and the most recently selected option is
set to visible.
public void onCompletion(MediaPlayer mp)
voComplete
to indicate the
voice over file has finished playing. If an option has
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.