From 9f5d2b37b77d23e26d1a3bf1c0fc4b00dc3c81da Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Fri, 31 Jul 2015 01:14:18 +0200 Subject: [PATCH] Center toasts --- app/src/main/java/com/termux/api/ToastAPI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/termux/api/ToastAPI.java b/app/src/main/java/com/termux/api/ToastAPI.java index e23d9e69..2dbc3a1f 100644 --- a/app/src/main/java/com/termux/api/ToastAPI.java +++ b/app/src/main/java/com/termux/api/ToastAPI.java @@ -3,6 +3,7 @@ import android.content.Context; import android.content.Intent; import android.os.Handler; +import android.view.Gravity; import android.widget.Toast; import com.termux.api.util.ResultReturner; @@ -18,7 +19,6 @@ public static void onReceive(TermuxApiReceiver receiver, final Context context, final Handler handler = new Handler(); - TermuxApiLogger.info("duration=" + durationExtra); ResultReturner.returnData(context, intent, new ResultReturner.WithStringInput() { @Override public void writeResult(PrintWriter out) throws Exception { @@ -26,6 +26,7 @@ public void writeResult(PrintWriter out) throws Exception { @Override public void run() { Toast toast = Toast.makeText(context, inputString, durationExtra); + toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); } });