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 #5251 Modify Feature Flag Names to reflect those on Oppia Web #5257

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4b1bdf0
Fix oppia#4760 In Terms of Service the website should be displayed as…
Oct 29, 2023
ae84328
Merge remote-tracking branch 'origin/develop' into develop
Oct 29, 2023
c197e03
Merge branch 'oppia:develop' into develop
Tejas-67 Oct 31, 2023
37a1af4
Merge branch 'oppia:develop' into develop-tejas
Tejas-67 Oct 31, 2023
237c463
Refactor link detection in policyDescription
Oct 31, 2023
8f113e0
Refactor link detection in policyDescription
Oct 31, 2023
63b191e
Merge remote-tracking branch 'origin/develop' into develop-tejas
Oct 31, 2023
e688b1e
Merge branch 'oppia:develop' into develop-tejas
Tejas-67 Nov 1, 2023
800b769
Merge branch 'oppia:develop' into develop
Tejas-67 Nov 1, 2023
b59ac37
Refractor functions to set text in textviews
Nov 1, 2023
d9fcc71
refractored function names
Nov 1, 2023
dbd97de
Merge branch 'oppia:develop' into develop
Tejas-67 Nov 24, 2023
606ad30
Merge branch 'oppia:develop' into develop-tejas
Tejas-67 Nov 24, 2023
4b870c9
Merge remote-tracking branch 'origin/develop' into develop-tejas
Nov 24, 2023
d258dd1
FIX: PrivacyPolicy navigation issue.
Nov 27, 2023
4049796
Merge remote-tracking branch 'origin/develop-tejas' into develop-tejas
Nov 27, 2023
a0c68b2
Remove unused imports.
Nov 28, 2023
5cb9b6d
Merge branch 'oppia:develop' into develop
Tejas-67 Dec 1, 2023
859c962
Merge branch 'oppia:develop' into develop
Tejas-67 Dec 4, 2023
b345a05
Merge branch 'oppia:develop' into develop-tejas
Tejas-67 Dec 4, 2023
4d01b02
Modify: Feature Flag Names to reflect those on Oppia Web
Dec 4, 2023
9744842
Merge remote-tracking branch 'origin/develop-tejas' into develop-tejas
Dec 4, 2023
bcc938d
Modify: Feature Flag Names to reflect those on Oppia Web
Dec 4, 2023
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 @@ -46,12 +46,10 @@ class PoliciesFragmentPresenter @Inject constructor(
var policyWebLink = ""

if (policyPage == PolicyPage.PRIVACY_POLICY) {
policyDescription =
resourceHandler.getStringInLocale(R.string.privacy_policy_content)
policyDescription = resourceHandler.getStringInLocale(R.string.privacy_policy_content)
policyWebLink = resourceHandler.getStringInLocale(R.string.privacy_policy_web_link)
} else if (policyPage == PolicyPage.TERMS_OF_SERVICE) {
policyDescription =
resourceHandler.getStringInLocale(R.string.terms_of_service_content)
policyDescription = resourceHandler.getStringInLocale(R.string.terms_of_service_content)
Comment on lines +49 to +52
Copy link
Collaborator

Choose a reason for hiding this comment

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

These changes are not related to this PR. Please revert

policyWebLink = resourceHandler.getStringInLocale(R.string.terms_of_service_web_link)
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/terms_of_service.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,4 @@
<li>26 Sep 2015: Revised terms added.</li>
</ul>
</]]></string>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file change too is not related to this PR.

</resources>
</resources>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file should not be part of this PR

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import android.app.Application
import android.content.Context
import android.text.Spannable
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.text.method.LinkMovementMethod
import android.text.style.URLSpan
import android.text.util.Linkify
import android.view.View
import android.widget.TextView
Expand Down Expand Up @@ -86,7 +88,7 @@ class HtmlParser private constructor(
val regex = Regex("""<oppia-noninteractive-image [^>]*>.*?</oppia-noninteractive-image>""")
val modifiedHtmlContent = rawString.replace(regex) {
val oppiaImageTag = it.value
"""<div style="text-align: center;">$oppiaImageTag</div>"""
"""<div style="centtext-align: er;">$oppiaImageTag</div>"""
}
htmlContent = modifiedHtmlContent
} else {
Expand Down Expand Up @@ -117,7 +119,8 @@ class HtmlParser private constructor(
// https://stackoverflow.com/a/8662457
if (supportsLinks) {
htmlContentTextView.movementMethod = LinkMovementMethod.getInstance()
LinkifyCompat.addLinks(htmlContentTextView, Linkify.WEB_URLS)
LinkifyCompat.addLinks(htmlContentTextView, Linkify.ALL)
htmlContentTextView.linksClickable = true
}

val imageGetter = urlImageParserFactory?.create(
Expand All @@ -128,6 +131,15 @@ class HtmlParser private constructor(
htmlContent, imageGetter, computeCustomTagHandlers(supportsConceptCards, htmlContentTextView)
)

val websiteLink = "https://www.oppia.org"
val start = htmlSpannable.indexOf(websiteLink)
val end = start + websiteLink.length
if (start != -1) {
val urlSpan = URLSpan(websiteLink)
htmlSpannable.setSpan(
urlSpan, start, end, Spanned.SPAN_EXCLUSIVE_INCLUSIVE
)
}
return ensureNonEmpty(trimSpannable(htmlSpannable as SpannableStringBuilder))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import javax.inject.Qualifier
@Qualifier annotation class EnableDownloadsSupport

/** Name of the feature flag that controls whether to enable downloads support. */
const val DOWNLOADS_SUPPORT = "downloads_support"
const val DOWNLOADS_SUPPORT = "android_enable_downloads_support"

/** Default value for feature flag corresponding to [EnableDownloadsSupport]. */
const val ENABLE_DOWNLOADS_SUPPORT_DEFAULT_VALUE = false
Expand All @@ -38,7 +38,7 @@ const val ENABLE_LANGUAGE_SELECTION_UI_DEFAULT_VALUE = true
annotation class EnableExtraTopicTabsUi

/** Name of the feature flag that controls whether to enable the extra topics tab UI. */
const val EXTRA_TOPIC_TABS_UI = "extra_topic_tabs_ui"
const val EXTRA_TOPIC_TABS_UI = "android_enable_extra_topic_tabs_ui"

/** Default value for the feature flag corresponding to [EnableExtraTopicTabsUi]. */
const val ENABLE_EXTRA_TOPIC_TABS_UI_DEFAULT_VALUE = false
Expand All @@ -54,7 +54,7 @@ annotation class EnableLearnerStudyAnalytics
* Name of the feature flag that controls the visibility of [ProfileAndDeviceIdActivity]
* and working of learner study related analytics logging.
*/
const val LEARNER_STUDY_ANALYTICS = "learner_study_analytics"
const val LEARNER_STUDY_ANALYTICS = "android_enable_learner_study_analytics"

/**
* Default value of the feature flag that controls the visibility of [ProfileAndDeviceIdActivity]
Expand All @@ -72,7 +72,7 @@ const val LEARNER_STUDY_ANALYTICS_DEFAULT_VALUE = false
@Qualifier annotation class EnableFastLanguageSwitchingInLesson

/** The feature flag name corresponding to [EnableFastLanguageSwitchingInLesson]. */
const val FAST_LANGUAGE_SWITCHING_IN_LESSON = "fast_language_switching_in_lesson"
const val FAST_LANGUAGE_SWITCHING_IN_LESSON = "android_enable_fast_language_switching_in_lesson"

/**
* The default enabled state for the feature corresponding to [EnableFastLanguageSwitchingInLesson].
Expand All @@ -88,7 +88,7 @@ const val FAST_LANGUAGE_SWITCHING_IN_LESSON_DEFAULT_VALUE = false
@Qualifier annotation class EnableLoggingLearnerStudyIds

/** The feature flag name corresponding to [EnableLoggingLearnerStudyIds]. */
const val LOGGING_LEARNER_STUDY_IDS = "logging_learner_study_ids"
const val LOGGING_LEARNER_STUDY_IDS = "android_enable_logging_learner_study_ids"

/** The default enabled state for the feature corresponding to [EnableLoggingLearnerStudyIds]. */
const val LOGGING_LEARNER_STUDY_IDS_DEFAULT_VALUE = false
Expand All @@ -98,7 +98,7 @@ const val LOGGING_LEARNER_STUDY_IDS_DEFAULT_VALUE = false
annotation class EnableEditAccountsOptionsUi

/** Name of the feature flag that controls whether to enable the edit account options UI. */
const val EDIT_ACCOUNTS_OPTIONS_UI = "edit_accounts_options_ui"
const val EDIT_ACCOUNTS_OPTIONS_UI = "android_enable_edit_accounts_options_ui"

/** Default value for the feature flag corresponding to [EnableEditAccountsOptionsUi]. */
const val ENABLE_EDIT_ACCOUNTS_OPTIONS_UI_DEFAULT_VALUE = false
Expand All @@ -108,7 +108,7 @@ const val ENABLE_EDIT_ACCOUNTS_OPTIONS_UI_DEFAULT_VALUE = false
annotation class EnablePerformanceMetricsCollection

/** Name of the feature flag that controls whether to record performance metrics. */
const val ENABLE_PERFORMANCE_METRICS_COLLECTION = "enable_performance_metrics_collection"
const val ENABLE_PERFORMANCE_METRICS_COLLECTION = "android_enable_performance_metrics_collection"

/** Default value for whether to record performance metrics. */
const val ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE = false
Expand All @@ -118,7 +118,7 @@ const val ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE = false
annotation class EnableSpotlightUi

/** Name of the feature flag that controls whether to enable the spotlight UI. */
const val SPOTLIGHT_UI = "spotlight_ui"
const val SPOTLIGHT_UI = "android_enable_spotlight_ui"

/** Default value for the feature flag corresponding to [EnableSpotlightUi]. */
const val ENABLE_SPOTLIGHT_UI_DEFAULT_VALUE = false
Expand All @@ -134,7 +134,8 @@ annotation class EnableInteractionConfigChangeStateRetention
* Name of the feature flag that controls whether input interaction state is correctly retained
* across configuration changes.
*/
const val INTERACTION_CONFIG_CHANGE_STATE_RETENTION = "interaction_config_change_state_retention"
const val INTERACTION_CONFIG_CHANGE_STATE_RETENTION =
"android_enable_interaction_config_change_state_retention"

/**
* Default value for feature flag corresponding to [EnableInteractionConfigChangeStateRetention].
Expand All @@ -149,7 +150,7 @@ const val ENABLE_INTERACTION_CONFIG_CHANGE_STATE_RETENTION_DEFAULT_VALUE = false
annotation class EnableAppAndOsDeprecation

/** Name of the feature flag that controls whether to enable app and os deprecation. */
const val APP_AND_OS_DEPRECATION = "app_and_os_deprecation"
const val APP_AND_OS_DEPRECATION = "android_enable_app_and_os_deprecation"

/**
* Default value for the feature flag corresponding to [EnableAppAndOsDeprecation].
Expand Down
Loading