public class Template2 extends Activity implements SSCallback
SSJsonReader
class and the proceeds to pass that instance throughout
the run of the application.Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
fileName
The filename of the file to be exported.
|
(package private) java.lang.String |
finalHeaders
Strings used to save the output data.
|
(package private) java.lang.String |
finalValues
Strings used to save the output data.
|
(package private) ImageView |
nextButton
The ImageView containing the "next button"
|
(package private) SSJsonReader |
reader
The instance of the
SSJsonReader to be passed to all of the
Fragments incorporated in Template 2. |
private boolean |
secondUse
Indicates if this is the second time the
Think Fragment has been
executed for this template |
(package private) Stop |
stopFragment
The instance of the
Stop fragment saved so the
ExitUtility cannot be performed when onLongClick(View)
occurs. |
Constructor and Description |
---|
Template2() |
Modifier and Type | Method and Description |
---|---|
void |
addData(java.lang.String key,
java.lang.String value)
Saves key value pairs in order to have them output at the end of the
session.
|
void |
addOutputFile()
Causes all saved items (
finalHeaders and finalValues )
from the session to be compiled and saved in the root:/StaySafe/Data/
directory. |
void |
animateHand(float x,
float y,
int angle,
java.lang.Runnable runnable)
Not used in this class.
|
void |
animateHand(int i,
int j,
int k,
java.lang.Runnable runnable,
boolean b)
Not used in this class.
|
void |
animateHandNext()
Not used in this class.
|
void |
handVisible(boolean b)
Not used in this class.
|
void |
move(int i)
Not used in this class.
|
void |
moveHand(float x,
float y,
int angle)
Not used in this class.
|
void |
nextVisible(boolean visible)
Makes the next button visible to the user.
|
void |
onBackPressed()
Method run when back button is pressed.
|
protected void |
onCreate(Bundle savedInstanceState)
Responsible for inflating the Template 2 view elements.
|
boolean |
onLongClick(View v)
Called by the Android system when the StaySafe logo has been long
pressed.
|
void |
onNext(View v)
Called when the user presses the next button.
|
void |
restart()
Closes the current Activity and loads the
Login Activity to
restart the application. |
void |
showError(java.lang.String error)
Shows an error to the user.
|
void |
showRouting(boolean b)
Not used in this class.
|
void |
stopRoutingTimer()
Not used in this class.
|
java.lang.String fileName
java.lang.String finalHeaders
java.lang.String finalValues
ImageView nextButton
SSJsonReader reader
SSJsonReader
to be passed to all of the
Fragments incorporated in Template 2.private boolean secondUse
Think
Fragment has been
executed for this templateStop stopFragment
Stop
fragment saved so the
ExitUtility
cannot be performed when onLongClick(View)
occurs.public void addData(java.lang.String key, java.lang.String value)
finalHeaders
and finalValues
)
Concatenates two strings, one for the keys and the other for the values.
Provides a means for the fragments to communicate and have data generated
within the Fragment be saved within the activity.addData
in interface SSCallback
key
- The title of the value being passedvalue
- The value associated with the keypublic void addOutputFile()
finalHeaders
and finalValues
)
from the session to be compiled and saved in the root:/StaySafe/Data/
directory.addOutputFile
in interface SSCallback
public void animateHand(float x, float y, int angle, java.lang.Runnable runnable)
animateHand
in interface SSCallback
x
- The x location the hand should be moved to at as a percentage
of total screen size. No limits are set on the percentage.y
- The y location the hand should be moved to as a percentage of
total screen size. No limits are set on the percentage.angle
- The angle the hand show be rotated to during animation.runnable
- The runnable that corresponds to the hand "pressing" something
on the screen.public void animateHand(int i, int j, int k, java.lang.Runnable runnable, boolean b)
animateHand
in interface SSCallback
i
- The absolute x position the hand should be moved toj
- The absolute y position the hand should be moved tok
- The angle the hand should be rotated torunnable
- The runnable that corresponds to the hand "pressing" something
on the screen.b
- fifth variable used to distinguish
SSCallback.animateHand(float, float, int, Runnable)
from this
one. This variable has no affect on the method.public void animateHandNext()
animateHandNext
in interface SSCallback
public void handVisible(boolean b)
handVisible
in interface SSCallback
b
- visible if true invisible if falsepublic void move(int i)
move
in interface SSCallback
i
- 1 - Video\n 2 - Game\n 3 - Factspublic void moveHand(float x, float y, int angle)
moveHand
in interface SSCallback
x
- The x location the hand should be moved to at as a percentage
of total screen size. No limits are set on the percentage.y
- The y location the hand should be moved to as a percentage of
total screen size. No limits are set on the percentage.angle
- The angle the hand show be rotated to during animation.public void nextVisible(boolean visible)
nextVisible
in interface SSCallback
visible
- If true, the next button will be made visible. If false, the
next button will be made invisible.public void onBackPressed()
protected void onCreate(Bundle savedInstanceState)
Login
screen. All Views are
associated with their ids within the activity. Listeners are assigned.public boolean onLongClick(View v)
ExitUtility
.public void onNext(View v)
v
- The view that cause this method to be executed.public void restart()
Login
Activity to
restart the application.restart
in interface SSCallback
public void showError(java.lang.String error)
ErrorFragment
showError
in interface SSCallback
error
- The error message to be displayed.public void showRouting(boolean b)
showRouting
in interface SSCallback
b
- visible if true invisible if falsepublic void stopRoutingTimer()
stopRoutingTimer
in interface SSCallback