From 65bc1eb12cf851f1b7a25933e9bd678c8c33ae6a Mon Sep 17 00:00:00 2001 From: Rajat Talesra Date: Wed, 24 Jun 2020 15:29:12 +0530 Subject: [PATCH 1/2] Update topic description --- .../topic/info/TopicInfoFragmentPresenter.kt | 7 +------ .../app/topic/info/TopicInfoFragmentTest.kt | 19 ------------------- domain/src/main/assets/fractions_topic.json | 2 +- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/org/oppia/app/topic/info/TopicInfoFragmentPresenter.kt b/app/src/main/java/org/oppia/app/topic/info/TopicInfoFragmentPresenter.kt index d02ff75d6b8..e5c0af13cdc 100644 --- a/app/src/main/java/org/oppia/app/topic/info/TopicInfoFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/app/topic/info/TopicInfoFragmentPresenter.kt @@ -82,12 +82,7 @@ class TopicInfoFragmentPresenter @Inject constructor( fragment, Observer { topic -> topicInfoViewModel.topic.set(topic) - topicInfoViewModel.topicDescription.set( - htmlParser.parseOppiaHtml( - topic.description, - fragment.requireView().findViewById(R.id.topic_description_text_view) - ) - ) + topicInfoViewModel.topicDescription.set(topic.description) topicInfoViewModel.calculateTopicSizeWithUnit() controlSeeMoreTextVisibility() } diff --git a/app/src/sharedTest/java/org/oppia/app/topic/info/TopicInfoFragmentTest.kt b/app/src/sharedTest/java/org/oppia/app/topic/info/TopicInfoFragmentTest.kt index b47a35dc73b..b880127599c 100644 --- a/app/src/sharedTest/java/org/oppia/app/topic/info/TopicInfoFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/app/topic/info/TopicInfoFragmentTest.kt @@ -1,7 +1,5 @@ package org.oppia.app.topic.info -import android.text.SpannedString -import android.text.style.StyleSpan import android.view.View import android.widget.TextView import androidx.test.core.app.ActivityScenario @@ -19,7 +17,6 @@ import androidx.test.espresso.matcher.ViewMatchers.isRoot import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.runners.AndroidJUnit4 -import com.google.common.truth.Truth.assertThat import com.google.firebase.FirebaseApp import org.hamcrest.CoreMatchers import org.hamcrest.Description @@ -86,22 +83,6 @@ class TopicInfoFragmentTest { } } - @Test - fun testTopicInfoFragment_loadFragmentWithTestTopicId1_checkTopicDescription_hasRichText() { - launchTopicActivityIntent(internalProfileId, TEST_TOPIC_ID).use { scenario -> - scenario.onActivity { activity -> - val descriptionTextView: TextView = activity.findViewById(R.id.topic_description_text_view) - val descriptionText = descriptionTextView.text as SpannedString - val spans = descriptionText.getSpans( - 0, - descriptionText.length, - StyleSpan::class.java - ) - assertThat(spans).isNotEmpty() - } - } - } - @Test fun testTopicInfoFragment_loadFragment_configurationChange_checkTopicThumbnail_isCorrect() { launchTopicActivityIntent(internalProfileId, TEST_TOPIC_ID).use { diff --git a/domain/src/main/assets/fractions_topic.json b/domain/src/main/assets/fractions_topic.json index e911e8428b4..7c500473c8f 100755 --- a/domain/src/main/assets/fractions_topic.json +++ b/domain/src/main/assets/fractions_topic.json @@ -1,7 +1,7 @@ { "topic": { "story_reference_schema_version": 1, - "description": "You'll often need to talk about part of an object or group. For example, a jar of milk might be half-full, or some of the eggs in a box might have broken. In these lessons, you'll learn to use fractions to describe situations like these.", + "description": "You'll often need to talk about part of an object or group. For example, a jar of milk might be half-full, or some of the eggs in a box might have broken. In these lessons, you'll learn to use fractions to describe situations like these.", "canonical_story_references": [ { "story_id": "wANbh4oOClga", From 9d21fd1065e2a97652c38915ab313dda20c0b1d6 Mon Sep 17 00:00:00 2001 From: Rajat Talesra Date: Mon, 29 Jun 2020 14:01:55 +0530 Subject: [PATCH 2/2] Nit change --- .../java/org/oppia/app/topic/info/TopicInfoFragmentPresenter.kt | 2 +- .../java/org/oppia/app/topic/info/TopicInfoFragmentTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/oppia/app/topic/info/TopicInfoFragmentPresenter.kt b/app/src/main/java/org/oppia/app/topic/info/TopicInfoFragmentPresenter.kt index e5c0af13cdc..8702e31966f 100644 --- a/app/src/main/java/org/oppia/app/topic/info/TopicInfoFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/app/topic/info/TopicInfoFragmentPresenter.kt @@ -120,7 +120,7 @@ class TopicInfoFragmentPresenter @Inject constructor( } } - private fun logInfoFragmentEvent(topicId: String){ + private fun logInfoFragmentEvent(topicId: String) { analyticsController.logTransitionEvent( fragment.requireActivity().applicationContext, oppiaClock.getCurrentCalendar().timeInMillis, diff --git a/app/src/sharedTest/java/org/oppia/app/topic/info/TopicInfoFragmentTest.kt b/app/src/sharedTest/java/org/oppia/app/topic/info/TopicInfoFragmentTest.kt index b880127599c..d4e9edd49a7 100644 --- a/app/src/sharedTest/java/org/oppia/app/topic/info/TopicInfoFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/app/topic/info/TopicInfoFragmentTest.kt @@ -57,7 +57,7 @@ class TopicInfoFragmentTest { private val internalProfileId = 0 @Before - fun setUp(){ + fun setUp() { FirebaseApp.initializeApp(ApplicationProvider.getApplicationContext()) }