Search in sources :

Example 1 with PersonalColors

use of com.cmput301w18t05.taskzilla.PersonalColors in project Taskzilla by CMPUT301W18T05.

the class WelcomeActivity method loadAppColors.

/**
 * load the AppColors singleton from storage
 */
private void loadAppColors() {
    try {
        FileInputStream fis = openFileInput("COLORS.TXT");
        BufferedReader br = new BufferedReader(new InputStreamReader(fis));
        PersonalColors c = new Gson().fromJson(br, PersonalColors.class);
        AppColors.getInstance().setColors(c);
    } catch (FileNotFoundException e) {
        System.out.println("File not found!");
    }
}
Also used : InputStreamReader(java.io.InputStreamReader) BufferedReader(java.io.BufferedReader) FileNotFoundException(java.io.FileNotFoundException) Gson(com.google.gson.Gson) FileInputStream(java.io.FileInputStream) PersonalColors(com.cmput301w18t05.taskzilla.PersonalColors)

Aggregations

PersonalColors (com.cmput301w18t05.taskzilla.PersonalColors)1 Gson (com.google.gson.Gson)1 BufferedReader (java.io.BufferedReader)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 InputStreamReader (java.io.InputStreamReader)1