Matthew Finkel pushed to branch tor-browser-86.0.0b2-10.5-1 at The Tor Project / Applications / fenix
Commits:
-
4cda0a0b
by Matthew Finkel at 2021-02-11T16:31:48+00:00
11 changed files:
- app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlAdapter.kt
- app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlController.kt
- app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlInteractor.kt
- app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlView.kt
- + app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorFeedbackSurveyViewHolder.kt
- app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt
- + app/src/main/res/drawable/feedback_survey_padded_background.xml
- + app/src/main/res/drawable/tor_survey_icon_3x.png
- app/src/main/res/layout/fragment_home.xml
- + app/src/main/res/layout/tor_feedback_survey.xml
- app/src/main/res/values/colors.xml
Changes:
... | ... | @@ -23,6 +23,7 @@ import org.mozilla.fenix.home.sessioncontrol.viewholders.CollectionViewHolder |
23 | 23 |
import org.mozilla.fenix.home.sessioncontrol.viewholders.NoCollectionsMessageViewHolder
|
24 | 24 |
import org.mozilla.fenix.home.sessioncontrol.viewholders.PrivateBrowsingDescriptionViewHolder
|
25 | 25 |
import org.mozilla.fenix.home.sessioncontrol.viewholders.TorBootstrapPagerViewHolder
|
26 |
+import org.mozilla.fenix.home.sessioncontrol.viewholders.TorFeedbackSurveyViewHolder
|
|
26 | 27 |
import org.mozilla.fenix.home.sessioncontrol.viewholders.TabInCollectionViewHolder
|
27 | 28 |
import org.mozilla.fenix.home.sessioncontrol.viewholders.TopSitePagerViewHolder
|
28 | 29 |
import org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding.OnboardingAutomaticSignInViewHolder
|
... | ... | @@ -80,6 +81,7 @@ sealed class AdapterItem(@LayoutRes val viewType: Int) { |
80 | 81 |
}
|
81 | 82 |
|
82 | 83 |
object PrivateBrowsingDescription : AdapterItem(PrivateBrowsingDescriptionViewHolder.LAYOUT_ID)
|
84 |
+ object TorFeedbackSurvey : AdapterItem(TorFeedbackSurveyViewHolder.LAYOUT_ID)
|
|
83 | 85 |
object NoCollectionsMessage : AdapterItem(NoCollectionsMessageViewHolder.LAYOUT_ID)
|
84 | 86 |
|
85 | 87 |
object TorBootstrap : AdapterItem(TorBootstrapPagerViewHolder.LAYOUT_ID)
|
... | ... | @@ -179,6 +181,10 @@ class SessionControlAdapter( |
179 | 181 |
view,
|
180 | 182 |
interactor
|
181 | 183 |
)
|
184 |
+ TorFeedbackSurveyViewHolder.LAYOUT_ID -> TorFeedbackSurveyViewHolder(
|
|
185 |
+ view,
|
|
186 |
+ interactor
|
|
187 |
+ )
|
|
182 | 188 |
TorBootstrapPagerViewHolder.LAYOUT_ID -> TorBootstrapPagerViewHolder(
|
183 | 189 |
view,
|
184 | 190 |
components,
|
... | ... | @@ -90,6 +90,11 @@ interface SessionControlController { |
90 | 90 |
*/
|
91 | 91 |
fun handlePrivateBrowsingLearnMoreClicked()
|
92 | 92 |
|
93 |
+ /**
|
|
94 |
+ * @see [TabSessionInteractor.onTorFeedbackSurveyLaunchClicked]
|
|
95 |
+ */
|
|
96 |
+ fun handleTorFeedbackSurveyLaunchClicked()
|
|
97 |
+ |
|
93 | 98 |
/**
|
94 | 99 |
* @see [TopSiteInteractor.onRenameTopSiteClicked]
|
95 | 100 |
*/
|
... | ... | @@ -593,4 +598,12 @@ class DefaultSessionControlController( |
593 | 598 |
override fun handleTorNetworkSettingsClicked() {
|
594 | 599 |
openTorNetworkSettings()
|
595 | 600 |
}
|
601 |
+ |
|
602 |
+ override fun handleTorFeedbackSurveyLaunchClicked() {
|
|
603 |
+ activity.openToBrowserAndLoad(
|
|
604 |
+ searchTermOrURL = SupportUtils.TOR_FEEDBACK_SURVEY_URL,
|
|
605 |
+ newTab = true,
|
|
606 |
+ from = BrowserDirection.FromHome
|
|
607 |
+ )
|
|
608 |
+ }
|
|
596 | 609 |
}
|
... | ... | @@ -18,6 +18,12 @@ interface TabSessionInteractor { |
18 | 18 |
* "Common myths about private browsing" link in private mode.
|
19 | 19 |
*/
|
20 | 20 |
fun onPrivateBrowsingLearnMoreClicked()
|
21 |
+ |
|
22 |
+ /**
|
|
23 |
+ * Shows the Feedback Survey web page in a new tab. Called when a user clicks on the
|
|
24 |
+ * "Launch the Survey" button.
|
|
25 |
+ */
|
|
26 |
+ fun onTorFeedbackSurveyLaunchClicked()
|
|
21 | 27 |
}
|
22 | 28 |
|
23 | 29 |
/**
|
... | ... | @@ -361,4 +367,8 @@ class SessionControlInteractor( |
361 | 367 |
override fun onTorBootstrapNetworkSettingsClicked() {
|
362 | 368 |
controller.handleTorNetworkSettingsClicked()
|
363 | 369 |
}
|
370 |
+ |
|
371 |
+ override fun onTorFeedbackSurveyLaunchClicked() {
|
|
372 |
+ controller.handleTorFeedbackSurveyLaunchClicked()
|
|
373 |
+ }
|
|
364 | 374 |
}
|
... | ... | @@ -66,7 +66,7 @@ private fun showCollections( |
66 | 66 |
}
|
67 | 67 |
}
|
68 | 68 |
|
69 |
-private fun privateModeAdapterItems() = listOf(AdapterItem.PrivateBrowsingDescription)
|
|
69 |
+private fun privateModeAdapterItems() = listOf(AdapterItem.TorFeedbackSurvey)
|
|
70 | 70 |
|
71 | 71 |
private fun bootstrapAdapterItems() = listOf(AdapterItem.TorBootstrap)
|
72 | 72 |
|
1 |
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
4 |
+ |
|
5 |
+package org.mozilla.fenix.home.sessioncontrol.viewholders
|
|
6 |
+ |
|
7 |
+import android.view.View
|
|
8 |
+import androidx.recyclerview.widget.RecyclerView
|
|
9 |
+import kotlinx.android.synthetic.main.tor_feedback_survey.view.*
|
|
10 |
+import org.mozilla.fenix.R
|
|
11 |
+import org.mozilla.fenix.home.sessioncontrol.TabSessionInteractor
|
|
12 |
+ |
|
13 |
+class TorFeedbackSurveyViewHolder(
|
|
14 |
+ view: View,
|
|
15 |
+ private val interactor: TabSessionInteractor
|
|
16 |
+) : RecyclerView.ViewHolder(view) {
|
|
17 |
+ |
|
18 |
+ init {
|
|
19 |
+ // val resources = view.resources
|
|
20 |
+ // val appName = resources.getString(R.string.app_name)
|
|
21 |
+ // view.private_session_description.text = resources.getString(
|
|
22 |
+ // R.string.private_browsing_placeholder_description_2, appName
|
|
23 |
+ // )
|
|
24 |
+ with(view.feedback_survey_launch_button) {
|
|
25 |
+ setOnClickListener {
|
|
26 |
+ interactor.onTorFeedbackSurveyLaunchClicked()
|
|
27 |
+ }
|
|
28 |
+ }
|
|
29 |
+ }
|
|
30 |
+ |
|
31 |
+ companion object {
|
|
32 |
+ const val LAYOUT_ID = R.layout.tor_feedback_survey
|
|
33 |
+ }
|
|
34 |
+}
|
... | ... | @@ -37,6 +37,7 @@ object SupportUtils { |
37 | 37 |
const val DONATE_URL = "https://donate.torproject.org/"
|
38 | 38 |
const val TB_MANUAL_URL = "https://tb-manual.torproject.org/mobile-tor"
|
39 | 39 |
const val TOR_RELEASES = "https://www.torproject.org/releases/"
|
40 |
+ const val TOR_FEEDBACK_SURVEY_URL = "https://survey.torproject.org/index.php/217469"
|
|
40 | 41 |
|
41 | 42 |
enum class SumoTopic(internal val topicStr: String) {
|
42 | 43 |
FENIX_MOVING("sync-delist"),
|
1 |
+<?xml version="1.0" encoding="utf-8"?><!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
2 |
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3 |
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
4 |
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
|
5 |
+ android:color="@color/feedback_survey_padded_background_color">
|
|
6 |
+ <item
|
|
7 |
+ android:bottom="6dp"
|
|
8 |
+ android:top="6dp">
|
|
9 |
+ <shape android:shape="rectangle">
|
|
10 |
+ <corners android:radius="4dp" />
|
|
11 |
+ </shape>
|
|
12 |
+ </item>
|
|
13 |
+</ripple>
|
No preview for this file type
... | ... | @@ -94,7 +94,8 @@ |
94 | 94 |
android:textColor="#DEFFFFFF"
|
95 | 95 |
android:textSize="40sp"
|
96 | 96 |
android:lineSpacingMultiplier="1.1"
|
97 |
- app:layout_scrollFlags="scroll" />
|
|
97 |
+ app:layout_scrollFlags="scroll"
|
|
98 |
+ android:visibility="gone" />
|
|
98 | 99 |
|
99 | 100 |
</com.google.android.material.appbar.AppBarLayout>
|
100 | 101 |
|
1 |
+<?xml version="1.0" encoding="utf-8"?>
|
|
2 |
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
3 |
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4 |
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
5 |
+<androidx.constraintlayout.widget.ConstraintLayout
|
|
6 |
+ xmlns:android="http://schemas.android.com/apk/res/android"
|
|
7 |
+ xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
8 |
+ android:id="@+id/feedback_survey_wrapper"
|
|
9 |
+ style="@style/OnboardingCardLightWithPadding"
|
|
10 |
+ android:layout_width="match_parent"
|
|
11 |
+ android:layout_height="wrap_content"
|
|
12 |
+ android:clipChildren="false"
|
|
13 |
+ android:clipToPadding="false">
|
|
14 |
+ |
|
15 |
+ <LinearLayout
|
|
16 |
+ android:id="@+id/feedback_survey_header_wrapper"
|
|
17 |
+ android:layout_width="match_parent"
|
|
18 |
+ android:layout_height="wrap_content"
|
|
19 |
+ app:layout_constraintStart_toStartOf="parent"
|
|
20 |
+ app:layout_constraintTop_toTopOf="parent"
|
|
21 |
+ android:importantForAccessibility="no">
|
|
22 |
+ |
|
23 |
+ <ImageView
|
|
24 |
+ android:id="@+id/tor_feedback_icon"
|
|
25 |
+ android:layout_width="wrap_content"
|
|
26 |
+ android:layout_height="32dp"
|
|
27 |
+ android:layout_marginEnd="10dp"
|
|
28 |
+ android:adjustViewBounds="true"
|
|
29 |
+ android:clickable="false"
|
|
30 |
+ android:focusable="false"
|
|
31 |
+ android:importantForAccessibility="no"
|
|
32 |
+ app:srcCompat="@drawable/tor_survey_icon_3x"/>
|
|
33 |
+ |
|
34 |
+ <TextView
|
|
35 |
+ android:id="@+id/feedback_survey_header"
|
|
36 |
+ android:layout_width="match_parent"
|
|
37 |
+ android:layout_height="wrap_content"
|
|
38 |
+ android:ellipsize="none"
|
|
39 |
+ android:lineSpacingExtra="6dp"
|
|
40 |
+ android:paddingHorizontal="4dp"
|
|
41 |
+ android:paddingTop="4dp"
|
|
42 |
+ android:scrollHorizontally="false"
|
|
43 |
+ android:textAlignment="viewStart"
|
|
44 |
+ android:textColor="?primaryText"
|
|
45 |
+ android:textSize="20sp"
|
|
46 |
+ android:text="We’d love your feedback" />
|
|
47 |
+ </LinearLayout>
|
|
48 |
+ |
|
49 |
+ <TextView
|
|
50 |
+ android:id="@+id/feedback_survey_description"
|
|
51 |
+ android:layout_width="match_parent"
|
|
52 |
+ android:layout_height="wrap_content"
|
|
53 |
+ android:ellipsize="none"
|
|
54 |
+ android:lineSpacingExtra="6dp"
|
|
55 |
+ android:paddingHorizontal="4dp"
|
|
56 |
+ android:paddingTop="4dp"
|
|
57 |
+ app:layout_constraintEnd_toEndOf="parent"
|
|
58 |
+ app:layout_constraintStart_toStartOf="parent"
|
|
59 |
+ app:layout_constraintTop_toBottomOf="@id/feedback_survey_header_wrapper"
|
|
60 |
+ android:scrollHorizontally="false"
|
|
61 |
+ android:textAlignment="viewStart"
|
|
62 |
+ android:textColor="?primaryText"
|
|
63 |
+ android:textSize="16sp"
|
|
64 |
+ android:text="We put our users at the center of our development process. You can help us improve Tor Browser by completing this short survey about your experience:" />
|
|
65 |
+ |
|
66 |
+ <Button
|
|
67 |
+ style="@style/PositiveButton"
|
|
68 |
+ android:id="@+id/feedback_survey_launch_button"
|
|
69 |
+ android:text="Launch the Survey"
|
|
70 |
+ android:layout_marginTop="16dp"
|
|
71 |
+ android:textSize="18dp"
|
|
72 |
+ android:textColor="@android:color/black"
|
|
73 |
+ android:background="@drawable/feedback_survey_padded_background"
|
|
74 |
+ android:fontFamily="Roboto-Medium"
|
|
75 |
+ app:layout_constraintEnd_toEndOf="parent"
|
|
76 |
+ app:layout_constraintStart_toStartOf="parent"
|
|
77 |
+ app:layout_constraintTop_toBottomOf="@id/feedback_survey_description" />
|
|
78 |
+ |
|
79 |
+</androidx.constraintlayout.widget.ConstraintLayout>
|
... | ... | @@ -419,4 +419,7 @@ |
419 | 419 |
<!-- Tab Counter colors -->
|
420 | 420 |
<color name="mozac_ui_tabcounter_default_tint">@color/primary_text_light_theme</color>
|
421 | 421 |
<color name="mozac_ui_tabcounter_default_text">@color/primary_text_light_theme</color>
|
422 |
+ |
|
423 |
+ <!-- Tor -->
|
|
424 |
+ <color name="feedback_survey_padded_background_color">#A76FFA</color>
|
|
422 | 425 |
</resources>
|