Java Code Examples for android.widget.HorizontalScrollView#setFillViewport()
The following examples show how to use
android.widget.HorizontalScrollView#setFillViewport() .
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: TableFragment.java From pandora with Apache License 2.0 | 5 votes |
@Override protected View getLayoutView() { HorizontalScrollView scrollView = new HorizontalScrollView(getContext()); ViewGroup.LayoutParams params = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); scrollView.setFillViewport(true); recyclerView = new MenuRecyclerView(getContext()); recyclerView.setBackgroundColor(ViewKnife.getColor(R.color.pd_main_bg)); scrollView.addView(recyclerView, params); return scrollView; }
Example 2
Source File: DisplayModelActivity.java From nosey with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); context = this; textSize = (int) getResources().getDimension(R.dimen.cell_text_size); padding = (int) getResources().getDimension(R.dimen.cell_padding); Nosey nosey = Nosey.getInstance(this); Inspector.ModelMapInspector inspector = new Inspector.ModelMapInspector(); inspector.inspect(nosey); String modelKey = getIntent().getStringExtra(EXTRA_MODEL_KEY); model = inspector.getModelMap().get(modelKey); methods = model.getDeclaredMethods(); Arrays.sort(methods, new MemberComparator<Method>()); TableLayout table = new TableLayout(this); addModelFieldHeaders(table, inspector); addModelDataRows(table, inspector); ScrollView scrollView = new ScrollView(this); scrollView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); scrollView.setHorizontalScrollBarEnabled(true); scrollView.setVerticalScrollBarEnabled(true); scrollView.setFillViewport(true); HorizontalScrollView horizontalScrollView = new HorizontalScrollView(this); horizontalScrollView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); horizontalScrollView.setHorizontalScrollBarEnabled(true); horizontalScrollView.setVerticalScrollBarEnabled(true); horizontalScrollView.setFillViewport(true); scrollView.addView(horizontalScrollView); horizontalScrollView.addView(table); setContentView(scrollView); }
Example 3
Source File: DisplayModelActivity.java From nosey with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); context = this; textSize = (int) getResources().getDimension(R.dimen.cell_text_size); padding = (int) getResources().getDimension(R.dimen.cell_padding); Nosey nosey = Nosey.getInstance(this); Inspector.ModelMapInspector inspector = new Inspector.ModelMapInspector(); inspector.inspect(nosey); String modelKey = getIntent().getStringExtra(EXTRA_MODEL_KEY); model = inspector.getModelMap().get(modelKey); methods = model.getDeclaredMethods(); Arrays.sort(methods, new MemberComparator<Method>()); TableLayout table = new TableLayout(this); addModelFieldHeaders(table, inspector); addModelDataRows(table, inspector); ScrollView scrollView = new ScrollView(this); scrollView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); scrollView.setHorizontalScrollBarEnabled(true); scrollView.setVerticalScrollBarEnabled(true); scrollView.setFillViewport(true); HorizontalScrollView horizontalScrollView = new HorizontalScrollView(this); horizontalScrollView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); horizontalScrollView.setHorizontalScrollBarEnabled(true); horizontalScrollView.setVerticalScrollBarEnabled(true); horizontalScrollView.setFillViewport(true); scrollView.addView(horizontalScrollView); horizontalScrollView.addView(table); setContentView(scrollView); }