1. peer list layout fix

This commit is contained in:
vadym 2020-06-30 07:03:58 -07:00
parent 04f2537145
commit 13af25ae08
2 changed files with 43 additions and 36 deletions

View File

@ -38,7 +38,7 @@ class SelectDNSInfoListAdapter(
dnsInfoHolder.checkbox = listItem.findViewById(R.id.checkbox) as CheckBox
dnsInfoHolder.countryFlag = listItem.findViewById(R.id.countryFlag) as ImageView
dnsInfoHolder.dnsInfoText = listItem.findViewById(R.id.hostInfoText) as TextView
dnsInfoHolder.ping = listItem.findViewById(R.id.ping) as TextView
dnsInfoHolder.ping = listItem.findViewById(R.id.frame) as TextView
listItem.tag = dnsInfoHolder
} else {
dnsInfoHolder = listItem.tag as DNSInfoHolder

View File

@ -1,57 +1,64 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal">
<FrameLayout
android:id="@+id/frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="0.4"
android:scaleY="0.4"
android:background="@drawable/checkbox_rounded_corner"
android:layout_alignParentStart="true"
android:layout_centerInParent="true">
<CheckBox
android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:theme="@style/SwitchTheme"
android:scaleX="3"
android:scaleY="3"
android:layout_margin="10dp"
android:background="@android:color/transparent"
android:checked="false"/>
</FrameLayout>
<ImageView
android:id="@+id/countryFlag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_toEndOf="@+id/frame"
android:layout_centerInParent="true"/>
android:layout_marginStart="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="@+id/hostInfoText"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/hostInfoText"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginEnd="60dp"
android:minHeight="45dp"
android:textSize="14sp"
android:textColor="@color/white"
android:layout_toEndOf="@+id/countryFlag"
android:layout_centerInParent="true"/>
android:layout_marginStart="10dp"
app:layout_constraintEnd_toStartOf="@+id/ping"
app:layout_constraintStart_toEndOf="@+id/countryFlag"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/ping"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginStart="10dp"
android:paddingEnd="10dp"
android:minHeight="45dp"
android:textSize="14sp"
android:textColor="@color/white"
android:layout_alignParentEnd="true"
android:layout_centerInParent="true"/>
</RelativeLayout>
app:layout_constraintEnd_toStartOf="@+id/frame"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<FrameLayout
android:id="@+id/frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/checkbox_rounded_corner"
android:scaleX="0.4"
android:scaleY="0.4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<CheckBox
android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@android:color/transparent"
android:checked="false"
android:scaleX="3"
android:scaleY="3"
android:theme="@style/SwitchTheme" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>