Skip to content

Commit 8cd7a41

Browse files
authored
Post visual update: Update the omnibar focused style (#6578)
Task/Issue URL: https://app.asana.com/1/137249556945/task/1210832711755376?focus=true ### Description This PR removes the blue outline for the focused state of the omnibar. ### Steps to test this PR - [x] Tap on the address bar to give it focus - [x] Verify the blue outline is not displayed --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1210832711755376
1 parent 549d05e commit 8cd7a41

File tree

4 files changed

+5
-27
lines changed

4 files changed

+5
-27
lines changed

app/src/main/java/com/duckduckgo/app/browser/omnibar/SingleOmnibarLayout.kt

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import android.util.AttributeSet
2323
import android.view.View
2424
import android.view.ViewGroup
2525
import android.view.ViewTreeObserver.OnGlobalLayoutListener
26-
import android.view.animation.DecelerateInterpolator
2726
import android.widget.ImageView
2827
import androidx.core.content.ContextCompat
2928
import androidx.core.view.isGone
@@ -43,6 +42,7 @@ import com.duckduckgo.di.scopes.FragmentScope
4342
import com.duckduckgo.mobile.android.R as CommonR
4443
import com.duckduckgo.navigation.api.GlobalActivityStarter
4544
import com.google.android.material.card.MaterialCardView
45+
import com.google.android.material.color.MaterialColors.*
4646
import dagger.android.support.AndroidSupportInjection
4747
import javax.inject.Inject
4848

@@ -55,7 +55,6 @@ class SingleOmnibarLayout @JvmOverloads constructor(
5555
@Inject
5656
lateinit var globalActivityStarter: GlobalActivityStarter
5757

58-
private val omnibarCard: MaterialCardView by lazy { findViewById(R.id.omniBarContainer) }
5958
private val omnibarCardShadow: MaterialCardView by lazy { findViewById(R.id.omniBarContainerShadow) }
6059
private val iconsContainer: View by lazy { findViewById(R.id.iconsContainer) }
6160
private val shieldIconPulseAnimationContainer: View by lazy { findViewById(R.id.shieldIconPulseAnimationContainer) }
@@ -185,28 +184,7 @@ class SingleOmnibarLayout @JvmOverloads constructor(
185184
}
186185

187186
private fun animateOmnibarFocusedState(focused: Boolean) {
188-
focusAnimator?.cancel()
189-
190-
val startCardStrokeWidth = omnibarCard.strokeWidth
191-
val endCardStrokeWidth: Int = if (focused) {
192-
omnibarOutlineFocusedWidth
193-
} else {
194-
omnibarOutlineWidth
195-
}
196-
197-
val animator = ValueAnimator.ofFloat(0f, 1f)
198-
animator.duration = DEFAULT_ANIMATION_DURATION
199-
animator.interpolator = DecelerateInterpolator()
200-
animator.addUpdateListener { valueAnimator ->
201-
val fraction = valueAnimator.animatedValue as Float
202-
203-
val animatedCardStrokeWidth = (startCardStrokeWidth + (endCardStrokeWidth - startCardStrokeWidth) * fraction).toInt()
204-
205-
omnibarCard.strokeWidth = animatedCardStrokeWidth
206-
}
207-
208-
animator.start()
209-
focusAnimator = animator
187+
// temporarily disable focus animation
210188
}
211189

212190
private fun onFindInPageShown() {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
android:layout_width="match_parent"
6767
android:layout_height="match_parent"
6868
app:cardElevation="0dp"
69-
app:strokeColor="?daxColorAccentBlue"
70-
app:strokeWidth="@dimen/omnibarOutlineWidth">
69+
app:strokeWidth="0dp">
7170

7271
<androidx.constraintlayout.widget.ConstraintLayout
7372
android:id="@+id/omniBarContentContainer"

common/common-ui/src/main/java/com/duckduckgo/common/ui/view/ViewExtension.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,5 @@ fun View.addBottomShadow(
300300

301301
clipToOutline = false
302302
elevation = shadowSize
303+
setAllParentsClip(false)
303304
}

common/common-ui/src/main/res/values/design-system-colors.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
<color name="lines_light">#171F1F1F</color>
319319

320320
<!-- Tone -->
321-
<color name="shade_light">#2E1F1F1F</color>
321+
<color name="shade_light">#8E1F1F1F</color>
322322

323323
<!-- Controls -->
324324
<color name="controls_fill_primary_light">#171F1F1F</color>

0 commit comments

Comments
 (0)