Search in sources :

Example 71 with ScrollView

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

Example 72 with ScrollView

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

the class TextPathActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ScrollView scroller = new ScrollView(this);
    scroller.addView(new CustomTextView(this));
    setContentView(scroller);
}
Also used : ScrollView(android.widget.ScrollView)

Example 73 with ScrollView

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

the class ActivityTestMain method scrollWrap.

private View scrollWrap(View view) {
    ScrollView scroller = new ScrollView(this);
    scroller.addView(view, new ScrollView.LayoutParams(ScrollView.LayoutParams.MATCH_PARENT, ScrollView.LayoutParams.MATCH_PARENT));
    return scroller;
}
Also used : ScrollView(android.widget.ScrollView)

Example 74 with ScrollView

use of android.widget.ScrollView in project android-topeka by googlesamples.

the class PickerQuizView method createQuizContentView.

@Override
protected View createQuizContentView() {
    initStep();
    mMin = getQuiz().getMin();
    ScrollView layout = (ScrollView) getLayoutInflater().inflate(R.layout.quiz_layout_picker, this, false);
    mCurrentSelection = (TextView) layout.findViewById(R.id.seekbar_progress);
    mCurrentSelection.setText(String.valueOf(mMin));
    mSeekBar = (SeekBar) layout.findViewById(R.id.seekbar);
    mSeekBar.setMax(getSeekBarMax());
    mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            setCurrentSelectionText(mMin + progress);
            allowAnswer();
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        /* no-op */
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        /* no-op */
        }
    });
    return layout;
}
Also used : ScrollView(android.widget.ScrollView) SeekBar(android.widget.SeekBar) SuppressLint(android.annotation.SuppressLint)

Example 75 with ScrollView

use of android.widget.ScrollView in project TwinklingRefreshLayout by lcodecorex.

the class ScrollingUtil method scrollAViewBy.

public static void scrollAViewBy(View view, int height) {
    if (view instanceof RecyclerView)
        ((RecyclerView) view).scrollBy(0, height);
    else if (view instanceof ScrollView)
        ((ScrollView) view).smoothScrollBy(0, height);
    else if (view instanceof AbsListView)
        ((AbsListView) view).smoothScrollBy(height, 0);
    else {
        try {
            Method method = view.getClass().getDeclaredMethod("smoothScrollBy", Integer.class, Integer.class);
            method.invoke(view, 0, height);
        } catch (Exception e) {
            view.scrollBy(0, height);
        }
    }
}
Also used : ScrollView(android.widget.ScrollView) AbsListView(android.widget.AbsListView) RecyclerView(android.support.v7.widget.RecyclerView) Method(java.lang.reflect.Method)

Aggregations

ScrollView (android.widget.ScrollView)363 View (android.view.View)173 TextView (android.widget.TextView)149 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 RecyclerView (android.support.v7.widget.RecyclerView)25 Intent (android.content.Intent)24 AbsListView (android.widget.AbsListView)24 AdapterView (android.widget.AdapterView)24 GridLayout (android.widget.GridLayout)24 ArrayList (java.util.ArrayList)21 SuppressLint (android.annotation.SuppressLint)20 WebView (android.webkit.WebView)19 FrameLayout (android.widget.FrameLayout)19 Dialog (android.app.Dialog)17 DialogInterface (android.content.DialogInterface)16