Commit 13522a8f authored by Tiger Oakes's avatar Tiger Oakes Committed by Tiger Oakes
Browse files

Deprecated View.isGone, View.isInvisible

parent cdb4c146
......@@ -15,6 +15,7 @@ import android.view.accessibility.AccessibilityManager
import android.widget.ImageButton
import android.widget.LinearLayout
import androidx.core.view.inputmethod.EditorInfoCompat
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.test.ext.junit.runners.AndroidJUnit4
import mozilla.components.browser.menu.BrowserMenuBuilder
......@@ -24,7 +25,6 @@ import mozilla.components.browser.toolbar.edit.EditToolbar
import mozilla.components.concept.toolbar.Toolbar
import mozilla.components.concept.toolbar.Toolbar.SiteSecurity
import mozilla.components.support.base.android.Padding
import mozilla.components.support.ktx.android.view.isGone
import mozilla.components.support.test.mock
import mozilla.components.support.test.robolectric.testContext
import org.junit.Assert.assertEquals
......@@ -302,13 +302,13 @@ class BrowserToolbarTest {
toolbar.setOnUrlCommitListener { true }
toolbar.editMode()
assertTrue(toolbar.displayToolbar.isGone())
assertTrue(toolbar.displayToolbar.isGone)
assertTrue(toolbar.editToolbar.isVisible)
toolbar.onUrlEntered("https://www.mozilla.org")
assertTrue(toolbar.displayToolbar.isVisible)
assertTrue(toolbar.editToolbar.isGone())
assertTrue(toolbar.editToolbar.isGone)
}
@Test
......@@ -317,12 +317,12 @@ class BrowserToolbarTest {
toolbar.setOnUrlCommitListener { false }
toolbar.editMode()
assertTrue(toolbar.displayToolbar.isGone())
assertTrue(toolbar.displayToolbar.isGone)
assertTrue(toolbar.editToolbar.isVisible)
toolbar.onUrlEntered("https://www.mozilla.org")
assertTrue(toolbar.displayToolbar.isGone())
assertTrue(toolbar.displayToolbar.isGone)
assertTrue(toolbar.editToolbar.isVisible)
}
......
......@@ -30,8 +30,8 @@ val View.isLTR: Boolean
/**
* Returns true if this view's visibility is set to View.VISIBLE.
* @deprecated Use Android KTX instead.
*/
@Deprecated("Use Android KTX instead", ReplaceWith("isVisible", "androidx.core.view.isVisible"))
fun View.isVisible(): Boolean {
return visibility == View.VISIBLE
}
......@@ -39,6 +39,7 @@ fun View.isVisible(): Boolean {
/**
* Returns true if this view's visibility is set to View.GONE.
*/
@Deprecated("Use Android KTX instead", ReplaceWith("isGone", "androidx.core.view.isGone"))
fun View.isGone(): Boolean {
return visibility == View.GONE
}
......@@ -46,6 +47,7 @@ fun View.isGone(): Boolean {
/**
* Returns true if this view's visibility is set to View.INVISIBLE.
*/
@Deprecated("Use Android KTX instead", ReplaceWith("isInvisible", "androidx.core.view.isInvisible"))
fun View.isInvisible(): Boolean {
return visibility == View.INVISIBLE
}
......
......@@ -35,6 +35,7 @@ class ViewTest {
assertTrue(view.hasFocus())
}
@Suppress("Deprecation")
@Test
fun `visibility helper methods`() {
val view = TextView(testContext)
......
......@@ -33,6 +33,7 @@ permalink: /changelog/
* **support-ktx**
* Deprecated `String.toUri()` in favour of Android Core KTX.
* Deprecated `View.isGone` and `View.isInvisible` in favour of Android Core KTX.
* Added `putCompoundDrawablesRelative` and `putCompoundDrawablesRelativeWithIntrinsicBounds`, aliases of `setCompoundDrawablesRelative` that use Kotlin named and default arguments.
* **feature-prompts**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment