Search in sources :

Example 31 with ScrollView

use of android.widget.ScrollView in project android_frameworks_base by DirtyUnicorns.

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 32 with ScrollView

use of android.widget.ScrollView in project android_frameworks_base by DirtyUnicorns.

the class EditTextActivityDialog method createDialog.

protected Dialog createDialog(boolean scrollable) {
    View layout;
    EditText editText;
    if (scrollable) {
        layout = new ScrollView(EditTextActivityDialog.this);
        ((ScrollView) layout).setMinimumHeight(mLayout.getHeight());
        ((ScrollView) layout).addView((LinearLayout) View.inflate(EditTextActivityDialog.this, R.layout.dialog_edit_text_no_scroll, null));
    } else {
        layout = View.inflate(EditTextActivityDialog.this, R.layout.dialog_edit_text_no_scroll, null);
    }
    Dialog d = new Dialog(EditTextActivityDialog.this);
    d.setTitle(getString(R.string.test_dialog));
    d.setCancelable(true);
    d.setContentView(layout);
    return d;
}
Also used : EditText(android.widget.EditText) ScrollView(android.widget.ScrollView) Dialog(android.app.Dialog) ScrollView(android.widget.ScrollView) View(android.view.View)

Example 33 with ScrollView

use of android.widget.ScrollView in project android_frameworks_base by DirtyUnicorns.

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);
}
Also used : EditText(android.widget.EditText) ScrollView(android.widget.ScrollView) LinearLayout(android.widget.LinearLayout)

Example 34 with ScrollView

use of android.widget.ScrollView in project android_frameworks_base by DirtyUnicorns.

the class OneEditTextActivityNotSelected method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LinearLayout layout = new LinearLayout(this);
    layout.setOrientation(LinearLayout.VERTICAL);
    mRootView = new ScrollView(this);
    EditText editText = new EditText(this);
    Button button = new Button(this);
    button.setText("The focus is here.");
    button.setFocusableInTouchMode(true);
    button.requestFocus();
    mDefaultFocusedView = button;
    layout.addView(button);
    layout.addView(editText);
    ((ScrollView) mRootView).addView(layout);
    setContentView(mRootView);
}
Also used : EditText(android.widget.EditText) ScrollView(android.widget.ScrollView) Button(android.widget.Button) LinearLayout(android.widget.LinearLayout)

Example 35 with ScrollView

use of android.widget.ScrollView in project android_frameworks_base by DirtyUnicorns.

the class VectorDrawablePerformance method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ScrollView scrollView = new ScrollView(this);
    GridLayout container = new GridLayout(this);
    scrollView.addView(container);
    container.setColumnCount(4);
    Resources res = this.getResources();
    container.setBackgroundColor(0xFF888888);
    VectorDrawable[] d = new VectorDrawable[icon.length];
    long time = android.os.SystemClock.elapsedRealtimeNanos();
    for (int i = 0; i < icon.length; i++) {
        d[i] = create(res, icon[i]);
    }
    time = android.os.SystemClock.elapsedRealtimeNanos() - time;
    TextView t = new TextView(this);
    DecimalFormat df = new DecimalFormat("#.##");
    t.setText("avgL=" + df.format(time / (icon.length * 1000000.)) + " ms");
    container.addView(t);
    time = android.os.SystemClock.elapsedRealtimeNanos();
    for (int i = 0; i < icon.length; i++) {
        Button button = new Button(this);
        button.setWidth(200);
        button.setBackgroundResource(icon[i]);
        container.addView(button);
    }
    setContentView(scrollView);
    time = android.os.SystemClock.elapsedRealtimeNanos() - time;
    t = new TextView(this);
    t.setText("avgS=" + df.format(time / (icon.length * 1000000.)) + " ms");
    container.addView(t);
}
Also used : GridLayout(android.widget.GridLayout) ScrollView(android.widget.ScrollView) Button(android.widget.Button) DecimalFormat(java.text.DecimalFormat) TextView(android.widget.TextView) Resources(android.content.res.Resources) VectorDrawable(android.graphics.drawable.VectorDrawable)

Aggregations

ScrollView (android.widget.ScrollView)366 View (android.view.View)173 TextView (android.widget.TextView)148 LinearLayout (android.widget.LinearLayout)93 ImageView (android.widget.ImageView)65 ViewGroup (android.view.ViewGroup)53 Button (android.widget.Button)36 EditText (android.widget.EditText)36 ListView (android.widget.ListView)29 AbsListView (android.widget.AbsListView)27 RecyclerView (android.support.v7.widget.RecyclerView)25 Intent (android.content.Intent)24 AdapterView (android.widget.AdapterView)24 GridLayout (android.widget.GridLayout)24 WebView (android.webkit.WebView)22 SuppressLint (android.annotation.SuppressLint)21 ArrayList (java.util.ArrayList)21 FrameLayout (android.widget.FrameLayout)19 Dialog (android.app.Dialog)16 DialogInterface (android.content.DialogInterface)16