public class Think
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) ImageView |
d1
The ImageViews of the done buttons the user presses after thinking
about each question.
|
(package private) ImageView |
d2
The ImageViews of the done buttons the user presses after thinking
about each question.
|
(package private) ImageView |
d3
The ImageViews of the done buttons the user presses after thinking
about each question.
|
(package private) boolean |
done
A boolean value indicating when all three questions have been answered.
|
(package private) java.lang.String |
done1Time
String values representing the time it takes for the user to press the done
button for each question they are asked to think about.
|
(package private) java.lang.String |
done2Time
String values representing the time it takes for the user to press the done
button for each question they are asked to think about.
|
(package private) java.lang.String |
done3Time
String values representing the time it takes for the user to press the done
button for each question they are asked to think about.
|
(package private) int |
DURATION_MACRO
An int value representing how long the animation is suppose to last.
|
(package private) boolean |
first
Boolean values indicating if the user has already pressed the corresponding
done button.
|
(package private) boolean |
last
Boolean values indicating if the user has already pressed the corresponding
done button.
|
(package private) TextView |
opA
The TextViews of each of the questions the user is suppose to think about.
|
(package private) TextView |
opB
The TextViews of each of the questions the user is suppose to think about.
|
(package private) TextView |
problem
The TextView of the problem the user is 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
Boolean value indicating if the user is on the Think Fragment for option A or option B.
|
(package private) Animation |
slide
The instance of the Animation
|
(package private) boolean |
temp1
Boolean value indicating if the user is on Template 1.
|
(package private) boolean |
third
Boolean values indicating if the user has already pressed the corresponding
done button.
|
(package private) SSTimer |
timer
The instances of the
SSTimer used for retrieving timing values for
this Fragment. |
(package private) TextView |
tv1
The TextViews of each of the questions the user is suppose to think about.
|
(package private) TextView |
tv2
The TextViews of each of the questions the user is suppose to think about.
|
(package private) TextView |
tv3
The TextViews of each of the questions the user is suppose to think about.
|
(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
String values containing the paths of the audio and prompt voice over files.
|
(package private) java.lang.String |
voString
String values containing the paths of the audio and prompt voice over files.
|
Constructor and Description |
---|
Think() |
Think(boolean second,
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 all done buttons have 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
Think screen.
|
void |
onDestroy()
All data is saved within this method and memory with the
voMediaPlayer is released. |
void |
setPrompt()
|
Activity activity
SSCallback callback
SSCallback
that allows this fragment to
communicate with the parent activity.ImageView d1
ImageView d2
ImageView d3
boolean done
java.lang.String done1Time
java.lang.String done2Time
java.lang.String done3Time
int DURATION_MACRO
boolean first
boolean last
TextView opA
TextView opB
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
second
.Animation slide
boolean temp1
boolean third
SSTimer timer
SSTimer
used for retrieving timing values for
this Fragment.TextView tv1
TextView tv2
TextView tv3
View view
boolean voComplete
voMediaPlayer
has finished
playing. Default value = false;MediaPlayer voMediaPlayer
java.lang.String voPrompt
java.lang.String voString
public Think()
public Think(boolean second, SSJsonReader reader, int run)
SSJsonReader
into memory.second
- If the user is on option A or Breader
- 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 all done buttons have 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()