@@ -32,19 +32,15 @@ public GitAsyncTask(Activity activity, boolean finishOnEnd, boolean refreshListO
32
32
}
33
33
34
34
protected void onPreExecute () {
35
- // Toast.makeText(activity.getApplicationContext(), String.format("Running %s", operation.toString()), Toast.LENGTH_LONG).show();
36
- snack = Snackbar .make (activity .findViewById (R .id .main_layout ),
37
- Html .fromHtml (String .format ("<font color=\" #ffffff\" >Running the Git operation %s</font>" , operation .toString ())),
38
- Snackbar .LENGTH_INDEFINITE );
39
- snack .show ();
35
+ Toast .makeText (activity .getApplicationContext (),
36
+ Html .fromHtml (String .format ("<font color=\" #ffffff\" >Running %s</font>" , operation .getClass ().getSimpleName ())),
37
+ Toast .LENGTH_LONG ).show ();
40
38
}
41
39
42
40
protected void onProgressUpdate (String ... progress ) {
43
- if (this .snack != null ) snack .dismiss ();
44
- snack = Snackbar .make (activity .findViewById (R .id .main_layout ),
45
- Html .fromHtml (String .format ("<font color=\" #ffffff\" >Running: <strong>%s</strong></font>" , progress [0 ])),
46
- Snackbar .LENGTH_INDEFINITE );
47
- snack .show ();
41
+ Toast .makeText (activity .getApplicationContext (),
42
+ Html .fromHtml (String .format ("<font color=\" #ffffff\" >Running jgit command: <strong>%s</strong></font>" , progress [0 ])),
43
+ Toast .LENGTH_LONG ).show ();
48
44
}
49
45
50
46
@ Override
@@ -63,7 +59,8 @@ protected String doInBackground(GitCommand... commands) {
63
59
} else {
64
60
command .call ();
65
61
}
66
- publishProgress (command .getClass ().getName ());
62
+ String opName = command .getClass ().getSimpleName ();
63
+ publishProgress (opName );
67
64
} catch (Exception e ) {
68
65
e .printStackTrace ();
69
66
return e .getMessage () + "\n Caused by:\n " + e .getCause ();
@@ -73,13 +70,6 @@ protected String doInBackground(GitCommand... commands) {
73
70
}
74
71
75
72
protected void onPostExecute (String result ) {
76
- if (this .snack != null )
77
- try {
78
- this .snack .dismiss ();
79
- } catch (Exception e ) {
80
- // ignore
81
- }
82
-
83
73
if (result == null )
84
74
result = "Unexpected error" ;
85
75
0 commit comments