List of usage examples for android.widget LinearLayout HORIZONTAL
int HORIZONTAL
To view the source code for android.widget LinearLayout HORIZONTAL.
Click Source Link
From source file:com.telerik.examples.primitives.ExampleViewPagerBase.java
private void offsetChildStartEnd(View v, int offset) { if (this.orientation == LinearLayout.HORIZONTAL) { v.offsetLeftAndRight(offset);// w w w .j a v a 2s . c o m } v.offsetTopAndBottom(offset); }
From source file:com.mycelium.wallet.activity.modern.RecordsFragment.java
private LinearLayout createRecordViewList(int titleResource, List<Record> records, Record selectedRecord, boolean addButton) { LinearLayout outer = new LinearLayout(getActivity()); outer.setOrientation(LinearLayout.VERTICAL); outer.setLayoutParams(_outerLayoutParameters); // Add title//from w w w . j a v a 2 s .c o m if (addButton) { // Add both a title and an "+" button LinearLayout titleLayout = new LinearLayout(getActivity()); titleLayout.setOrientation(LinearLayout.HORIZONTAL); titleLayout.setLayoutParams(_innerLayoutParameters); titleLayout.addView(createTitle(titleResource)); outer.addView(titleLayout); } else { outer.addView(createTitle(titleResource)); } if (records.isEmpty()) { return outer; } LinearLayout inner = new LinearLayout(getActivity()); inner.setOrientation(LinearLayout.VERTICAL); inner.setLayoutParams(_innerLayoutParameters); // inner.setBackgroundDrawable(getResources().getDrawable(R.drawable.btn_pitch_black_slim)); inner.requestLayout(); // build only once since it is relatively slow final Set<Address> addressSet = _mbwManager.getRecordManager().getWallet(_mbwManager.getWalletMode()) .getAddressSet(); // Add records for (Record record : records) { // Add separator inner.addView(createSeparator()); // Add item boolean isSelected = record.address.equals(selectedRecord.address); View item = createRecord(outer, record, isSelected, addressSet); inner.addView(item); } if (records.size() > 0) { // Add separator inner.addView(createSeparator()); } outer.addView(inner); return outer; }
From source file:com.telerik.examples.primitives.ExampleViewPagerBase.java
private int getStart(View v) { if (this.orientation == LinearLayout.HORIZONTAL) { return v.getLeft(); }// w w w .java2 s .c om return v.getTop(); }
From source file:com.appfirst.activities.details.AFServerDetail.java
/** * Draw a ScrollView to display the Disk usage for each disk. * //from w w w . ja v a 2 s. c om * @return a ScrollView containing a list of AFBarView and AFPieView. */ private View createDiskListDialog() { // use the scroll view to scale ScrollView container = createOuterContainer(); LinearLayout innerContainer = createInnerContainer(); List<BasicNameValuePair> items = data.getDisk_percent_part(); for (int i = 0; i < items.size(); i++) { BasicNameValuePair item = items.get(i); Double value = Double.parseDouble(item.getValue()); String name = item.getName(); LinearLayout row = createTableRow(LinearLayout.HORIZONTAL); AFPieView pieView = createPieView(value); row.addView(pieView); TextView text = new TextView(this); text.setPadding(10, 0, 0, 0); text.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); text.setText(String.format("%s - %.1f %s used", name, value, "%")); row.addView(text); innerContainer.addView(row); } container.addView(innerContainer); innerContainer.invalidate(); container.invalidate(); return container; }
From source file:com.telerik.examples.primitives.ExampleViewPagerBase.java
private int getEnd(View v) { if (this.orientation == LinearLayout.HORIZONTAL) { return v.getRight(); }//from w ww. ja v a 2 s . com return v.getBottom(); }
From source file:com.telerik.examples.primitives.ExampleViewPagerBase.java
private int getPaddingStart(View v) { if (this.orientation == LinearLayout.HORIZONTAL) { return v.getPaddingLeft(); }/* www .j a v a 2 s . c o m*/ return v.getPaddingTop(); }
From source file:com.telerik.examples.primitives.ExampleViewPagerBase.java
private int getPaddingEnd(View v) { if (this.orientation == LinearLayout.HORIZONTAL) { return v.getPaddingRight(); }// w ww.j a va2 s .c o m return v.getPaddingBottom(); }
From source file:com.google.samples.apps.iosched.ui.widget.CollectionView.java
private View makeNewItemRow(RowComputeResult rowInfo) { LinearLayout ll = new LinearLayout(getContext()); LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); ll.setOrientation(LinearLayout.HORIZONTAL); ll.setLayoutParams(params);// w ww.j ava2 s . co m int nbColumns = rowInfo.group.mDisplayCols; if (hasCustomGroupView()) { nbColumns = 1; } for (int i = 0; i < nbColumns; i++) { View view = getItemView(rowInfo, i, null, ll); setupLayoutParams(view); ll.addView(view); } return ll; }
From source file:com.telerik.examples.primitives.ExampleViewPagerBase.java
private int getViewLength(View v) { if (this.orientation == LinearLayout.HORIZONTAL) { return v.getWidth(); }// w w w . j a v a 2 s .co m return v.getHeight(); }
From source file:com.telerik.examples.primitives.ExampleViewPagerBase.java
private int getViewMeasuredLength(View v) { if (this.orientation == LinearLayout.HORIZONTAL) { return v.getMeasuredWidth(); }/* ww w.j a v a 2 s . c om*/ return v.getMeasuredHeight(); }