package com.basgeekball.screenshotsnanny.core;

import android.os.Handler;

import com.basgeekball.screenshotsnanny.activityassistant.ActivityHelper;
import com.basgeekball.screenshotsnanny.helper.Callback;
import com.basgeekball.screenshotsnanny.helper.KeyboardHelper;

public class ScreenshotsTask {
    private static void perform(final Class<?> T, final Callback callback, final Callback completionCallback, final boolean hasMap, final long screenshotDelay, final int mapFragmentId) {
        new Runnable() {
            @Override
            public void run() {
                callback.execute();
                ActivityHelper.performTaskWhenActivityIsReady(T, new Callback() {
                    @Override
                    public void execute() {
                        KeyboardHelper.hideKeyboard();
                        if (hasMap) {
                            ScreenshotsCapturer.executeWithMap(ActivityHelper.getCurrentActivity(), mapFragmentId, screenshotDelay, completionCallback);
                        } else {
                            new Handler().postDelayed(new Runnable() {
                                @Override
                                public void run() {
                                    ScreenshotsCapturer.execute(ActivityHelper.getCurrentActivity(), completionCallback);
                                }
                            }, screenshotDelay);
                        }
                    }
                });
            }
        }.run();
    }

    public static void perform(Class<?> T, Callback callback, Callback completionCallback, long screenshotDelay) {
        perform(T, callback, completionCallback, false, screenshotDelay, 0);
    }

    public static void perform(Class<?> T, Callback callback, Callback completionCallback, int mapFragmentId, long screenshotDelay) {
        perform(T, callback, completionCallback, true, screenshotDelay, mapFragmentId);
    }
}

@@ -437,53 +437,53 @@
 nal 
-long screenshotDelay, final int mapFragmentId
+int mapFragmentId, final long screenshotDelay
 ) %7B%0A
@@ -1678,16 +1678,19 @@
 , false,
+ 0,
  screens
@@ -1697,19 +1697,16 @@
 hotDelay
-, 0
 );%0A    %7D
@@ -1896,16 +1896,31 @@
 , true, 
+mapFragmentId, 
 screensh
@@ -1926,31 +1926,16 @@
 hotDelay
-, mapFragmentId
 );%0A    %7D

Order method parameters more consistent