Refactoring

pull/178/head
M66B 5 years ago
parent cedbebf2d0
commit 5ac07d0e03

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

Loading…
Cancel
Save