@@ -5232,10+5232,10 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
// Set the favorite icon when it changes.
@Override
public void onReceivedIcon(WebView view, Bitmap icon) {
// Set the favorite icon when it changes.
@Override
public void onReceivedIcon(WebView view, Bitmap icon) {
- // Only update the favorite icon if the website has finished loading.
- if (progressBar.getVisibility() == View.GONE) {
+ // Only update the favorite icon if the website has finished loading and the new favorite icon height is greater than the current favorite icon height. This prevents low resolution icons from replacing high resolution one.
+ if ((progressBar.getVisibility() == View.GONE) && (icon.getHeight() > nestedScrollWebView.getFavoriteIconHeight())) {
@@ -169,11+176,15 @@ class NestedScrollWebView @JvmOverloads constructor(context: Context, attributeS
}
}
}
}
- fun getFavoriteOrDefaultIcon(): Bitmap {
- // Return the favorite or default icon. This is the only way to return a non-nullable variable while retaining the custom initialization and setter functions above.
- return favoriteOrDefaultIcon
+ fun getFavoriteIcon(): Bitmap {
+ // Return the favorite icon. This is the only way to return a non-nullable variable while retaining the custom initialization and setter functions above.
+ return favoriteIcon
}
}
+ fun getFavoriteIconHeight(): Int {
+ // Return the favorite icon height.
+ return favoriteIconHeight
+ }
// Reset the handlers.
fun resetSslErrorHandler() {
// Reset the handlers.
fun resetSslErrorHandler() {
@@ -540,4+551,4 @@ class NestedScrollWebView @JvmOverloads constructor(context: Context, attributeS
// Dispatch a nested fling with the specified velocity.
<string name="file_is_mht">Le fichier est une archive web MHT.</string>
<string name="mht_checkbox_explanation">Parfois, les archives web MHT (MIME Encapsulated HTML) doivent être spécifiées manuellement pour être ouvertes correctement.</string>
<string name="file_is_mht">Le fichier est une archive web MHT.</string>
<string name="mht_checkbox_explanation">Parfois, les archives web MHT (MIME Encapsulated HTML) doivent être spécifiées manuellement pour être ouvertes correctement.</string>
- <!-- Save Dialog. Android removes double spaces, but extra spaces can be manually specified with the Unicode `\u0020` formatting.
- The `%*$s` code inserts variables into the displayed text and should be preserved in translation. <https://developer.android.com/reference/kotlin/java/util/Formatter> -->
+ <!-- Save Dialog. The `%*$s` code inserts variables into the displayed text and should be preserved in translation. <https://developer.android.com/reference/kotlin/java/util/Formatter> -->
<string name="saved_ip_addresses">Adresse(s) IP sauvegardée(s)</string>
<string name="current_ip_addresses">Adresse(s) IP courante(s)</string>
<string name="saved_ip_addresses">Adresse(s) IP sauvegardée(s)</string>
<string name="current_ip_addresses">Adresse(s) IP courante(s)</string>
- <!-- Import/Export. Android removes double spaces, but extra spaces can be manually specified with the Unicode `\u0020` formatting.
- The `%1$s` code inserts variables into the displayed text and should be preserved in translation. <https://developer.android.com/reference/kotlin/java/util/Formatter> -->
+ <!-- Import/Export. The `%1$s` code inserts variables into the displayed text and should be preserved in translation. <https://developer.android.com/reference/kotlin/java/util/Formatter> -->
<string name="export_failed">L\'export a échoué : %1$s</string>
<string name="import_failed">L\'import a échoué : %1$s</string>
<string name="export_failed">L\'export a échoué : %1$s</string>
<string name="import_failed">L\'import a échoué : %1$s</string>
- <!-- Logcat. Android removes double spaces, but extra spaces can be manually specified with the Unicode `\u0020` formatting.
- The `%1$s` code inserts variables into the displayed text and should be preserved in translation. <https://developer.android.com/reference/kotlin/java/util/Formatter> -->
+ <!-- Logcat. The `%1$s` code inserts variables into the displayed text and should be preserved in translation. <https://developer.android.com/reference/kotlin/java/util/Formatter> -->
<string name="copy_string">Copie</string>
<string name="clear">Vider</string>
<string name="logcat_copied">Journal système copié.</string>