更新ToolAlert方法命名
This commit is contained in:
parent
b9e1849408
commit
99a85bc3c8
|
@ -133,7 +133,7 @@ public class Operation {
|
|||
* @param message 提示信息
|
||||
*/
|
||||
public void showLoading(String message){
|
||||
ToolAlert.showLoading(mContext, message);
|
||||
ToolAlert.loading(mContext, message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,7 +142,7 @@ public class Operation {
|
|||
* @param listener 按键监听器
|
||||
*/
|
||||
public void showLoading(String message,ILoadingOnKeyListener listener){
|
||||
ToolAlert.showLoading(mContext, message, listener);
|
||||
ToolAlert.loading(mContext, message, listener);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -81,7 +81,7 @@ public class FeedbackActivity extends BaseActivity implements OnClickListener {
|
|||
if(ToolString.isNoBlankAndNoNull(strMessage)){
|
||||
return true;
|
||||
}else{
|
||||
ToolAlert.showShort(getContext(), "请输入意见内容再提交,谢谢^_^");
|
||||
ToolAlert.toastShort(getContext(), "请输入意见内容再提交,谢谢^_^");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -94,12 +94,12 @@ public class FeedbackActivity extends BaseActivity implements OnClickListener {
|
|||
|
||||
@Override
|
||||
public void onFailure(int statusCode, Header[] headers,String responseString, Throwable throwable) {
|
||||
ToolAlert.showShort(getContext(), "反馈意见失败,原因:"+throwable.getMessage());
|
||||
ToolAlert.toastShort(getContext(), "反馈意见失败,原因:"+throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(int statusCode, Header[] headers,JSONObject response) {
|
||||
ToolAlert.showShort(getContext(), "感谢您的意见!");
|
||||
ToolAlert.toastShort(getContext(), "感谢您的意见!");
|
||||
finish();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -58,7 +58,7 @@ public class VersionChecker {
|
|||
@Override
|
||||
public void onSuccess(int statusCode, Header[] headers,final JSONObject response) {
|
||||
if(getLocalVersion(mContext) >= response.optDouble(SERVER_VERSION, 0.0)){
|
||||
ToolAlert.showShort(mContext, "已是最新版本");
|
||||
ToolAlert.toastShort(mContext, "已是最新版本");
|
||||
}else{
|
||||
ToolAlert.dialog(mContext, "版本升级", "检测到有新版本,是否马上更新?",
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
@ -109,7 +109,7 @@ public class VersionChecker {
|
|||
pd.dismiss();
|
||||
} catch (Exception e) {
|
||||
pd.dismiss();
|
||||
ToolAlert.showShort(mContext,"下载新版本失败,原因:" + e.getMessage());
|
||||
ToolAlert.toastShort(mContext,"下载新版本失败,原因:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
|
|
|
@ -161,7 +161,7 @@ public class DBDemoActivity extends BaseActivity {
|
|||
String username = et_username.getText().toString();
|
||||
String email = et_email.getText().toString();
|
||||
if(!ToolString.isNoBlankAndNoNull(username) || !ToolString.isNoBlankAndNoNull(email)){
|
||||
ToolAlert.showShort(getContext(), "请输入用户名和邮箱");
|
||||
ToolAlert.toastShort(getContext(), "请输入用户名和邮箱");
|
||||
return ;
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ public class DBDemoActivity extends BaseActivity {
|
|||
|
||||
//提交事务
|
||||
conn.commit(null);
|
||||
ToolAlert.showShort(getContext(), "添加成功");
|
||||
ToolAlert.toastShort(getContext(), "添加成功");
|
||||
|
||||
//刷新列表
|
||||
queryUserList();
|
||||
|
@ -212,7 +212,7 @@ public class DBDemoActivity extends BaseActivity {
|
|||
String username = et_u_username.getText().toString();
|
||||
String email = et_u_email.getText().toString();
|
||||
if(!ToolString.isNoBlankAndNoNull(username) || !ToolString.isNoBlankAndNoNull(email)){
|
||||
ToolAlert.showShort(getContext(), "请输入更新用户名和邮箱");
|
||||
ToolAlert.toastShort(getContext(), "请输入更新用户名和邮箱");
|
||||
return ;
|
||||
}
|
||||
|
||||
|
@ -228,13 +228,13 @@ public class DBDemoActivity extends BaseActivity {
|
|||
//提交事务
|
||||
conn.commit(null);
|
||||
|
||||
ToolAlert.showShort(getContext(), "修改成功");
|
||||
ToolAlert.toastShort(getContext(), "修改成功");
|
||||
|
||||
//刷新列表
|
||||
queryUserList();
|
||||
|
||||
}else{
|
||||
ToolAlert.showShort(getContext(), "没有选择用户");
|
||||
ToolAlert.toastShort(getContext(), "没有选择用户");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -317,10 +317,10 @@ public class DBDemoActivity extends BaseActivity {
|
|||
mUserListAdapter.notifyDataSetChanged();
|
||||
try {
|
||||
userDao.delete(rowData);
|
||||
ToolAlert.showShort(getContext(), "删除成功");
|
||||
ToolAlert.toastShort(getContext(), "删除成功");
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
ToolAlert.showShort(getContext(), "删除失败,原因:"+e.getMessage());
|
||||
ToolAlert.toastShort(getContext(), "删除失败,原因:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -71,11 +71,11 @@ public class PhoneValidateCodeActivity extends BaseActivity {
|
|||
ToolSMS.getVerificationCode(et_phone.getText().toString());
|
||||
startTimer();
|
||||
}else{
|
||||
ToolAlert.showShort(mContext, "请先开启网络测试");
|
||||
ToolAlert.toastShort(mContext, "请先开启网络测试");
|
||||
}
|
||||
|
||||
}else{
|
||||
ToolAlert.showShort("请输入大陆的手机号码");
|
||||
ToolAlert.toastShort("请输入大陆的手机号码");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -90,18 +90,18 @@ public class PhoneValidateCodeActivity extends BaseActivity {
|
|||
|
||||
@Override
|
||||
public void onSucced() {
|
||||
ToolAlert.showShort(PhoneValidateCodeActivity.this, "验证成功");
|
||||
ToolAlert.toastShort(PhoneValidateCodeActivity.this, "验证成功");
|
||||
//释放监听器
|
||||
ToolSMS.release();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable e) {
|
||||
ToolAlert.showShort(PhoneValidateCodeActivity.this, "验证失败,原因:"+e.getMessage());
|
||||
ToolAlert.toastShort(PhoneValidateCodeActivity.this, "验证失败,原因:"+e.getMessage());
|
||||
}
|
||||
});
|
||||
}else{
|
||||
ToolAlert.showShort("请输入手机验证码");
|
||||
ToolAlert.toastShort("请输入手机验证码");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -45,7 +45,7 @@ public class SMSBroadcastReceiver extends BaseBroadcastReceiver {
|
|||
Map<String,String> sms = new HashMap<String,String>();
|
||||
sms.put(message.getDisplayOriginatingAddress(), message.getDisplayMessageBody());
|
||||
smsList.add(sms);
|
||||
ToolAlert.showLong(context, "SMSBroadcastReceiver-->拦截到来自【"+message.getDisplayOriginatingAddress()+"】的短信-->"+message.getDisplayMessageBody());
|
||||
ToolAlert.toastLong(context, "SMSBroadcastReceiver-->拦截到来自【"+message.getDisplayOriginatingAddress()+"】的短信-->"+message.getDisplayMessageBody());
|
||||
}
|
||||
//取消广播,系统将收不到短信)
|
||||
//abortBroadcast();
|
||||
|
|
|
@ -49,7 +49,7 @@ public class SMSInterceptService extends BaseService {
|
|||
|
||||
for (SmsMessage message : messages) {
|
||||
System.out.println("SMSInterceptService-->来信号码:"+ message.getDisplayOriginatingAddress()+ "\n短信内容:" + message.getDisplayMessageBody());
|
||||
ToolAlert.showLong(context,"SMSInterceptService.SmsReceiver-->拦截到来自【" + message.getDisplayOriginatingAddress()+ "】的短信-->"+ message.getDisplayMessageBody());
|
||||
ToolAlert.toastLong(context,"SMSInterceptService.SmsReceiver-->拦截到来自【" + message.getDisplayOriginatingAddress()+ "】的短信-->"+ message.getDisplayMessageBody());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,9 +82,9 @@ public class SMSOperationActivity extends BaseActivity implements
|
|||
filter.setPriority(Integer.MAX_VALUE);
|
||||
mSMSBroadcastReceiver = new SMSBroadcastReceiver();
|
||||
registerReceiver(mSMSBroadcastReceiver, filter);
|
||||
ToolAlert.showShort(this, "绑定拦截成功");
|
||||
ToolAlert.toastShort(this, "绑定拦截成功");
|
||||
} else {
|
||||
ToolAlert.showShort(this, "手机号不能为空");
|
||||
ToolAlert.toastShort(this, "手机号不能为空");
|
||||
}
|
||||
break;
|
||||
case R.id.btn_send:
|
||||
|
@ -95,7 +95,7 @@ public class SMSOperationActivity extends BaseActivity implements
|
|||
// ToolSMS.sendMessage(this, phoneNumber,
|
||||
// strContent);//跳转到发送短信界面
|
||||
} else {
|
||||
ToolAlert.showShort(this, "手机号和短信内容两者都不能为空");
|
||||
ToolAlert.toastShort(this, "手机号和短信内容两者都不能为空");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -53,7 +53,7 @@ public class CityActivity extends BaseActivity {
|
|||
public void doBusiness(final Context mContext) {
|
||||
|
||||
//等待对话框
|
||||
ToolAlert.showLoading(this, "数据加载中...");
|
||||
ToolAlert.loading(this, "数据加载中...");
|
||||
|
||||
//添加参数
|
||||
HashMap<String, String> properties = new HashMap<String, String>();
|
||||
|
@ -69,7 +69,7 @@ public class CityActivity extends BaseActivity {
|
|||
citysList = parseSoapObject(result);
|
||||
mCityListView.setAdapter(new ArrayAdapter<String>(mContext, android.R.layout.simple_list_item_1, citysList));
|
||||
}else{
|
||||
ToolAlert.showShort(mContext, "呼叫WebService-->getSupportCity失败");
|
||||
ToolAlert.toastShort(mContext, "呼叫WebService-->getSupportCity失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ public class CityActivity extends BaseActivity {
|
|||
//关闭等待对话框
|
||||
ToolAlert.closeLoading();
|
||||
|
||||
ToolAlert.showShort(mContext, "呼叫WebService-->getSupportProvince失败,原因:"+result);
|
||||
ToolAlert.toastShort(mContext, "呼叫WebService-->getSupportProvince失败,原因:"+result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ProviceActivity extends BaseActivity {
|
|||
@Override
|
||||
public void doBusiness(final Context mContext) {
|
||||
//等待对话框
|
||||
ToolAlert.showLoading(this, "数据加载中...");
|
||||
ToolAlert.loading(this, "数据加载中...");
|
||||
|
||||
//呼叫WebService接口
|
||||
ToolSOAP.callService(ProviceActivity.WEB_SERVER_URL,ProviceActivity.NAME_SPACE,"getSupportProvince", null, new ToolSOAP.WebServiceCallBack() {
|
||||
|
@ -71,7 +71,7 @@ public class ProviceActivity extends BaseActivity {
|
|||
provinceList = parseSoapObject(result);
|
||||
mProvinceList.setAdapter(new ArrayAdapter<String>(ProviceActivity.this, android.R.layout.simple_list_item_1, provinceList));
|
||||
}else{
|
||||
ToolAlert.showShort(mContext, "呼叫WebService-->getSupportProvince失败");
|
||||
ToolAlert.toastShort(mContext, "呼叫WebService-->getSupportProvince失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ public class ProviceActivity extends BaseActivity {
|
|||
//关闭等待对话框
|
||||
ToolAlert.closeLoading();
|
||||
|
||||
ToolAlert.showShort(mContext, "呼叫WebService-->getSupportProvince失败,原因:"+result);
|
||||
ToolAlert.toastShort(mContext, "呼叫WebService-->getSupportProvince失败,原因:"+result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class WeatherActivity extends BaseActivity{
|
|||
@Override
|
||||
public void doBusiness(final Context mContext) {
|
||||
//等待对话框
|
||||
ToolAlert.showLoading(mContext, "数据加载中...");
|
||||
ToolAlert.loading(mContext, "数据加载中...");
|
||||
|
||||
HashMap<String, String> properties = new HashMap<String, String>();
|
||||
properties.put("theCityName", String.valueOf(getOperation().getParameters("city")));
|
||||
|
@ -55,7 +55,7 @@ public class WeatherActivity extends BaseActivity{
|
|||
}
|
||||
mTextWeather.setText(sb.toString());
|
||||
}else{
|
||||
ToolAlert.showShort(mContext, "呼叫WebService-->getWeatherbyCityName失败");
|
||||
ToolAlert.toastShort(mContext, "呼叫WebService-->getWeatherbyCityName失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class WeatherActivity extends BaseActivity{
|
|||
//关闭等待对话框
|
||||
ToolAlert.closeLoading();
|
||||
|
||||
ToolAlert.showShort(mContext, "呼叫WebService-->getWeatherbyCityName失败,原因:"+result);
|
||||
ToolAlert.toastShort(mContext, "呼叫WebService-->getWeatherbyCityName失败,原因:"+result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class ZxingGenBinActivity extends BaseActivity {
|
|||
|
||||
try {
|
||||
if("".equals(et_qr_text.getText().toString())){
|
||||
ToolAlert.showShort("请输入要生成二维码内容!");
|
||||
ToolAlert.toastShort("请输入要生成二维码内容!");
|
||||
return ;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class ZxingGenBinActivity extends BaseActivity {
|
|||
|
||||
getOperation().closeLoading();
|
||||
|
||||
ToolAlert.showShort("二维码已经保存在:"+filePath);
|
||||
ToolAlert.toastShort("二维码已经保存在:"+filePath);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -103,7 +103,7 @@ public class ZxingGenBinActivity extends BaseActivity {
|
|||
validateCodeImage = ToolPicture.makeValidateCode(200, 30);
|
||||
validate_image.setImageBitmap(validateCodeImage);
|
||||
|
||||
ToolAlert.showShort("验证码值:"+ToolPicture.gainValidateCodeValue());
|
||||
ToolAlert.toastShort("验证码值:"+ToolPicture.gainValidateCodeValue());
|
||||
|
||||
getOperation().closeLoading();
|
||||
|
||||
|
|
|
@ -44,9 +44,9 @@ public class ToolAlert {
|
|||
* @param context 上下文
|
||||
* @param message 消息
|
||||
*/
|
||||
public static void showLoading(Context context, String message){
|
||||
public static void loading(Context context, String message){
|
||||
|
||||
showLoading(context,message,true);
|
||||
loading(context,message,true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,9 +54,9 @@ public class ToolAlert {
|
|||
* @param context 上下文
|
||||
* @param message 消息
|
||||
*/
|
||||
public static void showLoading(Context context, String message,final ILoadingOnKeyListener listener){
|
||||
public static void loading(Context context, String message,final ILoadingOnKeyListener listener){
|
||||
|
||||
showLoading(context,message,true,listener);
|
||||
loading(context,message,true,listener);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,7 +65,7 @@ public class ToolAlert {
|
|||
* @param message 消息
|
||||
* @param cancelable 是否可以取消
|
||||
*/
|
||||
public static void showLoading(Context context, String message,boolean cancelable){
|
||||
public static void loading(Context context, String message,boolean cancelable){
|
||||
|
||||
if (mProgressDialog == null) {
|
||||
mProgressDialog = new ProgressDialog(context,message);
|
||||
|
@ -80,7 +80,7 @@ public class ToolAlert {
|
|||
* @param context 上下文
|
||||
* @param message 消息
|
||||
*/
|
||||
public static void showLoading(Context context, String message,boolean cancelable ,final ILoadingOnKeyListener listener){
|
||||
public static void loading(Context context, String message,boolean cancelable ,final ILoadingOnKeyListener listener){
|
||||
|
||||
if(mProgressDialog == null){
|
||||
mProgressDialog = new ProgressDialog(context,message);
|
||||
|
@ -116,7 +116,7 @@ public class ToolAlert {
|
|||
* 判断加载对话框是否正在加载
|
||||
* @return 是否
|
||||
*/
|
||||
public static boolean isShowLoading(){
|
||||
public static boolean isLoading(){
|
||||
|
||||
if(null != mProgressDialog){
|
||||
return mProgressDialog.isShowing();
|
||||
|
@ -269,7 +269,7 @@ public class ToolAlert {
|
|||
* 弹出较短的Toast消息
|
||||
* @param msg 消息内容
|
||||
*/
|
||||
public static void showShort(String msg) {
|
||||
public static void toastShort(String msg) {
|
||||
Toast.makeText(MApplication.gainContext(), msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ public class ToolAlert {
|
|||
* 弹出较短的Toast消息
|
||||
* @param msg 消息内容
|
||||
*/
|
||||
public static void showShort(Context context,String msg) {
|
||||
public static void toastShort(Context context,String msg) {
|
||||
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ public class ToolAlert {
|
|||
* 弹出较长的Toast消息
|
||||
* @param msg 消息内容
|
||||
*/
|
||||
public static void showLong(String msg) {
|
||||
public static void toastLong(String msg) {
|
||||
Toast.makeText(MApplication.gainContext(), msg, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,7 @@ public class ToolAlert {
|
|||
* 弹出较长的Toast消息
|
||||
* @param msg 消息内容
|
||||
*/
|
||||
public static void showLong(Context context,String msg) {
|
||||
public static void toastLong(Context context,String msg) {
|
||||
Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
|
@ -301,7 +301,7 @@ public class ToolAlert {
|
|||
* 弹出自定义时长的Toast消息
|
||||
* @param msg 消息内容
|
||||
*/
|
||||
public static void show(String msg,int duration) {
|
||||
public static void toast(String msg,int duration) {
|
||||
Toast.makeText(MApplication.gainContext(), msg, duration).show();
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ public class ToolAlert {
|
|||
* 弹出自定义时长的Toast消息
|
||||
* @param msg 消息内容
|
||||
*/
|
||||
public static void show(Context context,String msg,int duration) {
|
||||
public static void toast(Context context,String msg,int duration) {
|
||||
Toast.makeText(context, msg, duration).show();
|
||||
}
|
||||
|
||||
|
@ -424,7 +424,7 @@ public class ToolAlert {
|
|||
* @param forwardKey 点击消息跳转界面需携带的数据key
|
||||
* @param forwardData 点击消息跳转界面需携带的数据value
|
||||
*/
|
||||
public static void sendNotice(Context mContext,NotificationMessage message){
|
||||
public static void notification(Context mContext,NotificationMessage message){
|
||||
|
||||
//消息管理器
|
||||
NotificationManager mNoticeManager = (NotificationManager)mContext.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
@ -469,7 +469,7 @@ public class ToolAlert {
|
|||
* @param statusBarText 状态栏提示信息文本
|
||||
* @param mRemoteViews 自定义不布局通知文件
|
||||
*/
|
||||
public static void sendNoticeCustomView(Context mContext,NotificationMessage message){
|
||||
public static void notificationCustomView(Context mContext,NotificationMessage message){
|
||||
|
||||
//消息管理器
|
||||
NotificationManager mNoticeManager = (NotificationManager)mContext.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
|
|
@ -207,7 +207,7 @@ public abstract class ToolHTTP {
|
|||
if(isConnected){
|
||||
return true;
|
||||
}else{
|
||||
ToolAlert.showShort("网络连接失败");
|
||||
ToolAlert.toastShort("网络连接失败");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ public class UIWebViewClient extends WebViewClient {
|
|||
@Override
|
||||
public void onReceivedError(WebView view, int errorCode,String description, String failingUrl) {
|
||||
ToolAlert.closeLoading();
|
||||
ToolAlert.showShort("加载数据失败,错误码:"+errorCode+ "\n 原因描述:"+description);
|
||||
ToolAlert.toastShort("加载数据失败,错误码:"+errorCode+ "\n 原因描述:"+description);
|
||||
super.onReceivedError(view, errorCode, description, failingUrl);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue