Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c0fcebf authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

update import of ThreadFactory & FlashThread. Deleted StepUi class because not used anymore

parent 66735393
Loading
Loading
Loading
Loading
+0 −98
Original line number Diff line number Diff line
/*
 * Copyright 2019-2020 - ECORP SAS 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
package ecorp.easy.installer.models;

import java.util.List;

/**
 * This encapsulate data about the user interface for a step
 * @author vincent Bourgmayer
 */
public class StepUi{
    final private String type; //Can be: error, load or action
    final private List<String> instructions; //Instruction of the step
    final private String title; // Title of the step
    final private String stepNumber; //It correspond more to the state of progression. It should be like: 1/7 not just: 1
    final private String titleIconName;
    final private int averageTime; //in second. The average time required to finsh the step. It only concern 'load' type.
    /**
     * Constructor for StepUI object
     * @param type type of step ("action" if user action is needed or "load" if no user action is needed)
     * @param instructions instructions of the step
     * @param title title of the current step
     * @param titleIconName icon to show beside to the title. Only for action type. Either provide null.
     * @param stepNumber the number of the step in the whole process
     * @param averageTime The number of second needed to finish the step (it's an average)
     */
    public StepUi(String type, List<String> instructions, String title, String titleIconName, String stepNumber, int averageTime){
        this.type = type;
        this.instructions = instructions;
        this.title = title;
        this.stepNumber = stepNumber;
        this.titleIconName = titleIconName;
        this.averageTime = averageTime;
    }
    
    /**
     * get the file name of the icon beside the title
     * @return return null if no value provided at constructor which is the case if type is "load" instead of "action"
     */
    public String getTitleIconName(){
        return this.titleIconName;
    }
    
    /**
     * Get the average time required to finish the task
     * @return int the value or -1 if no value
     */
    public int getAverageTime(){
        return this.averageTime;
    }
    
        /**
     * get the type of Step from UI point of view.
     * It has mainly impact on background color of the flash box
     * @return can be null but should be "error", "load" or "action"
     */
    public String getType() {
        return type;
    }

    /**
     * Get the instruction to print for user
     * @return String, but can be null.
     */
    public List<String> getInstructions() {
        return instructions;
    }

    /**
     * Get the title of the step
     * @return 
     */
    public String getTitle() {
        return title;
    }

    /**
     * Return the step number as progress.
     * It will be like "1/7" or something like that.
     * @return String
     */
    public String getStepNumber() {
        return stepNumber;
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ import ecorp.easy.installer.AppConstants;
import ecorp.easy.installer.models.Phone;
import ecorp.easy.installer.models.Command;
import ecorp.easy.installer.models.DataBundle;
import ecorp.easy.installer.models.StepUi;
import ecorp.easy.installer.models.steps.ICustomStep;
import ecorp.easy.installer.models.steps.IExecutableStep;
import ecorp.easy.installer.models.steps.IStep;
+0 −2
Original line number Diff line number Diff line
@@ -25,8 +25,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.security.InvalidParameterException;
import java.text.ParseException;
import java.util.LinkedHashMap; //used instead of HashMap to conserve order
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.HashMap;