public DetailsPresenter(DetailsView detailsView, BaseActivity activity) { this.detailsView = detailsView; this.activity = activity; this.database = FirebaseDatabase.getInstance().getReference(FirebaseLink.forNotes()); this.storage = FirebaseStorage.getInstance().getReferenceFromUrl(Secrets.FIREBASE_STORAGE); this.password = activity.getAuthHandler().getCredentials().getId(); this.filesDir = activity.getFilesDir(); }
private void displayContents(final String content) { final Encryptor encryptor = new Encryptor(password); activity.runOnUiThread( new Runnable() { @Override public void run() { detailsView.noteContentsLoaded(encryptor.decrypt(content)); } }); }