package com.example.layout02;


import android.os.Bundle;
import android.app.Activity;
import android.widget.EditText;
import android.widget.Scroller;


public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Get the widgets reference from XML layout
        final EditText et = (EditText) findViewById(R.id.et);
        final EditText et2 = (EditText) findViewById(R.id.et2);

        /*
            This will provide Scroll option for EditText,
            but it will not show the scroll bar on EditText
        */
        et2.setScroller(new Scroller(getApplicationContext()));
        et2.setVerticalScrollBarEnabled(true);

        /*
            setMinLines (int minlines)
                Makes the TextView at least this many lines tall.
                Setting this value overrides any other (minimum) height
                setting. A single line TextView will set this value to 1.
         */
        // Set the minimum lines to display on EditText
        et2.setMinLines(2);

        /*
            setMaxLines (int maxlines)
                Makes the TextView at most this many lines tall.
                Setting this value overrides any other (maximum) height setting.
         */
        // Set the maximum lines to display on EditText
        et2.setMaxLines(2);
   }
}