Skip to content

Commit

Permalink
Implement proper about screen
Browse files Browse the repository at this point in the history
  • Loading branch information
MrApplejuice committed Feb 1, 2022
1 parent 3077394 commit fe350cc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public Range(int start, int end) {
}
}

private static Pattern HREF_DETECTOR_PATTERN = Pattern.compile("<a .*href=[\"']([^\"]+)[\"'][^>]*>([^<]*)</a>");
private static Pattern HREF_DETECTOR_PATTERN = Pattern.compile("<a .*href=[\"']([^\"']+)[\"'][^>]*>([^<]*)</a>");

private void filterLinksFromTextFields(ViewGroup root) {
for (int i = 0; i < root.getChildCount(); i++) {
Expand Down Expand Up @@ -207,7 +207,7 @@ public void updateDrawState(@NonNull TextPaint ds) {

filterLinksFromTextFields(binding.root);

return binding.root;
return binding.getRoot();
}

@Override
Expand Down
51 changes: 29 additions & 22 deletions app/src/main/res/layout/about_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="8dp"
tools:context=".AboutFragment">

<TextView
<LinearLayout
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/about_text" />
android:orientation="vertical">

<TextView
android:id="@+id/aboutLicenseTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/autostring_about_license_title"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/about_text" />

<TextView
android:id="@+id/aboutLicenseText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/autostring_about_license_text" />
<TextView
android:id="@+id/aboutLicenseTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/autostring_about_license_title"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="External Resources"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<TextView
android:id="@+id/aboutLicenseText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/autostring_about_license_text" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/about_external_media_resources_title"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

</LinearLayout>

</LinearLayout>
</ScrollView>
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

<string name="app_name">Baby Buddy</string>

<string name="about_text">This Android application is Open Source software licensed under the MIT License (see below).\n\nThe source code of the application is available at &lt;a href=\'https://github.com/MrApplejuice/BabyBuddyAndroid/\'&gt;https://github.com/MrApplejuice/BabyBuddyAndroid/&lt;/a&gt;.\n\nThe application uses third-party media under attribution licenes listed below.</string>
<string name="about_text">This Android application is Open Source software created by &lt;a href=\'http://www.craftware.info\'&gt;Paul Konstantin Gerke&lt;/a&gt; and licensed under the MIT License (see below).\n\nThe source code of the application is available at &lt;a href=\'https://github.com/MrApplejuice/BabyBuddyAndroid/\'&gt;https://github.com/MrApplejuice/BabyBuddyAndroid/&lt;/a&gt;.\n\nThe application uses third-party media under attribution licenes listed below.</string>
<string name="about_external_media_resources_title">Third party media</string>

<!-- Strings used for fragments for navigation -->
<string name="action_settings">Settings</string>
Expand Down

0 comments on commit fe350cc

Please sign in to comment.