public class Affected
extends Fragment
Data collected here includes which affected persons 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) TextView[] | 
facts
An TextView array of the affected persons facts. 
 | 
(package private) FrameLayout[] | 
highlights
An FrameLayout array of the affected persons highlights. 
 | 
(package private) SSJsonReader | 
reader
The instance of the  
SSJsonReader class that reads in the dynamic
 content for the application. | 
(package private) boolean[] | 
selected
A boolean[] indicating which facts were selected by the user. 
 | 
(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) int[] | 
time
A int[] that holds the time from the beginning of the screen to when the
 corresponding affected person was selected. 
 | 
(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 | 
|---|
Affected(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 boolean | 
atLeastOne()
This method checks to see if at least one affected person is selected. 
 | 
private void | 
deselect(int deselect)
This method indicated that a affected person has been de-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)
The method called when an affected person 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
 Affected screen. 
 | 
void | 
onDestroy()
All data is saved within this method and memory with the
  
voMediaPlayer is released. | 
private void | 
select(int select)
This method indicated that a affected person has been selected. 
 | 
Activity activity
SSCallback callback
SSCallback that allows this fragment to
 communicate with the parent activity.TextView[] facts
reader instance.FrameLayout[] highlights
SSJsonReader reader
SSJsonReader class that reads in the dynamic
 content for the application.boolean[] selected
boolean temp1
boolean temp2
int[] time
SSTimer timer
SSTimer used for retrieving timing values for
 this Fragment.boolean voComplete
voMediaPlayer has finished
 playing. Default value = false;MediaPlayer voMediaPlayer
public Affected(SSJsonReader reader, int run)
SSJsonReader into memory.reader - The instance of the SSJsonReaderrun - The integer representation of the corresponding Template the
            Fragment is a part of.private boolean atLeastOne()
private void deselect(int deselect)
deselect - the index within facts, highlights, and
            selected needed to indicate de-selectionpublic 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 at least one affected person 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.private void select(int select)
time
 array.select - the index within facts, highlights, and
            selected needed to indicate selection