From 79b0b5fbe6778ea4d77edd4e4052bfe0995f0769 Mon Sep 17 00:00:00 2001 From: akwizgran <michael@briarproject.org> Date: Tue, 20 Apr 2021 11:35:52 +0100 Subject: [PATCH] Make interface list scrollable. --- .../hotspot/InterfacesFragment.java | 2 +- .../main/res/layout/fragment_interfaces.xml | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/briarproject/hotspot/InterfacesFragment.java b/app/src/main/java/org/briarproject/hotspot/InterfacesFragment.java index 9a5d06d..a41006d 100644 --- a/app/src/main/java/org/briarproject/hotspot/InterfacesFragment.java +++ b/app/src/main/java/org/briarproject/hotspot/InterfacesFragment.java @@ -21,7 +21,7 @@ public class InterfacesFragment extends Fragment { @Override public void onViewCreated(@NonNull View v, @Nullable Bundle savedInstanceState) { super.onViewCreated(v, savedInstanceState); - TextView textView = (TextView) v; + TextView textView = v.findViewById(R.id.text); textView.setText(NetworkUtils.getNetworkInterfaceSummary()); } diff --git a/app/src/main/res/layout/fragment_interfaces.xml b/app/src/main/res/layout/fragment_interfaces.xml index 90c28c9..1fcd36d 100644 --- a/app/src/main/res/layout/fragment_interfaces.xml +++ b/app/src/main/res/layout/fragment_interfaces.xml @@ -1,8 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> -<TextView xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:fontFamily="monospace" - android:padding="16dp" - tools:text="@tools:sample/lorem/random" /> +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:fontFamily="monospace" + android:padding="16dp" + tools:text="@tools:sample/lorem/random" /> +</ScrollView> \ No newline at end of file -- GitLab