|
|
|
@ -145,22 +145,6 @@ public class FragmentSetup extends FragmentEx {
|
|
|
|
|
tvIdentityDone.setVisibility(View.INVISIBLE);
|
|
|
|
|
tvPermissionsDone.setVisibility(View.INVISIBLE);
|
|
|
|
|
|
|
|
|
|
final DB db = DB.getInstance(getContext());
|
|
|
|
|
|
|
|
|
|
db.account().liveAccounts(true).observe(this, new Observer<List<EntityAccount>>() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onChanged(@Nullable List<EntityAccount> accounts) {
|
|
|
|
|
tvAccountDone.setVisibility(accounts.size() > 0 ? View.VISIBLE : View.INVISIBLE);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
db.identity().liveIdentities(true).observe(this, new Observer<List<EntityIdentity>>() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onChanged(@Nullable List<EntityIdentity> identities) {
|
|
|
|
|
tvIdentityDone.setVisibility(identities.size() > 0 ? View.VISIBLE : View.INVISIBLE);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
int[] grantResults = new int[permissions.length];
|
|
|
|
|
for (int i = 0; i < permissions.length; i++)
|
|
|
|
|
grantResults[i] = ContextCompat.checkSelfPermission(getActivity(), permissions[i]);
|
|
|
|
@ -171,6 +155,7 @@ public class FragmentSetup extends FragmentEx {
|
|
|
|
|
executor.submit(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
DB db = DB.getInstance(getContext());
|
|
|
|
|
EntityFolder outbox = db.folder().getOutbox();
|
|
|
|
|
if (outbox == null) {
|
|
|
|
|
outbox = new EntityFolder();
|
|
|
|
@ -186,6 +171,27 @@ public class FragmentSetup extends FragmentEx {
|
|
|
|
|
return view;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
|
|
|
|
super.onActivityCreated(savedInstanceState);
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(getContext());
|
|
|
|
|
|
|
|
|
|
db.account().liveAccounts(true).observe(this, new Observer<List<EntityAccount>>() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onChanged(@Nullable List<EntityAccount> accounts) {
|
|
|
|
|
tvAccountDone.setVisibility(accounts.size() > 0 ? View.VISIBLE : View.INVISIBLE);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
db.identity().liveIdentities(true).observe(this, new Observer<List<EntityIdentity>>() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onChanged(@Nullable List<EntityIdentity> identities) {
|
|
|
|
|
tvIdentityDone.setVisibility(identities.size() > 0 ? View.VISIBLE : View.INVISIBLE);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
|
|
|
|
boolean has = (grantResults.length > 0);
|
|
|
|
|