Skip to content

Commit c9bcba8

Browse files
authored
updated system search activity to match the current designs (#1166)
* updated system search activity to match the current designs * cleaning up old reference
1 parent 1f64dfc commit c9bcba8

File tree

3 files changed

+99
-78
lines changed

3 files changed

+99
-78
lines changed

app/src/main/java/com/duckduckgo/app/systemsearch/SystemSearchActivity.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ import com.duckduckgo.app.pixels.AppPixelName
4343
import com.duckduckgo.app.systemsearch.SystemSearchViewModel.Command.*
4444
import com.duckduckgo.app.systemsearch.SystemSearchViewModel.SystemSearchResultsViewState
4545
import kotlinx.android.synthetic.main.activity_system_search.*
46+
import kotlinx.android.synthetic.main.activity_system_search.appBarLayout
47+
import kotlinx.android.synthetic.main.activity_system_search.autocompleteSuggestions
48+
import kotlinx.android.synthetic.main.activity_system_search.clearTextButton
49+
import kotlinx.android.synthetic.main.activity_system_search.deviceAppSuggestions
50+
import kotlinx.android.synthetic.main.activity_system_search.deviceLabel
51+
import kotlinx.android.synthetic.main.activity_system_search.logo
52+
import kotlinx.android.synthetic.main.activity_system_search.omnibarTextInput
53+
import kotlinx.android.synthetic.main.activity_system_search.results
54+
import kotlinx.android.synthetic.main.activity_system_search.resultsContent
4655
import kotlinx.android.synthetic.main.include_system_search_onboarding.*
4756
import javax.inject.Inject
4857

@@ -165,10 +174,10 @@ class SystemSearchActivity : DuckDuckGoActivity() {
165174
private fun updateScroll() {
166175
val scrollable = resultsContent.height > (results.height - results.paddingTop - results.paddingBottom)
167176
if (scrollable) {
168-
omnibarScrolling.enableOmnibarScrolling(toolbar)
177+
omnibarScrolling.enableOmnibarScrolling(toolbarContainer)
169178
} else {
170179
showOmnibar()
171-
omnibarScrolling.disableOmnibarScrolling(toolbar)
180+
omnibarScrolling.disableOmnibarScrolling(toolbarContainer)
172181
}
173182
}
174183

app/src/main/res/layout/activity_system_search.xml

Lines changed: 88 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -25,84 +25,96 @@
2525
android:id="@+id/appBarLayout"
2626
android:layout_width="match_parent"
2727
android:layout_height="?attr/actionBarSize"
28-
android:fitsSystemWindows="true"
2928
android:theme="@style/AppTheme.Dark.AppBarOverlay">
3029

31-
<androidx.appcompat.widget.Toolbar
32-
android:id="@+id/toolbar"
30+
<androidx.constraintlayout.widget.ConstraintLayout
31+
android:id="@+id/toolbarContainer"
3332
android:layout_width="match_parent"
34-
android:layout_height="?attr/actionBarSize"
35-
android:background="?attr/colorPrimary"
36-
android:theme="@style/OmnibarToolbarTheme"
37-
app:contentInsetEnd="0dp"
38-
app:contentInsetStart="0dp"
39-
app:layout_scrollFlags="scroll|enterAlways"
40-
app:popupTheme="@style/AppTheme.Dark.PopupOverlay">
41-
42-
<androidx.constraintlayout.widget.ConstraintLayout
43-
android:id="@+id/omniBarContainer"
33+
android:layout_height="match_parent"
34+
android:background="?toolbarBgColor">
35+
36+
<androidx.appcompat.widget.Toolbar
37+
android:id="@+id/toolbar"
4438
android:layout_width="match_parent"
45-
android:layout_height="match_parent"
46-
android:layout_marginStart="16dp"
47-
android:layout_marginTop="8dp"
48-
android:layout_marginEnd="16dp"
49-
android:layout_marginBottom="8dp">
50-
51-
<ImageView
52-
android:id="@+id/logo"
53-
android:layout_width="30dp"
54-
android:layout_height="30dp"
55-
android:importantForAccessibility="no"
56-
android:src="@drawable/logo_mini"
57-
app:layout_constraintBottom_toBottomOf="parent"
58-
app:layout_constraintStart_toStartOf="parent"
59-
app:layout_constraintTop_toTopOf="parent" />
60-
61-
<androidx.appcompat.widget.AppCompatEditText
62-
android:id="@+id/omnibarTextInput"
63-
style="@style/Base.V7.Widget.AppCompat.EditText"
64-
android:layout_width="0dp"
65-
android:layout_height="0dp"
66-
android:layout_marginStart="16dp"
67-
android:layout_marginEnd="16dp"
68-
android:background="@android:color/transparent"
69-
android:fontFamily="sans-serif-medium"
70-
android:hint="@string/systemSearchOmnibarInputHint"
71-
android:imeOptions="flagNoExtractUi|actionGo|flagNoPersonalizedLearning"
72-
android:inputType="textUri|textNoSuggestions"
73-
android:maxLines="1"
74-
android:selectAllOnFocus="true"
75-
android:textColor="?attr/omnibarTextColor"
76-
android:textColorHint="?attr/omnibarHintColor"
77-
android:textCursorDrawable="@drawable/text_cursor"
78-
android:textSize="16sp"
79-
android:textStyle="normal"
80-
app:layout_constraintBottom_toBottomOf="parent"
81-
app:layout_constraintEnd_toStartOf="@id/clearTextButton"
82-
app:layout_constraintStart_toEndOf="@id/logo"
83-
app:layout_constraintTop_toTopOf="parent"
84-
tools:text="https://duckduckgo.com/?q=areallylongexampleexample">
85-
86-
<requestFocus />
87-
88-
</androidx.appcompat.widget.AppCompatEditText>
89-
90-
<ImageView
91-
android:id="@+id/clearTextButton"
92-
android:layout_width="wrap_content"
93-
android:layout_height="wrap_content"
94-
android:background="?selectableItemBackground"
95-
android:contentDescription="@string/clearButtonContentDescription"
96-
android:padding="3dp"
97-
android:src="@drawable/ic_close_24dp"
98-
app:layout_constraintBottom_toBottomOf="parent"
99-
app:layout_constraintEnd_toEndOf="parent"
100-
app:layout_constraintTop_toTopOf="parent"
101-
tools:visibility="visible" />
102-
103-
</androidx.constraintlayout.widget.ConstraintLayout>
104-
105-
</androidx.appcompat.widget.Toolbar>
39+
android:layout_height="?attr/actionBarSize"
40+
android:background="?attr/toolbarBgColor"
41+
app:contentInsetEnd="0dp"
42+
app:contentInsetStart="0dp"
43+
app:layout_constraintBottom_toBottomOf="parent"
44+
app:layout_constraintEnd_toStartOf="parent"
45+
app:layout_constraintStart_toStartOf="parent"
46+
app:layout_constraintTop_toTopOf="parent"
47+
app:layout_scrollFlags="scroll|enterAlways"
48+
app:popupTheme="@style/AppTheme.Dark.PopupOverlay">
49+
50+
<androidx.constraintlayout.widget.ConstraintLayout
51+
android:id="@+id/omniBarContainer"
52+
android:layout_width="match_parent"
53+
android:layout_height="match_parent"
54+
android:layout_margin="8dp"
55+
android:background="@drawable/omnibar_field_background"
56+
android:paddingStart="6dp"
57+
android:paddingEnd="6dp">
58+
59+
<ImageView
60+
android:id="@+id/logo"
61+
android:layout_width="wrap_content"
62+
android:layout_height="wrap_content"
63+
android:importantForAccessibility="no"
64+
android:src="@drawable/ic_ddg_logo"
65+
android:padding="4dp"
66+
app:layout_constraintBottom_toBottomOf="parent"
67+
app:layout_constraintStart_toStartOf="parent"
68+
app:layout_constraintTop_toTopOf="parent" />
69+
70+
<androidx.appcompat.widget.AppCompatEditText
71+
android:id="@+id/omnibarTextInput"
72+
style="@style/Base.V7.Widget.AppCompat.EditText"
73+
android:layout_width="0dp"
74+
android:layout_height="0dp"
75+
android:layout_marginStart="8dp"
76+
android:background="@null"
77+
android:fontFamily="sans-serif"
78+
android:hint="@string/systemSearchOmnibarInputHint"
79+
android:imeOptions="flagNoExtractUi|actionGo|flagNoPersonalizedLearning"
80+
android:inputType="textUri|textNoSuggestions"
81+
android:maxLines="1"
82+
android:selectAllOnFocus="true"
83+
android:textColor="?attr/omnibarTextColor"
84+
android:textColorHint="?attr/omnibarHintColor"
85+
android:textCursorDrawable="@drawable/text_cursor"
86+
android:textSize="16sp"
87+
android:textStyle="normal"
88+
app:layout_constraintBottom_toBottomOf="parent"
89+
app:layout_constraintEnd_toStartOf="@id/clearTextButton"
90+
app:layout_constraintStart_toEndOf="@id/logo"
91+
app:layout_constraintTop_toTopOf="parent"
92+
tools:text="https://duckduckgo.com/?q=areallylongexampleexample">
93+
94+
<requestFocus />
95+
96+
</androidx.appcompat.widget.AppCompatEditText>
97+
98+
<ImageView
99+
android:id="@+id/clearTextButton"
100+
android:layout_width="wrap_content"
101+
android:layout_height="wrap_content"
102+
android:background="?selectableItemBackground"
103+
android:contentDescription="@string/clearButtonContentDescription"
104+
android:padding="3dp"
105+
android:src="@drawable/ic_close"
106+
app:layout_constraintBottom_toBottomOf="parent"
107+
app:layout_constraintEnd_toEndOf="parent"
108+
app:layout_constraintTop_toTopOf="parent"
109+
tools:visibility="visible" />
110+
111+
</androidx.constraintlayout.widget.ConstraintLayout>
112+
113+
114+
</androidx.appcompat.widget.Toolbar>
115+
116+
</androidx.constraintlayout.widget.ConstraintLayout>
117+
106118

107119
</com.google.android.material.appbar.AppBarLayout>
108120

@@ -119,8 +131,9 @@
119131
android:id="@+id/resultsContent"
120132
android:layout_width="match_parent"
121133
android:layout_height="wrap_content"
122-
android:background="?attr/colorPrimary"
123134
android:clipToPadding="false"
135+
android:background="?toolbarBgColor"
136+
android:backgroundTint="?toolbarBgColor"
124137
android:elevation="4dp">
125138

126139
<androidx.recyclerview.widget.RecyclerView

app/src/main/res/layout/include_omnibar_toolbar.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
app:layout_constraintBottom_toBottomOf="@id/omnibarIconContainer"
6666
app:layout_constraintStart_toStartOf="@id/omnibarIconContainer"
6767
app:layout_constraintTop_toTopOf="@id/omnibarIconContainer"
68-
6968
tools:ignore="RtlSymmetry" >
7069
</androidx.constraintlayout.widget.ConstraintLayout>
7170

0 commit comments

Comments
 (0)