Java Code Examples for android.widget.ScrollView#setId()

The following examples show how to use android.widget.ScrollView#setId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EspViewTest.java    From espresso-macchiato with MIT License 5 votes vote down vote up
private void givenViewLargerThanScreen() {
    ScrollView scrollView = new ScrollView(getActivity());
    scrollView.setId(android.R.id.candidatesArea);
    addViewToLayout(scrollView, BaseActivity.rootLayout);

    view = new Button(activityTestRule.getActivity());
    view.setHeight(3000);
    view.setWidth(2000);
    view.setId(viewId);
    addViewToLayout(view, android.R.id.candidatesArea);
}
 
Example 2
Source File: TextFragment.java    From Dashchan with Apache License 2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	Bundle args = getArguments();
	int type = args.getInt(EXTRA_TYPE);
	String content = args.getString(EXTRA_CONTENT);
	switch (type) {
		case TYPE_LICENSES: {
			InputStream input = null;
			try {
				input = getActivity().getAssets().open("licenses.txt");
				ByteArrayOutputStream output = new ByteArrayOutputStream();
				IOUtils.copyStream(input, output);
				content = new String(output.toByteArray()).replaceAll("\r?\n", "<br/>");
			} catch (IOException e) {
				throw new RuntimeException(e);
			} finally {
				IOUtils.close(input);
			}
			break;
		}
	}
	CharSequence text = HtmlParser.spanify(content, new Markup(), null, null);
	new ColorScheme(getActivity()).apply(text);
	float density = ResourceUtils.obtainDensity(this);
	textView = new CommentTextView(getActivity(), null, android.R.attr.textAppearanceLarge);
	int padding = (int) (16f * density);
	textView.setPadding(padding, padding, padding, padding);
	textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
	textView.setText(text);
	ScrollView scrollView = new ScrollView(getActivity());
	scrollView.setId(android.R.id.list);
	FrameLayout frameLayout = new FrameLayout(getActivity());
	frameLayout.setOnClickListener(this);
	scrollView.addView(frameLayout, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
	frameLayout.addView(textView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
	return scrollView;
}
 
Example 3
Source File: PullToZoomScrollViewEx.java    From likequanmintv with Apache License 2.0 4 votes vote down vote up
@Override
protected ScrollView createRootView(Context context, AttributeSet attrs) {
    ScrollView scrollView = new InternalScrollView(context, attrs);
    scrollView.setId(R.id.scrollview);
    return scrollView;
}
 
Example 4
Source File: InboxLayoutScrollView.java    From InboxLayout with MIT License 4 votes vote down vote up
@Override
protected ScrollView createDragableView(Context context, AttributeSet attrs) {
    mScrollView = new ScrollView(context);
    mScrollView.setId(R.id.scrollview);
    return mScrollView;
}
 
Example 5
Source File: PullToZoomScrollViewEx.java    From PullZoomView with Apache License 2.0 4 votes vote down vote up
@Override
protected ScrollView createRootView(Context context, AttributeSet attrs) {
    ScrollView scrollView = new InternalScrollView(context, attrs);
    scrollView.setId(R.id.scrollview);
    return scrollView;
}