Я хотел бы выполнить задачу, показанную на двух изображениях ниже;точнее, иметь возможность каким-либо образом «расширять» TextInputLayout на коммутатор, чтобы он включался в вышеупомянутый макет вместе с TextInputEditText.
Все попытки, которые я сделал до сих пор, провалились.
XML-код для одного элемента приведен ниже:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="10dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/myprofile_twitter"
android:layout_width="match_parent"
android:textColor="@color/blue_grey_800"
android:layout_height="wrap_content"
android:hint="Twitter" />
</android.support.design.widget.TextInputLayout>
<Switch
android:id="@+id/twitter_switch"
android:layout_width="45dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:layout_gravity="center_vertical"/>
</LinearLayout>
И вот два изображения (изображение1 - это то, как оно представлено в настоящее время, а изображение 2 - то, чего я хотел бы достичь - см. Linkedin).Хотя, не уверен, возможно ли это сделать.
![enter image description here](https://i.stack.imgur.com/Nptvq.png)
![enter image description here](https://i.stack.imgur.com/k4qsY.png)