[fenix] For https://github.com/mozilla-mobile/fenix/issues/22022 - Composify Customize Home Button and update the background color
parent
f3f8f717f5
commit
2e7f52f63a
@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/home_item_horizontal_margin"
|
||||
android:layout_marginTop="68dp"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
|
||||
<Button
|
||||
android:id="@+id/customize_home"
|
||||
style="@style/NeutralOnboardingButton"
|
||||
android:layout_height="36dp"
|
||||
android:background="@drawable/rounded_button_background"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:text="@string/browser_menu_customize_home_1"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,40 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.fenix.home.sessioncontrol
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import io.mockk.mockk
|
||||
import io.mockk.verify
|
||||
import mozilla.components.support.test.robolectric.testContext
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mozilla.fenix.databinding.CustomizeHomeListItemBinding
|
||||
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
|
||||
import org.mozilla.fenix.home.sessioncontrol.viewholders.CustomizeHomeButtonViewHolder
|
||||
|
||||
@RunWith(FenixRobolectricTestRunner::class)
|
||||
class CustomizeHomeButtonViewHolderTest {
|
||||
|
||||
private lateinit var binding: CustomizeHomeListItemBinding
|
||||
private lateinit var interactor: CustomizeHomeIteractor
|
||||
|
||||
@Before
|
||||
fun setup() {
|
||||
binding = CustomizeHomeListItemBinding.inflate(LayoutInflater.from(testContext))
|
||||
interactor = mockk(relaxed = true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `hide view and change setting on remove placeholder click`() {
|
||||
CustomizeHomeButtonViewHolder(binding.root, interactor)
|
||||
|
||||
binding.customizeHome.performClick()
|
||||
|
||||
verify {
|
||||
interactor.openCustomizeHomePage()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue