use of android.widget.LinearLayout in project platform_frameworks_base by android.
the class InputTypeActivity method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mScrollView = new ScrollView(this);
mLayout = new LinearLayout(this);
mLayout.setOrientation(LinearLayout.VERTICAL);
mLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
mInflater = getLayoutInflater();
mParent = mLayout;
/* Normal Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_NORMAL, R.string.normal_edit_text_label));
/* Normal Edit Text w/Cap Chars Flag*/
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_NORMAL | EditorInfo.TYPE_TEXT_FLAG_CAP_CHARACTERS, R.string.cap_chars_edit_text_label));
/* Normal Edit Text w/Cap Words Flag*/
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_NORMAL | EditorInfo.TYPE_TEXT_FLAG_CAP_WORDS, R.string.cap_words_edit_text_label));
/* Normal Edit Text w/Cap Multiline Flag */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_NORMAL | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE, R.string.multiline_edit_text_label));
/* Normal Edit Text w/Cap Sentences Flag */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_NORMAL | EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES, R.string.cap_sentences_edit_text_label));
/* Normal Edit Text w/Auto-complete Flag */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_NORMAL | EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE, R.string.auto_complete_edit_text_label));
/* Normal Edit Text w/Auto-correct Flag */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_NORMAL | EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT, R.string.auto_correct_edit_text_label));
/* Uri Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_URI, R.string.uri_edit_text_label));
/* Email Address Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS, R.string.email_address_edit_text_label));
/* Email Subject Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_EMAIL_SUBJECT, R.string.email_subject_edit_text_label));
/* Email Content Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_LONG_MESSAGE, R.string.email_content_edit_text_label));
/* Person Name Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_PERSON_NAME, R.string.person_name_edit_text_label));
/* Postal Address Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_POSTAL_ADDRESS, R.string.postal_address_edit_text_label));
/* Password Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_PASSWORD, R.string.password_edit_text_label));
/* Web Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT, R.string.web_edit_text_label));
/* Signed Number Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_FLAG_SIGNED, R.string.signed_number_edit_text_label));
/* Decimal Number Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_FLAG_DECIMAL, R.string.decimal_number_edit_text_label));
/* Phone Number Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_PHONE, R.string.phone_number_edit_text_label));
/* Normal Datetime Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_DATETIME | EditorInfo.TYPE_DATETIME_VARIATION_NORMAL, R.string.normal_datetime_edit_text_label));
/* Date Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_DATETIME | EditorInfo.TYPE_DATETIME_VARIATION_DATE, R.string.date_edit_text_label));
/* Time Edit Text */
mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_DATETIME | EditorInfo.TYPE_DATETIME_VARIATION_TIME, R.string.time_edit_text_label));
mScrollView.addView(mLayout);
setContentView(mScrollView);
}
use of android.widget.LinearLayout in project platform_frameworks_base by android.
the class ManyEditTextActivityScrollPanScan method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mRootView = new ScrollView(this);
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
for (int i = 0; i < NUM_EDIT_TEXTS; i++) {
final EditText editText = new EditText(this);
editText.setText(String.valueOf(i));
editText.setId(i);
layout.addView(editText);
}
((ScrollView) mRootView).addView(layout);
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 DatePicker method reorderPickers.
private void reorderPickers(String[] months) {
java.text.DateFormat format;
String order;
if (months[0].startsWith("1")) {
format = DateFormat.getDateFormat(getContext());
} else {
format = DateFormat.getMediumDateFormat(getContext());
}
if (format instanceof SimpleDateFormat) {
order = ((SimpleDateFormat) format).toPattern();
} else {
// Shouldn't happen, but just in case.
order = new String(DateFormat.getDateFormatOrder(getContext()));
}
/* Remove the 3 pickers from their parent and then add them back in the
* required order.
*/
LinearLayout parent = (LinearLayout) findViewById(R.id.parent);
parent.removeAllViews();
boolean quoted = false;
boolean didDay = false, didMonth = false, didYear = false;
for (int i = 0; i < order.length(); i++) {
char c = order.charAt(i);
if (c == '\'') {
quoted = !quoted;
}
if (!quoted) {
if (c == DateFormat.DATE && !didDay) {
parent.addView(mDayPicker);
didDay = true;
} else if ((c == DateFormat.MONTH || c == 'L') && !didMonth) {
parent.addView(mMonthPicker);
didMonth = true;
} else if (c == DateFormat.YEAR && !didYear) {
parent.addView(mYearPicker);
didYear = true;
}
}
}
// Shouldn't happen, but just in case.
if (!didMonth) {
parent.addView(mMonthPicker);
}
if (!didDay) {
parent.addView(mDayPicker);
}
if (!didYear) {
parent.addView(mYearPicker);
}
}
use of android.widget.LinearLayout in project platform_frameworks_base by android.
the class DisplayListLayersActivity method createContainer.
private LinearLayout createContainer() {
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
return layout;
}
use of android.widget.LinearLayout in project platform_frameworks_base by android.
the class LooperAcceleration method makeView.
private View makeView() {
LinearLayout layout = new LinearLayout(this);
layout.addView(new IsAcceleratedView(this), LayoutParams.MATCH_PARENT, 60);
if (INCLUDE_WEBVIEW) {
WebView wv = new WebView(this);
wv.setWebViewClient(new WebViewClient());
wv.setWebChromeClient(new WebChromeClient());
wv.loadUrl("http://www.webkit.org/blog-files/3d-transforms/poster-circle.html");
layout.addView(wv, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
}
return layout;
}
Aggregations