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