Skip to content

Commit 76f6d5b

Browse files
authored
Fix regression to autocomplete top padding (Input Screen) (#6727)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1200204095367872/task/1211224065958257?focus=true ### Description - Fixes an issue where the autocomplete list is clipped and the top padding is too large. - Adds `12dp` top padding/margin to the logo/NTP content to remove the jump on transition. ### Steps to test this PR - [x] Verify that the logo/content transitions smoothly - [x] Verify that the autocomplete list has the correct top padding and doesn’t clip ### UI changes | Before | After | | ------ | ----- | <img width="1080" height="352" alt="Screenshot_20250903_164702" src="https://github.com/user-attachments/assets/e12f623f-c361-423e-97d1-76680775b4d7" />|<img width="1080" height="323" alt="Screenshot_20250903_164744" src="https://github.com/user-attachments/assets/ac7d1926-4b00-412c-929b-b15305c61b4a" /> | Before | After | | ------ | ----- | <img width="1080" height="260" alt="Screenshot_20250903_164430" src="https://github.com/user-attachments/assets/0da3e4e4-ac94-4be3-b0cb-3f645add63fb" />|<img width="1080" height="231" alt="Screenshot_20250903_164418" src="https://github.com/user-attachments/assets/e9abafa7-1dcc-4342-8661-753d6f96fd53" />
1 parent e6ceeb4 commit 76f6d5b

File tree

4 files changed

+63
-67
lines changed

4 files changed

+63
-67
lines changed

duckchat/duckchat-impl/src/main/res/layout/fragment_input_screen.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
android:layout_width="@dimen/ntpDaxLogoIconWidth"
3737
android:layout_height="wrap_content"
3838
android:layout_marginTop="@dimen/homeTabDdgLogoTopMargin"
39+
android:paddingTop="@dimen/inputScreenContentTopOffset"
3940
android:adjustViewBounds="true"
4041
android:maxWidth="180dp"
4142
android:maxHeight="180dp"

duckchat/duckchat-impl/src/main/res/layout/fragment_search_tab.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<androidx.core.widget.NestedScrollView
2626
android:id="@+id/newTabContainerScrollView"
2727
android:layout_width="match_parent"
28-
android:layout_height="match_parent">
28+
android:layout_height="match_parent"
29+
android:layout_marginTop="@dimen/inputScreenContentTopOffset">
2930

3031
<FrameLayout
3132
android:id="@+id/newTabContainerLayout"

duckchat/duckchat-impl/src/main/res/layout/view_input_mode_switch_widget.xml

Lines changed: 59 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
style="@style/Widget.DuckChat.TabLayout.Rounded"
88
android:layout_width="wrap_content"
99
android:layout_height="@dimen/inputModeSwitchHeight"
10-
app:layout_constrainedWidth="true"
11-
app:layout_constraintEnd_toEndOf="parent"
1210
app:layout_constraintStart_toStartOf="parent"
13-
app:layout_constraintTop_toTopOf="parent">
11+
app:layout_constraintEnd_toEndOf="parent"
12+
app:layout_constraintTop_toTopOf="parent"
13+
app:layout_constrainedWidth="true">
1414

1515
<com.google.android.material.tabs.TabItem
1616
android:id="@+id/tabSearch"
1717
android:layout_width="wrap_content"
1818
android:layout_height="wrap_content"
19-
android:layout="@layout/view_search_tab_indicator" />
19+
android:layout="@layout/view_search_tab_indicator"/>
2020

2121
<com.google.android.material.tabs.TabItem
2222
android:id="@+id/tabDuckAi"
2323
android:layout_width="wrap_content"
2424
android:layout_height="wrap_content"
25-
android:layout="@layout/view_chat_tab_indicator" />
25+
android:layout="@layout/view_chat_tab_indicator"/>
2626

2727
</com.duckduckgo.duckchat.impl.inputscreen.ui.view.InputModeTabLayout>
2828

@@ -37,84 +37,77 @@
3737
android:importantForAccessibility="no"
3838
android:padding="@dimen/keyline_2"
3939
android:scaleType="center"
40-
app:layout_constraintBottom_toBottomOf="@id/inputModeSwitch"
40+
app:srcCompat="@drawable/ic_arrow_left_24"
4141
app:layout_constraintStart_toStartOf="parent"
4242
app:layout_constraintTop_toTopOf="@id/inputModeSwitch"
43-
app:srcCompat="@drawable/ic_arrow_left_24" />
43+
app:layout_constraintBottom_toBottomOf="@id/inputModeSwitch"/>
4444

4545
<Space
4646
android:id="@+id/spacer"
4747
android:layout_width="0dp"
4848
android:layout_height="10dp"
49-
app:layout_constraintEnd_toEndOf="parent"
49+
app:layout_constraintTop_toBottomOf="@id/inputModeSwitch"
5050
app:layout_constraintStart_toStartOf="parent"
51-
app:layout_constraintTop_toBottomOf="@id/inputModeSwitch" />
51+
app:layout_constraintEnd_toEndOf="parent"/>
5252

53-
<FrameLayout
53+
<com.google.android.material.card.MaterialCardView
54+
android:id="@+id/inputModeWidgetCard"
55+
style="@style/Widget.DuckDuckGo.OmnibarCardView"
5456
android:layout_width="0dp"
5557
android:layout_height="wrap_content"
56-
android:minHeight="@dimen/toolbarSize"
57-
app:layout_constraintEnd_toEndOf="parent"
58+
android:layout_marginHorizontal="@dimen/omnibarCardMarginHorizontal"
59+
android:layout_marginTop="@dimen/omnibarCardMarginTop"
60+
android:layout_marginBottom="@dimen/omnibarCardMarginBottom"
61+
app:strokeColor="?attr/daxColorAccentBlue"
62+
app:strokeWidth="@dimen/omnibarOutlineWidth"
63+
app:cardElevation="0dp"
64+
app:layout_constraintTop_toBottomOf="@id/spacer"
5865
app:layout_constraintStart_toStartOf="parent"
59-
app:layout_constraintTop_toBottomOf="@id/spacer">
66+
app:layout_constraintEnd_toEndOf="parent">
6067

61-
<com.google.android.material.card.MaterialCardView
62-
android:id="@+id/inputModeWidgetCard"
63-
style="@style/Widget.DuckDuckGo.OmnibarCardView"
68+
<LinearLayout
69+
android:id="@+id/inputModeWidgetCardContent"
6470
android:layout_width="match_parent"
65-
android:layout_height="match_parent"
66-
android:layout_marginHorizontal="@dimen/omnibarCardMarginHorizontal"
67-
android:layout_marginTop="@dimen/omnibarCardMarginTop"
68-
android:layout_marginBottom="@dimen/omnibarCardMarginBottom"
69-
app:cardElevation="0dp"
70-
app:strokeColor="?attr/daxColorAccentBlue"
71-
app:strokeWidth="@dimen/omnibarOutlineWidth">
71+
android:layout_height="wrap_content"
72+
android:orientation="horizontal"
73+
android:padding="@dimen/keyline_0">
7274

73-
<LinearLayout
74-
android:id="@+id/inputModeWidgetCardContent"
75-
android:layout_width="match_parent"
75+
<EditText
76+
android:id="@+id/inputField"
77+
android:layout_width="0dp"
7678
android:layout_height="wrap_content"
77-
android:orientation="horizontal"
78-
android:padding="@dimen/keyline_0">
79-
80-
<EditText
81-
android:id="@+id/inputField"
82-
android:layout_width="0dp"
83-
android:layout_height="wrap_content"
84-
android:layout_gravity="center_vertical"
85-
android:layout_marginStart="@dimen/keyline_4"
86-
android:layout_weight="1"
87-
android:background="@null"
88-
android:fontFamily="sans-serif"
89-
android:gravity="start|top"
90-
android:hint="@string/input_screen_search_hint"
91-
android:lineSpacingMultiplier="1.2"
92-
android:maxLines="1"
93-
android:minHeight="@dimen/toolbarIcon"
94-
android:paddingVertical="@dimen/keyline_2"
95-
android:textColor="?attr/daxColorPrimaryText"
96-
android:textColorHighlight="?attr/daxOmnibarTextColorHighlight"
97-
android:textColorHint="?attr/daxColorSecondaryText"
98-
android:textCursorDrawable="@drawable/text_cursor"
99-
android:textSize="16sp"
100-
android:textStyle="normal" />
101-
102-
<ImageView
103-
android:id="@+id/inputFieldClearText"
104-
android:layout_width="@dimen/toolbarIcon"
105-
android:layout_height="@dimen/toolbarIcon"
106-
android:layout_gravity="top"
107-
android:background="@drawable/selectable_item_experimental_background"
108-
android:gravity="center"
109-
android:importantForAccessibility="no"
110-
android:padding="@dimen/keyline_1"
111-
android:scaleType="centerInside"
112-
android:visibility="gone"
113-
app:srcCompat="@drawable/ic_close_circle_small_secondary_24" />
79+
android:layout_gravity="center_vertical"
80+
android:layout_marginStart="@dimen/keyline_4"
81+
android:layout_weight="1"
82+
android:background="@null"
83+
android:fontFamily="sans-serif"
84+
android:gravity="start|top"
85+
android:hint="@string/input_screen_search_hint"
86+
android:lineSpacingMultiplier="1.2"
87+
android:minHeight="@dimen/toolbarIcon"
88+
android:paddingVertical="@dimen/keyline_2"
89+
android:textColor="?attr/daxColorPrimaryText"
90+
android:textColorHighlight="?attr/daxOmnibarTextColorHighlight"
91+
android:textColorHint="?attr/daxColorSecondaryText"
92+
android:textCursorDrawable="@drawable/text_cursor"
93+
android:textSize="16sp"
94+
android:textStyle="normal"
95+
android:maxLines="1" />
11496

115-
</LinearLayout>
97+
<ImageView
98+
android:id="@+id/inputFieldClearText"
99+
android:layout_width="@dimen/toolbarIcon"
100+
android:layout_height="@dimen/toolbarIcon"
101+
android:layout_gravity="top"
102+
android:background="@drawable/selectable_item_experimental_background"
103+
android:gravity="center"
104+
android:importantForAccessibility="no"
105+
android:padding="@dimen/keyline_1"
106+
android:scaleType="centerInside"
107+
android:visibility="gone"
108+
app:srcCompat="@drawable/ic_close_circle_small_secondary_24" />
116109

117-
</com.google.android.material.card.MaterialCardView>
110+
</LinearLayout>
118111

119-
</FrameLayout>
112+
</com.google.android.material.card.MaterialCardView>
120113
</merge>

duckchat/duckchat-impl/src/main/res/values/dimens.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@
2020
<dimen name="inputModeTabIndicatorHorizontalInset">2dp</dimen>
2121
<dimen name="inputModeTabIndicatorElevation">5dp</dimen>
2222
<dimen name="inputScreenUserPrefToggleSpacing">16dp</dimen>
23+
<dimen name="inputScreenContentTopOffset">12dp</dimen>
2324
</resources>

0 commit comments

Comments
 (0)