Code example for ScrollView

Methods: addView, requestFocus, setScrollBarStyle

0
        initAudioInfoView(name);
    } 
 
    public void setText(String name, String text) {
        if (null == mScrollText) {
            mScrollText = new ScrollView(mContext);
            mScrollText.setScrollBarStyle(SCROLLBARS_OUTSIDE_INSET);
            addView(mScrollText, new LayoutParams(
                    0, 0, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
            if (DEBUG) {
                mScrollText.setBackgroundColor(0xFF00FF00);
            } 
        } 
 
        if (null == mTextView) {
            mTextView = new TextView(mContext);
            mTextView.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
            mScrollText.addView(mTextView);
        } 
 
        mScrollText.requestFocus();
        mTextView.setText(text);
    } 
 
    public void setTextRegion(int left, int top, int width, int height) {
        if (mScrollText != null) {
Experience pair programming with AI  Get Codota for Java