Skip to content
Merged
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
13 changes: 13 additions & 0 deletions app/src/main/java/fr/free/nrw/commons/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.Html;
import android.text.SpannableString;
import android.text.style.UnderlineSpan;
import android.util.Log;
Expand Down Expand Up @@ -62,6 +63,18 @@ public void onCreate(Bundle savedInstanceState) {
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
faqText.setText(content);
versionText.setText(BuildConfig.VERSION_NAME);
TextView rate_us = findViewById(R.id.about_rate_us);
TextView privacy_policy = findViewById(R.id.about_privacy_policy);
TextView translate = findViewById(R.id.about_translate);
TextView credits = findViewById(R.id.about_credits);
TextView faq = findViewById(R.id.about_faq);

rate_us.setText(Html.fromHtml(getString(R.string.about_rate_us)));
privacy_policy.setText(Html.fromHtml(getString(R.string.about_privacy_policy)));
translate.setText(Html.fromHtml(getString(R.string.about_translate)));
credits.setText(Html.fromHtml(getString(R.string.about_credits)));
faq.setText(Html.fromHtml(getString(R.string.about_faq)));

Copy link
Member

Choose a reason for hiding this comment

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

The CDATA changes look fine, but why the switch to TextViews?

Copy link
Contributor Author

@Mansi449 Mansi449 Mar 27, 2018

Choose a reason for hiding this comment

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

If the text is not set like this then it does not work as expected i.e. if we specify
<TextView android:text="@string/about_rate_us" />

then the output is:
https://drive.google.com/open?id=1YHZcHHhgmUBqMUE48BpWY5toeEcMgjqC

Copy link
Member

Choose a reason for hiding this comment

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

Ah, okay, looks good in that case. :)

initDrawer();
}

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
android:layout_marginTop="@dimen/standard_gap"
android:gravity="center"
android:textColor="@color/primaryColor"
android:text="@string/about_rate_us" />
/>

<TextView
android:id="@+id/about_privacy_policy"
Expand All @@ -121,7 +121,7 @@
android:layout_marginTop="@dimen/standard_gap"
android:textColor="@color/primaryColor"
android:gravity="center"
android:text="@string/about_privacy_policy" />
/>

<TextView
android:id="@+id/about_translate"
Expand All @@ -131,7 +131,7 @@
android:textColor="@color/primaryColor"
android:layout_marginTop="@dimen/standard_gap"
android:gravity="center"
android:text="@string/about_translate" />
/>

<TextView
android:id="@+id/about_credits"
Expand All @@ -141,7 +141,7 @@
android:textColor="@color/primaryColor"
android:layout_marginTop="@dimen/standard_gap"
android:gravity="center"
android:text="@string/about_credits" />
/>

<TextView
android:id="@+id/about_faq"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
<string name="about_license">The Wikimedia Commons app is an open-source app created and maintained by grantees and volunteers of the Wikimedia community. The Wikimedia Foundation is not involved in the creation, development, or maintenance of the app. </string>
<string name="trademarked_name" translatable="false">Wikimedia Commons</string>
<string name="about_improve">Create a new &lt;a href=\"https://github.com/commons-app/apps-android-commons/issues\"&gt;GitHub issue&lt;/a&gt; for bug reports and suggestions.</string>
<string name="about_privacy_policy"><u>Privacy policy</u></string>
<string name="about_credits"><u>Credits</u></string>
<string name="about_privacy_policy"><![CDATA[<u>Privacy policy</u>]]></string>
<string name="about_credits"><![CDATA[<u>Credits</u>]]></string>
<string name="title_activity_about">About</string>
<string name="menu_feedback">Send Feedback (via Email)</string>
<string name="no_email_client">No email client installed</string>
Expand Down Expand Up @@ -253,16 +253,16 @@
<string name="nearby_wikipedia">WIKIPEDIA</string>
<string name="nearby_commons">COMMONS</string>

<string name="about_rate_us"><u>Rate us</u></string>
<string name="about_faq">FAQ</string>
<string name="about_rate_us"><![CDATA[<u>Rate us</u>]]></string>
<string name="about_faq"><![CDATA[<u>FAQ</u>]]></string>
<string name="welcome_skip_button">Skip Tutorial</string>

<string name="no_internet">Internet unavailable</string>
<string name="internet_established">Internet available</string>
<string name="error_notifications">Error fetching notifications</string>
<string name="no_notifications">No notifications found</string>

<string name="about_translate"><u>Translate</u></string>
<string name="about_translate"><![CDATA[<u>Translate</u>]]></string>
<string name="about_translate_title">Languages</string>
<string name="about_translate_message">Select the language that you would like to submit translations for</string>
<string name="about_translate_proceed">Proceed</string>
Expand Down