diff --git a/briar-android/src/main/java/org/briarproject/briar/android/navdrawer/PluginViewController.java b/briar-android/src/main/java/org/briarproject/briar/android/navdrawer/PluginViewController.java index 42901a5ce4cadea9d07656af626dde5efeede203..f8776e566cf3ede68e8595aa75f893bf046b2a09 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/navdrawer/PluginViewController.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/navdrawer/PluginViewController.java @@ -11,11 +11,14 @@ import org.briarproject.bramble.api.plugin.TorConstants; import org.briarproject.bramble.api.plugin.TransportId; import org.briarproject.briar.R; +import androidx.appcompat.widget.AppCompatImageButton; import androidx.appcompat.widget.SwitchCompat; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintSet; import androidx.lifecycle.LifecycleOwner; +import static android.os.Build.VERSION.SDK_INT; +import static android.transition.TransitionManager.beginDelayedTransition; import static android.view.View.FOCUS_DOWN; import static androidx.core.content.ContextCompat.getColor; import static org.briarproject.bramble.api.plugin.Plugin.State.ACTIVE; @@ -27,7 +30,8 @@ import static org.briarproject.briar.android.navdrawer.NavDrawerViewModel.TRANSP class PluginViewController { private final ConstraintLayout drawerContent; - private final View backgroundView; + private final ConstraintSet collapsedConstraints, expandedConstraints; + private final AppCompatImageButton chevronView; private final ImageView torIcon, wifiIcon, btIcon; private final SwitchCompat torSwitch, wifiSwitch, btSwitch; @@ -36,20 +40,28 @@ class PluginViewController { PluginViewController(View v, LifecycleOwner owner, NavDrawerViewModel viewModel) { drawerContent = v.findViewById(R.id.drawerContent); - backgroundView = v.findViewById(R.id.backgroundView); - ConstraintSet cs = new ConstraintSet(); - cs.load(v.getContext(), R.xml.transports_list_collapsed); - drawerContent.setConstraintSet(cs); - backgroundView.setOnClickListener(view -> toggleExpandedView()); + collapsedConstraints = new ConstraintSet(); + collapsedConstraints.clone(v.getContext(), + R.layout.navigation_menu_collapsed); + expandedConstraints = new ConstraintSet(); + expandedConstraints.clone(v.getContext(), + R.layout.navigation_menu_expanded); + + // Scroll the drawer to the bottom when the view is expanded/collapsed ScrollView scrollView = v.findViewById(R.id.drawerScrollView); drawerContent.addOnLayoutChangeListener((view, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> scrollView.fullScroll(FOCUS_DOWN)); - v.findViewById(R.id.chevronView).setOnClickListener(view -> - toggleExpandedView()); + // Clicking the chevron expands or collapses the view + chevronView = v.findViewById(R.id.chevronView); + chevronView.setOnClickListener(view -> expandOrCollapseView()); + + // The whole view is clickable when collapsed + v.findViewById(R.id.connectionsBackground).setOnClickListener(view -> + expandOrCollapseView()); torIcon = v.findViewById(R.id.torIcon); wifiIcon = v.findViewById(R.id.wifiIcon); @@ -74,21 +86,16 @@ class PluginViewController { } } - private void toggleExpandedView() { - ConstraintSet cs = new ConstraintSet(); + private void expandOrCollapseView() { + if (SDK_INT >= 19) beginDelayedTransition(drawerContent); if (expanded) { - cs.load(drawerContent.getContext(), - R.xml.transports_list_collapsed); - drawerContent.setConstraintSet(cs); - backgroundView.setOnClickListener(v -> toggleExpandedView()); - expanded = false; + collapsedConstraints.applyTo(drawerContent); + chevronView.setImageResource(R.drawable.chevron_up_white); } else { - cs.load(drawerContent.getContext(), - R.xml.transports_list_expanded); - drawerContent.setConstraintSet(cs); - backgroundView.setOnClickListener(null); - expanded = true; + expandedConstraints.applyTo(drawerContent); + chevronView.setImageResource(R.drawable.chevron_down_white); } + expanded = !expanded; } private void stateUpdate(TransportId id, State state) { diff --git a/briar-android/src/main/res/layout/navigation_menu.xml b/briar-android/src/main/res/layout/navigation_menu.xml index 17ed20534f734d5b9d43c2f7d6dce25100791ace..f23d4bda95dff6fbd8be2e9955ad69bdfac2d23c 100644 --- a/briar-android/src/main/res/layout/navigation_menu.xml +++ b/briar-android/src/main/res/layout/navigation_menu.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawerScrollView" android:layout_width="wrap_content" android:layout_height="match_parent" @@ -8,30 +7,6 @@ android:fillViewport="true" android:orientation="vertical"> - <androidx.constraintlayout.widget.ConstraintLayout - android:id="@+id/drawerContent" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:background="@color/window_background" - android:orientation="vertical"> + <include layout="@layout/navigation_menu_collapsed" /> - <com.google.android.material.navigation.NavigationView - android:id="@+id/navigation" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:background="@color/window_background" - app:elevation="0dp" - app:headerLayout="@layout/navigation_header" - app:itemBackground="@drawable/navigation_item_background" - app:itemIconTint="?attr/colorControlNormal" - app:itemTextColor="?android:textColorPrimary" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.0" - app:menu="@menu/navigation_drawer" /> - - <include layout="@layout/transports_list" /> - - </androidx.constraintlayout.widget.ConstraintLayout> - -</ScrollView> +</ScrollView> \ No newline at end of file diff --git a/briar-android/src/main/res/layout/navigation_menu_collapsed.xml b/briar-android/src/main/res/layout/navigation_menu_collapsed.xml new file mode 100644 index 0000000000000000000000000000000000000000..11daa10fcff7c9a5f4e6d93ab5b0df298ab684c5 --- /dev/null +++ b/briar-android/src/main/res/layout/navigation_menu_collapsed.xml @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/drawerContent" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@color/window_background"> + + <com.google.android.material.navigation.NavigationView + android:id="@+id/navigation" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@color/window_background" + app:elevation="0dp" + app:headerLayout="@layout/navigation_header" + app:itemBackground="@drawable/navigation_item_background" + app:itemIconTint="?attr/colorControlNormal" + app:itemTextColor="?android:textColorPrimary" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.0" + app:menu="@menu/navigation_drawer" /> + + <androidx.appcompat.widget.AppCompatImageButton + android:id="@+id/chevronView" + android:layout_width="0dp" + android:layout_height="24dp" + android:layout_marginBottom="8dp" + android:background="@color/divider" + android:foreground="?attr/selectableItemBackground" + android:src="@drawable/chevron_up_white" + app:layout_constraintBottom_toTopOf="@+id/connectionsLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/navigation" + app:layout_constraintVertical_bias="1.0" + app:layout_constraintVertical_chainStyle="packed" + app:tint="?attr/colorControlNormal" + tools:ignore="ContentDescription,UnusedAttribute" /> + + <View + android:id="@+id/connectionsBackground" + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/chevronView" /> + + <TextView + android:id="@+id/connectionsLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:layout_marginTop="8dp" + android:layout_marginBottom="16dp" + android:text="@string/transport_connection" + android:textSize="12sp" + android:visibility="visible" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/torIcon" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/chevronView" /> + + <!-- Hidden --> + <View + android:id="@+id/longRangeBackground" + android:layout_width="0dp" + android:layout_height="0dp" + android:background="@color/item_background_highlight" + android:visibility="gone" + tools:ignore="MissingConstraints" /> + + <!-- Hidden --> + <TextView + android:id="@+id/longRangeLabel" + android:layout_width="0dp" + android:layout_height="0dp" + android:text="@string/transport_internet" + android:textSize="12sp" + android:visibility="gone" + tools:ignore="MissingConstraints" /> + + <ImageView + android:id="@+id/torIcon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:src="@drawable/transport_tor" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/wifiIcon" + app:layout_constraintTop_toBottomOf="@+id/chevronView" + tools:ignore="ContentDescription" + tools:tint="@color/briar_green" /> + + <!-- Hidden --> + <androidx.appcompat.widget.SwitchCompat + android:id="@+id/torSwitch" + android:layout_width="0dp" + android:layout_height="0dp" + android:text="@string/transport_tor" + android:visibility="gone" + tools:ignore="MissingConstraints" /> + + <!-- Hidden --> + <TextView + android:id="@+id/nearbyLabel" + android:layout_width="0dp" + android:layout_height="0dp" + android:text="@string/transport_nearby" + android:textSize="12sp" + android:visibility="gone" + tools:ignore="MissingConstraints" /> + + <ImageView + android:id="@+id/wifiIcon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:src="@drawable/transport_lan" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/btIcon" + app:layout_constraintTop_toBottomOf="@+id/chevronView" + tools:checked="true" + tools:ignore="ContentDescription" + tools:tint="@color/briar_green" /> + + <!-- Hidden --> + <androidx.appcompat.widget.SwitchCompat + android:id="@+id/wifiSwitch" + android:layout_width="0dp" + android:layout_height="0dp" + android:text="@string/transport_lan" + android:visibility="gone" + tools:ignore="MissingConstraints" /> + + <ImageView + android:id="@+id/btIcon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:src="@drawable/transport_bt" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toBottomOf="@+id/chevronView" + tools:checked="true" + tools:ignore="ContentDescription" + tools:tint="@color/briar_green" /> + + <!-- Hidden --> + <androidx.appcompat.widget.SwitchCompat + android:id="@+id/btSwitch" + android:layout_width="0dp" + android:layout_height="0dp" + android:text="@string/transport_bt" + android:visibility="gone" + tools:ignore="MissingConstraints" /> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/briar-android/src/main/res/layout/navigation_menu_expanded.xml b/briar-android/src/main/res/layout/navigation_menu_expanded.xml new file mode 100644 index 0000000000000000000000000000000000000000..1573a9917f51d2293124277446fda1fa10ed5004 --- /dev/null +++ b/briar-android/src/main/res/layout/navigation_menu_expanded.xml @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/drawerContent" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@color/window_background"> + + <com.google.android.material.navigation.NavigationView + android:id="@+id/navigation" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@color/window_background" + app:elevation="0dp" + app:headerLayout="@layout/navigation_header" + app:itemBackground="@drawable/navigation_item_background" + app:itemIconTint="?attr/colorControlNormal" + app:itemTextColor="?android:textColorPrimary" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.0" + app:menu="@menu/navigation_drawer" /> + + <androidx.appcompat.widget.AppCompatImageButton + android:id="@+id/chevronView" + android:layout_width="0dp" + android:layout_height="24dp" + android:layout_marginBottom="8dp" + android:background="@color/divider" + android:foreground="?attr/selectableItemBackground" + android:src="@drawable/chevron_down_white" + app:layout_constraintBottom_toTopOf="@+id/longRangeLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/navigation" + app:layout_constraintVertical_bias="1.0" + app:layout_constraintVertical_chainStyle="packed" + app:tint="?attr/colorControlNormal" + tools:ignore="ContentDescription,UnusedAttribute" /> + + <!-- Hidden --> + <View + android:id="@+id/connectionsBackground" + android:layout_width="0dp" + android:layout_height="0dp" + android:visibility="gone" + tools:ignore="MissingConstraints" /> + + <!-- Hidden --> + <TextView + android:id="@+id/connectionsLabel" + android:layout_width="0dp" + android:layout_height="0dp" + android:text="@string/transport_connection" + android:textSize="12sp" + android:visibility="gone" + tools:ignore="MissingConstraints" /> + + <View + android:id="@+id/longRangeBackground" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginBottom="8dp" + android:background="@color/item_background_highlight" + app:layout_constraintBottom_toTopOf="@+id/nearbyLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/chevronView" /> + + <TextView + android:id="@+id/longRangeLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:text="@string/transport_internet" + android:textSize="12sp" + app:layout_constraintBottom_toTopOf="@+id/torSwitch" + app:layout_constraintStart_toStartOf="@+id/torIcon" + app:layout_constraintTop_toBottomOf="@+id/chevronView" /> + + <ImageView + android:id="@+id/torIcon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:src="@drawable/transport_tor" + app:layout_constraintBottom_toBottomOf="@+id/torSwitch" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="@+id/torSwitch" + tools:ignore="ContentDescription" + tools:tint="@color/briar_green" /> + + <androidx.appcompat.widget.SwitchCompat + android:id="@+id/torSwitch" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:layout_marginBottom="16dp" + android:text="@string/transport_tor" + app:layout_constraintBottom_toTopOf="@+id/nearbyLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/torIcon" + app:layout_constraintTop_toBottomOf="@+id/longRangeLabel" + tools:checked="true" /> + + <TextView + android:id="@+id/nearbyLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:gravity="center_vertical" + android:text="@string/transport_nearby" + android:textSize="12sp" + app:layout_constraintBottom_toTopOf="@+id/wifiSwitch" + app:layout_constraintStart_toStartOf="@+id/torIcon" + app:layout_constraintTop_toBottomOf="@+id/torSwitch" /> + + <ImageView + android:id="@+id/wifiIcon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:src="@drawable/transport_lan" + app:layout_constraintBottom_toBottomOf="@+id/wifiSwitch" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="@+id/wifiSwitch" + tools:checked="true" + tools:ignore="ContentDescription" + tools:tint="@color/briar_green" /> + + <androidx.appcompat.widget.SwitchCompat + android:id="@+id/wifiSwitch" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:layout_marginBottom="8dp" + android:text="@string/transport_lan" + app:layout_constraintBottom_toTopOf="@+id/btSwitch" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/wifiIcon" + app:layout_constraintTop_toBottomOf="@+id/nearbyLabel" + tools:checked="true" /> + + <ImageView + android:id="@+id/btIcon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:src="@drawable/transport_bt" + app:layout_constraintBottom_toBottomOf="@+id/btSwitch" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="@+id/btSwitch" + tools:checked="true" + tools:ignore="ContentDescription" + tools:tint="@color/briar_green" /> + + <androidx.appcompat.widget.SwitchCompat + android:id="@+id/btSwitch" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:layout_marginBottom="8dp" + android:text="@string/transport_bt" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/btIcon" + app:layout_constraintTop_toBottomOf="@+id/wifiSwitch" + tools:checked="true" /> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/briar-android/src/main/res/layout/transports_list.xml b/briar-android/src/main/res/layout/transports_list.xml deleted file mode 100644 index 71de3ca0a54af5cfe56644b4a8b7e5458f675586..0000000000000000000000000000000000000000 --- a/briar-android/src/main/res/layout/transports_list.xml +++ /dev/null @@ -1,110 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<merge xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - tools:showIn="@layout/navigation_menu"> - - <androidx.appcompat.widget.AppCompatImageButton - android:id="@+id/chevronView" - android:layout_width="0dp" - android:layout_height="24dp" - android:layout_marginBottom="8dp" - android:background="@color/divider" - android:foreground="?attr/selectableItemBackground" - app:tint="?attr/colorControlNormal" - tools:ignore="ContentDescription,UnusedAttribute" /> - - <TextView - android:id="@+id/connectionsLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="8dp" - android:text="@string/transport_connection" - android:textSize="12sp" /> - - <View - android:id="@+id/backgroundView" - android:layout_width="0dp" - android:layout_height="0dp" /> - - <TextView - android:id="@+id/longRangeLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:text="@string/transport_internet" - android:textSize="12sp" /> - - <ImageView - android:id="@+id/torIcon" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/transport_tor" - tools:ignore="ContentDescription" - tools:tint="@color/briar_green" /> - - <androidx.appcompat.widget.SwitchCompat - android:id="@+id/torSwitch" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginLeft="16dp" - android:layout_marginEnd="16dp" - android:layout_marginRight="16dp" - android:layout_marginBottom="16dp" - android:text="@string/transport_tor" - tools:checked="true" /> - - <TextView - android:id="@+id/nearbyLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:layout_marginBottom="8dp" - android:gravity="center_vertical" - android:text="@string/transport_nearby" - android:textSize="12sp" /> - - <ImageView - android:id="@+id/wifiIcon" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/transport_lan" - tools:checked="true" - tools:ignore="ContentDescription" - tools:tint="@color/briar_green" /> - - <androidx.appcompat.widget.SwitchCompat - android:id="@+id/wifiSwitch" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginLeft="16dp" - android:layout_marginEnd="16dp" - android:layout_marginRight="16dp" - android:layout_marginBottom="8dp" - android:text="@string/transport_lan" - tools:checked="true" /> - - <ImageView - android:id="@+id/btIcon" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/transport_bt" - tools:checked="true" - tools:ignore="ContentDescription" - tools:tint="@color/briar_green" /> - - <androidx.appcompat.widget.SwitchCompat - android:id="@+id/btSwitch" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginLeft="16dp" - android:layout_marginEnd="16dp" - android:layout_marginRight="16dp" - android:layout_marginBottom="8dp" - android:text="@string/transport_bt" - tools:checked="true" /> - -</merge> diff --git a/briar-android/src/main/res/xml/transports_list_collapsed.xml b/briar-android/src/main/res/xml/transports_list_collapsed.xml deleted file mode 100644 index c4489af1efd6495786c3458b72955aa874081b8a..0000000000000000000000000000000000000000 --- a/briar-android/src/main/res/xml/transports_list_collapsed.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<ConstraintSet xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> - - <Constraint - android:id="@+id/chevronView" - android:clickable="false" - android:focusable="false" - android:src="@drawable/chevron_up_white" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/navigation" - app:layout_constraintVertical_bias="1.0" /> - - <Constraint - android:id="@+id/backgroundView" - android:layout_marginBottom="8dp" - android:background="@color/window_background" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/chevronView" /> - - <Constraint - android:id="@+id/connectionsLabel" - android:visibility="visible" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toStartOf="@+id/torIcon" - app:layout_constraintHorizontal_bias="0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/chevronView" /> - - <Constraint - android:id="@+id/torIcon" - android:layout_margin="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toStartOf="@+id/wifiIcon" - app:layout_constraintTop_toBottomOf="@+id/chevronView" /> - - <Constraint - android:id="@+id/wifiIcon" - android:layout_margin="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toStartOf="@+id/btIcon" - app:layout_constraintTop_toBottomOf="@+id/chevronView" /> - - <Constraint - android:id="@+id/btIcon" - android:layout_margin="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/chevronView" /> - - <Constraint - android:id="@+id/longRangeLabel" - android:visibility="gone" /> - - <Constraint - android:id="@+id/torSwitch" - android:visibility="gone" /> - - <Constraint - android:id="@+id/nearbyLabel" - android:visibility="gone" /> - - <Constraint - android:id="@+id/wifiSwitch" - android:visibility="gone" /> - - <Constraint - android:id="@+id/btSwitch" - android:visibility="gone" /> - -</ConstraintSet> \ No newline at end of file diff --git a/briar-android/src/main/res/xml/transports_list_expanded.xml b/briar-android/src/main/res/xml/transports_list_expanded.xml deleted file mode 100644 index 4bec1c28faf4771a655b7f1dbbf5d0854a556e91..0000000000000000000000000000000000000000 --- a/briar-android/src/main/res/xml/transports_list_expanded.xml +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<ConstraintSet xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> - - <Constraint - android:id="@+id/chevronView" - android:clickable="true" - android:focusable="true" - android:src="@drawable/chevron_down_white" - app:layout_constraintBottom_toTopOf="@+id/longRangeLabel" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/navigation" - app:layout_constraintVertical_bias="1.0" /> - - <Constraint - android:id="@+id/backgroundView" - android:layout_marginBottom="8dp" - android:background="@color/item_background_highlight" - android:visibility="visible" - app:layout_constraintBottom_toTopOf="@+id/nearbyLabel" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/chevronView" /> - - <Constraint - android:id="@+id/longRangeLabel" - android:visibility="visible" - app:layout_constraintBottom_toTopOf="@+id/torSwitch" - app:layout_constraintStart_toStartOf="@+id/torIcon" /> - - <Constraint - android:id="@+id/torIcon" - android:layout_marginStart="16dp" - android:layout_marginLeft="16dp" - app:layout_constraintBottom_toBottomOf="@+id/torSwitch" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@+id/torSwitch" /> - - <Constraint - android:id="@+id/torSwitch" - android:visibility="visible" - app:layout_constraintBottom_toTopOf="@+id/nearbyLabel" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toEndOf="@+id/torIcon" /> - - <Constraint - android:id="@+id/nearbyLabel" - android:visibility="visible" - app:layout_constraintBottom_toTopOf="@+id/wifiSwitch" - app:layout_constraintStart_toStartOf="@+id/torIcon" /> - - <Constraint - android:id="@+id/wifiIcon" - android:layout_marginStart="16dp" - android:layout_marginLeft="16dp" - app:layout_constraintBottom_toBottomOf="@+id/wifiSwitch" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@+id/wifiSwitch" /> - - <Constraint - android:id="@+id/wifiSwitch" - android:visibility="visible" - app:layout_constraintBottom_toTopOf="@+id/btSwitch" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toEndOf="@+id/wifiIcon" /> - - <Constraint - android:id="@+id/btIcon" - android:layout_marginStart="16dp" - android:layout_marginLeft="16dp" - app:layout_constraintBottom_toBottomOf="@+id/btSwitch" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@+id/btSwitch" /> - - <Constraint - android:id="@+id/btSwitch" - android:visibility="visible" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toEndOf="@+id/btIcon" /> - - <Constraint - android:id="@+id/connectionsLabel" - android:visibility="gone" /> - -</ConstraintSet> \ No newline at end of file