diff options
| author | Benjamin Linskey | 2025-11-04 02:00:07 -0500 |
|---|---|---|
| committer | Benjamin Linskey | 2025-11-04 02:08:05 -0500 |
| commit | 5ff7154219d60679d0687dd8836f1b00f57f441e (patch) | |
| tree | 524f888e66bf37b4ca31bf7d16560d48eb113e1e | |
| parent | ab3401657fa5d428929ad183073a75d1e2bc2ee6 (diff) | |
| download | greek-reference-5ff7154219d60679d0687dd8836f1b00f57f441e.tar.gz | |
Improve license dialog formatting
| -rw-r--r-- | GreekReference/src/main/java/LicensesPreference.java | 13 | ||||
| -rw-r--r-- | GreekReference/src/main/res/layout/license_preference_layout.xml | 2 | ||||
| -rw-r--r-- | GreekReference/src/main/res/values/strings.xml | 4 |
3 files changed, 9 insertions, 10 deletions
diff --git a/GreekReference/src/main/java/LicensesPreference.java b/GreekReference/src/main/java/LicensesPreference.java index 08bafa3..6cea298 100644 --- a/GreekReference/src/main/java/LicensesPreference.java +++ b/GreekReference/src/main/java/LicensesPreference.java @@ -44,18 +44,17 @@ public class LicensesPreference extends DialogPreference { protected void onBindDialogView(@NonNull View view) { super.onBindDialogView(view); - TextView textView = (TextView) view.findViewById(R.id.licenseDialogTextView); + WebView infoView = (WebView) view.findViewById(R.id.licenseDialogTextView); String licenseStr = getContext().getString(R.string.message_licenses); - textView.setText(Html.fromHtml(licenseStr)); - textView.setMovementMethod(LinkMovementMethod.getInstance()); + infoView.loadDataWithBaseURL(null, licenseStr, "text/html", "utf-8", null); - WebView webView = (WebView) view.findViewById(R.id.licenseDialogWebView); - webView.setInitialScale(1); - WebSettings settings = webView.getSettings(); + WebView apacheView = (WebView) view.findViewById(R.id.licenseDialogWebView); + apacheView.setInitialScale(1); + WebSettings settings = apacheView.getSettings(); settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING); settings.setUseWideViewPort(true); settings.setLoadWithOverviewMode(true); String licenseString = getContext().getString(R.string.apache_license); - webView.loadDataWithBaseURL(null, licenseString, "text/html", "utf-8", null); + apacheView.loadDataWithBaseURL(null, licenseString, "text/html", "utf-8", null); } }
\ No newline at end of file diff --git a/GreekReference/src/main/res/layout/license_preference_layout.xml b/GreekReference/src/main/res/layout/license_preference_layout.xml index 04cd59c..89acce4 100644 --- a/GreekReference/src/main/res/layout/license_preference_layout.xml +++ b/GreekReference/src/main/res/layout/license_preference_layout.xml @@ -24,7 +24,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <TextView + <WebView android:id="@+id/licenseDialogTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/GreekReference/src/main/res/values/strings.xml b/GreekReference/src/main/res/values/strings.xml index 54020ad..a5dd84d 100644 --- a/GreekReference/src/main/res/values/strings.xml +++ b/GreekReference/src/main/res/values/strings.xml @@ -131,7 +131,7 @@ <string name="message_licenses"> <![CDATA[ <p> - This app includes the contents of the text "An Intermediate Greek-English Lexicon," + This app includes the contents of the text \"An Intermediate Greek-English Lexicon,\" by Henry George Liddell and Robert Scott. Text provided by Perseus Digital Library, with funding from The Annenberg CPB/Project. Original version available for viewing and download at http://www.perseus.tufts.edu/hopper/. The text is licensed under @@ -157,7 +157,7 @@ </ul> <hr> <p> - This app includes the contents of the text "Overview of Greek Syntax," + This app includes the contents of the text \"Overview of Greek Syntax,\" by Jeffrey A. Rydberg-Cox. Text provided by Perseus Digital Library, with funding from The Annenberg CPB/Project. Original version available for viewing and download at http://www.perseus.tufts.edu/hopper/. The text is licensed under |