Added option to block sender when reporting spam from notification

This commit is contained in:
M66B
2020-04-06 20:36:26 +02:00
parent e873d2d780
commit c9f56cef7a
6 changed files with 129 additions and 60 deletions

View File

@@ -471,26 +471,30 @@ public class FragmentSetup extends FragmentBase {
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == ActivitySetup.REQUEST_STILL && resultCode != Activity.RESULT_OK)
((FragmentBase) getParentFragment()).finish();
else {
boolean hasPermissions = hasPermission(Manifest.permission.READ_CONTACTS);
Boolean isIgnoring = Helper.isIgnoringOptimizations(getContext());
try {
if (requestCode == ActivitySetup.REQUEST_STILL && resultCode != Activity.RESULT_OK)
((FragmentBase) getParentFragment()).finish();
else {
boolean hasPermissions = hasPermission(Manifest.permission.READ_CONTACTS);
Boolean isIgnoring = Helper.isIgnoringOptimizations(getContext());
final int top;
if (!hasPermissions)
top = view.findViewById(R.id.three).getTop();
else if (isIgnoring != null && !isIgnoring)
top = view.findViewById(R.id.four).getTop();
else
top = 0;
final int top;
if (!hasPermissions)
top = view.findViewById(R.id.three).getTop();
else if (isIgnoring != null && !isIgnoring)
top = view.findViewById(R.id.four).getTop();
else
top = 0;
new Handler().post(new Runnable() {
@Override
public void run() {
view.scrollTo(0, top);
}
});
new Handler().post(new Runnable() {
@Override
public void run() {
view.scrollTo(0, top);
}
});
}
} catch (Throwable ex) {
Log.e(ex);
}
}