public class Menu
extends Fragment
Data collected here includes which Theme and Problem were selected as well the users time to do so. The last timing element is the total time the user spent on the Menu 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 |
endTime
Time for taken to make a selection.
|
(package private) int |
FADE_MACRO
Used for the length of the of fading transition the
problems
layout uses. |
(package private) java.lang.String[] |
people
Holds the problem choices related to the category.
|
(package private) ImageView |
peopleButton
Buttons for the different themes.
|
(package private) java.lang.String[] |
places
Holds the problem choices related to the category.
|
(package private) ImageView |
placesButton
Buttons for the different themes.
|
(package private) Problem |
probChoice
A
Problem type denoting which problem is currently selected. |
(package private) TextView |
problem1
A TextView corresponding to a possible problem choice.
|
(package private) TextView |
problem2
A TextView corresponding to a possible problem choice.
|
(package private) TextView |
problem3
A TextView corresponding to a possible problem choice.
|
(package private) TextView |
problem4
A TextView corresponding to a possible problem choice.
|
(package private) TextView[] |
problemArray
An array of all the problem choices in
problems layout |
(package private) LinearLayout |
problems
A layout containing all the problems on the screen.
|
(package private) java.lang.String |
problemTime
Time for taken to make a selection.
|
(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) Theme |
themeChoice
A
Theme type denoting which theme is currently selected. |
(package private) java.lang.String |
themeTime
Time for taken to make a selection.
|
(package private) java.lang.String[] |
things
Holds the problem choices related to the category.
|
(package private) ImageView |
thingsButton
Buttons for the different themes.
|
(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 |
---|
Menu(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 |
---|---|
private void |
menuAnimate(java.lang.String[] choices)
Method call to change the problem choices displayed to the user.
|
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)
Performs the appropriate actions for the user interactions.
|
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 Menu
screen.
|
void |
onDestroy()
All data is saved within this method and memory with the
voMediaPlayer is released. |
private void |
resetBackgrounds()
Resets the backgrounds of all problems TextViews in the
problems
layout to be clear. |
Activity activity
SSCallback callback
SSCallback
that allows this fragment to
communicate with the parent activity.java.lang.String endTime
int FADE_MACRO
problems
layout uses.java.lang.String[] people
ImageView peopleButton
problems
layout is then animated to display the problems in
this area.java.lang.String[] places
ImageView placesButton
problems
layout is then animated to display the problems in
this area.TextView problem1
problems
TextView problem2
problems
TextView problem3
problems
TextView problem4
problems
TextView[] problemArray
problems
layoutLinearLayout problems
java.lang.String problemTime
SSJsonReader reader
SSJsonReader
class that reads in the dynamic
content for the application.boolean temp1
java.lang.String themeTime
java.lang.String[] things
ImageView thingsButton
problems
layout is then animated to display the problems in
this area.SSTimer timer
SSTimer
used for retrieving timing values for
this Fragment.boolean voComplete
voMediaPlayer
has finished
playing. Default value = false;MediaPlayer voMediaPlayer
public Menu(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.private void menuAnimate(java.lang.String[] choices)
choices
- The strings to replace what is currently displayed to the
user.public 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 a problem choice has been made
by the user, 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.
For template 1, when the audio finishes, the application automatically selects the people category
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
public void onDestroy()
voMediaPlayer
is released.private void resetBackgrounds()
problems
layout to be clear.