List of usage examples for android.widget RelativeLayout ALIGN_PARENT_RIGHT
int ALIGN_PARENT_RIGHT
To view the source code for android.widget RelativeLayout ALIGN_PARENT_RIGHT.
Click Source Link
From source file:com.truizlop.fabreveallayout.FABRevealLayout.java
private void setupFABPosition() { RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) fab.getLayoutParams(); params.addRule(RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE); params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { params.rightMargin = dipsToPixels(16); params.topMargin = dipsToPixels(20); }//from w ww.j a v a 2 s . c om fab.bringToFront(); }
From source file:com.polyvi.xface.extension.inappbrowser.XInAppBrowser.java
/** * //w w w .j av a 2s .c o m * @return */ protected Button buildCloseButton() { RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); closeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); Button close = createButton(BUTTON_CLOSE_ID, closeLayoutParams, "Close Button", "Done", new View.OnClickListener() { public void onClick(View v) { closeDialog(); } }); return close; }
From source file:edu.htl3r.schoolplanner.gui.timetable.ViewPagerIndicator.java
/** * Create all views, build the layout// w ww. ja v a2 s. c om */ private void addContent() { mFocusedTextColor = new int[] { 0, 0, 0 }; mUnfocusedTextColor = new int[] { 190, 190, 190 }; // Text views mPrevious = new TextView(getContext()); mCurrent = new TextView(getContext()); mNext = new TextView(getContext()); RelativeLayout.LayoutParams previousParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); previousParams.addRule(RelativeLayout.ALIGN_LEFT); RelativeLayout.LayoutParams currentParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); currentParams.addRule(RelativeLayout.CENTER_HORIZONTAL); RelativeLayout.LayoutParams nextParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); nextParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); // Groups holding text and arrows mPreviousGroup = new LinearLayout(getContext()); mPreviousGroup.setOrientation(LinearLayout.HORIZONTAL); mNextGroup = new LinearLayout(getContext()); mNextGroup.setOrientation(LinearLayout.HORIZONTAL); mPreviousGroup.addView(mPrevious, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mNextGroup.addView(mNext, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); addView(mPreviousGroup, previousParams); addView(mCurrent, currentParams); addView(mNextGroup, nextParams); mPrevious.setSingleLine(); mCurrent.setSingleLine(); mNext.setSingleLine(); mPrevious.setText("previous"); mCurrent.setText("current"); mNext.setText("next"); // Set colors mNext.setTextColor(Color.argb(255, mUnfocusedTextColor[0], mUnfocusedTextColor[1], mUnfocusedTextColor[2])); mPrevious.setTextColor( Color.argb(255, mUnfocusedTextColor[0], mUnfocusedTextColor[1], mUnfocusedTextColor[2])); updateColor(0); }
From source file:com.l4digital.fastscroll.FastScroller.java
public void setLayoutParams(@NonNull ViewGroup viewGroup) { if (viewGroup instanceof CoordinatorLayout) { CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) getLayoutParams(); @IdRes/* w w w . jav a2 s. c om*/ int layoutId = mRecyclerView.getId(); if (layoutId != NO_ID) { layoutParams.setAnchorId(layoutId); layoutParams.anchorGravity = GravityCompat.END; } else { layoutParams.gravity = GravityCompat.END; } setLayoutParams(layoutParams); } else if (viewGroup instanceof FrameLayout) { FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) getLayoutParams(); layoutParams.gravity = GravityCompat.END; setLayoutParams(layoutParams); } else if (viewGroup instanceof RelativeLayout) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) getLayoutParams(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { layoutParams.addRule(RelativeLayout.ALIGN_PARENT_END); } else { layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); } setLayoutParams(layoutParams); } else { throw new IllegalArgumentException( "Parent ViewGroup must be a CoordinatorLayout, FrameLayout, or RelativeLayout"); } }
From source file:at.alladin.rmbt.android.fragments.history.RMBTFilterFragment.java
@Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); view = inflater.inflate(R.layout.history_filter, container, false); deviceListView = (LinearLayout) view.findViewById(R.id.deviceList); networkListView = (LinearLayout) view.findViewById(R.id.networkList); final RelativeLayout resultLimitView = (RelativeLayout) view.findViewById(R.id.Limit25Wrapper); limit25CheckBox = (CheckBox) view.findViewById(R.id.Limit25CheckBox); if (activity.getHistoryResultLimit() == 250) limit25CheckBox.setChecked(true); else/*from w w w .j a va2s. c o m*/ limit25CheckBox.setChecked(false); resultLimitView.setOnClickListener(new OnClickListener() { @Override public void onClick(final View v) { if (limit25CheckBox.isChecked()) { limit25CheckBox.setChecked(false); activity.setHistoryResultLimit(0); } else { limit25CheckBox.setChecked(true); activity.setHistoryResultLimit(250); } } }); devicesToShow = activity.getHistoryFilterDevicesFilter(); networksToShow = activity.getHistoryFilterNetworksFilter(); if (devicesToShow == null && networksToShow == null) { devicesToShow = new ArrayList<String>(); networksToShow = new ArrayList<String>(); } final float scale = activity.getResources().getDisplayMetrics().density; final int leftRightItem = Helperfunctions.dpToPx(5, scale); // int topBottomItem = Helperfunctions.dpToPx(5, scale); // int leftRightDiv = Helperfunctions.dpToPx(0, scale); // int topBottomDiv = Helperfunctions.dpToPx(0, scale); final int heightDiv = Helperfunctions.dpToPx(1, scale); // int topBottomImg = Helperfunctions.dpToPx(1, scale); final String historyDevices[] = activity.getHistoryFilterDevices(); if (historyDevices != null) { for (int i = 0; i < historyDevices.length; i++) { final RelativeLayout singleItemLayout = new RelativeLayout(activity); // (LinearLayout)measurememtItemView.findViewById(R.id.measurement_item); singleItemLayout.setId(i); singleItemLayout.setClickable(true); singleItemLayout.setBackgroundResource(R.drawable.list_selector); singleItemLayout.setLayoutParams( new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); final TextView itemTitle = new TextView(activity, null, R.style.textMediumLight); RelativeLayout.LayoutParams layout = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); layout.addRule(RelativeLayout.ALIGN_PARENT_LEFT); layout.addRule(RelativeLayout.CENTER_VERTICAL); // itemTitle.setLayoutParams(layout); itemTitle.setGravity(Gravity.LEFT); itemTitle.setPadding(leftRightItem, 0, leftRightItem, 0); itemTitle.setText(historyDevices[i]); singleItemLayout.addView(itemTitle, layout); final CheckBox itemCheck = new CheckBox(activity); layout = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); layout.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); layout.addRule(RelativeLayout.CENTER_VERTICAL); // itemCheck.setLayoutParams(layout); itemCheck.setGravity(Gravity.RIGHT); itemCheck.setPadding(leftRightItem, 0, leftRightItem, 0); itemCheck.setOnClickListener(null); itemCheck.setClickable(false); itemCheck.setId(i + historyDevices.length); if (devicesToShow.isEmpty() || devicesToShow.contains(historyDevices[i])) itemCheck.setChecked(true); else itemCheck.setChecked(false); singleItemLayout.addView(itemCheck, layout); // layout = new // RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, // RelativeLayout.LayoutParams.WRAP_CONTENT); // singleItemLayout.setLayoutParams(layout); singleItemLayout.setOnClickListener(new OnClickListener() { @Override public void onClick(final View v) { final CheckBox check = (CheckBox) v.findViewById(v.getId() + historyDevices.length); if (check.isChecked()) { check.setChecked(false); devicesToShow.remove(historyDevices[v.getId()]); } else { check.setChecked(true); devicesToShow.add(historyDevices[v.getId()]); } } }); deviceListView.addView(singleItemLayout); final View divider = new View(activity); layout = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, heightDiv); divider.setBackgroundResource(R.drawable.bg_trans_light_10); deviceListView.addView(divider, layout); } deviceListView.invalidate(); } final String historyNetworks[] = activity.getHistoryFilterNetworks(); if (historyNetworks != null) { for (int i = 0; i < historyNetworks.length; i++) { final RelativeLayout singleItemLayout = new RelativeLayout(activity); // (LinearLayout)measurememtItemView.findViewById(R.id.measurement_item); singleItemLayout.setId(i); singleItemLayout.setClickable(true); singleItemLayout.setBackgroundResource(R.drawable.list_selector); singleItemLayout.setLayoutParams( new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); final TextView itemTitle = new TextView(activity, null, R.style.textMediumLight); RelativeLayout.LayoutParams layout = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); layout.addRule(RelativeLayout.ALIGN_PARENT_LEFT); layout.addRule(RelativeLayout.CENTER_VERTICAL); // itemTitle.setLayoutParams(layout); itemTitle.setGravity(Gravity.LEFT); itemTitle.setPadding(leftRightItem, 0, leftRightItem, 0); itemTitle.setText(historyNetworks[i]); singleItemLayout.addView(itemTitle, layout); final CheckBox itemCheck = new CheckBox(activity); layout = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); layout.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); layout.addRule(RelativeLayout.CENTER_VERTICAL); // itemCheck.setLayoutParams(layout); itemCheck.setGravity(Gravity.RIGHT); itemCheck.setPadding(leftRightItem, 0, leftRightItem, 0); itemCheck.setOnClickListener(null); itemCheck.setClickable(false); itemCheck.setId(i + historyNetworks.length); if (networksToShow.isEmpty() || networksToShow.contains(historyNetworks[i])) itemCheck.setChecked(true); else itemCheck.setChecked(false); singleItemLayout.addView(itemCheck, layout); singleItemLayout.setOnClickListener(new OnClickListener() { @Override public void onClick(final View v) { final CheckBox check = (CheckBox) v.findViewById(v.getId() + historyNetworks.length); if (check.isChecked()) { check.setChecked(false); networksToShow.remove(historyNetworks[v.getId()]); } else { check.setChecked(true); networksToShow.add(historyNetworks[v.getId()]); } System.out.println(networksToShow.toString()); } }); networkListView.addView(singleItemLayout); final View divider = new View(activity); layout = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, heightDiv); divider.setBackgroundResource(R.drawable.bg_trans_light_10); networkListView.addView(divider, layout); } networkListView.invalidate(); } /* * // Set option as Multiple Choice. So that user can able to select * more the one option from list deviceListView.setAdapter(new * ArrayAdapter<String>(activity, * android.R.layout.simple_list_item_multiple_choice, historyDevices)); * deviceListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); * * for (int i = 0; i < historyDevices.length; i++) { * //deviceListView.setItemChecked(i, true); } * * deviceListView.setOnItemClickListener(new OnItemClickListener() { * * @Override public void onItemClick(AdapterView<?> l, View v, int * position, long id) { * * } * * }); * * * // Set option as Multiple Choice. So that user can able to select * more the one option from list networkListView.setAdapter(new * ArrayAdapter<String>(activity, * android.R.layout.simple_list_item_multiple_choice, networkDevices)); * networkListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); * * for (int i = 0; i < networkDevices.length; i++) { * networkListView.setItemChecked(i, true); } * * SparseBooleanArray checked = * deviceListView.getCheckedItemPositions(); ArrayList<String> * devicesToShow = new ArrayList<String>(); for(int i = 0; i < * checked.size()+1; i++){ if(checked.get(i)) * devicesToShow.add(historyDevices[i]); } */ return view; }
From source file:org.loon.framework.android.game.LGameActivity.java
public void initialization(Bundle icicle, final boolean landscape, final boolean openAD, final LAD lad, final String publisherId, final String keywords, final int requestInterval) { LSystem.gc();// w w w .j a va2s .c o m this.androidSelect = -2; frameLayout = new FrameLayout(LGameActivity.this); super.onCreate(icicle); if (openAD) { // setVolumeControlStream(AudioManager.STREAM_MUSIC); AdManager.setPublisherId(publisherId); AdManager.setTestDevices(new String[] { "" }); AdManager.setAllowUseOfLocation(true); view = new LGameView(LGameActivity.this, landscape); adview = new AdView(LGameActivity.this); adview.setKeywords(keywords); adview.setRequestInterval(requestInterval); adview.setGravity(Gravity.NO_GRAVITY); RelativeLayout rl = new RelativeLayout(LGameActivity.this); RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); if (lad == LAD.LEFT) { lp.addRule(RelativeLayout.ALIGN_PARENT_LEFT, 1); } else if (lad == LAD.RIGHT) { lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, 1); } else if (lad == LAD.TOP) { lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, 1); } else { lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, 1); } visible = true; adview.requestFreshAd(); frameLayout.addView(view); rl.addView(adview, lp); frameLayout.addView(rl); } else { view = new LGameView(LGameActivity.this, landscape); frameLayout.addView(view); } if (view != null) { gameHandler = view.getGameHandler(); } }
From source file:com.morestudio.littledot.doctor.ui.messages.MessageAdapter.java
private void setPhotoSide(MessageListItemViews tagView, ArrowPosition pos) { LayoutParams lp = (LayoutParams) tagView.quickContactView.getLayoutParams(); lp.addRule(//from ww w . ja v a2 s. c o m (pos == ArrowPosition.LEFT) ? RelativeLayout.ALIGN_PARENT_RIGHT : RelativeLayout.ALIGN_PARENT_LEFT); lp.addRule( (pos == ArrowPosition.LEFT) ? RelativeLayout.ALIGN_PARENT_LEFT : RelativeLayout.ALIGN_PARENT_RIGHT, 0); lp = (LayoutParams) tagView.containterBlock.getLayoutParams(); lp.addRule((pos == ArrowPosition.LEFT) ? RelativeLayout.LEFT_OF : RelativeLayout.RIGHT_OF, R.id.quick_contact_photo); lp.addRule((pos == ArrowPosition.LEFT) ? RelativeLayout.RIGHT_OF : RelativeLayout.LEFT_OF, 0); tagView.quickContactView.setPosition(pos); }
From source file:com.abcvoipsip.ui.messages.MessageAdapter.java
private void setPhotoSide(MessageListItemViews tagView, ArrowPosition pos) { LayoutParams lp = (RelativeLayout.LayoutParams) tagView.quickContactView.getLayoutParams(); lp.addRule(//w w w . ja v a 2 s . c o m (pos == ArrowPosition.LEFT) ? RelativeLayout.ALIGN_PARENT_RIGHT : RelativeLayout.ALIGN_PARENT_LEFT); lp.addRule( (pos == ArrowPosition.LEFT) ? RelativeLayout.ALIGN_PARENT_LEFT : RelativeLayout.ALIGN_PARENT_RIGHT, 0); lp = (RelativeLayout.LayoutParams) tagView.containterBlock.getLayoutParams(); lp.addRule((pos == ArrowPosition.LEFT) ? RelativeLayout.LEFT_OF : RelativeLayout.RIGHT_OF, R.id.quick_contact_photo); lp.addRule((pos == ArrowPosition.LEFT) ? RelativeLayout.RIGHT_OF : RelativeLayout.LEFT_OF, 0); tagView.quickContactView.setPosition(pos); }
From source file:es.eucm.eadandroid.utils.ViewPagerIndicator.java
/** * Create all views, build the layout/*from w w w . j a v a 2 s . c o m*/ */ private void addContent() { mFocusedTextColor = new int[] { 0, 0, 0 }; mUnfocusedTextColor = new int[] { 225, 225, 225 }; // Text views mPrevious = new TextView(getContext()); mCurrent = new TextView(getContext()); mNext = new TextView(getContext()); RelativeLayout.LayoutParams previousParams = new RelativeLayout.LayoutParams( android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT); previousParams.addRule(RelativeLayout.ALIGN_LEFT); RelativeLayout.LayoutParams currentParams = new RelativeLayout.LayoutParams( android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT); currentParams.addRule(RelativeLayout.CENTER_HORIZONTAL); RelativeLayout.LayoutParams nextParams = new RelativeLayout.LayoutParams( android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT); nextParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); // Groups holding text and arrows mPreviousGroup = new LinearLayout(getContext()); mPreviousGroup.setOrientation(LinearLayout.HORIZONTAL); mNextGroup = new LinearLayout(getContext()); mNextGroup.setOrientation(LinearLayout.HORIZONTAL); mPreviousGroup.addView(mPrevious, new LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT)); mNextGroup.addView(mNext, new LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT)); addView(mPreviousGroup, previousParams); addView(mCurrent, currentParams); addView(mNextGroup, nextParams); mPrevious.setSingleLine(); mCurrent.setSingleLine(); mNext.setSingleLine(); mPrevious.setText("previous"); mCurrent.setText("current"); mNext.setText("next"); // Set colors mNext.setTextColor(Color.argb(255, mUnfocusedTextColor[0], mUnfocusedTextColor[1], mUnfocusedTextColor[2])); mPrevious.setTextColor( Color.argb(255, mUnfocusedTextColor[0], mUnfocusedTextColor[1], mUnfocusedTextColor[2])); updateColor(0); }
From source file:fr.cph.stock.android.activity.AccountActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { Log.v(TAG, "Account Activity onCreate"); super.onCreate(savedInstanceState); setContentView(R.layout.account_activity); Bundle b = getIntent().getExtras();/* w ww. j a v a2 s . co m*/ portfolio = b.getParcelable("portfolio"); errorView = (TextView) findViewById(R.id.errorMessage); totalValueView = (TextView) findViewById(R.id.totalValue); totalGainView = (TextView) findViewById(R.id.totalGain); totalPlusMinusValueView = (TextView) findViewById(R.id.totalPlusMinusValue); lastUpateView = (TextView) findViewById(R.id.lastUpdate); liquidityView = (TextView) findViewById(R.id.liquidity); yieldYearView = (TextView) findViewById(R.id.yieldYear); shareValueView = (TextView) findViewById(R.id.shareValue); gainView = (TextView) findViewById(R.id.gain2); perfView = (TextView) findViewById(R.id.perf); yieldView = (TextView) findViewById(R.id.yieldPerf); taxesView = (TextView) findViewById(R.id.taxes); RelativeLayout accLayout = (RelativeLayout) findViewById(R.id.accountsLayout); TextView recent = new TextView(getApplicationContext()); textViews = new ArrayList<TextView>(); int id = 1; int nameID = 100; int viewId1 = 500; int currencyId = 1000; for (int i = 0; i < portfolio.getAccounts().size(); i++) { Account account = portfolio.getAccounts().get(i); TextView currentAccountNameTextView = new TextView(getApplicationContext()); currentAccountNameTextView.setText(account.getName()); currentAccountNameTextView.setTextColor(Color.GRAY); currentAccountNameTextView.setId(nameID); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams((int) LayoutParams.WRAP_CONTENT, (int) LayoutParams.WRAP_CONTENT); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } params.addRule(RelativeLayout.ALIGN_PARENT_LEFT); currentAccountNameTextView.setLayoutParams(params); accLayout.addView(currentAccountNameTextView, params); textViews.add(currentAccountNameTextView); View viewPoint1 = new View(getApplicationContext()); viewPoint1.setId(viewId1); viewPoint1.setBackgroundColor(getResources().getColor(R.color.grey_light)); params = new RelativeLayout.LayoutParams((int) LayoutParams.MATCH_PARENT, 2); params.addRule(RelativeLayout.RIGHT_OF, nameID); params.addRule(RelativeLayout.LEFT_OF, currencyId); params.setMargins(0, Util.convertDpToPxl(15, getApplicationContext()), 0, 0); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } viewPoint1.setLayoutParams(params); accLayout.addView(viewPoint1, params); TextView currentCurrencyTextView = new TextView(getApplicationContext()); currentCurrencyTextView.setText(account.getCurrency()); currentCurrencyTextView.setTextColor(Color.GRAY); currentCurrencyTextView.setId(currencyId); params = new RelativeLayout.LayoutParams((int) LayoutParams.WRAP_CONTENT, (int) LayoutParams.WRAP_CONTENT); params.addRule(RelativeLayout.CENTER_HORIZONTAL); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } currentCurrencyTextView.setLayoutParams(params); accLayout.addView(currentCurrencyTextView, params); textViews.add(currentCurrencyTextView); View viewPoint2 = new View(getApplicationContext()); viewPoint2.setBackgroundColor(getResources().getColor(R.color.grey_light)); params = new RelativeLayout.LayoutParams((int) LayoutParams.MATCH_PARENT, 2); params.addRule(RelativeLayout.RIGHT_OF, currencyId); params.addRule(RelativeLayout.LEFT_OF, id); params.setMargins(0, Util.convertDpToPxl(15, getApplicationContext()), 0, 0); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } viewPoint2.setLayoutParams(params); accLayout.addView(viewPoint2, params); TextView currentTextView = new TextView(getApplicationContext()); currentTextView.setText(account.getLiquidity()); currentTextView.setTextColor(Color.GRAY); currentTextView.setId(id); params = new RelativeLayout.LayoutParams((int) LayoutParams.WRAP_CONTENT, (int) LayoutParams.WRAP_CONTENT); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); currentTextView.setLayoutParams(params); recent = currentTextView; accLayout.addView(currentTextView, params); textViews.add(currentTextView); id++; nameID++; viewId1++; currencyId++; } buildUi(false); // Set context EasyTracker.getInstance().setContext(getApplicationContext()); // Instantiate the Tracker tracker = EasyTracker.getTracker(); }