3535import com .hjq .permissions .OnPermissionCallback ;
3636import com .hjq .permissions .Permission ;
3737import com .hjq .permissions .XXPermissions ;
38- import com .hjq .toast .ToastUtils ;
38+ import com .hjq .toast .Toaster ;
3939
4040import java .io .File ;
4141import java .io .IOException ;
@@ -97,10 +97,10 @@ public void onGranted(@NonNull List<String> permissions, boolean allGranted) {}
9797 @ Override
9898 public void onDenied (@ NonNull List <String > permissions , boolean doNotAskAgain ) {
9999 if (doNotAskAgain ) {
100- ToastUtils .show ("授权失败,请手动授予存储权限" );
100+ Toaster .show ("授权失败,请手动授予存储权限" );
101101 XXPermissions .startPermissionActivity (this , permissions );
102102 } else {
103- ToastUtils .show ("请先授予存储权限" );
103+ Toaster .show ("请先授予存储权限" );
104104 requestPermission ();
105105 }
106106 }
@@ -127,7 +127,7 @@ public void onClick(View view) {
127127
128128 @ Override
129129 public void onSucceed (HttpData <List <SearchAuthorApi .Bean >> result ) {
130- ToastUtils .show ("Get 请求成功,请看日志" );
130+ Toaster .show ("Get 请求成功,请看日志" );
131131 }
132132 });
133133
@@ -140,7 +140,7 @@ public void onSucceed(HttpData<List<SearchAuthorApi.Bean>> result) {
140140
141141 @ Override
142142 public void onSucceed (HttpData <SearchBlogsApi .Bean > result ) {
143- ToastUtils .show ("Post 请求成功,请看日志" );
143+ Toaster .show ("Post 请求成功,请看日志" );
144144 }
145145 });
146146
@@ -154,17 +154,17 @@ public void onSucceed(HttpData<SearchBlogsApi.Bean> result) {
154154 .api (new SearchBlogsApi ()
155155 .setKeyword ("搬砖不再有" ))
156156 .execute (new ResponseClass <HttpData <SearchBlogsApi .Bean >>() {});
157- ToastUtils .show ("同步请求成功,请看日志" );
157+ Toaster .show ("同步请求成功,请看日志" );
158158 } catch (Exception e ) {
159- ToastUtils .show (e .getMessage ());
159+ Toaster .show (e .getMessage ());
160160 }
161161 runOnUiThread (this ::hideDialog );
162162 }).start ();
163163
164164 } else if (viewId == R .id .btn_main_update ) {
165165
166166 if (mProgressBar .getVisibility () == View .VISIBLE ) {
167- ToastUtils .show ("当前正在上传或者下载,请等待完成之后再进行操作" );
167+ Toaster .show ("当前正在上传或者下载,请等待完成之后再进行操作" );
168168 return ;
169169 }
170170
@@ -219,12 +219,12 @@ public void onProgress(int progress) {
219219
220220 @ Override
221221 public void onSucceed (Void result ) {
222- ToastUtils .show ("上传成功" );
222+ Toaster .show ("上传成功" );
223223 }
224224
225225 @ Override
226226 public void onFail (Exception e ) {
227- ToastUtils .show ("上传失败" );
227+ Toaster .show ("上传失败" );
228228 }
229229
230230 @ Override
@@ -236,7 +236,7 @@ public void onEnd(Call call) {
236236 } else if (viewId == R .id .btn_main_download ) {
237237
238238 if (mProgressBar .getVisibility () == View .VISIBLE ) {
239- ToastUtils .show ("当前正在上传或者下载,请等待完成之后再进行操作" );
239+ Toaster .show ("当前正在上传或者下载,请等待完成之后再进行操作" );
240240 return ;
241241 }
242242
@@ -281,13 +281,13 @@ public void onProgress(File file, int progress) {
281281
282282 @ Override
283283 public void onComplete (File file ) {
284- ToastUtils .show ("下载完成:" + file .getPath ());
284+ Toaster .show ("下载完成:" + file .getPath ());
285285 installApk (MainActivity .this , file );
286286 }
287287
288288 @ Override
289289 public void onError (File file , Exception e ) {
290- ToastUtils .show (e .getMessage ());
290+ Toaster .show (e .getMessage ());
291291 if (e instanceof FileMD5Exception ) {
292292 // 如果是文件 md5 校验失败,则删除文件
293293 file .delete ();
0 commit comments