Skip to content

Commit eb90bb8

Browse files
committed
Revert "Post visual update: Center NTP logo (#6700)"
This reverts commit 549d05e.
1 parent c550cd2 commit eb90bb8

File tree

6 files changed

+13
-55
lines changed

6 files changed

+13
-55
lines changed

app/src/main/java/com/duckduckgo/app/browser/HomeBackgroundLogo.kt

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,16 @@ package com.duckduckgo.app.browser
1818

1919
import android.view.View
2020
import android.view.animation.AccelerateInterpolator
21-
import com.duckduckgo.app.browser.omnibar.model.OmnibarPosition
2221
import com.duckduckgo.common.ui.view.gone
2322
import com.duckduckgo.common.ui.view.show
2423
import logcat.LogPriority.VERBOSE
2524
import logcat.logcat
2625

27-
class HomeBackgroundLogo(
28-
private val ddgLogoView: View,
29-
) {
26+
class HomeBackgroundLogo(private var ddgLogoView: View) {
3027

3128
private var readyToShowLogo = false
3229

33-
fun showLogo(omnibarPosition: OmnibarPosition) {
34-
updateLogoConstraint(omnibarPosition)
30+
fun showLogo() {
3531
this.readyToShowLogo = true
3632
update()
3733
}
@@ -65,21 +61,6 @@ class HomeBackgroundLogo(
6561
ddgLogoView.gone()
6662
}
6763

68-
private fun updateLogoConstraint(omnibarPosition: OmnibarPosition) {
69-
val params = ddgLogoView.layoutParams as? androidx.constraintlayout.widget.ConstraintLayout.LayoutParams ?: return
70-
when (omnibarPosition) {
71-
OmnibarPosition.TOP -> {
72-
params.topToTop = R.id.guidelineTop
73-
params.topToBottom = androidx.constraintlayout.widget.ConstraintLayout.LayoutParams.UNSET
74-
}
75-
OmnibarPosition.BOTTOM -> {
76-
params.topToTop = R.id.guidelineBottom
77-
params.topToBottom = androidx.constraintlayout.widget.ConstraintLayout.LayoutParams.UNSET
78-
}
79-
}
80-
ddgLogoView.layoutParams = params
81-
}
82-
8364
companion object {
8465
private const val FADE_IN_DURATION = 50L
8566
}

app/src/main/java/com/duckduckgo/app/browser/newtab/NewTabLegacyPageView.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import com.duckduckgo.app.browser.newtab.NewTabLegacyPageViewModel.ViewState
4747
import com.duckduckgo.app.browser.remotemessage.SharePromoLinkRMFBroadCastReceiver
4848
import com.duckduckgo.app.browser.remotemessage.asMessage
4949
import com.duckduckgo.app.global.view.launchDefaultAppActivity
50-
import com.duckduckgo.app.settings.db.SettingsDataStore
5150
import com.duckduckgo.app.statistics.pixels.Pixel
5251
import com.duckduckgo.app.tabs.BrowserNav
5352
import com.duckduckgo.common.ui.store.AppTheme
@@ -97,9 +96,6 @@ class NewTabLegacyPageView @JvmOverloads constructor(
9796
@Inject
9897
lateinit var dispatchers: DispatcherProvider
9998

100-
@Inject
101-
lateinit var settingsDataStore: SettingsDataStore
102-
10399
private val binding: ViewNewTabLegacyBinding by viewBinding()
104100

105101
private val homeBackgroundLogo by lazy { HomeBackgroundLogo(binding.ddgLogo) }
@@ -144,7 +140,7 @@ class NewTabLegacyPageView @JvmOverloads constructor(
144140
onHasContent?.invoke(viewState.hasContent)
145141

146142
if (viewState.shouldShowLogo) {
147-
homeBackgroundLogo.showLogo(settingsDataStore.omnibarPosition)
143+
homeBackgroundLogo.showLogo()
148144
} else {
149145
homeBackgroundLogo.hideLogo()
150146
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@
5252

5353
<androidx.core.widget.NestedScrollView
5454
android:id="@+id/newTabContainerScrollView"
55-
android:fillViewport="true"
5655
android:layout_width="match_parent"
5756
android:layout_height="match_parent">
5857

5958
<FrameLayout
6059
android:id="@+id/newTabContainerLayout"
6160
android:layout_width="match_parent"
62-
android:layout_height="match_parent" />
61+
android:layout_height="match_parent"
62+
app:layout_constraintBottom_toBottomOf="parent"
63+
app:layout_constraintEnd_toEndOf="parent"
64+
app:layout_constraintStart_toStartOf="parent" />
6365

6466
</androidx.core.widget.NestedScrollView>
6567

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

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,36 +33,22 @@
3333
android:layout_height="wrap_content"/>
3434

3535
<androidx.constraintlayout.widget.ConstraintLayout
36-
android:id="@+id/ddgLogoContainer"
3736
android:layout_width="match_parent"
38-
android:layout_height="match_parent">
39-
40-
<androidx.constraintlayout.widget.Guideline
41-
android:id="@+id/guidelineTop"
42-
android:layout_width="wrap_content"
43-
android:layout_height="wrap_content"
44-
android:orientation="horizontal"
45-
app:layout_constraintGuide_percent="0.365" />
46-
47-
<androidx.constraintlayout.widget.Guideline
48-
android:id="@+id/guidelineBottom"
49-
android:layout_width="wrap_content"
50-
android:layout_height="wrap_content"
51-
android:orientation="horizontal"
52-
app:layout_constraintGuide_percent="0.44" />
37+
android:layout_height="wrap_content">
5338

5439
<ImageView
5540
android:id="@+id/ddgLogo"
5641
android:layout_height="wrap_content"
5742
android:layout_width="@dimen/ntpDaxLogoIconWidth"
43+
android:layout_marginTop="@dimen/homeTabDdgLogoTopMargin"
5844
android:adjustViewBounds="true"
5945
android:alpha="0"
6046
android:contentDescription="@string/duckDuckGoLogoDescription"
6147
android:maxWidth="180dp"
6248
android:maxHeight="180dp"
6349
app:srcCompat="@drawable/logo_full"
6450
android:visibility="gone"
65-
app:layout_constraintTop_toTopOf="@id/guidelineTop"
51+
app:layout_constraintTop_toTopOf="parent"
6652
app:layout_constraintStart_toStartOf="parent"
6753
app:layout_constraintEnd_toEndOf="parent" />
6854

duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/inputscreen/ui/InputScreenFragment.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import android.view.View
2323
import androidx.activity.OnBackPressedCallback
2424
import androidx.core.view.isInvisible
2525
import androidx.core.view.isVisible
26-
import androidx.core.view.postDelayed
2726
import androidx.lifecycle.ViewModelProvider
2827
import androidx.lifecycle.lifecycleScope
2928
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
@@ -127,7 +126,7 @@ class InputScreenFragment : DuckDuckGoFragment(R.layout.fragment_input_screen) {
127126
binding.actionSend.setOnClickListener {
128127
binding.inputModeWidget.submitMessage()
129128
}
130-
binding.inputModeWidget.inputField.postDelayed(300) {
129+
binding.inputModeWidget.inputField.post {
131130
showKeyboard(binding.inputModeWidget.inputField)
132131
}
133132
binding.actionNewLine.setOnClickListener {

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,17 @@
3131
app:layout_constraintStart_toStartOf="parent"
3232
app:layout_constraintTop_toTopOf="parent" />
3333

34-
<androidx.constraintlayout.widget.Guideline
35-
android:id="@+id/guidelineTop"
36-
android:layout_width="wrap_content"
37-
android:layout_height="wrap_content"
38-
android:orientation="horizontal"
39-
app:layout_constraintGuide_percent="0.465" />
40-
4134
<ImageView
4235
android:id="@+id/ddgLogo"
4336
android:layout_width="@dimen/ntpDaxLogoIconWidth"
4437
android:layout_height="wrap_content"
38+
android:layout_marginTop="@dimen/homeTabDdgLogoTopMargin"
4539
android:adjustViewBounds="true"
4640
android:maxWidth="180dp"
4741
android:maxHeight="180dp"
4842
app:layout_constraintEnd_toEndOf="parent"
4943
app:layout_constraintStart_toStartOf="parent"
50-
app:layout_constraintTop_toTopOf="@id/guidelineTop"
44+
app:layout_constraintTop_toBottomOf="@id/inputModeWidget"
5145
app:srcCompat="@drawable/logo_full" />
5246

5347
<androidx.viewpager2.widget.ViewPager2

0 commit comments

Comments
 (0)