Skip to content

Commit ede8c76

Browse files
ujjwalagrawal17Vivek Maskara
authored andcommitted
Faqs added in About Activity (commons-app#1256)
* Faqs added in About Activity * Added CDATA in strings * removed cdata, added SpannableString
1 parent bdd7a86 commit ede8c76

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

app/src/main/java/fr/free/nrw/commons/AboutActivity.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import android.content.Intent;
55
import android.net.Uri;
66
import android.os.Bundle;
7+
import android.text.SpannableString;
8+
import android.text.style.UnderlineSpan;
79
import android.util.Log;
810
import android.support.customtabs.CustomTabsIntent;
911
import android.support.v4.content.ContextCompat;
@@ -25,6 +27,7 @@
2527
public class AboutActivity extends NavigationBaseActivity {
2628
@BindView(R.id.about_version) TextView versionText;
2729
@BindView(R.id.about_license) HtmlTextView aboutLicenseText;
30+
@BindView(R.id.about_faq) TextView faqText;
2831

2932
/**
3033
* This method helps in the creation About screen
@@ -40,7 +43,9 @@ public void onCreate(Bundle savedInstanceState) {
4043
ButterKnife.bind(this);
4144
String aboutText = getString(R.string.about_license);
4245
aboutLicenseText.setHtmlText(aboutText);
43-
46+
SpannableString content = new SpannableString(getString(R.string.about_faq));
47+
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
48+
faqText.setText(content);
4449
versionText.setText(BuildConfig.VERSION_NAME);
4550
initDrawer();
4651
}
@@ -113,4 +118,9 @@ public void launchPrivacyPolicy(View view) {
113118
}
114119
}
115120

121+
@OnClick(R.id.about_faq)
122+
public void launchFrequentlyAskedQuesions(View view) {
123+
Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Frequently-Asked-Questions\\"));
124+
}
125+
116126
}

app/src/main/res/layout/activity_about.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@
133133
android:gravity="center"
134134
android:text="@string/about_credits" />
135135

136+
<TextView
137+
android:id="@+id/about_faq"
138+
style="?android:textAppearanceSmall"
139+
android:layout_width="wrap_content"
140+
android:layout_height="wrap_content"
141+
android:textColor="@color/primaryColor"
142+
android:layout_marginTop="@dimen/standard_gap"
143+
android:gravity="center"
144+
/>
145+
136146
<TextView
137147
android:id="@+id/about_uploads_to"
138148
style="?android:textAppearanceSmall"

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,5 +243,6 @@
243243
<string name="notifications_mention">%1$s mentioned you on %2$s.</string>
244244
<string name="toggle_view_button">Toggle view</string>
245245
<string name="about_rate_us"><u>Rate Us</u></string>
246-
<string name="welcome_skip_button">Skip Tutorial</string>
246+
<string name="about_faq">Frequently Asked Questions</string>
247+
<string name="welcome_skip_button">Skip Tutorial</string>
247248
</resources>

0 commit comments

Comments
 (0)