Merge "Updating isTextClippedVerticallyTest" into udc-dev am: 5929e8aec0 am: 66685841ee
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23159150 Change-Id: I16fa3e8d78116d7d826930567634e6f611a5c1df Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -115,6 +115,12 @@ public abstract class ButtonDropTarget extends TextView
|
|||||||
setContentDescription(mText);
|
setContentDescription(mText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void updateText(CharSequence text) {
|
||||||
|
setText(text);
|
||||||
|
mText = getText();
|
||||||
|
setContentDescription(mText);
|
||||||
|
}
|
||||||
|
|
||||||
protected void setDrawable(int resId) {
|
protected void setDrawable(int resId) {
|
||||||
// We do not set the drawable in the xml as that inflates two drawables corresponding to
|
// We do not set the drawable in the xml as that inflates two drawables corresponding to
|
||||||
// drawableLeft and drawableStart.
|
// drawableLeft and drawableStart.
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.android.launcher3.Utilities.*
|
|||||||
import com.android.launcher3.util.ActivityContextWrapper
|
import com.android.launcher3.util.ActivityContextWrapper
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
@@ -26,19 +25,15 @@ class DeleteDropTargetTest {
|
|||||||
enableRunningInTestHarnessForTests()
|
enableRunningInTestHarnessForTests()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Needs mText, mTempRect, getPaddingTop, getPaddingBottom
|
|
||||||
// availableHeight as a parameter
|
|
||||||
@Ignore("TODO(b/279464742)")
|
|
||||||
@Test
|
@Test
|
||||||
fun isTextClippedVerticallyTest() {
|
fun isTextClippedVerticallyTest() {
|
||||||
buttonDropTarget.mText = "My Test"
|
buttonDropTarget.updateText("My Test")
|
||||||
|
buttonDropTarget.setPadding(0, 0, 0, 0)
|
||||||
|
buttonDropTarget.setTextMultiLine(false)
|
||||||
|
|
||||||
// No space for text
|
// No space for text
|
||||||
assertThat(buttonDropTarget.isTextClippedVertically(30)).isTrue()
|
assertThat(buttonDropTarget.isTextClippedVertically(30)).isTrue()
|
||||||
|
|
||||||
// Some space for text, and just enough that the text should not be clipped
|
|
||||||
assertThat(buttonDropTarget.isTextClippedVertically(50)).isFalse()
|
|
||||||
|
|
||||||
// A lot of space for text so the text should not be clipped
|
// A lot of space for text so the text should not be clipped
|
||||||
assertThat(buttonDropTarget.isTextClippedVertically(100)).isFalse()
|
assertThat(buttonDropTarget.isTextClippedVertically(100)).isFalse()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user