ScrollView addView - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ScrollView addView method.

This code example shows how to use the following methods: addView, setOrientation, addView
    @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);
        editText.requestFocus();
        mDefaultFocusedView = editText;
        layout.addView(editText);
 
        ((ScrollView) mRootView).addView(layout);
        setContentView(mRootView);
         
        // set to resize so IME is always shown (and also so 
        // ImfBaseTestCase#destructiveCheckImeInitialState thinks it should always be shown 
        this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
Full Snippet Info
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: addView, setOrientation, addView
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setBackgroundColor, setLayoutParams, setScrollContainer, addView, setFillViewport
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setLayoutParams, setVerticalScrollBarEnabled, addView
        LinearLayout layout = new LinearLayout(context);
        layout.setOrientation(LinearLayout.VERTICAL);
        layout.setPadding(6, 6, 6, 6);
 
        // Create a ScrollView to put the text in. Shouldn't be necessary... 
        ScrollView tscroll = new ScrollView(context);
        tscroll.setVerticalScrollBarEnabled(true);
        tscroll.setLayoutParams(new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.WRAP_CONTENT,
                LinearLayout.LayoutParams.WRAP_CONTENT, 1));
        layout.addView(tscroll);
 
        // Now create the text view and add it to the scroller. 
        textView = new TextView(context);
        textView.setTextSize(16);
        textView.setTextColor(0xffffffff);
        textView.setText(textId);
        textView.setLayoutParams(new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.FILL_PARENT,
                LinearLayout.LayoutParams.FILL_PARENT));

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setLayoutParams, addView, setFillViewport
				actionLayoutView = container.getBean("actionDetailLayoutView", bundleKeys);
				 
				LayoutParams scrollViewLayout = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
				LayoutParams childViewLayout = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
				 
				ScrollView scrollView = new ScrollView(getContext());
				scrollView.setFillViewport(true);
				scrollView.setLayoutParams(scrollViewLayout);
				scrollView.addView(actionLayoutView, childViewLayout);	
				 
				LinearLayout layout = new LinearLayout(getContext());
				LayoutParams masterParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT);
				 
				layout.setLayoutParams(masterParams);
				layout.setBackgroundDrawable(((Drawables)container.getBean("drawables")).getDrawable("slate.png", true, true, true));
				 
				layout.addView(scrollView);
				 
				view = layout;
			} 
Full Snippet Info
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: addView
 
        setContentView(scrollWrap(root));
    } 
 
    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;
    } 
 
    private void addLabelToRoot(LinearLayout root, String text) {
        TextView label = new TextView(this);
        label.setText(text);
        root.addView(label, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
                LinearLayout.LayoutParams.WRAP_CONTENT));
    } 
 
    private void addChildToRoot(LinearLayout root, LinearLayout layout) {
        root.addView(layout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
Full Snippet Info
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setPadding, addView, setView
	  return new AlertDialog.Builder(context)
	   .setTitle(title)
	   .setCancelable(true)
	   .setIcon(android.R.drawable.ic_dialog_info)
	   .setPositiveButton(button, null)
	   .setView(LinkifyText(context, text))
	   .create();
	 } 
 
		public static ScrollView LinkifyText(Context context, String message) 
		{ 
		    ScrollView svMessage = new ScrollView(context); 
		    TextView tvMessage = new TextView(context);
		 
		    SpannableString spanText = new SpannableString(message);
		 
		    Linkify.addLinks(spanText, Linkify.ALL);
		    tvMessage.setText(spanText);
		    tvMessage.setMovementMethod(LinkMovementMethod.getInstance());
		     

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: addView
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        ScrollView sv = new ScrollView(this);
        ViewGroup.LayoutParams svLp = new ScrollView.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);
 
        LinearLayout ll = new LinearLayout(this);
        ll.setLayoutParams(svLp);
        sv.addView(ll);
 
        InternalSelectionView isv = new InternalSelectionView(this, 10);
        int screenHeight = getWindowManager().getDefaultDisplay().getHeight();
        LinearLayout.LayoutParams llLp = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                2 * screenHeight);  // 2x screen height to ensure scrolling
        isv.setLayoutParams(llLp);
Full Snippet Info
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setId, setLayoutParams, setScrollBarStyle, addView
        // To fight color branding. 
        ((Activity)getContext()).getWindow().setFormat(PixelFormat.RGBA_8888);
 
        // Create the scrollview over the dialog 
        final int dlgMarging = (int)convertDpToPixel(DEFAULT_MARGIN_DP);
        ScrollView sv = new ScrollView(getContext());
        sv.setId(generateViewId());
        RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
                android.view.ViewGroup.LayoutParams.MATCH_PARENT,
                android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
        lp.setMargins(dlgMarging, 0, dlgMarging, 0);
        sv.setLayoutParams(lp);
        sv.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_INSET);
 
        // Now the vertical layout 
        LinearLayout ll = new LinearLayout(getContext());
        ll.setId(generateViewId());
        lp = new RelativeLayout.LayoutParams(
                android.view.ViewGroup.LayoutParams.MATCH_PARENT,
                android.view.ViewGroup.LayoutParams.MATCH_PARENT);

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setId, setLayoutParams, setPadding, addView
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related ScrollView addView Questions & Answers:

addView Method Overview
Adds a child view.
See Code Examples for other Android ScrollView Methods: