Skip to content

Commit

Permalink
ADS: System Search (#2714)
Browse files Browse the repository at this point in the history
  • Loading branch information
malmstein committed Jan 16, 2023
1 parent b12d750 commit 2f5c355
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ class SystemSearchActivity : DuckDuckGoActivity() {
private val textChangeWatcher = object : TextChangedWatcher() {
override fun afterTextChanged(editable: Editable) {
showOmnibar()
val searchQuery = omnibarTextInput.text.toString()
binding.clearTextButton.isVisible = searchQuery.isNotEmpty()
viewModel.userUpdatedQuery(omnibarTextInput.text.toString())
}
}
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/res/layout/activity_system_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,21 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatEditText
<EditText
android:id="@+id/omnibarTextInput"
style="@style/Widget.DuckDuckGo.SearchInput"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="4dp"
android:hint="@string/systemSearchOmnibarInputHint"
android:imeOptions="flagNoExtractUi|actionGo|flagNoPersonalizedLearning"
android:inputType="textUri|textNoSuggestions"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/voiceSearchButton"
app:layout_constraintStart_toEndOf="@id/logo"
app:layout_constraintTop_toTopOf="parent">

<requestFocus />

</androidx.appcompat.widget.AppCompatEditText>
</EditText>

<ImageView
android:id="@+id/voiceSearchButton"
Expand All @@ -103,6 +101,7 @@
android:background="?selectableItemBackground"
android:contentDescription="@string/clearButtonContentDescription"
android:padding="@dimen/toolbarIconPadding"
android:visibility="invisible"
android:src="@drawable/ic_close_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/include_system_search_onboarding.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<com.duckduckgo.mobile.android.ui.view.text.DaxTextView
android:id="@+id/onboardingText"
android:layout_width="0dp"
app:typography="body2"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="6dp"
Expand Down Expand Up @@ -124,6 +125,7 @@
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:drawableStart="@drawable/ic_success"
app:typography="body2"
android:drawablePadding="12dp"
android:text="@string/systemSearchOnboardingFeatureThreeText"/>
</LinearLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ See the License for the specific language governaing permissions and
~ limitations under the License.
-->

Expand Down

0 comments on commit 2f5c355

Please sign in to comment.