Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate in options, whether images are currently loaded or not #10

Merged
merged 1 commit into from
Apr 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -968,21 +968,26 @@ public boolean onNavigationItemSelected(MenuItem item) {
}
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());
appSettings.setLoadImages(!appSettings.isLoadImages());
webView.loadUrl(webView.getUrl());
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 {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down