public class Imagine
extends Fragment
Data collected here includes the time to press each done button 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) java.lang.String |
d1Time
String representing the values of the times until each done button was pressed.
|
(package private) java.lang.String |
d2Time
String representing the values of the times until each done button was pressed.
|
(package private) java.lang.String |
d3Time
String representing the values of the times until each done button was pressed.
|
(package private) boolean |
done
A boolean value indicating if
done3 has been pressed. |
(package private) ImageView |
done1
The TextViews of all three done buttons.
|
(package private) ImageView |
done2
The TextViews of all three done buttons.
|
(package private) ImageView |
done3
The TextViews of all three done buttons.
|
(package private) int |
DURATION_MACRO
An int for the length of the animation.
|
(package private) boolean |
first
The boolean values indicating what done buttons have been pressed.
|
(package private) boolean |
last
The boolean values indicating what done buttons have been pressed.
|
(package private) TextView |
letter
The TextViews of the options, the letter of the option, and the problem
the user it working on.
|
(package private) TextView |
option
The TextViews of the options, the letter of the option, and the problem
the user it working on.
|
(package private) TextView |
problem
The TextViews of the options, the letter of the option, and the problem
the user it working on.
|
(package private) SSTimer |
prompt
The instances of the
SSTimer used for retrieving timing values for
this Fragment. |
(package private) SSJsonReader |
reader
The instance of the
SSJsonReader class that reads in the dynamic
content for the application. |
(package private) boolean |
second
The boolean values indicating what done buttons have been pressed.
|
(package private) Animation |
slide
The instance of the animation.
|
(package private) boolean |
temp1
The boolean values indicating what the current session is.
|
(package private) boolean |
temp2
The boolean values indicating what the current session is.
|
(package private) SSTimer |
timer
The instances 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
|
(package private) java.lang.String |
voPrompt
Strings for the paths to the audio files for the voice over and for the prompt.
|
(package private) java.lang.String |
voString
Strings for the paths to the audio files for the voice over and for the prompt.
|
Constructor and Description |
---|
Imagine(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 the third done button has been pressed
|
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 a done button has been pressed 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
Imagine screen.
|
void |
onDestroy()
All data is saved within this method and memory with the
voMediaPlayer is released. |
void |
setPrompt()
This method sets the timer listener for the
prompt SSTimer . |
Activity activity
SSCallback callback
SSCallback
that allows this fragment to
communicate with the parent activity.java.lang.String d1Time
java.lang.String d2Time
java.lang.String d3Time
boolean done
done3
has been pressed.
Default value = false;ImageView done1
ImageView done2
ImageView done3
int DURATION_MACRO
boolean first
boolean last
TextView letter
TextView option
TextView problem
SSTimer prompt
SSTimer
used for retrieving timing values for
this Fragment.SSJsonReader reader
SSJsonReader
class that reads in the dynamic
content for the application.boolean second
Animation slide
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
java.lang.String voPrompt
java.lang.String voString
public Imagine(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)
prompt
SSTimer
is then started and the countdown begun. If the SSTimer
reaches
20 seconds then the prompt audio is played. If the next button is pressed before
20 seconds then the SSTimer
is restarted. Once a button has been pressed, its corresponding
boolean is set to true so nothing happens upon subsequent presses.
Once the last done button has been pressed,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 void onCompletion(MediaPlayer mp)
voComplete
to indicate the
voice over file has finished playing. If the final done button has been
pressed, 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.public void setPrompt()
prompt
SSTimer
. Once the timer has finished,
the media player will play the selected prompt audio file.