+ // Enable Clear Form Data is there is any.
+ MenuItem clearFormData = menu.findItem(R.id.clearFormData);
+ WebViewDatabase mainWebViewDatabase = WebViewDatabase.getInstance(this);
+ clearFormData.setEnabled(mainWebViewDatabase.hasFormData());
+
+ // Initialize font size variables.
+ int fontSize = mainWebView.getSettings().getTextZoom();
+ String fontSizeTitle;
+ MenuItem selectedFontSizeMenuItem;
+
+ // Prepare the font size title and current size menu item.
+ switch (fontSize) {
+ case 50:
+ fontSizeTitle = getResources().getString(R.string.font_size) + " - " + getResources().getString(R.string.fifty_percent);
+ selectedFontSizeMenuItem = menu.findItem(R.id.fontSizeFiftyPercent);
+ break;
+
+ case 75:
+ fontSizeTitle = getResources().getString(R.string.font_size) + " - " + getResources().getString(R.string.seventy_five_percent);
+ selectedFontSizeMenuItem = menu.findItem(R.id.fontSizeSeventyFivePercent);
+ break;
+
+ case 100:
+ fontSizeTitle = getResources().getString(R.string.font_size) + " - " + getResources().getString(R.string.one_hundred_percent);
+ selectedFontSizeMenuItem = menu.findItem(R.id.fontSizeOneHundredPercent);
+ break;
+
+ case 125:
+ fontSizeTitle = getResources().getString(R.string.font_size) + " - " + getResources().getString(R.string.one_hundred_twenty_five_percent);
+ selectedFontSizeMenuItem = menu.findItem(R.id.fontSizeOneHundredTwentyFivePercent);
+ break;
+
+ case 150:
+ fontSizeTitle = getResources().getString(R.string.font_size) + " - " + getResources().getString(R.string.one_hundred_fifty_percent);
+ selectedFontSizeMenuItem = menu.findItem(R.id.fontSizeOneHundredFiftyPercent);
+ break;
+
+ case 175:
+ fontSizeTitle = getResources().getString(R.string.font_size) + " - " + getResources().getString(R.string.one_hundred_seventy_five_percent);
+ selectedFontSizeMenuItem = menu.findItem(R.id.fontSizeOneHundredSeventyFivePercent);
+ break;
+
+ case 200:
+ fontSizeTitle = getResources().getString(R.string.font_size) + " - " + getResources().getString(R.string.two_hundred_percent);
+ selectedFontSizeMenuItem = menu.findItem(R.id.fontSizeTwoHundredPercent);
+ break;
+
+ default:
+ fontSizeTitle = getResources().getString(R.string.font_size) + " - " + getResources().getString(R.string.one_hundred_percent);
+ selectedFontSizeMenuItem = menu.findItem(R.id.fontSizeOneHundredPercent);
+ break;
+ }
+
+ // Set the font size title and select the current size menu item.
+ MenuItem fontSizeMenuItem = menu.findItem(R.id.fontSize);
+ fontSizeMenuItem.setTitle(fontSizeTitle);
+ selectedFontSizeMenuItem.setChecked(true);
+
+ // Only show `Refresh` if `swipeToRefresh` is disabled.
+ MenuItem refreshMenuItem = menu.findItem(R.id.refresh);
+ refreshMenuItem.setVisible(!swipeToRefreshEnabled);
+