@Override
    public float getTaskProgress() {

        if (taskList.size() == 0)
            return 0;
        if (totalWeight == 0)
            return 0;

        float completedWeight = 0;
        for (int i = 0; i < taskProgress; i++) {
            IInstallTask task = taskList.get(i);
            if (taskWeights.containsKey(task)) {
                completedWeight += taskWeights.get(task);
            }
        }

        float finishedTasksProgress = (completedWeight / totalWeight);
        IInstallTask currentTask = taskList.get(taskProgress);
        float currentTaskProgress = (currentTask.getTaskProgress() / 100.0f);

        float currentTaskWeight = 1;
        if (taskWeights.containsKey(currentTask))
            currentTaskWeight = taskWeights.get(currentTask);

        currentTaskProgress *= (currentTaskWeight / totalWeight);

        return (finishedTasksProgress + currentTaskProgress) * 100.0f;
    }