Search in sources :

Example 61 with LinearLayout

use of android.widget.LinearLayout in project platform_frameworks_base by android.

the class GlyphCacheActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ScrollView scrollView = new ScrollView(this);
    scrollView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    LinearLayout layout = new LinearLayout(this);
    layout.setOrientation(LinearLayout.VERTICAL);
    layout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    scrollView.addView(layout);
    while (mTotalChars < 10000) {
        layout.addView(createTextView());
    }
    setContentView(scrollView);
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) ScrollView(android.widget.ScrollView) LinearLayout(android.widget.LinearLayout)

Example 62 with LinearLayout

use of android.widget.LinearLayout in project platform_frameworks_base by android.

the class BigEditTextActivityScrollableResize method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    mRootView = new ScrollView(this);
    ((ScrollView) mRootView).setFillViewport(true);
    mRootView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    mLayout = new LinearLayout(this);
    mLayout.setOrientation(LinearLayout.VERTICAL);
    mLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    View view = getLayoutInflater().inflate(R.layout.full_screen_edit_text, ((ScrollView) mRootView), false);
    mLayout.addView(view);
    ((ScrollView) mRootView).addView(mLayout);
    mDefaultFocusedView = view.findViewById(R.id.data);
    setContentView(mRootView);
}
Also used : ScrollView(android.widget.ScrollView) ViewGroup(android.view.ViewGroup) ScrollView(android.widget.ScrollView) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Example 63 with LinearLayout

use of android.widget.LinearLayout in project platform_frameworks_base by android.

the class BottomEditTextActivityPanScan method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mRootView = new LinearLayout(this);
    ((LinearLayout) mRootView).setOrientation(LinearLayout.VERTICAL);
    View view = getLayoutInflater().inflate(R.layout.one_edit_text_activity, ((LinearLayout) mRootView), false);
    mDefaultFocusedView = view.findViewById(R.id.dialog_edit_text);
    ((LinearLayout) mRootView).addView(view);
    setContentView(mRootView);
    this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
}
Also used : TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Example 64 with LinearLayout

use of android.widget.LinearLayout in project platform_frameworks_base by android.

the class BottomEditTextActivityResize method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mRootView = new LinearLayout(this);
    ((LinearLayout) mRootView).setOrientation(LinearLayout.VERTICAL);
    View view = getLayoutInflater().inflate(R.layout.one_edit_text_activity, ((LinearLayout) mRootView), false);
    mDefaultFocusedView = view.findViewById(R.id.dialog_edit_text);
    ((LinearLayout) mRootView).addView(view);
    setContentView(mRootView);
    this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
}
Also used : TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Example 65 with LinearLayout

use of android.widget.LinearLayout in project platform_frameworks_base by android.

the class DialogActivity method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    mLayout = new LinearLayout(this);
    mLayout.setOrientation(LinearLayout.VERTICAL);
    mLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    mButton1 = new Button(this);
    //(R.string.open_dialog_scrollable);
    mButton1.setText("Dialog WITHOUT EditText");
    mButton1.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            showDialog(DIALOG_WITHOUT_EDITTEXT);
        }
    });
    mButton2 = new Button(this);
    //(R.string.open_dialog_nonscrollable);
    mButton2.setText("Dialog WITH EditText");
    mButton2.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            showDialog(DIALOG_WITH_EDITTEXT);
        }
    });
    mEditText = new EditText(this);
    mLayout.addView(mEditText);
    mLayout.addView(mButton1);
    mLayout.addView(mButton2);
    setContentView(mLayout);
}
Also used : EditText(android.widget.EditText) Button(android.widget.Button) ViewGroup(android.view.ViewGroup) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Aggregations

LinearLayout (android.widget.LinearLayout)1205 View (android.view.View)473 TextView (android.widget.TextView)455 ViewGroup (android.view.ViewGroup)203 ImageView (android.widget.ImageView)196 Button (android.widget.Button)167 ScrollView (android.widget.ScrollView)125 ListView (android.widget.ListView)100 LayoutInflater (android.view.LayoutInflater)90 FrameLayout (android.widget.FrameLayout)85 Context (android.content.Context)80 AdapterView (android.widget.AdapterView)74 EditText (android.widget.EditText)74 Intent (android.content.Intent)66 AbsListView (android.widget.AbsListView)58 LayoutParams (android.widget.LinearLayout.LayoutParams)48 RelativeLayout (android.widget.RelativeLayout)48 Bitmap (android.graphics.Bitmap)46 OnClickListener (android.view.View.OnClickListener)44 Drawable (android.graphics.drawable.Drawable)42