Skip to content

Commit

Permalink
Fix logic and init value for zoom size determination.
Browse files Browse the repository at this point in the history
Previous logic would throw an ArrayIndexOutOfBoundsException for new
installs.
  • Loading branch information
maniac103 committed Apr 15, 2017
1 parent 99ad0b9 commit edbbaa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/com/gh4a/activities/WebViewerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ private void setupWebView() {
initWebViewSettings(s);

SharedPreferences prefs = getSharedPreferences(SettingsFragment.PREF_NAME, MODE_PRIVATE);
int initialZoomLevel = prefs.getInt(SettingsFragment.KEY_TEXT_SIZE, -1);
if (initialZoomLevel >= 0 || initialZoomLevel < ZOOM_SIZES.length) {
int initialZoomLevel = prefs.getInt(SettingsFragment.KEY_TEXT_SIZE, 2);
if (initialZoomLevel >= 0 && initialZoomLevel < ZOOM_SIZES.length) {
s.setTextZoom(ZOOM_SIZES[initialZoomLevel]);
}

Expand Down

2 comments on commit edbbaa4

@maniac103
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slapperwan Guess we need a 4.1.1 soon-ish :(

@slapperwan
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sure.

Please # to comment.