Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Enhanced layout of "About" Activity #1139

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it would be better if we could just remove unused code

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 {
Expand All @@ -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));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, I personally feel we could just remove this

// 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)));
}
}
97 changes: 92 additions & 5 deletions onebusaway-android/src/main/res/layout/content_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,99 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.onebusaway.android.ui.AboutActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/version_margin"
android:paddingStart="@dimen/about_padding"
android:orientation="vertical">
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/version_text"
android:layout_margin="@dimen/version_margin"
android:autoLink="web"
/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/welcome_heading"
android:textSize="@dimen/main_heading_size"
android:textStyle="bold"
android:textColor="@color/navdrawer_text_color"/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/app_description"
android:autoLink="web"
android:text="@string/app_description"
android:textSize="@dimen/content_size"
android:layout_marginHorizontal="@dimen/description_margin"
android:layout_marginBottom="@dimen/description_margin"
/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/code_contributors_sub_heading"
android:textStyle="bold"
android:textSize="@dimen/about_sub_heading_text_size"
android:textColor="@color/navdrawer_text_color"/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/code_contributor_text"
android:autoLink="web"
android:textSize="@dimen/content_size"
android:layout_marginStart="@dimen/description_margin"
/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/translations_sub_heading"
android:textStyle="bold"
android:textSize="@dimen/about_sub_heading_text_size"
android:textColor="@color/navdrawer_text_color"
/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/translations_text"
android:autoLink="web"
android:textSize="@dimen/content_size"
android:layout_marginStart="@dimen/description_margin"

<TextView
android:id="@+id/about_text"
android:layout_width="wrap_content"
/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/image_credits_sub_heading"
android:textStyle="bold"
android:textSize="@dimen/about_sub_heading_text_size"
android:textColor="@color/navdrawer_text_color"
/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/image_credit_text"
android:autoLink="web"
android:textSize="@dimen/content_size"
android:layout_marginStart="@dimen/description_margin"
/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/contribute_to_our_app_sub_heading"
android:textStyle="bold"
android:textSize="@dimen/about_sub_heading_text_size"
android:textColor="@color/navdrawer_text_color"/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:autoLink="web"/>
android:id="@+id/contribute_to_our_app_text"
android:autoLink="web"
android:textSize="@dimen/content_size"
android:layout_marginStart="@dimen/description_margin"
/>
</LinearLayout>

</androidx.core.widget.NestedScrollView>
6 changes: 6 additions & 0 deletions onebusaway-android/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@
<!-- About -->
<dimen name="app_bar_height">180dp</dimen>
<dimen name="text_margin">16dp</dimen>
<dimen name="main_heading_size">25sp</dimen>
<dimen name="about_sub_heading_text_size">18sp</dimen>
<dimen name="description_margin">10dp</dimen>
<dimen name="content_size">16sp</dimen>
<dimen name="version_margin">5dp</dimen>
<dimen name="about_padding">10dp</dimen>

<!-- Dialog -->
<dimen name="dialog_margin">32dp</dimen>
Expand Down
80 changes: 80 additions & 0 deletions onebusaway-android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,87 @@
<string name="storage_permissions_message">To backup or restore your data, OneBusAway needs permission to access your local device storage.</string>

<!-- About -->
<string name="welcome_heading">Welcome to OneBusAway!</string>
<string name="title_activity_about">About</string>
<string name="code_contributors_sub_heading"><b>Code Contributors:</b></string>
<string name="image_credits_sub_heading">Image Credits:</string>
<string name="translations_sub_heading">Translations:</string>
<string name="contribute_to_our_app_sub_heading">Join the Journey: Contribute to Our App!</string>
<string name="app_description">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:</string>
<string name="code_contributors_content"><![CDATA[

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm not sure, but I I feel its not good to store html in this file, as it would be hard to translate the html anyways

<html>
<body>
<p>Our dedicated contributors improve the app\'s functionality and user experience:<br></p>
<ul>
<li><b>Paul Watts</b></li>
<li><b>Brian Ferris</b></li>
<li><b>Daniel Welsh</b></li>
<li><b>Arno Hart</b></li>
<li><b>Sean Barbeau</b></li>
<li><b>York Region Transit</b></li>
<li><b>Ben Du</b></li>
<li><b>Cagri Cetin</b></li>
<li><b>Mike Karabushin</b></li>
<li><b>Aziz Batihk</b></li>
<li><b>Charles Bond</b></li>
<li><b>Hillsborough Area Regional Transit (via Simon Jacobs at Cambridge Systematics)</b></li>
<li><b>Bridgette Eichelberger</b></li>
<li><b>Rodrigo Carvalho (Google Summer of Code 2017)</b></li>
<li><b>Steve Moritani</b></li>
<li><b>Ellen Conley</b></li>
</ul>
</body>
</html>
]]></string>
<string name="translations_content"><![CDATA[
<html>
<body>
<p>
Thanks to our translators, OneBusAway is
accessible worldwide:
</p>
<ul>
<li><b>Ari Rusakko</b></li>
<li><b>Eleonora Fabbri</b></li>
<li><b>Edgar Andrés Moncada Taborda</b></li>
</ul>
</body>
</html>
]]></string>
<string name="image_credits_content"><![CDATA[
<html>
<body>
<p>
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/):
</p>
<ul>
<li>Arrow by <b>Zlatko Najdenovski</b>, MK</li>
<li>Map Marker by <b>Housin Aziz</b>, SE</li>
<li>Incognito by <b>Christopher Schreiner</b></li>
<li>Flag Triangle by <b>Austin Andrews</b></li>
</ul>
</body>
</html>
]]></string>
<string name="contribute_to_our_app_content"><![CDATA[
<html>
<body>
<p>Check out our project on GitHub at https://github.com/OneBusAway/onebusaway-android.
</p>
<p>
Find out more about the OneBusAway open-source project at https://onebusaway.org .</p>
<p>
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.
</p>

<p>
Explore our app and embark on a seamless transit journey with OneBusAway!
</p>
</body>
</html>
]]></string>
<string name="about_text">
"Find out more about the OneBusAway open-source project at https://onebusaway.org.\n\n"

Expand Down
Loading