Commit 4cd40bb4 by chengxiuhong

test main

parent b5f913af
...@@ -32,10 +32,12 @@ public class ToastUtil { ...@@ -32,10 +32,12 @@ public class ToastUtil {
public static void showMessage(final int msg) { public static void showMessage(final int msg) {
showMessage(msg, Toast.LENGTH_SHORT); showMessage(msg, Toast.LENGTH_SHORT);
} }
//显示在屏幕中间 //显示在屏幕中间
public static void showMessageCenter(final String msg) { public static void showMessageCenter(final String msg) {
showMessageCenter(msg, Toast.LENGTH_SHORT); showMessageCenter(msg, Toast.LENGTH_SHORT);
} }
//显示在屏幕中间 //显示在屏幕中间
private static void showMessageCenter(final String msg, final int lengthShort) { private static void showMessageCenter(final String msg, final int lengthShort) {
if (Thread.currentThread() != Looper.getMainLooper().getThread()) { if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
...@@ -84,7 +86,8 @@ public class ToastUtil { ...@@ -84,7 +86,8 @@ public class ToastUtil {
TextView message = (TextView) toastView.findViewById(R.id.message); TextView message = (TextView) toastView.findViewById(R.id.message);
message.setText(msg); message.setText(msg);
sToast = new Toast(BaseApplication.getAppContext()); sToast = new Toast(BaseApplication.getAppContext());
sToast.setGravity(Gravity.BOTTOM, 0, 20); // sToast.setGravity(Gravity.BOTTOM, 0, 20);
sToast.setGravity(Gravity.CENTER,0,0);
sToast.setDuration(len); sToast.setDuration(len);
sToast.setView(toastView); sToast.setView(toastView);
sToast.show(); sToast.show();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment