Guest User

Untitled

a guest
Apr 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. gl = (GridLayout) v.findViewById(R.id.tlGridTable);
  2. gl.setPadding(2, 2, 2, 2);[enter image description here][1]
  3. gl.setBackgroundResource(R.drawable.grid_items_border);
  4. gl.setColumnCount(13);
  5.  
  6. TextView instText = new TextView(v.getContext());
  7. instText.setText("Institutions");
  8. GridLayout.LayoutParams instparam = new GridLayout.LayoutParams();
  9. instparam.setGravity(Gravity.CENTER);
  10. instparam.rowSpec = GridLayout.spec(1, 2);
  11. instparam.columnSpec = GridLayout.spec(0);
  12. instText.setLayoutParams(instparam);
  13. instText.setBackgroundResource(R.drawable.grid_items_border);
  14. gl.addView(instText);
  15.  
  16. TextView totalAssests = new TextView(v.getContext());
  17. totalAssests.setText("Total Assets");
  18. totalAssests.setBackgroundColor(Color.LTGRAY);
  19. GridLayout.LayoutParams totalAssest = new GridLayout.LayoutParams();
  20. totalAssest.columnSpec = GridLayout.spec(1, 3);
  21. totalAssest.setMargins(34, 0, 0, 0);
  22. totalAssest.setGravity(Gravity.CENTER);
  23. totalAssests.setLayoutParams(totalAssest);
  24. totalAssests.setBackgroundResource(R.drawable.grid_items_border);
  25. gl.addView(totalAssests);
  26.  
  27. TextView totalCapital = new TextView(v.getContext());
  28. totalCapital.setText("Capital");
  29. totalCapital.setBackgroundColor(Color.LTGRAY);
  30. GridLayout.LayoutParams totalCap = new GridLayout.LayoutParams();
  31. totalCap.columnSpec = GridLayout.spec(4, 3);
  32. totalCap.setMargins(34, 0, 0, 0);
  33. totalCap.setGravity(Gravity.CENTER);
  34. totalCapital.setLayoutParams(totalCap);
  35. totalCapital.setBackgroundResource(R.drawable.grid_items_border);
  36. gl.addView(totalCapital);
  37.  
  38. TextView deposits = new TextView(v.getContext());
  39. deposits.setText("Deposits");
  40. deposits.setBackgroundColor(Color.LTGRAY);
  41. GridLayout.LayoutParams dep = new GridLayout.LayoutParams();
  42. dep.columnSpec = GridLayout.spec(7, 3);
  43. dep.setMargins(34, 0, 0, 0);
  44. dep.setGravity(Gravity.CENTER);
  45. deposits.setLayoutParams(dep);
  46. deposits.setBackgroundResource(R.drawable.grid_items_border);
  47. gl.addView(deposits);
  48.  
  49. TextView loanAd = new TextView(v.getContext());
  50. loanAd.setText("Loans and Advances");
  51. loanAd.setBackgroundColor(Color.LTGRAY);
  52. GridLayout.LayoutParams loan = new GridLayout.LayoutParams();
  53. loan.columnSpec = GridLayout.spec(10, 3);
  54. loan.setMargins(34, 0, 0, 0);
  55. loan.setGravity(Gravity.CENTER);
  56. loanAd.setLayoutParams(loan);
  57. loanAd.setBackgroundResource(R.drawable.grid_items_border);
  58. gl.addView(loanAd);
Add Comment
Please, Sign In to add comment