ui: fix scrolling in detail view
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
6a11a199ca
commit
ef70aa88e1
@ -22,131 +22,134 @@
|
|||||||
type="com.wireguard.config.Config" />
|
type="com.wireguard.config.Config" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/colorBackground"
|
android:background="?attr/colorBackground"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true">
|
||||||
android:orientation="vertical">
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
|
||||||
android:id="@+id/tunnel_detail_card"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
app:cardBackgroundColor="?attr/elevationOverlayColor"
|
|
||||||
app:cardCornerRadius="0dp"
|
|
||||||
app:cardElevation="2dp"
|
|
||||||
app:contentPadding="8dp"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:id="@+id/tunnel_detail_card"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:cardBackgroundColor="?attr/elevationOverlayColor"
|
||||||
|
app:cardCornerRadius="0dp"
|
||||||
|
app:cardElevation="2dp"
|
||||||
|
app:contentPadding="8dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/interface_title"
|
|
||||||
style="@style/SectionText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/interface_title"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<com.wireguard.android.widget.ToggleSwitch
|
|
||||||
android:id="@+id/tunnel_switch"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
app:checked="@{tunnel.state == State.UP}"
|
|
||||||
app:layout_constraintBaseline_toBaselineOf="@+id/interface_title"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:onBeforeCheckedChanged="@{fragment::setTunnelState}" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/interface_name_label"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:labelFor="@+id/interface_name_text"
|
|
||||||
android:text="@string/name"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/interface_title" />
|
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.textview.MaterialTextView
|
||||||
android:id="@+id/interface_name_text"
|
android:id="@+id/interface_title"
|
||||||
style="@style/DetailText"
|
style="@style/SectionText"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{tunnel.name}"
|
android:text="@string/interface_title"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/interface_name_label"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
tools:text="wg0" />
|
|
||||||
|
|
||||||
<TextView
|
<com.wireguard.android.widget.ToggleSwitch
|
||||||
android:id="@+id/public_key_label"
|
android:id="@+id/tunnel_switch"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="16dp"
|
||||||
android:labelFor="@+id/public_key_text"
|
app:checked="@{tunnel.state == State.UP}"
|
||||||
android:text="@string/public_key"
|
app:layout_constraintBaseline_toBaselineOf="@+id/interface_title"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/interface_name_text" />
|
app:onBeforeCheckedChanged="@{fragment::setTunnelState}" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/public_key_text"
|
android:id="@+id/interface_name_label"
|
||||||
style="@style/DetailText"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginTop="8dp"
|
||||||
android:contentDescription="@string/public_key_description"
|
android:labelFor="@+id/interface_name_text"
|
||||||
android:ellipsize="end"
|
android:text="@string/name"
|
||||||
android:maxLines="1"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:onClick="@{ClipboardUtils::copyTextView}"
|
app:layout_constraintTop_toBottomOf="@+id/interface_title" />
|
||||||
android:singleLine="true"
|
|
||||||
android:text="@{config.interface.keyPair.publicKey.toBase64}"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/public_key_label"
|
|
||||||
tools:text="wOs2eguFEohqIZxlSJ1CAT9584tc6ejj9hfGFsoBVkA=" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/addresses_label"
|
android:id="@+id/interface_name_text"
|
||||||
android:layout_width="match_parent"
|
style="@style/DetailText"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_height="wrap_content"
|
||||||
android:labelFor="@+id/addresses_text"
|
android:text="@{tunnel.name}"
|
||||||
android:text="@string/addresses"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toBottomOf="@+id/interface_name_label"
|
||||||
app:layout_constraintTop_toBottomOf="@id/public_key_text" />
|
tools:text="wg0" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/addresses_text"
|
android:id="@+id/public_key_label"
|
||||||
style="@style/DetailText"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginTop="8dp"
|
||||||
android:contentDescription="@string/addresses"
|
android:labelFor="@+id/public_key_text"
|
||||||
android:text="@{config.interface.addresses}"
|
android:text="@string/public_key"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/addresses_label"
|
app:layout_constraintTop_toBottomOf="@id/interface_name_text" />
|
||||||
tools:text="fc00:bbbb:bbbb:bb11::3:368b/128" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:id="@+id/peers_layout"
|
android:id="@+id/public_key_text"
|
||||||
android:layout_width="match_parent"
|
style="@style/DetailText"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_height="wrap_content"
|
||||||
android:divider="@null"
|
android:contentDescription="@string/public_key_description"
|
||||||
android:orientation="vertical"
|
android:ellipsize="end"
|
||||||
app:items="@{config.peers}"
|
android:maxLines="1"
|
||||||
app:layout="@{@layout/tunnel_detail_peer}"
|
android:onClick="@{ClipboardUtils::copyTextView}"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:singleLine="true"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tunnel_detail_card"
|
android:text="@{config.interface.keyPair.publicKey.toBase64}"
|
||||||
tools:ignore="UselessLeaf" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
app:layout_constraintTop_toBottomOf="@+id/public_key_label"
|
||||||
|
tools:text="wOs2eguFEohqIZxlSJ1CAT9584tc6ejj9hfGFsoBVkA=" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/addresses_label"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:labelFor="@+id/addresses_text"
|
||||||
|
android:text="@string/addresses"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/public_key_text" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/addresses_text"
|
||||||
|
style="@style/DetailText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@string/addresses"
|
||||||
|
android:text="@{config.interface.addresses}"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/addresses_label"
|
||||||
|
tools:text="fc00:bbbb:bbbb:bb11::3:368b/128" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/peers_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:divider="@null"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:items="@{config.peers}"
|
||||||
|
app:layout="@{@layout/tunnel_detail_peer}"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tunnel_detail_card"
|
||||||
|
tools:ignore="UselessLeaf" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</ScrollView>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user