Skip to content

Commit

Permalink
悬浮窗权限低版本兼容不提示
Browse files Browse the repository at this point in the history
  • Loading branch information
XinYiWorld committed Apr 19, 2017
1 parent 70904e2 commit 66c3a30
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ public boolean isFloatWindowOpAllowed(Context context) {
if (version >= 19) {
return checkOp(context, 24); // AppOpsManager.OP_SYSTEM_ALERT_WINDOW
} else {
if ((context.getApplicationInfo().flags & 1 << 27) == 1 << 27) {
return true;
} else {
return false;
}
// if ((context.getApplicationInfo().flags & 1 << 27) == 1 << 27) {
// return true;
// } else {
// return false;
// }
return true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,30 +187,18 @@ public MaterialDialog createChoiceListMaterialDialog(String title,int itemRes,S
* @param content
*/
public MaterialDialog createProgressMaterialDialog(String title,String content){
// if(progressMaterialDialogBuilder== null){
// progressMaterialDialogBuilder = new MaterialDialog.Builder(mContext);
// }else{
// if(progressMaterialDialogBuilder.getContext() != mContext){
// progressMaterialDialogBuilder = new MaterialDialog.Builder(mContext);
// }
// }
progressMaterialDialogBuilder = new MaterialDialog.Builder(mContext);


if(progressMaterialDialog != null){
progressMaterialDialog.setTitle(title);
progressMaterialDialog.setContent(content);

if(!progressMaterialDialog.isShowing()){
progressMaterialDialog.show();
}
return progressMaterialDialog;
}

progressMaterialDialog = progressMaterialDialogBuilder.title(title)
MaterialDialog.Builder builder = progressMaterialDialogBuilder.title(title)
.content(content)
.progress(true, 0)
.show();
.title(title)
.content(content);
progressMaterialDialog = builder.build();
if(!progressMaterialDialog.isShowing()){
progressMaterialDialog.show();
}

return progressMaterialDialog;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static boolean isNumeric(String str){
public static boolean isEmail(String email){
return check(email,"^([a-z0-9A-Z]+[-|_|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$");
}

public static boolean check(String input ,String reg){
Pattern pattern = Pattern.compile(reg);
Matcher isNum = pattern.matcher(input);
Expand Down

0 comments on commit 66c3a30

Please sign in to comment.