1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-22 04:12:08 +01:00

Merge pull request #10 from vanitasvitae/master

Indicate in options, whether images are currently loaded or not
This commit is contained in:
Gregor Santner 2016-04-08 12:13:49 +02:00
commit 79087d75d7
3 changed files with 19 additions and 10 deletions

View file

@ -968,21 +968,26 @@ public class MainActivity extends AppCompatActivity
}
break;
case R.id.nav_settings_view: {
final CharSequence[] options = {getString(R.string.settings_font), getString(R.string.settings_view), getString(R.string.settings_image)};
case R.id.nav_settings_view:
{
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)) {
new AlertDialog.Builder(MainActivity.this)
.setItems(options, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int item) {
if (options[item].equals(getString(R.string.settings_font)))
alertFormElements();
if (options[item].equals(getString(R.string.settings_view)))
webView.loadUrl("https://" + podDomain + "/mobile/toggle");
if (options[item].equals(getString(R.string.settings_image)))
webSettings.setLoadsImagesAutomatically(!appSettings.isLoadImages());
switch(item) {
case 0: alertFormElements();
break;
case 1: webView.loadUrl("https://" + podDomain + "/mobile/toggle");
break;
case 2: webSettings.setLoadsImagesAutomatically(!appSettings.isLoadImages());
appSettings.setLoadImages(!appSettings.isLoadImages());
webView.loadUrl(webView.getUrl());
break;
}
}
}).show();
} else {

View file

@ -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="new_post1">D* nur Text</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>

View file

@ -62,6 +62,8 @@
<string name="settings_font">Change font size</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="share_link">Share link as text</string>
<string name="share_screenshot">Share screenshot of webpage</string>