添加吐司控件
This commit is contained in:
		| @@ -26,6 +26,8 @@ android { | ||||
| } | ||||
|  | ||||
| dependencies { | ||||
|     api 'com.github.getActivity:ToastUtils:10.5' | ||||
|      | ||||
|     api 'androidx.appcompat:appcompat:1.3.1' | ||||
|     //api 'androidx.vectordrawable:vectordrawable:1.1.0' | ||||
|     //api 'androidx.vectordrawable:vectordrawable-animated:1.1.0' | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| #Created by .winboll/winboll_app_build.gradle | ||||
| #Wed Feb 12 15:01:33 HKT 2025 | ||||
| #Wed Feb 12 08:43:03 GMT 2025 | ||||
| stageCount=1 | ||||
| libraryProject=libappbase | ||||
| baseVersion=1.4 | ||||
| publishVersion=1.4.0 | ||||
| buildCount=0 | ||||
| buildCount=2 | ||||
| baseBetaVersion=1.4.1 | ||||
|   | ||||
| @@ -12,6 +12,9 @@ import android.content.pm.ApplicationInfo; | ||||
| import android.content.pm.PackageManager; | ||||
| import android.os.Handler; | ||||
| import android.os.Looper; | ||||
| import android.view.Gravity; | ||||
| import com.hjq.toast.ToastUtils; | ||||
| import com.hjq.toast.style.WhiteToastStyle; | ||||
|  | ||||
| public class GlobalApplication extends Application { | ||||
|  | ||||
| @@ -69,8 +72,14 @@ public class GlobalApplication extends Application { | ||||
|         //SharedPreferences sharedPreferences = getSharedPreferences(PREFS, Context.MODE_PRIVATE); | ||||
|         //GlobalApplication.isDebuging = sharedPreferences.getBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging); | ||||
|  | ||||
|         // 初始化 Toast 框架 | ||||
|         ToastUtils.init(this); | ||||
|         // 设置 Toast 布局样式 | ||||
|         //ToastUtils.setView(R.layout.toast_custom_view); | ||||
|         ToastUtils.setStyle(new WhiteToastStyle()); | ||||
|         ToastUtils.setGravity(Gravity.BOTTOM, 0, 200); | ||||
|     } | ||||
|      | ||||
|  | ||||
|     public static String getAppName(Context context) { | ||||
|         PackageManager packageManager = context.getPackageManager(); | ||||
|         try { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ZhanGSKen
					ZhanGSKen