Code example for ImageButton

Methods: getBackgroundgetHeightgetPaddingBottomgetPaddingTopgetTopgetDrawable

0
                + mPause.getPaddingTop() + mPause.getPaddingBottom(),
                mPause.getBackground().getMinimumHeight());
        int prevHeight = Math.max(mPrev.getDrawable().getIntrinsicHeight() + mPrev.getPaddingTop()
                + mPrev.getPaddingBottom(),
                mPrev.getBackground().getMinimumHeight());
        int nextHeight = Math.max(mNext.getDrawable().getIntrinsicHeight() + mNext.getPaddingTop()
                + mNext.getPaddingBottom(),
                mNext.getBackground().getMinimumHeight());
        assertEquals("Layout incorrect height", pauseHeight, mLayout.getHeight()); 
        assertEquals("Pause incorrect height", pauseHeight, mPause.getHeight()); 
        assertEquals("Prev incorrect height", prevHeight, mPrev.getHeight()); 
        assertEquals("Next incorrect height", nextHeight, mNext.getHeight()); 
        assertEquals("Pause wrong top", 0, mPause.getTop()); 
        assertEquals("Prev wrong top", (pauseHeight - prevHeight) / 2, mPrev.getTop());
        assertEquals("Next wrong top", (pauseHeight - nextHeight) / 2, mNext.getTop());
        assertEquals("CurrentTime wrong bottom",  pauseHeight, mCurrentTime.getBottom());
        assertEquals("TotalTime wrong bottom",  pauseHeight, mTotalTime.getBottom());
        assertTrue("CurrentTime too tall", mCurrentTime.getTop() > 0);
        assertTrue("TotalTime too tall", mTotalTime.getTop() > 0);
    } 
Experience pair programming with AI  Get Codota for Java