From 2eec3de87b6b616a69a46c1f97c2397159031d2f Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 21 十一月 2023 18:01:43 +0800 Subject: [PATCH] 广告升级/bug修复 --- BuWanVideo/src/com/weikou/beibeivideo/util/ui/ToastUtil.java | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/ui/ToastUtil.java b/BuWanVideo/src/com/weikou/beibeivideo/util/ui/ToastUtil.java index 12bb891..c200f1f 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/ui/ToastUtil.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/ui/ToastUtil.java @@ -2,9 +2,12 @@ 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 { @@ -19,11 +22,12 @@ 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; -- Gitblit v1.8.0