diff --git a/briar-android/src/main/java/org/briarproject/briar/android/hotspot/AbstractTabsFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/hotspot/AbstractTabsFragment.java
index 173586337..982d538b9 100644
--- a/briar-android/src/main/java/org/briarproject/briar/android/hotspot/AbstractTabsFragment.java
+++ b/briar-android/src/main/java/org/briarproject/briar/android/hotspot/AbstractTabsFragment.java
@@ -3,6 +3,9 @@ package org.briarproject.briar.android.hotspot;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
@@ -52,6 +55,7 @@ public abstract class AbstractTabsFragment extends Fragment {
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
+ setHasOptionsMenu(true);
return inflater
.inflate(R.layout.fragment_hotspot_tabs, container, false);
}
@@ -83,6 +87,29 @@ public abstract class AbstractTabsFragment extends Fragment {
connectedButton = view.findViewById(R.id.connectedButton);
}
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ inflater.inflate(R.menu.hotspot_help_action, menu);
+ super.onCreateOptionsMenu(menu, inflater);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == R.id.action_help) {
+ getParentFragmentManager().beginTransaction()
+ .setCustomAnimations(R.anim.step_next_in,
+ R.anim.step_previous_out,
+ R.anim.step_previous_in,
+ R.anim.step_next_out)
+ .replace(R.id.fragmentContainer, new HotspotHelpFragment(),
+ HotspotHelpFragment.TAG)
+ .addToBackStack(HotspotHelpFragment.TAG)
+ .commit();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
protected abstract Fragment getFirstFragment();
protected abstract Fragment getSecondFragment();
diff --git a/briar-android/src/main/java/org/briarproject/briar/android/hotspot/HotspotActivity.java b/briar-android/src/main/java/org/briarproject/briar/android/hotspot/HotspotActivity.java
index ce511e244..28d643d9e 100644
--- a/briar-android/src/main/java/org/briarproject/briar/android/hotspot/HotspotActivity.java
+++ b/briar-android/src/main/java/org/briarproject/briar/android/hotspot/HotspotActivity.java
@@ -1,10 +1,7 @@
package org.briarproject.briar.android.hotspot;
import android.os.Bundle;
-import android.view.Menu;
-import android.view.MenuInflater;
import android.view.MenuItem;
-import android.widget.Toast;
import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
@@ -19,8 +16,6 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.lifecycle.ViewModelProvider;
-import static android.widget.Toast.LENGTH_SHORT;
-
@MethodsNotNullByDefault
@ParametersNotNullByDefault
public class HotspotActivity extends BriarActivity {
@@ -57,21 +52,11 @@ public class HotspotActivity extends BriarActivity {
}
}
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.hotspot_help_action, menu);
- return super.onCreateOptionsMenu(menu);
- }
-
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == android.R.id.home) {
onBackPressed();
return true;
- } else if (item.getItemId() == R.id.action_help) {
- Toast.makeText(this, "Not yet implemented", LENGTH_SHORT).show();
- return true;
}
return super.onOptionsItemSelected(item);
}
diff --git a/briar-android/src/main/java/org/briarproject/briar/android/hotspot/HotspotHelpFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/hotspot/HotspotHelpFragment.java
new file mode 100644
index 000000000..8cacfcaee
--- /dev/null
+++ b/briar-android/src/main/java/org/briarproject/briar/android/hotspot/HotspotHelpFragment.java
@@ -0,0 +1,28 @@
+package org.briarproject.briar.android.hotspot;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
+import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
+import org.briarproject.briar.R;
+
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+@MethodsNotNullByDefault
+@ParametersNotNullByDefault
+public class HotspotHelpFragment extends Fragment {
+
+ public final static String TAG = HotspotHelpFragment.class.getName();
+
+ @Override
+ public View onCreateView(LayoutInflater inflater,
+ @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
+ return inflater
+ .inflate(R.layout.fragment_hotspot_help, container, false);
+ }
+}
diff --git a/briar-android/src/main/res/drawable/ic_circle_small.xml b/briar-android/src/main/res/drawable/ic_circle_small.xml
new file mode 100644
index 000000000..238f0d28f
--- /dev/null
+++ b/briar-android/src/main/res/drawable/ic_circle_small.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/briar-android/src/main/res/layout/fragment_hotspot_help.xml b/briar-android/src/main/res/layout/fragment_hotspot_help.xml
new file mode 100644
index 000000000..4251ce594
--- /dev/null
+++ b/briar-android/src/main/res/layout/fragment_hotspot_help.xml
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/briar-android/src/main/res/values/strings.xml b/briar-android/src/main/res/values/strings.xml
index fa7145afe..03d6d357a 100644
--- a/briar-android/src/main/res/values/strings.xml
+++ b/briar-android/src/main/res/values/strings.xml
@@ -708,6 +708,14 @@
Instead of typing the address manually, you can also scan a QR code.
To download the app on another phone, please scan this QR code to connect to this Wi-Fi network:
After you are connected to the Wi-Fi, scan this QR code to download the app.
+ Problems with connecting to Wi-Fi:
+ Try disabling and re-enabling Wi-Fi on both phones and try again.
+ If your phone complains that the Wi-Fi has no internet, tell it that you want to stay connected anyway.
+ Problems visiting the local website:
+ Double check that you entered the address exactly as shown. A small error can make it fail.
+ Ensure that your phone is still connected to the correct Wi-Fi (see above) when you try to access the site.
+ Check that you don\'t have any active firewall apps that may block the access.
+ If you can visit the site, but not download the Briar app, try it with a different web browser app.