| | |
| | | ) |
| | | } |
| | | |
| | | |
| | | // setPadding( |
| | | // TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20f, resources.displayMetrics).toInt(), // left padding |
| | | // TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt(), // top padding |
| | | // TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20f, resources.displayMetrics).toInt(), // right padding |
| | | // TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt() // bottom padding |
| | | // ) |
| | | } |
| | | |
| | | val textView = TextView(this).apply { |
| | |
| | | ConstraintSet.TOP, |
| | | previousViewId, |
| | | if (index == 0) ConstraintSet.TOP else ConstraintSet.BOTTOM, |
| | | 16 |
| | | 32 |
| | | ) |
| | | constraintSet.connect( |
| | | iconView.id, |
| | | ConstraintSet.START, |
| | | ConstraintSet.PARENT_ID, |
| | | ConstraintSet.START, |
| | | 16 |
| | | 32 |
| | | ) |
| | | |
| | | // Text 位置 |
| | |
| | | ConstraintSet.START, |
| | | iconView.id, |
| | | ConstraintSet.END, |
| | | 8 |
| | | 32 |
| | | ) |
| | | |
| | | // Check 位置 |
| | |
| | | ConstraintSet.END, |
| | | ConstraintSet.PARENT_ID, |
| | | ConstraintSet.END, |
| | | 16 |
| | | 32 |
| | | ) |
| | | |
| | | constraintSet.applyTo(container) |
| | |
| | | android:id="@+id/dynamicContainer" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:padding="20dp" |
| | | android:padding="10dp" |
| | | android:layout_marginTop="0dp" |
| | | android:background="@android:color/transparent" |
| | | app:layout_constraintTop_toBottomOf="@id/divider" |
| | |
| | | android:textColor="#7E5C3C" |
| | | android:textSize="14sp" |
| | | android:gravity="start" |
| | | android:layout_marginLeft="0dp" |
| | | android:layout_marginLeft="10dp" |
| | | android:orientation="horizontal" |
| | | /> |
| | | |