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
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ class AboutActivityTest {
IntentMatchers.hasData(Urls.CREDITS_URL)))
}

@Test
@Ignore("Fix Failing Test")
fun testLaunchUserGuide() {
Espresso.onView(ViewMatchers.withId(R.id.about_user_guide)).perform(ViewActions.click())
Intents.intended(CoreMatchers.allOf(IntentMatchers.hasAction(Intent.ACTION_VIEW),
IntentMatchers.hasData(Urls.USER_GUIDE_URL)))
}


@Test
@Ignore("Fix Failing Test")
fun testLaunchAboutFaq() {
Expand Down
6 changes: 6 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 @@ -64,6 +64,7 @@ public void onCreate(Bundle savedInstanceState) {

Utils.setUnderlinedText(binding.aboutFaq, R.string.about_faq, getApplicationContext());
Utils.setUnderlinedText(binding.aboutRateUs, R.string.about_rate_us, getApplicationContext());
Utils.setUnderlinedText(binding.aboutUserGuide, R.string.user_guide, getApplicationContext());
Utils.setUnderlinedText(binding.aboutPrivacyPolicy, R.string.about_privacy_policy, getApplicationContext());
Utils.setUnderlinedText(binding.aboutTranslate, R.string.about_translate, getApplicationContext());
Utils.setUnderlinedText(binding.aboutCredits, R.string.about_credits, getApplicationContext());
Expand All @@ -77,6 +78,7 @@ public void onCreate(Bundle savedInstanceState) {
binding.aboutRateUs.setOnClickListener(this::launchRatings);
binding.aboutCredits.setOnClickListener(this::launchCredits);
binding.aboutPrivacyPolicy.setOnClickListener(this::launchPrivacyPolicy);
binding.aboutUserGuide.setOnClickListener(this::launchUserGuide);
binding.aboutFaq.setOnClickListener(this::launchFrequentlyAskedQuesions);
binding.aboutTranslate.setOnClickListener(this::launchTranslate);
}
Expand Down Expand Up @@ -114,6 +116,10 @@ public void launchCredits(View view) {
Utils.handleWebUrl(this, Uri.parse(Urls.CREDITS_URL));
}

public void launchUserGuide(View view) {
Utils.handleWebUrl(this, Uri.parse(Urls.USER_GUIDE_URL));
}

public void launchPrivacyPolicy(View view) {
Utils.handleWebUrl(this, Uri.parse(BuildConfig.PRIVACY_POLICY_URL));
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/fr/free/nrw/commons/Urls.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ internal object Urls {
const val GITHUB_REPO_URL = "https://github.com/commons-app/apps-android-commons"
const val WEBSITE_URL = "https://commons-app.github.io"
const val CREDITS_URL = "https://github.com/commons-app/apps-android-commons/blob/master/CREDITS"
const val USER_GUIDE_URL = "https://commons-app.github.io/docs.html"
const val FAQ_URL = "https://github.com/commons-app/commons-app-documentation/blob/master/android/Frequently-Asked-Questions.md"
const val PLAY_STORE_PREFIX = "market://details?id="
const val PLAY_STORE_URL_PREFIX = "https://play.google.com/store/apps/details?id="
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@
android:textColor="?attr/colorAccent"
/>

<TextView
android:id="@+id/about_user_guide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_gap"
android:gravity="center"
android:textColor="?attr/colorAccent"
/>

<TextView
android:id="@+id/about_privacy_policy"
style="?android:textAppearanceSmall"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
<string name="nearby_commons">Commons</string>
<string name="about_rate_us">Rate us</string>
<string name="about_faq">FAQ</string>
<string name="user_guide">User Guide</string>
<string name="welcome_skip_button">Skip Tutorial</string>
<string name="no_internet">Internet unavailable</string>
<string name="error_notifications">Error fetching notifications</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class AboutActivityUnitTests {
activity.launchPrivacyPolicy(null)
}

@Test
@Throws(Exception::class)
fun testLaunchUserGuide() {
activity.launchUserGuide(null)
}

@Test
@Throws(Exception::class)
fun testLaunchFrequentlyAskedQuestions() {
Expand Down