mirror of
https://github.com/gsantner/dandelion
synced 2024-11-22 12:22:08 +01:00
Indicate in options, whether images are currently loaded or not
This commit is contained in:
parent
0fd8452f6a
commit
5c9c1de7fd
3 changed files with 19 additions and 10 deletions
|
@ -968,21 +968,26 @@ public class MainActivity extends AppCompatActivity
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_settings_view: {
|
case R.id.nav_settings_view:
|
||||||
final CharSequence[] options = {getString(R.string.settings_font), getString(R.string.settings_view), getString(R.string.settings_image)};
|
{
|
||||||
|
final CharSequence[] options = {getString(R.string.settings_font), getString(R.string.settings_view), appSettings.isLoadImages() ?
|
||||||
|
getString(R.string.settings_images_switch_off) : getString(R.string.settings_images_switch_on)};
|
||||||
|
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
new AlertDialog.Builder(MainActivity.this)
|
||||||
.setItems(options, new DialogInterface.OnClickListener() {
|
.setItems(options, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int item) {
|
public void onClick(DialogInterface dialog, int item) {
|
||||||
if (options[item].equals(getString(R.string.settings_font)))
|
switch(item) {
|
||||||
alertFormElements();
|
case 0: alertFormElements();
|
||||||
if (options[item].equals(getString(R.string.settings_view)))
|
break;
|
||||||
webView.loadUrl("https://" + podDomain + "/mobile/toggle");
|
case 1: webView.loadUrl("https://" + podDomain + "/mobile/toggle");
|
||||||
if (options[item].equals(getString(R.string.settings_image)))
|
break;
|
||||||
webSettings.setLoadsImagesAutomatically(!appSettings.isLoadImages());
|
case 2: webSettings.setLoadsImagesAutomatically(!appSettings.isLoadImages());
|
||||||
appSettings.setLoadImages(!appSettings.isLoadImages());
|
appSettings.setLoadImages(!appSettings.isLoadImages());
|
||||||
webView.loadUrl(webView.getUrl());
|
webView.loadUrl(webView.getUrl());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -153,5 +153,7 @@ along with this program. If not, see http://www.gnu.org/licenses.<br> <br
|
||||||
<string name="jb_profile">Profil</string>
|
<string name="jb_profile">Profil</string>
|
||||||
<string name="new_post1">D* nur Text</string>
|
<string name="new_post1">D* nur Text</string>
|
||||||
<string name="shared_by_diaspora_android">*[geteilt durch #diaspora-android]*</string>
|
<string name="shared_by_diaspora_android">*[geteilt durch #diaspora-android]*</string>
|
||||||
|
<string name="settings_images_switch_off">Bilder nicht laden</string>
|
||||||
|
<string name="settings_images_switch_on">Bilder laden</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -62,6 +62,8 @@
|
||||||
|
|
||||||
<string name="settings_font">Change font size</string>
|
<string name="settings_font">Change font size</string>
|
||||||
<string name="settings_image">Toggle image loading</string>
|
<string name="settings_image">Toggle image loading</string>
|
||||||
|
<string name="settings_images_switch_on">Do load images</string>
|
||||||
|
<string name="settings_images_switch_off">Do not load images</string>
|
||||||
<string name="settings_view">Change view</string>
|
<string name="settings_view">Change view</string>
|
||||||
<string name="share_link">Share link as text</string>
|
<string name="share_link">Share link as text</string>
|
||||||
<string name="share_screenshot">Share screenshot of webpage</string>
|
<string name="share_screenshot">Share screenshot of webpage</string>
|
||||||
|
|
Loading…
Reference in a new issue