Refactoring

This commit is contained in:
M66B 2020-04-11 09:24:57 +02:00
parent cedbebf2d0
commit 5ac07d0e03
1 changed files with 19 additions and 19 deletions

View File

@ -479,27 +479,27 @@ public class FragmentSetup extends FragmentBase {
super.onActivityResult(requestCode, resultCode, data);
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());
if (requestCode == ActivitySetup.REQUEST_STILL)
if (resultCode == Activity.RESULT_OK) {
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);
}
});
} else
((FragmentBase) getParentFragment()).finish();
} catch (Throwable ex) {
Log.e(ex);
}