| | |
| | | |
| | | import android.content.Context; |
| | | import android.view.Gravity; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.weikou.beibeivideo.R; |
| | | |
| | | public class ToastUtil { |
| | | |
| | |
| | | |
| | | |
| | | public static Toast showGetGoldGornToast(Context context, String text) { |
| | | View view = LayoutInflater.from(context).inflate(R.layout.item_gold_corn_toast, null); |
| | | Toast toast = new Toast(context); |
| | | TextView textView = new TextView(context); |
| | | textView.setText(text); |
| | | toast.setView(textView); |
| | | toast.setDuration(Toast.LENGTH_SHORT); |
| | | TextView textView = view.findViewById(R.id.tv_content); |
| | | textView.setText(text+" 影视豆"); |
| | | toast.setView(view); |
| | | toast.setDuration(Toast.LENGTH_LONG); |
| | | toast.setGravity(Gravity.CENTER, 0, 0); |
| | | toast.show(); |
| | | return toast; |