mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Put the transport toggles in an expandable view (no animations).
This commit is contained in:
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<Transition
|
||||
app:constraintSetEnd="@+id/end"
|
||||
app:constraintSetStart="@id/start"
|
||||
app:duration="1000">
|
||||
<OnClick app:targetId="@+id/chevronView" />
|
||||
</Transition>
|
||||
|
||||
<ConstraintSet android:id="@+id/start">
|
||||
<Constraint
|
||||
android:id="@+id/chevronView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
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">
|
||||
<CustomAttribute
|
||||
app:attributeName="crossfade"
|
||||
app:customFloatValue="0" />
|
||||
</Constraint>
|
||||
</ConstraintSet>
|
||||
|
||||
<ConstraintSet android:id="@+id/end">
|
||||
<Constraint
|
||||
android:id="@+id/chevronView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/connectionsLabel"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0">
|
||||
<CustomAttribute
|
||||
app:attributeName="crossfade"
|
||||
app:customFloatValue="1" />
|
||||
</Constraint>
|
||||
<Constraint
|
||||
android:id="@+id/backgroundView"
|
||||
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" />
|
||||
<Constraint
|
||||
android:id="@+id/torSwitch"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/nearbyLabel"
|
||||
app:layout_constraintStart_toEndOf="parent" />
|
||||
<Constraint
|
||||
android:id="@+id/wifiSwitch"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btSwitch"
|
||||
app:layout_constraintStart_toEndOf="parent" />
|
||||
<Constraint
|
||||
android:id="@+id/btSwitch"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="parent" />
|
||||
<Constraint
|
||||
android:id="@+id/longRangeLabel"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/torSwitch"
|
||||
app:layout_constraintStart_toEndOf="parent" />
|
||||
<Constraint
|
||||
android:id="@+id/nearbyLabel"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/wifiSwitch"
|
||||
app:layout_constraintStart_toEndOf="parent" />
|
||||
<Constraint
|
||||
android:id="@+id/torIcon"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="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_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="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_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/chevronView" />
|
||||
<Constraint
|
||||
android:id="@+id/connectionsLabel"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/torIcon"
|
||||
app:layout_constraintEnd_toStartOf="@+id/torIcon"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/torIcon" />
|
||||
</ConstraintSet>
|
||||
</MotionScene>
|
||||
@@ -7,9 +7,7 @@ import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
@@ -47,9 +45,7 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import static android.view.View.FOCUS_DOWN;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static androidx.core.view.GravityCompat.START;
|
||||
import static androidx.drawerlayout.widget.DrawerLayout.LOCK_MODE_LOCKED_CLOSED;
|
||||
@@ -92,7 +88,6 @@ public class NavDrawerActivity extends BriarActivity implements
|
||||
LifecycleManager lifecycleManager;
|
||||
|
||||
private DrawerLayout drawerLayout;
|
||||
private ScrollView drawerScrollView;
|
||||
private NavigationView navigation;
|
||||
|
||||
@Override
|
||||
@@ -114,26 +109,8 @@ public class NavDrawerActivity extends BriarActivity implements
|
||||
if (ask) showDozeDialog(getString(R.string.setup_doze_intro));
|
||||
});
|
||||
|
||||
drawerScrollView = findViewById(R.id.drawerScrollView);
|
||||
View chevronView = drawerScrollView.findViewById(R.id.chevronView);
|
||||
drawerScrollView.getViewTreeObserver().addOnGlobalLayoutListener(
|
||||
new OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
// hide/show chevron depending on whether we can scroll
|
||||
if (drawerScrollView.canScrollVertically(1)) {
|
||||
chevronView.setVisibility(VISIBLE);
|
||||
} else {
|
||||
chevronView.setVisibility(INVISIBLE);
|
||||
}
|
||||
drawerScrollView.getViewTreeObserver()
|
||||
.removeOnGlobalLayoutListener(this);
|
||||
}
|
||||
});
|
||||
View drawerScrollView = findViewById(R.id.drawerScrollView);
|
||||
new PluginViewController(drawerScrollView, this, viewModel);
|
||||
chevronView.setOnClickListener(v ->
|
||||
drawerScrollView.fullScroll(FOCUS_DOWN)
|
||||
);
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
drawerLayout = findViewById(R.id.drawer_layout);
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.briarproject.briar.android.navdrawer;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ScrollView;
|
||||
|
||||
import org.briarproject.bramble.api.plugin.BluetoothConstants;
|
||||
import org.briarproject.bramble.api.plugin.LanTcpConstants;
|
||||
@@ -13,6 +14,9 @@ import org.briarproject.briar.R;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import static android.view.View.FOCUS_DOWN;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static androidx.core.content.ContextCompat.getColor;
|
||||
import static org.briarproject.bramble.api.plugin.Plugin.State.ACTIVE;
|
||||
import static org.briarproject.bramble.api.plugin.Plugin.State.DISABLED;
|
||||
@@ -22,15 +26,38 @@ import static org.briarproject.briar.android.navdrawer.NavDrawerViewModel.TRANSP
|
||||
|
||||
class PluginViewController {
|
||||
|
||||
private final ImageView torIcon, wifiIcon, btIcon;
|
||||
private final ImageView torIconExpanded, torIconCollapsed;
|
||||
private final ImageView wifiIconExpanded, wifiIconCollapsed;
|
||||
private final ImageView btIconExpanded, btIconCollapsed;
|
||||
private final SwitchCompat torSwitch, wifiSwitch, btSwitch;
|
||||
|
||||
PluginViewController(View v, LifecycleOwner owner,
|
||||
NavDrawerViewModel viewModel) {
|
||||
|
||||
torIcon = v.findViewById(R.id.torIcon);
|
||||
wifiIcon = v.findViewById(R.id.wifiIcon);
|
||||
btIcon = v.findViewById(R.id.btIcon);
|
||||
ScrollView scrollView = v.findViewById(R.id.drawerScrollView);
|
||||
View expandedLayout = v.findViewById(R.id.expandedLayout);
|
||||
View collapsedLayout = v.findViewById(R.id.collapsedLayout);
|
||||
|
||||
expandedLayout.addOnLayoutChangeListener((view, left, top, right,
|
||||
bottom, oldLeft, oldTop, oldRight, oldBottom) ->
|
||||
scrollView.fullScroll(FOCUS_DOWN));
|
||||
|
||||
v.findViewById(R.id.chevronViewCollapsed).setOnClickListener(view -> {
|
||||
expandedLayout.setVisibility(VISIBLE);
|
||||
collapsedLayout.setVisibility(GONE);
|
||||
});
|
||||
|
||||
v.findViewById(R.id.chevronViewExpanded).setOnClickListener(view -> {
|
||||
expandedLayout.setVisibility(GONE);
|
||||
collapsedLayout.setVisibility(VISIBLE);
|
||||
});
|
||||
|
||||
torIconExpanded = v.findViewById(R.id.torIconExpanded);
|
||||
torIconCollapsed = v.findViewById(R.id.torIconCollapsed);
|
||||
wifiIconExpanded = v.findViewById(R.id.wifiIconExpanded);
|
||||
wifiIconCollapsed = v.findViewById(R.id.wifiIconCollapsed);
|
||||
btIconExpanded = v.findViewById(R.id.btIconExpanded);
|
||||
btIconCollapsed = v.findViewById(R.id.btIconCollapsed);
|
||||
|
||||
torSwitch = v.findViewById(R.id.torSwitch);
|
||||
wifiSwitch = v.findViewById(R.id.wifiSwitch);
|
||||
@@ -52,7 +79,8 @@ class PluginViewController {
|
||||
}
|
||||
|
||||
private void stateUpdate(TransportId id, State state) {
|
||||
updateIcon(getIcon(id), state);
|
||||
updateIcon(getExpandedIcon(id), state);
|
||||
updateIcon(getCollapsedIcon(id), state);
|
||||
updateSwitch(getSwitch(id), state);
|
||||
}
|
||||
|
||||
@@ -69,10 +97,17 @@ class PluginViewController {
|
||||
switchCompat.setEnabled(state != STARTING_STOPPING);
|
||||
}
|
||||
|
||||
private ImageView getIcon(TransportId id) {
|
||||
if (id == TorConstants.ID) return torIcon;
|
||||
if (id == BluetoothConstants.ID) return btIcon;
|
||||
if (id == LanTcpConstants.ID) return wifiIcon;
|
||||
private ImageView getExpandedIcon(TransportId id) {
|
||||
if (id == TorConstants.ID) return torIconExpanded;
|
||||
if (id == BluetoothConstants.ID) return btIconExpanded;
|
||||
if (id == LanTcpConstants.ID) return wifiIconExpanded;
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
private ImageView getCollapsedIcon(TransportId id) {
|
||||
if (id == TorConstants.ID) return torIconCollapsed;
|
||||
if (id == BluetoothConstants.ID) return btIconCollapsed;
|
||||
if (id == LanTcpConstants.ID) return wifiIconCollapsed;
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/window_background"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.navigation.NavigationView
|
||||
android:id="@+id/navigation"
|
||||
@@ -22,21 +24,12 @@
|
||||
app:itemBackground="@drawable/navigation_item_background"
|
||||
app:itemIconTint="?attr/colorControlNormal"
|
||||
app:itemTextColor="?android:textColorPrimary"
|
||||
app:layout_constraintBottom_toTopOf="@+id/chevronView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
app:layout_constraintVertical_chainStyle="spread_inside"
|
||||
app:menu="@menu/navigation_drawer" />
|
||||
|
||||
<include
|
||||
layout="@layout/transports_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/navigation" />
|
||||
<include layout="@layout/transports_list" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
@@ -2,162 +2,234 @@
|
||||
<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"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"
|
||||
tools:showIn="@layout/navigation_menu">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/chevronView"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/expandedLayout"
|
||||
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"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/navigation"
|
||||
app:layout_constraintVertical_bias="1.0"
|
||||
app:tint="?attr/colorControlNormal"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:id="@+id/backgroundView"
|
||||
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_constraintStart_toStartOf="parent"
|
||||
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" />
|
||||
|
||||
<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"
|
||||
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"
|
||||
app:layout_constraintBottom_toTopOf="@+id/wifiSwitch"
|
||||
app:layout_constraintStart_toStartOf="@+id/torIcon" />
|
||||
|
||||
<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"
|
||||
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_constraintVertical_bias="1.0"
|
||||
tools:checked="true" />
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/connectionsLabel"
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/chevronViewExpanded"
|
||||
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_toTopOf="parent"
|
||||
app:tint="?attr/colorControlNormal"
|
||||
tools:ignore="ContentDescription,UnusedAttribute"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:id="@+id/backgroundView"
|
||||
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/chevronViewExpanded" />
|
||||
|
||||
<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/torIconExpanded" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/torIconExpanded"
|
||||
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/torIconExpanded"
|
||||
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"
|
||||
app:layout_constraintBottom_toTopOf="@+id/wifiSwitch"
|
||||
app:layout_constraintStart_toStartOf="@+id/torIconExpanded" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/wifiIconExpanded"
|
||||
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/wifiIconExpanded"
|
||||
tools:checked="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btIconExpanded"
|
||||
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/btIconExpanded"
|
||||
tools:checked="true" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/collapsedLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/transport_connection"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/torIcon"
|
||||
app:layout_constraintEnd_toStartOf="@+id/torIcon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/navigation"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/torIcon" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/chevronViewCollapsed"
|
||||
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_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="?attr/colorControlNormal"
|
||||
tools:ignore="ContentDescription,UnusedAttribute"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<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"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/torIconCollapsed"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/chevronViewCollapsed" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/torIconCollapsed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:src="@drawable/transport_tor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/wifiIconCollapsed"
|
||||
app:layout_constraintTop_toBottomOf="@id/chevronViewCollapsed"
|
||||
tools:checked="true"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:tint="@color/briar_green" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/wifiIconCollapsed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:src="@drawable/transport_lan"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/btIconCollapsed"
|
||||
app:layout_constraintTop_toBottomOf="@id/chevronViewCollapsed"
|
||||
tools:checked="true"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:tint="@color/briar_green" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btIconCollapsed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:src="@drawable/transport_bt"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/chevronViewCollapsed"
|
||||
tools:checked="true"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:tint="@color/briar_green" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</merge>
|
||||
|
||||
Reference in New Issue
Block a user