mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 20:59:54 +01:00
Move hotspot help ActivityResultLauncher into method
This commit is contained in:
@@ -48,10 +48,8 @@ public class HotspotHelpFragment extends Fragment {
|
|||||||
|
|
||||||
private HotspotViewModel viewModel;
|
private HotspotViewModel viewModel;
|
||||||
private final ActivityResultLauncher<String> launcher =
|
private final ActivityResultLauncher<String> launcher =
|
||||||
registerForActivityResult(new CreateDocument(), uri -> {
|
registerForActivityResult(new CreateDocument(),
|
||||||
showButton();
|
this::onDocumentCreated);
|
||||||
if (uri != null) viewModel.exportApk(uri);
|
|
||||||
});
|
|
||||||
private Button button;
|
private Button button;
|
||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
|
|
||||||
@@ -88,6 +86,11 @@ public class HotspotHelpFragment extends Fragment {
|
|||||||
viewModel.getSavedApkToUri().observeEvent(this, this::shareUri);
|
viewModel.getSavedApkToUri().observeEvent(this, this::shareUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onDocumentCreated(@Nullable Uri uri) {
|
||||||
|
showButton();
|
||||||
|
if (uri != null) viewModel.exportApk(uri);
|
||||||
|
}
|
||||||
|
|
||||||
private void shareUri(Uri uri) {
|
private void shareUri(Uri uri) {
|
||||||
Intent i = new Intent(ACTION_SEND);
|
Intent i = new Intent(ACTION_SEND);
|
||||||
i.putExtra(EXTRA_STREAM, uri);
|
i.putExtra(EXTRA_STREAM, uri);
|
||||||
|
|||||||
Reference in New Issue
Block a user