У меня есть изображение и текстовое представление, которые были сгенерированы программно, но я столкнулся с проблемой, как сделать родительский отступ LinearLayout
прямо под моим кодом
LinearLayout lin = (LinearLayout) convertView.findViewById(R.id.linearChat);
final ImageView img1 = new ImageView(context);
final TextView tv1 = new TextView(context);
tv1.setText(chat.getPesan());
img1.setImageDrawable(context.getResources().getDrawable(R.drawable.cservice));
lin.addView(tv1);
tv1.setBackgroundResource(R.drawable.rounded_corner1);
tv1.setPadding(10,10,10,10);
lin.addView(img1);