From 1b85220390e0f7954b92b8c5b1419550e68e2e46 Mon Sep 17 00:00:00 2001 From: sebesti0n Date: Mon, 4 Mar 2024 12:28:33 +0530 Subject: [PATCH] feat- AboutActivity UI enhancement . --- .../onebusaway/android/ui/AboutActivity.java | 31 ++++-- .../src/main/res/layout/content_about.xml | 97 ++++++++++++++++++- .../src/main/res/values/dimens.xml | 6 ++ .../src/main/res/values/strings.xml | 80 +++++++++++++++ 4 files changed, 201 insertions(+), 13 deletions(-) diff --git a/onebusaway-android/src/main/java/org/onebusaway/android/ui/AboutActivity.java b/onebusaway-android/src/main/java/org/onebusaway/android/ui/AboutActivity.java index 24542dfc2..087d72a8c 100644 --- a/onebusaway-android/src/main/java/org/onebusaway/android/ui/AboutActivity.java +++ b/onebusaway-android/src/main/java/org/onebusaway/android/ui/AboutActivity.java @@ -21,9 +21,13 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.Bundle; +import android.text.Html; +import android.text.Spannable; +import android.text.Spanned; import android.widget.TextView; import com.google.android.material.appbar.CollapsingToolbarLayout; +import com.google.android.material.textview.MaterialTextView; import org.onebusaway.android.R; @@ -52,7 +56,14 @@ protected void onCreate(Bundle savedInstanceState) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - TextView tv = (TextView) findViewById(R.id.about_text); +// TextView tv = (TextView) findViewById(R.id.about_text); + MaterialTextView versionText,codeContributorsText,translationsText,imageCreditsText,howToContributeText; + versionText = findViewById(R.id.version_text); + codeContributorsText = findViewById(R.id.code_contributor_text); + translationsText = findViewById(R.id.translations_text); + imageCreditsText = findViewById(R.id.image_credit_text); + howToContributeText = findViewById(R.id.contribute_to_our_app_text); + String versionString = ""; int versionCode = 0; try { @@ -65,16 +76,20 @@ protected void onCreate(Bundle savedInstanceState) { StringBuilder builder = new StringBuilder(); // Version info - builder.append("v") + builder.append("Version: ") .append(versionString) - .append(" (") + .append("(") .append(versionCode) - .append(")\n\n"); + .append(")"); // Majority of content from string resource - builder.append(getString(R.string.about_text)); - builder.append("\n\n"); - - tv.setText(builder.toString()); +// builder.append(getString(R.string.about_text)); +// builder.append("\n\n"); + versionText.setText(builder); + //set Html text to textview + codeContributorsText.setText((Spannable) Html.fromHtml(getString(R.string.code_contributors_content))); + translationsText.setText((Spannable) Html.fromHtml(getString(R.string.translations_content))); + imageCreditsText.setText((Spannable) Html.fromHtml(getString(R.string.image_credits_content))); + howToContributeText.setText((Spannable) Html.fromHtml(getString(R.string.contribute_to_our_app_content))); } } diff --git a/onebusaway-android/src/main/res/layout/content_about.xml b/onebusaway-android/src/main/res/layout/content_about.xml index 74c105787..2feeb0250 100644 --- a/onebusaway-android/src/main/res/layout/content_about.xml +++ b/onebusaway-android/src/main/res/layout/content_about.xml @@ -8,12 +8,99 @@ android:layout_width="match_parent" android:layout_height="match_parent" tools:context="org.onebusaway.android.ui.AboutActivity"> + + + + + + + + + + + + + android:id="@+id/contribute_to_our_app_text" + android:autoLink="web" + android:textSize="@dimen/content_size" + android:layout_marginStart="@dimen/description_margin" + /> + diff --git a/onebusaway-android/src/main/res/values/dimens.xml b/onebusaway-android/src/main/res/values/dimens.xml index cf0ce7801..060321ca9 100644 --- a/onebusaway-android/src/main/res/values/dimens.xml +++ b/onebusaway-android/src/main/res/values/dimens.xml @@ -93,6 +93,12 @@ 180dp 16dp + 25sp + 18sp + 10dp + 16sp + 5dp + 10dp 32dp diff --git a/onebusaway-android/src/main/res/values/strings.xml b/onebusaway-android/src/main/res/values/strings.xml index 6464b8d07..7bbf90e9f 100644 --- a/onebusaway-android/src/main/res/values/strings.xml +++ b/onebusaway-android/src/main/res/values/strings.xml @@ -890,7 +890,87 @@ To backup or restore your data, OneBusAway needs permission to access your local device storage. + Welcome to OneBusAway! About + Code Contributors: + Image Credits: + Translations: + Join the Journey: Contribute to Our App! + At OneBusAway, we\'re passionate about creating innovative solutions to simplify your transit experience. Our Android app is a labor of love, made possible by the dedication and talent of a diverse group of individuals and organizations. Here\'s a glimpse into the fantastic contributors who have made OneBusAway what it is today: + + +

Our dedicated contributors improve the app\'s functionality and user experience:

+ + + + ]]>
+ + +

+ Thanks to our translators, OneBusAway is + accessible worldwide: +

+ + + + ]]>
+ + +

+ Thanks to the designers who created images used in the vehicle icons, which were uploaded to the Noun Project under CC BY 3.0 (https://creativecommons.org/licenses/by/3.0/us/): +

+ + + + ]]>
+ + +

Check out our project on GitHub at https://github.com/OneBusAway/onebusaway-android. +

+

+ Find out more about the OneBusAway open-source project at https://onebusaway.org .

+

+ Special thanks to Google for the visually stunning material design icons(https://github.com/google/material-design-icons), + which add a touch of elegance to our app. Their generosity in licensing + these icons under Apache v2.0(https://www.apache.org/licenses/LICENSE-2.0) has greatly enriched our user experience. +

+ +

+ Explore our app and embark on a seamless transit journey with OneBusAway! +

+ + + ]]>
"Find out more about the OneBusAway open-source project at https://onebusaway.org.\n\n"