Loading app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlAdapter.kt +6 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import org.mozilla.fenix.home.sessioncontrol.viewholders.CollectionViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.NoCollectionsMessageViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.PrivateBrowsingDescriptionViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.TorBootstrapPagerViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.TorFeedbackSurveyViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.TabInCollectionViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.TopSitePagerViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding.OnboardingAutomaticSignInViewHolder Loading Loading @@ -80,6 +81,7 @@ sealed class AdapterItem(@LayoutRes val viewType: Int) { } object PrivateBrowsingDescription : AdapterItem(PrivateBrowsingDescriptionViewHolder.LAYOUT_ID) object TorFeedbackSurvey : AdapterItem(TorFeedbackSurveyViewHolder.LAYOUT_ID) object NoCollectionsMessage : AdapterItem(NoCollectionsMessageViewHolder.LAYOUT_ID) object TorBootstrap : AdapterItem(TorBootstrapPagerViewHolder.LAYOUT_ID) Loading Loading @@ -179,6 +181,10 @@ class SessionControlAdapter( view, interactor ) TorFeedbackSurveyViewHolder.LAYOUT_ID -> TorFeedbackSurveyViewHolder( view, interactor ) TorBootstrapPagerViewHolder.LAYOUT_ID -> TorBootstrapPagerViewHolder( view, components, Loading app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlController.kt +13 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,11 @@ interface SessionControlController { */ fun handlePrivateBrowsingLearnMoreClicked() /** * @see [TabSessionInteractor.onTorFeedbackSurveyLaunchClicked] */ fun handleTorFeedbackSurveyLaunchClicked() /** * @see [TopSiteInteractor.onRenameTopSiteClicked] */ Loading Loading @@ -620,4 +625,12 @@ class DefaultSessionControlController( override fun handleTorNetworkSettingsClicked() { openTorNetworkSettings() } override fun handleTorFeedbackSurveyLaunchClicked() { activity.openToBrowserAndLoad( searchTermOrURL = SupportUtils.TOR_FEEDBACK_SURVEY_URL, newTab = true, from = BrowserDirection.FromHome ) } } app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlInteractor.kt +10 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,12 @@ interface TabSessionInteractor { * "Common myths about private browsing" link in private mode. */ fun onPrivateBrowsingLearnMoreClicked() /** * Shows the Feedback Survey web page in a new tab. Called when a user clicks on the * "Launch the Survey" button. */ fun onTorFeedbackSurveyLaunchClicked() } /** Loading Loading @@ -361,4 +367,8 @@ class SessionControlInteractor( override fun onTorBootstrapNetworkSettingsClicked() { controller.handleTorNetworkSettingsClicked() } override fun onTorFeedbackSurveyLaunchClicked() { controller.handleTorFeedbackSurveyLaunchClicked() } } app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlView.kt +1 −1 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ private fun showCollections( } } private fun privateModeAdapterItems() = listOf(AdapterItem.PrivateBrowsingDescription) private fun privateModeAdapterItems() = listOf(AdapterItem.TorFeedbackSurvey) private fun bootstrapAdapterItems() = listOf(AdapterItem.TorBootstrap) Loading app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorFeedbackSurveyViewHolder.kt 0 → 100644 +34 −0 Original line number Diff line number Diff line /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mozilla.fenix.home.sessioncontrol.viewholders import android.view.View import androidx.recyclerview.widget.RecyclerView import kotlinx.android.synthetic.main.tor_feedback_survey.view.* import org.mozilla.fenix.R import org.mozilla.fenix.home.sessioncontrol.TabSessionInteractor class TorFeedbackSurveyViewHolder( view: View, private val interactor: TabSessionInteractor ) : RecyclerView.ViewHolder(view) { init { // val resources = view.resources // val appName = resources.getString(R.string.app_name) // view.private_session_description.text = resources.getString( // R.string.private_browsing_placeholder_description_2, appName // ) with(view.feedback_survey_launch_button) { setOnClickListener { interactor.onTorFeedbackSurveyLaunchClicked() } } } companion object { const val LAYOUT_ID = R.layout.tor_feedback_survey } } Loading
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlAdapter.kt +6 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import org.mozilla.fenix.home.sessioncontrol.viewholders.CollectionViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.NoCollectionsMessageViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.PrivateBrowsingDescriptionViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.TorBootstrapPagerViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.TorFeedbackSurveyViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.TabInCollectionViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.TopSitePagerViewHolder import org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding.OnboardingAutomaticSignInViewHolder Loading Loading @@ -80,6 +81,7 @@ sealed class AdapterItem(@LayoutRes val viewType: Int) { } object PrivateBrowsingDescription : AdapterItem(PrivateBrowsingDescriptionViewHolder.LAYOUT_ID) object TorFeedbackSurvey : AdapterItem(TorFeedbackSurveyViewHolder.LAYOUT_ID) object NoCollectionsMessage : AdapterItem(NoCollectionsMessageViewHolder.LAYOUT_ID) object TorBootstrap : AdapterItem(TorBootstrapPagerViewHolder.LAYOUT_ID) Loading Loading @@ -179,6 +181,10 @@ class SessionControlAdapter( view, interactor ) TorFeedbackSurveyViewHolder.LAYOUT_ID -> TorFeedbackSurveyViewHolder( view, interactor ) TorBootstrapPagerViewHolder.LAYOUT_ID -> TorBootstrapPagerViewHolder( view, components, Loading
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlController.kt +13 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,11 @@ interface SessionControlController { */ fun handlePrivateBrowsingLearnMoreClicked() /** * @see [TabSessionInteractor.onTorFeedbackSurveyLaunchClicked] */ fun handleTorFeedbackSurveyLaunchClicked() /** * @see [TopSiteInteractor.onRenameTopSiteClicked] */ Loading Loading @@ -620,4 +625,12 @@ class DefaultSessionControlController( override fun handleTorNetworkSettingsClicked() { openTorNetworkSettings() } override fun handleTorFeedbackSurveyLaunchClicked() { activity.openToBrowserAndLoad( searchTermOrURL = SupportUtils.TOR_FEEDBACK_SURVEY_URL, newTab = true, from = BrowserDirection.FromHome ) } }
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlInteractor.kt +10 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,12 @@ interface TabSessionInteractor { * "Common myths about private browsing" link in private mode. */ fun onPrivateBrowsingLearnMoreClicked() /** * Shows the Feedback Survey web page in a new tab. Called when a user clicks on the * "Launch the Survey" button. */ fun onTorFeedbackSurveyLaunchClicked() } /** Loading Loading @@ -361,4 +367,8 @@ class SessionControlInteractor( override fun onTorBootstrapNetworkSettingsClicked() { controller.handleTorNetworkSettingsClicked() } override fun onTorFeedbackSurveyLaunchClicked() { controller.handleTorFeedbackSurveyLaunchClicked() } }
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlView.kt +1 −1 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ private fun showCollections( } } private fun privateModeAdapterItems() = listOf(AdapterItem.PrivateBrowsingDescription) private fun privateModeAdapterItems() = listOf(AdapterItem.TorFeedbackSurvey) private fun bootstrapAdapterItems() = listOf(AdapterItem.TorBootstrap) Loading
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorFeedbackSurveyViewHolder.kt 0 → 100644 +34 −0 Original line number Diff line number Diff line /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mozilla.fenix.home.sessioncontrol.viewholders import android.view.View import androidx.recyclerview.widget.RecyclerView import kotlinx.android.synthetic.main.tor_feedback_survey.view.* import org.mozilla.fenix.R import org.mozilla.fenix.home.sessioncontrol.TabSessionInteractor class TorFeedbackSurveyViewHolder( view: View, private val interactor: TabSessionInteractor ) : RecyclerView.ViewHolder(view) { init { // val resources = view.resources // val appName = resources.getString(R.string.app_name) // view.private_session_description.text = resources.getString( // R.string.private_browsing_placeholder_description_2, appName // ) with(view.feedback_survey_launch_button) { setOnClickListener { interactor.onTorFeedbackSurveyLaunchClicked() } } } companion object { const val LAYOUT_ID = R.layout.tor_feedback_survey } }