jimken135.files.wordpress.com  · web viewtask. list app. the task list app built upon the...

9
Android Assignment 3 Task List Report A00177486 – Jimmy Kenny - Android Assignment 3- Task List Report by Jimmy Kenny A00177486

Upload: others

Post on 16-Sep-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: jimken135.files.wordpress.com  · Web viewTask. List App. The Task List app built upon the Restaurant List app that we had developed previously with an addition of a Splash Screen

Android Assignment 3 Task List Report A00177486 – Jimmy Kenny

- Android Assignment 3-

Task List Report

by

Jimmy Kenny

A00177486

April 2012

Page 2: jimken135.files.wordpress.com  · Web viewTask. List App. The Task List app built upon the Restaurant List app that we had developed previously with an addition of a Splash Screen

Figure 1: The Enter Details tab

Android Assignment 3 Task List Report A00177486 – Jimmy Kenny

The Task List App

The Task List app built upon the Restaurant List app that we had developed previously with an addition of a Splash Screen and the use of a Date Picker Widget and a Spinner Widget. It is an app that allows a user to store a list of tasks. Each task is given a Title, a Description, a Priority and a Due Date. When the app is first run a Splash screen is displayed showing a spinning animation and some text that gradually becomes opaque. When these animations are complete the view changes to display a new window that contains two tabs. The Enter Details Tab contains two EditText widgets to allow the user to enter a task Title and Description. It also contains a Spinner widget to let the user choose the priority of the task to be recorded. There are two Button widgets; one that when clicked launches a Date Picker so that the Due Date of the task can be recorded; the other button then allows the user to save all the details to a list. When the details are saved a Toast message appears to let the user know that the task has been saved.

Page 3: jimken135.files.wordpress.com  · Web viewTask. List App. The Task List app built upon the Restaurant List app that we had developed previously with an addition of a Splash Screen

Figure 2: The Display Details tab

Figure 3: The xml for the spinning animation

Android Assignment 3 Task List Report A00177486 – Jimmy Kenny

When the Display Task tab is pressed a list of all the tasks that have been saved are displayed. The displayed list also shows an icon beside each task that shows the priority of that particular task. The red colour icon indicates a high priority, the orange icon indicates a medium priority and the green icon indicates a low priority.

THE SPLASH SCREENOne of the main differences between the Task List and the Restaurant List is the opening Splash Screen. The splash screen contains two different types of animations. There is a fade-in animation which displays two lines of text that go from transparent to opaque. The other animation makes an image spin in to view – getting bigger

Page 4: jimken135.files.wordpress.com  · Web viewTask. List App. The Task List app built upon the Restaurant List app that we had developed previously with an addition of a Splash Screen

Figure 4: The xml for the first line of text Figure 5: The xml for the second line of text

Android Assignment 3 Task List Report A00177486 – Jimmy Kenny

as it spins. The xml specifications for the animations are in a folder called anim in the Resources folder. There are three xml files; the custom_anim.xml controls the spinning animation; the fade-in.xml controls one line of text; the fade-in2.xml controls the other line of text.

The only difference between the two text animation xmls is that the second one has a setting that delays the animation for 2.5 seconds - android:startOffset="2500".

The splash screen has its own Activity called SplashActivity which extends Activity. In the onCreate() method a function, startAnimating(), is called that starts the animations and when the animations have stopped the MainActivity page is called.

Figure 6: The xml for the second line of text

Page 5: jimken135.files.wordpress.com  · Web viewTask. List App. The Task List app built upon the Restaurant List app that we had developed previously with an addition of a Splash Screen

Figure 8: The xml for the Spinner widget

Figure 9: The java code for the Spinner

Android Assignment 3 Task List Report A00177486 – Jimmy Kenny

THE SPINNER WIDGETThe priority setting for the tasks is obtained using a Spinner Widget the gives the user a choice of three priorty settings, high, medium and low. The xml for the Spinner is contained in the main.xml. The java code for the Spinner is in the MainActivity and is detailed here in Figure 8.

Figure 7: The Splash screen

Page 6: jimken135.files.wordpress.com  · Web viewTask. List App. The Task List app built upon the Restaurant List app that we had developed previously with an addition of a Splash Screen

Figure 10: The Date Picker

Figure 11: The setOnClickListener()

Figure 12: The code showing how the Date Picker values are set and then stored for viewing in the ListView

Android Assignment 3 Task List Report A00177486 – Jimmy Kenny

THE DATE PICKERThe Date Picker is a widget for selecting a date. The date can be selected by a year, month, and day spinners. In the Enter Details tab the Date Picker is launched when the Set Due Date button is clicked.

There is a setOnClickListener() attached to the button object that calls the Date Picker (see figure 11).

When the date is set on the picker the user presses the Set button to store the date. The details of the date is then stored in a String variable called msg. When the Save button is pressed all the details of the task including msg are stored in the Task object called current (see figure 12). The current object is then added to an ArrayAdapter which allows for the details of each task to be displayed when the Display Tasks tab is pressed.