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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations