Advertisement
Guest User

Untitled

a guest
Dec 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1.    linearLayout_childItems = itemView.findViewById(R.id.ll_child_items);
  2.             for (int indexView = 0; indexView < intMaxNoOfChild; indexView++) {
  3.                 TextView textView = new TextView(context);
  4.                 textView.setId(indexView);
  5.                 textView.setPadding(0, 20, 0, 20);
  6.                 textView.setGravity(Gravity.CENTER);
  7.                 textView.setBackground(ContextCompat.getDrawable(context, R.drawable.background_sub_module_text));
  8.                 LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
  9.                 textView.setOnClickListener(this);
  10.  
  11.                 Button bt = new Button(context);
  12.                 bt.setText("r");
  13.                 linearLayout_childItems.addView(textView, layoutParams);
  14.                 linearLayout_childItems.addView(bt, layoutParams);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement