/**
*
*/
package com.iaiot.webview;
import android.content.Context;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;
/**
* 功能介绍:自定义吐司
*
* @author JianRong
* @date2016-12-30上午11:09:00
*/
public class T {
public static void show(Context context, String str) {
Toast.makeText(context, str, 0).show();
}
public static void show(Context context, boolean isStartXFYJ) {
Toast.makeText(context, isStartXFYJ + "", 0).show();
}
public static void showMeddle(Context context, String str) {
Toast toast = Toast.makeText(context, str, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
public static void showPicToast(Context context, String str) {
Toast toast = Toast.makeText(context, str, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
LinearLayout toastView = (LinearLayout) toast.getView();
ImageView imageCodeProject = new ImageView(context);
imageCodeProject.setImageResource(R.drawable.ic_launcher);
toastView.addView(imageCodeProject, 0);
toast.show();
}
}
*
*/
package com.iaiot.webview;
import android.content.Context;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;
/**
* 功能介绍:自定义吐司
*
* @author JianRong
* @date2016-12-30上午11:09:00
*/
public class T {
public static void show(Context context, String str) {
Toast.makeText(context, str, 0).show();
}
public static void show(Context context, boolean isStartXFYJ) {
Toast.makeText(context, isStartXFYJ + "", 0).show();
}
public static void showMeddle(Context context, String str) {
Toast toast = Toast.makeText(context, str, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
public static void showPicToast(Context context, String str) {
Toast toast = Toast.makeText(context, str, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
LinearLayout toastView = (LinearLayout) toast.getView();
ImageView imageCodeProject = new ImageView(context);
imageCodeProject.setImageResource(R.drawable.ic_launcher);
toastView.addView(imageCodeProject, 0);
toast.show();
}
}