mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-22 03:54:18 -04:00
Dialog to turn on hotspot manually for API<26
This commit is contained in:
parent
bf46fe28b1
commit
be95e23c05
@ -959,6 +959,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
toggleHotspot();
|
||||
} else {
|
||||
//TO DO: show Dialog() + within that add check mobile Data check later.
|
||||
startHotspotDialog();
|
||||
}
|
||||
}
|
||||
default:
|
||||
@ -1109,6 +1110,25 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
this.startService(serviceIntent);
|
||||
}
|
||||
|
||||
//Advice user to turn on hotspot manually for API<26
|
||||
private void startHotspotDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this, dialogStyle());
|
||||
|
||||
builder.setPositiveButton(getString(R.string.hotspot_dialog_positive_button), (dialog, id) -> {
|
||||
});
|
||||
|
||||
builder.setNeutralButton(getString(R.string.hotspot_dialog_neutral_button), (dialog, id) -> {
|
||||
//TO DO: START SERVER WITHIN THE SERVICE.
|
||||
});
|
||||
|
||||
builder.setTitle(getString(R.string.hotspot_dialog_title));
|
||||
builder.setMessage(
|
||||
getString(R.string.hotspot_dialog_message)
|
||||
);
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
private void mobileDataDialog() {
|
||||
if (Build.VERSION.SDK_INT < VERSION_CODES.O) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this, dialogStyle());
|
||||
|
@ -34,6 +34,10 @@
|
||||
<string name="mobile_data_enabled">Warning: Mobile data enabled</string>
|
||||
<string name="mobile_data_message">You\'re about to turn on your wifi hotspot. This feature can work without data usage.</string>
|
||||
<string name="mobile_data_message_confirmation">Do you want to disable your data?</string>
|
||||
<string name="hotspot_dialog_title">Turn on your hotspot</string>
|
||||
<string name="hotspot_dialog_message">In order for this feature to work you need to turn on your hotspot first.</string>
|
||||
<string name="hotspot_dialog_neutral_button">YES, I’VE TURNED IT ON</string>
|
||||
<string name="hotspot_dialog_positive_button">Okay</string>
|
||||
<string name="sample_ip_address">http://000.000.000.000</string>
|
||||
<string name="server_started_title">Server started</string>
|
||||
<string name="server_started_message">Enter this ip address into your browser to access the server</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user