本文整理汇总了Java中cn.pedant.SweetAlert.SweetAlertDialog.dismiss方法的典型用法代码示例。如果您正苦于以下问题:Java SweetAlertDialog.dismiss方法的具体用法?Java SweetAlertDialog.dismiss怎么用?Java SweetAlertDialog.dismiss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.pedant.SweetAlert.SweetAlertDialog
的用法示例。
在下文中一共展示了SweetAlertDialog.dismiss方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exportUser
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
void exportUser() {
SweetAlertDialog sw=new SweetAlertDialog(getActivity(), SweetAlertDialog.PROGRESS_TYPE);
sw.show();
try {
ExcelUtil excelUtils = new ExcelUtil(jobName, modleList);
File file = excelUtils.create();
ExcelUtil.openFileByOtherApp(getActivity(), file);
if (sw.isShowing()) {
sw.dismiss();
}
} catch (Exception e) {
LogUtils.e("导出excel", e.getMessage());
if (sw.isShowing()) {
sw.dismiss();
}
}
}
示例2: verifyProfile
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
private void verifyProfile() {
SweetAlertDialog errorDialog = new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE);
SweetAlertDialog loadingDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
String username = userNameView.getText().toString();
String city = addressView.getText().toString();
String twitter = twitterView.getText().toString();
String github = githubView.getText().toString();
String blog = blogView.getText().toString();
String des = desView.getText().toString();
if (TextUtils.isEmpty(username)) {
errorDialog.setTitleText("Oops...");
errorDialog.setContentText(getString(R.string.username_error));
errorDialog.show();
return;
}
userInfo.setName(username);
userInfo.setCity(city);
userInfo.setTwitterAccount(twitter);
userInfo.setGithubName(github);
userInfo.setPersonalWebsite(blog);
userInfo.setIntroduction(des);
loadingDialog.getProgressHelper().setBarColor(Color.parseColor("#4394DA"));
loadingDialog.setContentText(getString(R.string.submitting));
loadingDialog.setCancelable(false);
loadingDialog.show();
getPresenter().request(userInfo);
loadingDialog.dismiss();
}
示例3: onNetWorkError
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public void onNetWorkError(Throwable throwable, SweetAlertDialog loadingDialog) {
Logger.e(throwable.getMessage());
loadingDialog.dismiss();
SweetAlertDialog errorDialog = new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE);
errorDialog.setTitleText("Oops...");
errorDialog.setContentText(getString(R.string.publish_error));
errorDialog.show();
}
示例4: populateList
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public void populateList(){
final SweetAlertDialog dialog = new SweetAlertDialog(getActivity(), SweetAlertDialog.PROGRESS_TYPE);
dialog.setTitleText(getResources().getString(R.string.loading_path));
dialog.getProgressHelper().setBarColor(getResources().getColor(R.color.colorAccent));
dialog.setCancelable(false);
dialog.show();
RequestQueue queue = Volley.newRequestQueue(getActivity());
String url = getArguments().getString("url");
// Request a string response from the provided URL.
StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONArray jsonArray = new JSONArray(response);
if (jsonArray.length()<1){
TextView ms = (TextView)getActivity().findViewById(R.id.ms);
ms.setVisibility(View.VISIBLE);
Typeface tf = Typeface.createFromAsset(getActivity().getAssets(),"fonts/arialRoundedBold.TTF");
ms.setTypeface(tf);
}
int count=jsonArray.length()-1;
while(count>=0){
JSONObject JO = jsonArray.getJSONObject(count);
Path path = new Path(JO);
count--;
pathsAdapter.add(path);
}
dialog.dismiss();
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
dialog.dismiss();
Toasty.error(getActivity(), getString(R.string.error_getpath), Toast.LENGTH_SHORT, true).show();
}
}){
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> map = new HashMap<String, String>();
map.put("Authorization", AccessToken.getCurrentAccessToken().getUserId());
return map;
}
};
queue.add(stringRequest);
}
示例5: populateList
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public void populateList(){
final SweetAlertDialog dialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
dialog.setTitleText(getResources().getString(R.string.loading_path));
dialog.getProgressHelper().setBarColor(getResources().getColor(R.color.colorAccent));
dialog.setCancelable(false);
dialog.show();
RequestQueue queue = Volley.newRequestQueue(this);
// Request a string response from the provided URL.
StringRequest stringRequest = new StringRequest(Request.Method.GET, url+user_id,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONArray jsonArray = new JSONArray(response);
if (jsonArray.length()<1){
TextView ms = (TextView)findViewById(R.id.ms);
ms.setVisibility(View.VISIBLE);
Typeface tf = Typeface.createFromAsset(getAssets(),"fonts/arialRoundedBold.TTF");
ms.setTypeface(tf);
}
int count=jsonArray.length()-1;
while(count>=0){
JSONObject JO = jsonArray.getJSONObject(count);
Path path = new Path(JO);
count--;
pathsAdapter.add(path);
}
dialog.dismiss();
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
dialog.dismiss();
Toasty.error(MainActivity.this, getString(R.string.error_getpath), Toast.LENGTH_SHORT, true).show();
}
})
{
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> map = new HashMap<String, String>();
map.put("Authorization", AccessToken.getCurrentAccessToken().getUserId());
return map;
}
};
queue.add(stringRequest);
}
示例6: getPathInfo
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
private void getPathInfo(int id) {
final SweetAlertDialog dialog = new SweetAlertDialog(this.getContext(), SweetAlertDialog.PROGRESS_TYPE);
dialog.setTitleText(this.getContext().getResources().getString(R.string.loading_info));
dialog.getProgressHelper().setBarColor(this.getContext().getResources().getColor(R.color.colorAccent));
dialog.setCancelable(false);
dialog.show();
RequestQueue queue = Volley.newRequestQueue(this.getContext());
StringRequest stringRequest = new StringRequest(Request.Method.GET, url+id,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
dialog.dismiss();
JSONObject info = null;
try {
info = new JSONObject(response);
} catch (JSONException e) {
e.printStackTrace();
}
Intent intent = new Intent(getContext(), RouteActivity.class);
intent.putExtra("path",info.toString());
getContext().startActivity(intent);
}
}
, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
dialog.dismiss();
Toast.makeText(getContext(), getContext().getResources().getString(R.string.error_info), Toast.LENGTH_SHORT).show();
}
})
{
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> map = new HashMap<String, String>();
map.put("Authorization", AccessToken.getCurrentAccessToken().getUserId());
return map;
}
};
queue.add(stringRequest);
}
示例7: onPublishSuccessful
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public void onPublishSuccessful(Topic topic, SweetAlertDialog loadingDialog) {
loadingDialog.dismiss();
finish();
navigator.navigateToTopicDetails(this, topic.getId());
}
示例8: onPublicSuccessful
import cn.pedant.SweetAlert.SweetAlertDialog; //导入方法依赖的package包/类
public void onPublicSuccessful(Reply reply, SweetAlertDialog loadingDialog) {
loadingDialog.dismiss();
finish();
}